Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Phase estimation

Phase estimation (Quantum Phase Estimation, QPE) finds the eigenphase φ of a unitary U given an eigenstate, using controlled powers of U and the inverse Quantum Fourier Transform; it is central to algorithms like Shor's and many quantum simulation tasks.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Quantum Phase Estimation (QPE) is the standard quantum subroutine to find an unknown phase φ when you know a unitary operator U and have access to one of its eigenstates. Engineers use QPE inside larger algorithms (for example, Shor's algorithm for factoring, quantum simulation and eigenvalue problems). QPE turns eigenvalue problems into bit strings that classical computers can process.

Key ideas

  • Phase: Given U|u> = e^{2πiφ}|u>, the real number φ ∈ [0,1) is called the eigenphase. QPE estimates φ as a t-bit binary fraction.

  • Controlled-U^{2^j} operations: QPE uses t ancilla (control) qubits. For ancilla qubit j (counting from 0 or 1 as you prefer), we apply a controlled-U^{2^j} gate that applies U^{2^j} to the target (the eigenstate |u>) if the control is |1>. These build phase kicks proportional to powers of two.

  • Quantum Fourier Transform (QFT): The QFT on t qubits is the linear map on computational basis states |k> (k=0..2^t-1) defined by QFT |k> = (1/2^{t/2}) ∑_{y=0}^{2^t-1} e^{2πi k y / 2^t} |y>. The QPE circuit uses the inverse QFT (QFT†) on the ancilla register to convert phase information into computational-basis bits.

  • Exact statement of the QPE algorithm (assumptions): Assumptions: you are given a unitary U, an eigenstate |u> with U|u> = e^{2πiφ}|u>, and t ancilla qubits initialized to |0>^{⊗t}. If the target is a superposition of eigenstates of U, QPE returns one eigenphase y/2^t at random with probability equal to the squared overlap with that eigenstate, and the target register collapses to the corresponding eigenstate. Algorithm steps (high level):

    1. Put ancilla in equal superposition: apply Hadamard H to each ancilla qubit so ancilla becomes (1/2^{t/2}) ∑_{k=0}^{2^t-1} |k>.
    2. Apply controlled-U^{2^j} operations so the combined state becomes (1/2^{t/2}) ∑_{k=0}^{2^t-1} e^{2πi φ k} |k> ⊗ |u>.
    3. Apply inverse QFT to the ancilla register: QFT† acts only on ancilla.
    4. Measure ancilla in the computational basis to get an integer y in {0,...,2^t-1}. Output φ̃ = y/2^t as the estimate. Resource note: implementing the controlled-U^{2^j} for j=0..t-1 costs a total of 1+2+...+2^{t-1} = 2^t-1 uses of U if done by repeated application; QFT† on t qubits uses O(t^2) two-qubit gates (or O(t log t) with an approximate QFT that omits small-angle rotations).
  • Output behaviour and probabilities (derivation universities expect): Before inverse QFT the ancilla state is (1/2^{t/2}) ∑{k=0}^{2^t-1} e^{2πi φ k} |k>. Apply QFT† and compute amplitude on basis state |y>: amplitude(y) = (1/2^t) ∑{k=0}^{2^t-1} e^{2πi (φ k - k y/2^t)} = (1/2^t) ∑_{k=0}^{2^t-1} e^{2πi k (φ - y/2^t)}. Let Δ = φ - y/2^t. Then this finite geometric sum equals (1/2^t) · (1 - e^{2πi 2^t Δ})/(1 - e^{2πi Δ}). Taking modulus squared gives the measurement probability P(y) = [sin(π 2^t Δ) / (2^t sin(π Δ))]^2 (the Dirichlet kernel form). When Δ = 0 (i.e., φ equals y/2^t exactly), P(y) = 1 and the algorithm returns φ exactly.

  • Precision and success probability (informal): If φ has an exact t-bit binary expansion (φ = a/2^t), the measurement returns y = a with probability 1. If φ is not exactly representable in t bits, the probability concentrates near the nearest integers to φ·2^t. With more ancilla qubits t you get more precision. Standard bounds (textbook): Pr(y = ⌊φ·2^t⌋ or ⌈φ·2^t⌉) ≥ 8/π^2 ≈ 0.8106, and Pr(y = round(φ·2^t)) ≥ 4/π^2 ≈ 0.405; equivalently, Pr(|y/2^t − φ| ≤ 1/2^{t+1}) ≥ 4/π^2.

  • Use in other algorithms: QPE reduces eigenvalue problems to bit strings; Shor's order-finding and many quantum simulation tasks use QPE as a subroutine.

Describe what to draw for exam diagrams:

  • Draw a 2-register circuit: top register has t qubits labelled ancilla 0..t-1 (left to right); bottom register is one (or more) target qubit(s) initialised to |u>.
  • Draw H gates on each ancilla, then a column of controlled-U^{1}, controlled-U^{2}, controlled-U^{4}, ... (powers doubling to the right), then a box labeled QFT† acting on ancilla, then measurement boxes on ancilla returning bits y_{t-1}...y_0. Label the flow left->right and show phase accumulation symbol e^{2πiφ k} on the ancilla superposition term. If your QFT convention reverses bit order, include final SWAP gates (or relabel wires) so that y_{t-1} is the MSB and y_0 the LSB at measurement.

Formulas

U |u> = e^{2πi φ} |u> — U: unitary operator, |u>: eigenstate (unitless), φ: eigenphase (dimensionless, in cycles; φ ∈ [0,1)). Applies whenever U is unitary and |u> is an eigenstate.

