quri_parts.core.state.state_vector module#

quri_parts.core.state.state_vector.StateVectorType: typing_extensions.TypeAlias = 'npt.NDArray[np.cfloat]'#

A type alias representing a numerical state vector, equivalent to np.ndarray of complex floats.

class quri_parts.core.state.state_vector.QuantumStateVectorMixin(n_qubits: int, vector: npt.NDArray[np.cfloat] | npt.ArrayLike | None = None)#

Bases: ABC

property vector: npt.NDArray[np.cfloat]#
class quri_parts.core.state.state_vector.QuantumStateVector(n_qubits: int, vector: npt.NDArray[np.cfloat] | npt.ArrayLike | None = None, circuit: NonParametricQuantumCircuit | None = None)#

Bases: QuantumStateVectorMixin, CircuitQuantumStateMixin, QuantumState

QuantumStateVector represents a state defined by a state vector with an optional circuit to be applied.

property qubit_count: int#

Returns the qubit count of the state.

with_gates_applied(gates: NonParametricQuantumCircuit | Sequence[QuantumGate]) QuantumStateVector#

Returns a new state with the gates applied.

The original state is not changed.