UncertaintyModel
class UncertaintyModel(num_target_qubits)
The abstract Uncertainty Model
Attributes
num_target_qubits
Returns the number of target qubits
Methods
build
abstract UncertaintyModel.build(qc, q, q_ancillas=None, params=None)
Adds 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)
- params (list) – parameters for circuit
build_controlled
UncertaintyModel.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
UncertaintyModel.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
UncertaintyModel.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
UncertaintyModel.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
UncertaintyModel.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
UncertaintyModel.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
UncertaintyModel.build_power(qc, q, power, q_ancillas=None)
Adds power of corresponding circuit. May be overridden if a more efficient implementation is possible
get_num_qubits
UncertaintyModel.get_num_qubits()
returns number of qubits
get_num_qubits_controlled
UncertaintyModel.get_num_qubits_controlled()
returns number of qubits controlled
required_ancillas
UncertaintyModel.required_ancillas()
returns required ancillas
required_ancillas_controlled
UncertaintyModel.required_ancillas_controlled()
returns required ancillas controlled