phase_estimation#
Functionality#
The phase_estimation module provides an implementation of the Quantum Phase Estimation (QPE) algorithm using Qiskit. The QPE algorithm is a fundamental quantum algorithm used to estimate the phase (eigenvalue) of an eigenvector of a unitary operator. This implementation allows users to create quantum circuits that perform phase estimation with a specified number of evaluation qubits and a given unitary operator.
phase_estimation.py#
Callee: PhaseEstimation
In the Quantum Phase Estimation (QPE) algorithm [30] [16] [31], the Phase Estimation circuit is used to estimate the phase \(\phi\) of an eigenvalue \(e^{2\pi i \phi}\) of a unitary operator \(U\), provided with the corresponding eigenstate \(\ket{\psi}\). That is
This estimation (and thereby this circuit) is a central routine to several well-known algorithms, such as Shor’s algorithm or Quantum Amplitude Estimation.
Here, the general quantum circuit for phase estimation is shown below. The top register contains \(t\) counting qubits, and the bottom contains qubits in the state \(\ket{\psi}\):
QPE circuit (Source: Qiskit/textbook)
Give a unitary \(U\) acting on \(n\) qubits and an eigenstate \(\ket{\psi}\) of \(U\), such that \(U\ket{\psi} = e^{2\pi i \phi}\ket{\psi}\). If \(2^t \phi\) is an integer, the ideal action of the phase estimation circuit performs:
For the case when \(2^t \phi\) is not an integer, it can be shown that the above expression still peaks near \(x = 2^t \phi\) with probability better than \(4/\pi^2\approx 40\%\) [16].
Test example:
Example of the input unitary circuit:
from qiskit.circuit.library import PauliEvolutionGate
from qiskit.quantum_info import SparsePauliOp
from qiskit import QuantumCircuit
# Example for the input unitary circuit as a Hamiltonian evolution
hamiltonian = SparsePauliOp(["ZZ", "IX", "XI"])
evo = PauliEvolutionGate(hamiltonian, time=0.1) # implements exp(-itH)
qc = QuantumCircuit(2)
qc.append(evo, [0, 1])
API#
qolumbina.programs.phase_estimation.phase_estimation#
- class PhaseEstimation(num_evaluation_qubits, unitary, name='QPE')[source]#
Bases:
QuantumCircuitPhase Estimation circuit.
- Parameters:
num_evaluation_qubits (int) – The number of qubits used for the phase estimation register, i.e., \(t\). This determines the precision of the phase estimation.
unitary (QuantumCircuit) – The unitary operator \(U\) for which the phase is to be estimated. This operator should act on the state register, and will be repeated and controlled.
name (str) – The name of the circuit.
Reference Circuit:
(
Source code,png,hires.png,pdf)