ancilla_before = (1/2^{t/2}) ∑_{k=0}^{2^t-1} |k> — equal superposition after Hadamards; t: number of ancilla qubits (dimensionless).

ancilla_after_control = (1/2^{t/2}) ∑_{k=0}^{2^t-1} e^{2πi φ k} |k> — after controlled powers, applies when target is eigenstate |u>.

QFT |k> = (1/2^{t/2}) ∑_{y=0}^{2^t-1} e^{2πi k y / 2^t} |y> — QFT on t qubits; unitless amplitudes.

amplitude(y) = (1/2^t) ∑_{k=0}^{2^t-1} e^{2πi k (φ - y/2^t)} — amplitude on ancilla state |y> before measurement.

P(y) = [sin(π 2^t Δ) / (2^t sin(π Δ))]^2 where Δ = φ - y/2^t — measurement probability. Applies for Δ not an integer; unitless probability between 0 and 1.

Note: All phases use dimensionless radians via factor 2π; no SI units apply because these are pure quantum amplitudes.

Worked examples

  1. Exact-phase example (theory model answer) Question: Show QPE with t=3 ancilla qubits returns φ = 5/8 exactly if U|u> = e^{2πi (5/8)} |u>. Answer (stepwise):
  • Start: ancilla = |000>, target = |u>.
  • After Hadamards: ancilla = (1/2^{3/2}) ∑_{k=0}^7 |k>.
  • Controlled operations: each basis state |k> picks up phase e^{2πi φ k} with φ = 5/8. So state becomes (1/2^{3/2}) ∑_{k=0}^7 e^{2πi (5/8) k} |k> ⊗ |u>.
  • Compute exponent modulo 1: e^{2πi (5k/8)} = e^{2πi ( (5k mod 8)/8)}. The map k -> (5k mod 8) permutes 0..7 because 5 is coprime to 8, giving a relabel of basis but the set of phases equals the 8th roots at indices matching k·5. After QFT† the ancilla collapses to |101> (binary for 5) with amplitude 1 (check by direct sum or use property: φ = 5/8 has exact 3-bit expansion 0.101). So measurement returns y = 5 and estimate φ̃ = 5/8 exactly. Final answer: measurement result 101 (5) corresponds to φ̃ = 5/8.
  1. Non-exact-phase numeric example Question: With t=3 ancilla qubits and φ = 0.3, compute probability of measuring y=2. Answer:
  • Compute Δ = φ - y/2^t = 0.3 - 2/8 = 0.3 - 0.25 = 0.05.
  • Compute numerator sin(π 2^t Δ) = sin(π · 8 · 0.05) = sin(0.4π) = approximately 0.95106.
  • Compute denominator 2^t sin(π Δ) = 8 · sin(0.05π) = 8 · 0.156434 ≈ 1.25147.
  • Ratio ≈ 0.95106 / 1.25147 ≈ 0.7604; square gives probability ≈ 0.5782.
  • So probability of measuring y=2 is about 0.578 (57.8%). (You can similarly compute probabilities for other y; most weight lies near the closest integers to φ·2^t.)
  1. Short derivation question (model answer): Why does QPE give highest probability near nearest integer to φ·2^t? Answer summary: Because probability amplitude is the Dirichlet kernel peaked when Δ is near 0. The numerator sin(π 2^t Δ) grows roughly linearly with 2^t Δ for small Δ, while the denominator scales with sin(π Δ), so the amplitude ratio ~ (sin(π 2^t Δ)/(2^t sin(π Δ))) approximates 1 when Δ=0 and falls off for larger Δ. Thus the nearest integers y to φ·2^t have the largest probabilities.

Common mistakes

  • Thinking QFT alone produces the phase without controlled-U^{2^j} gates. The controlled powers are essential to encode phase proportional to k.
  • Misordering bits after inverse QFT: remember conventional QFT ordering (MSB/LSB) in your university's preferred convention and label circuit qubits accordingly.
  • Using too few ancilla qubits t for desired precision and ignoring success probability bounds.

For your exam

Types of questions:

  • Definitions: define unitary, eigenstate, eigenvalue, phase, QFT.
  • Short notes: describe the QPE circuit and explain its components (Hadamards, controlled-U^{2^j}, inverse QFT).
  • Derivations: show the ancilla state before inverse QFT and derive the formula for P(y) (the Dirichlet kernel form). Step-by-step geometric series evaluation is expected.
  • Numericals: compute probabilities for given φ and t (like example 2), or find minimal t for a required precision (qualitative answer acceptable unless a tight bound is requested).
  • Diagrams: draw the QPE circuit with controlled-U^{2^j} and QFT†; label ancilla qubits, target register, and measurement outcomes.

What a full-marks answer includes:

  • Clear statement of assumptions (target is eigenstate, U unitary, t ancilla qubits).
  • Correct circuit diagram and ordering labels.
  • Correct derivation of ancilla state before and after QFT†, with the geometric series evaluated and the probability expression shown.
  • For numerical questions, show each arithmetic step, units (none here), and final probability or bitstring.

Quick check

  1. If U|u> = e^{2πi·0.375}|u> and t=3, what bitstring will QPE return with certainty?
  2. Write the amplitude on ancilla basis state |y> before measurement in terms of φ, t and y.
  3. For φ not exactly representable in t bits, what simple rule tells you which measured y are most likely? Answers: 1) 0.375 = 3/8 → bitstring 011 (decimal 3). 2) amplitude(y) = (1/2^t) ∑_{k=0}^{2^t-1} e^{2πi k(φ - y/2^t)}. 3) The integers y nearest to φ·2^t are most likely (probability given by the Dirichlet kernel).

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?