qrunch.quantum.algorithms.second_quantization.quantum_phase_estimation

Quantum Phase Estimation algorithms for second quantization.

class SecondQuantizationBasicQuantumPhaseEstimation

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_estimation: BasicQuantumPhaseEstimation, mapper: Mapper | None = None) None

Initialise the QPE algorithm.

Parameters:
  • quantum_phase_estimation (BasicQuantumPhaseEstimation) – 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: FermionHermitianSumProtocol | PairedHardcoreBosonHermitianSumProtocol) 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:
Return type:

ExpectationValue

class SecondQuantizationBayesianQuantumPhaseEstimation

Bases: object

Bayesian Quantum Phase Estimation (BQPE) algorithm for second-quantized Hamiltonians.

Estimates the lowest eigenvalue of a second-quantized Hamiltonian \(H\) by mapping it to a qubit Hamiltonian via a Mapper.

__init__(quantum_phase_estimation: BayesianQuantumPhaseEstimation, mapper: Mapper | None = None) None

Initialise the second-quantized BQPE algorithm.

Parameters:
  • quantum_phase_estimation (BayesianQuantumPhaseEstimation) – The underlying Bayesian QPE algorithm to use for estimating the phase.

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

Return type:

None

run(state_preparation_circuit: Circuit, hamiltonian: FermionHermitianSumProtocol | PairedHardcoreBosonHermitianSumProtocol) ExpectationValue

Execute the Bayesian QPE algorithm, returning the estimated eigenvalue.

Parameters:
Return type:

ExpectationValue

Modules

basic_quantum_phase_estimation

Textbook Quantum Phase Estimation algorithm.

bayesian_quantum_phase_estimation

Bayesian Quantum Phase Estimation algorithm for second-quantized Hamiltonians.