quri_parts.core.state.state_vector_parametric module#

class quri_parts.core.state.state_vector_parametric.ParametricQuantumStateVector(n_qubits: int, circuit: UnboundParametricQuantumCircuitProtocol, vector: npt.NDArray[np.cfloat] | npt.ArrayLike | None = None)#

Bases: QuantumStateVectorMixin, ParametricCircuitQuantumStateMixin, QuantumState

ParametricQuantumStateVector represents a state defined by a state vector with a parametric circuit applied.

This class holds an unbound parametric circuit, thus circuit parameters are not bound to concrete values. Use bind_parameters() when you need to bind concrete parameter values.

property qubit_count: int#

Returns the qubit count of the state.

with_primitive_circuit() ParametricQuantumStateVector#

Returns a new ParametricQuantumStateVector whose circuit is replaced with the corresponding primitive circuit.

The original state is not changed. For details about the primitive circuit, please refer to .primitive_circuit() in UnboundParametricQuantumCircuitProtocol.

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

Returns a new state with the gates applied.

The original state is not changed.

bind_parameters(params: Sequence[float]) QuantumStateVector#

Returns a new state with the circuit parameters assigned concrete values.

This method does not modify self but returns a newly created state.