- Algorithms
- Also: QPE
- Also: phase kickback algorithm
Quantum Phase Estimation
A quantum algorithm that estimates the eigenvalue phase of a unitary operator using the quantum Fourier transform and controlled-unitary operations, serving as a core subroutine in Shor's algorithm and quantum chemistry simulations.
Quantum Phase Estimation (QPE) solves the following problem: given a unitary operator and one of its eigenstates , estimate the phase in the eigenvalue equation . The phase is encoded as a binary fraction in a register of ancilla qubits, readable after a measurement. QPE underlies Shor’s algorithm, quantum chemistry ground-state energy estimation, and several quantum linear algebra routines.
The details
The circuit consists of two registers. The first is an ancilla register of qubits, initialized to , which will hold the binary approximation of . The second register holds the eigenstate .
Circuit structure:
- Apply Hadamard to each ancilla qubit to create a uniform superposition.
- Apply controlled- gates: ancilla qubit controls applied times to the eigenstate register.
- Apply the inverse Quantum Fourier Transform (QFT) to the ancilla register.
- Measure the ancilla register. The result is the -bit binary approximation of .
|0⟩ ──[H]──●─────────────── ... ──[QFT†]──[M]
|0⟩ ──[H]──│──●──────────── ... ──[QFT†]──[M]
|0⟩ ──[H]──│──│──● ──────── ... ──[QFT†]──[M]
|ψ⟩ ───────U──U²─U⁴──────── ...
Precision. With ancilla qubits, QPE estimates to bits of precision, meaning the error is at most with high probability. Adding one ancilla qubit halves the error. For a phase of , three ancilla qubits suffice to recover the exact answer.
QPE for the T gate. The T gate has eigenvalues and . For the eigenstate, the phase is . Three ancilla qubits suffice to recover this exactly:
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit.circuit.library import QFT
from qiskit_aer import AerSimulator
ancilla = QuantumRegister(3, 'anc')
target = QuantumRegister(1, 'tgt')
creg = ClassicalRegister(3, 'c')
qc = QuantumCircuit(ancilla, target, creg)
qc.x(target) # eigenstate |1> of T gate
qc.h(ancilla) # superposition on ancilla register
# Controlled-T^(2^k): T^1, T^2=S, T^4=Z
qc.cp(3.14159265 / 4, ancilla[0], target[0])
qc.cp(3.14159265 / 2, ancilla[1], target[0])
qc.cp(3.14159265, ancilla[2], target[0])
iqft = QFT(3, inverse=True)
qc.compose(iqft, qubits=ancilla, inplace=True)
qc.measure(ancilla, creg)
result = AerSimulator().run(qc, shots=1024).result()
print(result.get_counts()) # '001' (= 1/8) with high probability
Role in Shor’s algorithm. The period-finding step in Shor’s algorithm is a direct application of QPE. The unitary is ; its eigenvalue phases encode the period , which QPE extracts via the QFT.
Role in quantum chemistry. QPE can extract exact ground-state energies of molecular Hamiltonians: prepare an approximate ground state, run QPE with the time-evolution operator , and read off the energy as a phase. VQE was developed as a near-term alternative that trades exactness for shallower circuits.
Hardware requirements. QPE circuits are deep. The controlled- gates become expensive as grows, and practical applications in chemistry or cryptography need fault-tolerant hardware with thousands to millions of logical qubits. QPE is primarily a fault-tolerant-era algorithm.
Why it matters for learners
QPE is the engine behind many of quantum computing’s most important algorithms. Understanding it builds fluency in three concepts: the QFT (which converts period information into measurable frequencies), controlled unitaries (the mechanism for imprinting phase information on the ancilla register), and phase kickback (why controlled- gates write phase onto the control qubit). QPE is the cleanest demonstration of how quantum algorithms extract useful information from exponentially large superpositions via a single measurement.
Common misconceptions
Misconception 1: QPE gives the eigenvalue directly. QPE outputs a binary approximation of , the fractional part of the eigenvalue’s argument. Recovering requires interpreting , and if the true phase is irrational, QPE can only approximate it up to -bit precision.
Misconception 2: QPE requires the exact eigenstate as input. If the input is a superposition of eigenstates, QPE returns phase estimates for each eigenstate with probability equal to the squared overlap. For chemistry, a good approximate ground state is sufficient; the correct phase dominates the measurement outcomes.
Misconception 3: VQE replaces QPE for quantum chemistry. VQE finds approximate ground-state energies using shallow circuits and classical optimization; QPE finds exact energies but requires fault-tolerant hardware. They are complementary tools targeting different hardware regimes.