qpe_toolbox.circuit.initialization

Functions

make_circ(n_phase_bits, psi_mps)

Initialize a quimb quantum circuit with a phase register and a data register.

make_circMPS(n_phase_bits, psi_mps, *[, cutoff, max_bond])

Initialize a quimb CircuitMPS with a phase and data register.

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_bits qubits 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:

Circuit

Notes

  • The physical qubits of psi_mps are shifted by n_phase_bits to avoid index collisions.

  • The resulting circuit has n_phase_bits + psi_mps.L qubits in total.

qpe_toolbox.circuit.initialization.make_circMPS(n_phase_bits, psi_mps, *, cutoff=1e-10, max_bond=None)[source]

Initialize a quimb CircuitMPS with a phase and data register.

This function is equivalent to make_circ(), but returns a CircuitMPS object, 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:

CircuitMPS

Notes

  • CircuitMPS is more efficient than Circuit for large systems or deep circuits, at the cost of controlled approximation.

  • The phase register qubits precede the data register in qubit ordering.