qrunch.quantum.algorithms.second_quantization.quantum_phase_estimation
Quantum Phase Estimation algorithms for second quantization.
- class SecondQuantizationBasicQuantumPhaseEstimation
Bases:
objectTextbook 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:
state_preparation_circuit (Circuit) – Circuit that prepares the initial state on the state register. Typically an approximation of the target eigenstate.
hamiltonian (FermionHermitianSumProtocol | PairedHardcoreBosonHermitianSumProtocol) – The second-quantized Hermitian Hamiltonian whose eigenvalue is estimated.
- Return type:
- class SecondQuantizationBayesianQuantumPhaseEstimation
Bases:
objectBayesian 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:
state_preparation_circuit (Circuit) – Circuit preparing an approximate eigenstate \(|\psi\rangle\) on the state register.
hamiltonian (FermionHermitianSumProtocol | PairedHardcoreBosonHermitianSumProtocol) – The second-quantized Hermitian Hamiltonian whose eigenvalue is estimated.
- Return type:
Modules
Textbook Quantum Phase Estimation algorithm. |
|
Bayesian Quantum Phase Estimation algorithm for second-quantized Hamiltonians. |