qiu_quantum_computing.preparable_state
¶
A quantum state together with the way it is prepared in a circuit.
Classes:
-
PreparableState–An immutable quantum state, preparable from the all-zero state by a circuit.
PreparableState
dataclass
¶
PreparableState(statevector: Statevector | ArrayLike, method: SynthesisMethod = GATE)
An immutable quantum state, preparable from the all-zero state by a circuit.
The preparation circuits are built on first access and cached. Since the state and the method cannot change, the cached circuits always prepare the state.
Parameters:
-
statevector(Statevector | ArrayLike) –The normalized state, as a Qiskit statevector or its amplitudes. It is copied.
-
method(SynthesisMethod, default:GATE) –How the preparation is represented in the circuits, see
state_preparation_circuit.
Attributes:
-
statevector(Statevector) –The normalized state. Given amplitudes are converted to a statevector.
-
method(SynthesisMethod) –How the preparation is represented in the circuits.
-
num_qubits(int) –The number of qubits of the state.
-
circuit(QuantumCircuit) –The circuit mapping the all-zero state to the state.
-
inverse_circuit(QuantumCircuit) –The circuit mapping the state to the all-zero state.
Source code in packages/qiu-quantum-computing/src/qiu_quantum_computing/preparable_state.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
statevector
instance-attribute
¶
statevector: Statevector
The normalized state. Given amplitudes are converted to a statevector.
method
class-attribute
instance-attribute
¶
method: SynthesisMethod = SynthesisMethod.GATE
How the preparation is represented in the circuits.
circuit
cached
property
¶
circuit: QuantumCircuit
The circuit mapping the all-zero state to the state.
inverse_circuit
cached
property
¶
inverse_circuit: QuantumCircuit
The circuit mapping the state to the all-zero state.