qiskit.aqua.components.uncertainty_models.GaussianConditionalIndependenceModel
class GaussianConditionalIndependenceModel(n_normal, normal_max_value, p_zeros, rhos, i_normal=None, i_ps=None)
The Gaussian Conditional Independence Model for Credit Risk.
Reference: https://arxiv.org/abs/1412.1183
Dependency between individual risk variables and latent variable is approximated linearly.
Parameters
- n_normal (
int
) – Number of qubits to represent the latent normal random variable Z - normal_max_value (
float
) – Min/max value to truncate the latent normal random variable Z - p_zeros (
Union
[List
[float
],ndarray
]) – Standard default probabilities for each asset - rhos (
Union
[List
[float
],ndarray
]) – Sensitivities of default probability of assets with respect to latent variable Z - i_normal (
Union
[List
[float
],ndarray
,None
]) – Indices of qubits to represent normal variable - i_ps (
Union
[List
[float
],ndarray
,None
]) – Indices of qubits to represent asset defaults
__init__
__init__(n_normal, normal_max_value, p_zeros, rhos, i_normal=None, i_ps=None)
Parameters
- n_normal (
int
) – Number of qubits to represent the latent normal random variable Z - normal_max_value (
float
) – Min/max value to truncate the latent normal random variable Z - p_zeros (
Union
[List
[float
],ndarray
]) – Standard default probabilities for each asset - rhos (
Union
[List
[float
],ndarray
]) – Sensitivities of default probability of assets with respect to latent variable Z - i_normal (
Union
[List
[float
],ndarray
,None
]) – Indices of qubits to represent normal variable - i_ps (
Union
[List
[float
],ndarray
,None
]) – Indices of qubits to represent asset defaults
Methods
__init__ (n_normal, normal_max_value, …[, …]) | type n_normalint |
build (qc, q[, q_ancillas, params]) | |
build_controlled (qc, q, q_control[, …]) | Adds corresponding controlled sub-circuit to given circuit |
build_controlled_inverse (qc, q, q_control[, …]) | Adds controlled inverse of corresponding sub-circuit to given circuit |
build_controlled_inverse_power (qc, q, …[, …]) | Adds controlled, inverse, power of corresponding circuit. |
build_controlled_power (qc, q, q_control, power) | Adds controlled power of corresponding circuit. |
build_inverse (qc, q[, q_ancillas]) | Adds inverse of corresponding sub-circuit to given circuit |
build_inverse_power (qc, q, power[, q_ancillas]) | Adds inverse power of corresponding circuit. |
build_power (qc, q, power[, q_ancillas]) | Adds power of corresponding circuit. |
get_num_qubits () | returns number of qubits |
get_num_qubits_controlled () | returns number of qubits controlled |
pdf_to_probabilities (pdf, low, high, num_values) | pdf to probabilities |
required_ancillas () | returns required ancillas |
required_ancillas_controlled () | returns required ancillas controlled |
Attributes
dimension | returns dimensions |
high | returns high |
low | returns low |
num_qubits | returns num qubits |
num_target_qubits | Returns the number of target qubits |
num_values | returns number of values |
probabilities | returns probabilities |
probabilities_vector | returns probabilities vector |
values | returns values |
build
build(qc, q, q_ancillas=None, params=None)
build_controlled
build_controlled(qc, q, q_control, q_ancillas=None, use_basis_gates=True)
Adds corresponding controlled sub-circuit to given circuit
Parameters
- qc (QuantumCircuit) – quantum circuit
- q (list) – list of qubits (has to be same length as self._num_qubits)
- q_control (Qubit) – control qubit
- q_ancillas (list) – list of ancilla qubits (or None if none needed)
- use_basis_gates (bool) – use basis gates for expansion of controlled circuit
build_controlled_inverse
build_controlled_inverse(qc, q, q_control, q_ancillas=None, use_basis_gates=True)
Adds controlled inverse of corresponding sub-circuit to given circuit
Parameters
- qc (QuantumCircuit) – quantum circuit
- q (list) – list of qubits (has to be same length as self._num_qubits)
- q_control (Qubit) – control qubit
- q_ancillas (list) – list of ancilla qubits (or None if none needed)
- use_basis_gates (bool) – use basis gates for expansion of controlled circuit
build_controlled_inverse_power
build_controlled_inverse_power(qc, q, q_control, power, q_ancillas=None, use_basis_gates=True)
Adds controlled, inverse, power of corresponding circuit. May be overridden if a more efficient implementation is possible
build_controlled_power
build_controlled_power(qc, q, q_control, power, q_ancillas=None, use_basis_gates=True)
Adds controlled power of corresponding circuit. May be overridden if a more efficient implementation is possible
build_inverse
build_inverse(qc, q, q_ancillas=None)
Adds inverse of corresponding sub-circuit to given circuit
Parameters
- qc (QuantumCircuit) – quantum circuit
- q (list) – list of qubits (has to be same length as self._num_qubits)
- q_ancillas (list) – list of ancilla qubits (or None if none needed)
build_inverse_power
build_inverse_power(qc, q, power, q_ancillas=None)
Adds inverse power of corresponding circuit. May be overridden if a more efficient implementation is possible
build_power
build_power(qc, q, power, q_ancillas=None)
Adds power of corresponding circuit. May be overridden if a more efficient implementation is possible
dimension
returns dimensions
get_num_qubits
get_num_qubits()
returns number of qubits
get_num_qubits_controlled
get_num_qubits_controlled()
returns number of qubits controlled
high
returns high
low
returns low
num_qubits
returns num qubits
num_target_qubits
Returns the number of target qubits
num_values
returns number of values
pdf_to_probabilities
static pdf_to_probabilities(pdf, low, high, num_values)
pdf to probabilities
probabilities
returns probabilities
probabilities_vector
returns probabilities vector
required_ancillas
required_ancillas()
returns required ancillas
required_ancillas_controlled
required_ancillas_controlled()
returns required ancillas controlled
values
returns values