quri_parts.core.state.state_parametric module#

class quri_parts.core.state.state_parametric.ParametricCircuitQuantumStateMixin(n_qubits: int, circuit: UnboundParametricQuantumCircuitProtocol)#

Bases: ABC

property parametric_circuit: UnboundParametricQuantumCircuitProtocol#

Parametric circuit to build the quantum state.

class quri_parts.core.state.state_parametric.ParametricCircuitQuantumState(n_qubits: int, circuit: UnboundParametricQuantumCircuitProtocol)#

Bases: ParametricCircuitQuantumStateMixin, QuantumState

ParametricCircuitQuantumState represents a quantum state generated by applying a parametric circuit to |00…0> state.

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() ParametricCircuitQuantumState#

Returns a new ParametricCircuitQuantumState 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]) ParametricCircuitQuantumState#

Returns a new state with the gates applied.

The original state is not changed.

bind_parameters(params: Sequence[float]) GeneralCircuitQuantumState#

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

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