qpe_toolbox.circuit.initialization¶
Functions¶
|
Initialize a quimb quantum circuit with a phase register and a data register. |
|
Initialize a quimb |
Module Contents¶
- qpe_toolbox.circuit.initialization.make_circ(n_phase_bits, psi_mps)[source]¶
Initialize a quimb quantum circuit with a phase register and a data register.
The circuit is initialized in a product state consisting of:
A phase (auxiliary) register of
n_phase_bitsqubits in the computational|0...0⟩state.A data register initialized in the given matrix product state
psi_mps.
The phase register occupies the lowest qubit indices, while the data register is shifted to higher indices.
- Parameters:
n_phase_bits (int) – Number of qubits in the phase (auxiliary) register.
psi_mps (MatrixProductState) – Initial state of the data register as an MPS. Its sites will be reindexed and retagged to follow the phase register.
- Returns:
Quantum circuit initialized with the combined MPS state.
- Return type:
Notes
The physical qubits of
psi_mpsare shifted byn_phase_bitsto avoid index collisions.The resulting circuit has
n_phase_bits + psi_mps.Lqubits in total.
- qpe_toolbox.circuit.initialization.make_circMPS(n_phase_bits, psi_mps, *, cutoff=1e-10, max_bond=None)[source]¶
Initialize a quimb
CircuitMPSwith a phase and data register.This function is equivalent to
make_circ(), but returns aCircuitMPSobject, enabling controlled bond-dimension growth and truncation during circuit simulation.- Parameters:
n_phase_bits (int) – Number of qubits in the phase (ancilla) register.
psi_mps (MatrixProductState) – Initial data-register state as an MPS.
cutoff (float, optional) – Singular-value truncation threshold used during tensor compression. Default is
1e-10.max_bond (int or None, optional) – Maximum allowed bond dimension. If
None, no explicit limit is imposed.
- Returns:
Quantum circuit initialized with an MPS backend.
- Return type:
Notes
CircuitMPSis more efficient thanCircuitfor large systems or deep circuits, at the cost of controlled approximation.The phase register qubits precede the data register in qubit ordering.