qrunch.quantum.algorithms.second_quantization.quantum_phase_estimation.basic_quantum_phase_estimation

Textbook Quantum Phase Estimation algorithm.

Classes

SecondQuantizationBasicQuantumPhaseEstimator

Textbook Quantum Phase Estimation (QPE) algorithm.

class SecondQuantizationBasicQuantumPhaseEstimator

Bases: object

Textbook Quantum Phase Estimation (QPE) algorithm.

Estimates the lowest eigenvalue of a Hamiltonian \(H\) by preparing an approximate eigenstate with state_preparation_circuit, encoding the time-evolution unitary \(U_k = e^{-iH \cdot 2^k}\) for each precision qubit \(k\), and extracting the accumulated phase via an Inverse Quantum Fourier Transform.

__init__(quantum_phase_estimator: BasicQuantumPhaseEstimator, mapper: Mapper | None = None) None

Initialise the QPE algorithm.

Parameters:
  • quantum_phase_estimator (BasicQuantumPhaseEstimator) – The underlying QPE algorithm to use for estimating the phase.

  • mapper (Mapper | None) – Optional mapper to convert the second-quantized Hamiltonian to a qubit Hamiltonian.

Return type:

None

run(state_preparation_circuit: Circuit, hamiltonian: FermionHermitianSum | PairedHardcoreBosonHermitianSum) ExpectationValue

Build and execute the QPE circuit, returning the estimated ground-state eigenvalue.

The precision register occupies qubits \(0 \\ldots n-1\) and the state register occupies qubits \(n \\ldots n + m - 1\), where \(n\) is the number of precision qubits and \(m\) is the number of qubits in state_preparation_circuit.

Parameters:
  • state_preparation_circuit (Circuit) – Circuit that prepares the initial state on the state register. Typically an approximation of the target eigenstate.

  • hamiltonian (FermionHermitianSum | PairedHardcoreBosonHermitianSum) – The second-quantized Hermitian Hamiltonian whose eigenvalue is estimated.

Return type:

ExpectationValue