Quantum Outpost
algorithms advanced · 14 min read ·

Quantum Phase Estimation Precision: How Many Qubits, How Many Queries

Quantum phase estimation (QPE) is the workhorse of quantum factoring, HHL, quantum chemistry, and more. The precision-resource tradeoff is exactly: t bits of phase precision require 2^t controlled-U queries. This tutorial covers the resource analysis, the Heisenberg limit, the iterative QPE variant that uses fewer ancilla qubits, and the modern QSVT-based replacement that beats QPE for many applications.

Prerequisites: Tutorial 11: QFT and Phase Estimation, Tutorial 30: Quantum Singular Value Transformation

Tutorial 11 introduced quantum phase estimation as a building block: given a unitary UU and an eigenstate ψk|\psi_k\rangle with Uψk=e2πiϕkψkU|\psi_k\rangle = e^{2\pi i \phi_k}|\psi_k\rangle, QPE estimates the phase ϕk\phi_k to bits of precision. The construction uses an ancilla register, controlled applications of U2jU^{2^j} for j=0,1,,t1j = 0, 1, \ldots, t-1, and a final inverse QFT.

The precision-resource tradeoff is the heart of QPE: tt bits of phase precision require 2t\sim 2^t total queries to controlled-UU. This linear-in-precision scaling is fundamental — the Heisenberg limit of phase estimation — and it constrains every algorithm that uses QPE as a subroutine: Shor’s factoring (where the phase is the period), HHL (where the phase is the eigenvalue), quantum chemistry (where the phase is the energy), and many others.

For high-precision applications, this is expensive. Quantum-chemistry energy estimation to chemical accuracy (10310^{-3} Hartree, ~10 bits) needs 210=10242^{10} = 1024 controlled-UU queries per estimation. For each unitary application costing many gates, this compounds.

This tutorial covers the precision-resource analysis, the iterative phase estimation (IPE) variant that uses constant-many ancilla qubits at the cost of more measurements, and the modern QSVT-based replacement that matches the Heisenberg limit with much smaller resource overhead.

The standard QPE precision analysis

For QPE with tt ancilla qubits applied to an eigenstate ψk|\psi_k\rangle:

  • The output is a tt-bit estimate of ϕk\phi_k.
  • The probability of the most-likely outcome (the closest tt-bit binary fraction) is 4/π20.4054/\pi^2 \approx 0.405 at infinity-precision input, 0.81\sim 0.81 for typical applications.
  • The probability of being more than 11 bit off scales as 1/(2πδ)2\sim 1/(2 \pi \delta)^2 for a δ\delta-bit error.

To estimate ϕk\phi_k to accuracy ϵ\epsilon with success probability 1δ1 - \delta:

t    log2(1/ϵ)+log2(2+12δ).t \;\geq\; \log_2(1/\epsilon) + \log_2(2 + \tfrac{1}{2\delta}).

For ϵ=210\epsilon = 2^{-10} (10 bits = ~10310^{-3} accuracy) and δ=0.05\delta = 0.05 (95% success): t10+log2(12)13.6t \geq 10 + \log_2(12) \approx 13.6, so 14 ancilla qubits. The total controlled-UU queries: j=0t12j=2t116,000\sum_{j=0}^{t-1} 2^j = 2^t - 1 \approx 16{,}000. Per phase estimation.

The Heisenberg limit says you cannot do better than 1/ϵ\sim 1/\epsilon controlled-UU queries for ϵ\epsilon-accuracy. QPE saturates this limit: it gives optimal phase estimation, no algorithm can do exponentially better in queries.

Iterative phase estimation

The standard QPE uses tt ancilla qubits — one per bit of precision. For high-precision chemistry (ϵ=106\epsilon = 10^{-6}, t20t \approx 20), this means 20 ancilla qubits. On NISQ hardware, ancilla qubits are precious.

Iterative phase estimation (IPE) uses just one ancilla qubit at the cost of running the algorithm tt times sequentially. IPE works as follows:

  1. Apply U2t1U^{2^{t-1}} controlled on the single ancilla, then measure. Get the most significant bit of the phase.
  2. Use the result to do classical feedback: apply U2t2U^{2^{t-2}} with a phase-corrected ancilla initialization, measure for the next bit.
  3. Repeat for tt bits total.

The total controlled-UU queries is the same as standard QPE (2t\sim 2^t). The ancilla cost is reduced from tt to 11, at the cost of sequential dependency (each bit depends on the previous, so the algorithm can’t be parallelized across bits).

IPE is the standard choice for NISQ-era phase-estimation experiments — fewer qubits, same query cost. For fault-tolerant computation, the parallelism of standard QPE is more attractive (the time savings are real even though the qubit count is higher).

Phase estimation in HHL

Tutorial 58 covered HHL’s phase-estimation step. The phase-estimation precision determines:

  • The accuracy of the eigenvalue inversion.
  • The success probability of the conditional rotation (smaller eigenvalues are harder to invert).
  • The total runtime (precision squared by the conditional-rotation amplitude amplification).

For HHL with condition number κ\kappa, the phase estimation needs precision ϵ=1/(κlog(1/δ))\epsilon = 1/(\kappa \log(1/\delta)) for output accuracy δ\delta. So the phase-estimation queries scale as O(κ)O(\kappa) — the same factor that dominates HHL’s runtime. HHL’s κ\kappa-dependence comes mostly from phase-estimation precision.

The QSVT-based variant of HHL (modern era) replaces phase estimation with direct polynomial implementation of 1/x1/x, which avoids the precision-resource tradeoff in this specific way. The total cost is similar but the constants are better.

QSVT-based phase estimation

A modern alternative to QPE: quantum singular value transformation (QSVT) based phase estimation (tutorial 30). Instead of a phase-estimation register, apply a polynomial of degree dd that “thresholds” the unitary’s spectrum, then measure.

Specifically, to determine whether the phase is in a specific range [ϕa,ϕb][\phi_a, \phi_b], apply a polynomial p(ϕ)p(\phi) that approximates the indicator function on that range. The polynomial degree dd determines the resolution ϵ1/d\epsilon \sim 1/d — same Heisenberg limit, but the polynomial-implementation cost can be much smaller than the QPE-equivalent.

For specific tasks (e.g., “is the eigenvalue above threshold λ\lambda_*”), QSVT-based estimation uses O(log(1/ϵ))O(\log(1/\epsilon)) block-encoding queries, exponentially better than QPE’s O(1/ϵ)O(1/\epsilon). This is the dominant phase-estimation method in 2026 for fault-tolerant resource estimates.

For full tt-bit phase estimation, QSVT and QPE have similar asymptotic costs — but QSVT’s constants are typically better.

A small QPE precision demonstration

Concrete code that runs QPE and measures the precision-vs-queries tradeoff:

import numpy as np
import pennylane as qml

n_data = 1
def make_qpe_circuit(t_ancilla, eigenphase):
    """Standard QPE with t_ancilla bits to estimate eigenphase."""
    total_qubits = t_ancilla + n_data
    dev = qml.device("default.qubit", wires=total_qubits, shots=1000)

    @qml.qnode(dev)
    def qpe():
        # Initialize data register in eigenstate (here, just |1> for U = phase gate).
        qml.PauliX(wires=t_ancilla)
        # Apply Hadamards to ancilla register.
        for j in range(t_ancilla):
            qml.Hadamard(wires=j)
        # Controlled-U^(2^j) operations. U = phase gate by `eigenphase`.
        for j in range(t_ancilla):
            angle = 2 * np.pi * eigenphase * (2 ** j)
            qml.ctrl(qml.PhaseShift, control=j)(angle, wires=t_ancilla)
        # Inverse QFT on ancilla register.
        qml.adjoint(qml.QFT)(wires=range(t_ancilla))
        return qml.sample(wires=range(t_ancilla))

    return qpe


# True phase to estimate.
true_phase = 0.3142  # ~pi/10

for t in [3, 5, 7]:
    qpe = make_qpe_circuit(t, true_phase)
    samples = qpe()
    # Convert binary samples to phase estimates.
    estimates = np.array([sum(s[i] * 2**-(i+1) for i in range(t)) for s in samples.T.tolist() if hasattr(s, '__iter__')])
    if len(estimates) == 0:
        # Fallback: most-frequent integer outcome
        flat = np.array([np.dot(s, 2**np.arange(t-1, -1, -1)) for s in samples.T])
        most_common = np.bincount(flat).argmax()
        est = most_common / 2**t
        print(f"t={t}: estimate={est:.4f}, true={true_phase:.4f}, error={abs(est-true_phase):.4f}, queries={2**t-1}")
    else:
        mean_est = np.mean(estimates)
        print(f"t={t}: mean estimate={mean_est:.4f}, true={true_phase:.4f}, error={abs(mean_est-true_phase):.4f}, queries={2**t-1}")

The relationship to verify: with tt ancilla qubits, the typical precision is 1/2t\sim 1/2^t, and the total queries is 2t1\sim 2^t - 1. Doubling the precision doubles the queries — the Heisenberg limit made concrete.

Common misconceptions

“More ancilla qubits in QPE always gives better precision.” Up to a point — beyond the input state’s actual phase precision (e.g., for a noisy state with effective phase uncertainty σ\sigma, no QPE bit beyond log2(σ)-\log_2(\sigma) adds information). Ancillas need to match the input’s information content.

“Iterative QPE is strictly worse than standard QPE.” They use the same total number of queries. IPE uses fewer ancilla qubits at the cost of sequential dependency. For NISQ hardware, IPE is often better; for fault-tolerant, standard QPE is better.

“QSVT replaces QPE in all applications.” Not all. For tasks where you need the explicit phase as a classical number, QPE remains the right tool. QSVT is better for tasks where you only need to act on the phase (e.g., apply a polynomial of the phase to the state).

“The Heisenberg limit means QPE is optimal.” It means QPE saturates the optimal scaling. Constants matter — QSVT has better constants for many applications.

“QPE works with any unitary.” It works with any unitary that can be applied to the input state. Practically, the controlled-UU implementation is a constraint: implementing U2jU^{2^j} for large jj requires either repeated applications (cost 2j2^j) or fast-forwarding tricks that may not exist for the specific UU.

Decision rule

For phase-estimation tasks:

  1. Standard QPE is the right choice when you need explicit tt-bit phase output and have ancilla qubits to spare.
  2. Iterative QPE is the NISQ choice — one ancilla, sequential dependency, same total queries.
  3. QSVT-based phase estimation is the right choice when you only need to act on the phase (apply a polynomial), not extract its classical value. Better constants, exponentially better for thresholding-style tasks.
  4. Bayesian QPE (not covered in detail here) is a NISQ-era variant that uses repeated short-time evolution and Bayesian classical post-processing. Useful when controlled-U2jU^{2^j} for large jj is too expensive on hardware.

For most fault-tolerant resource estimates in 2026, the QSVT-based approach is preferred for performance reasons, with explicit QPE used only when the application specifically requires classical phase output.

Exercises

1. QPE for chemistry to chemical accuracy

A molecular Hamiltonian energy needs to be estimated to chemical accuracy (10310^{-3} Hartree). The Hamiltonian is given as H=iαiPiH = \sum_i \alpha_i P_i with iαi=100\sum_i |\alpha_i| = 100 Hartree. Compute the QPE ancilla count and total queries.

Show answer

Phase-to-energy conversion: phase = energy × time / 2π2\pi. To resolve energy to 10310^{-3} Hartree at time t=1t = 1: phase precision 103/(2π)1.6×10410^{-3} / (2\pi) \approx 1.6 \times 10^{-4}, so t=log2(1.6×104)13t = -\log_2(1.6 \times 10^{-4}) \approx 13 ancilla qubits. Total queries: 21380002^{13} \approx 8000. Each query is a controlled application of eiHte^{-iHt}. With LCU-based simulation (tutorial 59), each eiHte^{-iHt} costs O(αtlog(1/ϵ))=O(100110)=O(1000)O(\alpha t \log(1/\epsilon)) = O(100 \cdot 1 \cdot 10) = O(1000) gate-equivalents. Total QPE cost: 8000×1000=8×1068000 \times 1000 = 8 \times 10^6 gate-equivalents per energy estimate. For each chemistry molecule’s ground-state energy at chemical accuracy.

2. Heisenberg limit at the application level

A “Heisenberg-limited” sensor (e.g., NV-center magnetometry) requires 1/ϵ1/\epsilon measurements to achieve precision ϵ\epsilon. A “shot-noise-limited” sensor requires 1/ϵ21/\epsilon^2 measurements. What is the gain from Heisenberg-limited sensing?

Show answer

For ϵ=106\epsilon = 10^{-6}: shot-noise-limited sensor needs 101210^{12} measurements; Heisenberg-limited sensor needs 10610^6. Six orders of magnitude difference. The Heisenberg limit is the fundamental quantum-mechanical limit on phase estimation precision; saturating it gives the maximum possible advantage over classical sensing. QPE is the algorithmic embodiment of Heisenberg-limited estimation in computer-style settings. For physical sensors using entangled states, the Heisenberg limit gives the fundamental advantage of quantum sensing over classical.

3. Iterative QPE qubit savings

For a 20-bit phase estimation, compare ancilla qubit cost between standard QPE and iterative QPE.

Show answer

Standard QPE: 20 ancilla qubits. Iterative QPE: 1 ancilla qubit. A factor of 20 reduction in qubit count. Both use 220106\sim 2^{20} \approx 10^6 controlled-UU queries total. For NISQ-era phase-estimation experiments where ancilla qubits are scarce, IPE is dramatically more practical. For fault-tolerant computation where ancilla qubits are cheaper (a fraction of the total qubit count), standard QPE is often preferred for the parallel-execution structure.

4. When to use QSVT instead of QPE

You need to determine whether a Hamiltonian’s ground-state energy is below a threshold EE_* to accuracy 10410^{-4}. Compare QPE and QSVT-based approaches.

Show answer

QPE approach: estimate the energy with 14-bit precision (t=14t = 14, 2142^{14} queries), compare to threshold. QSVT approach: implement a polynomial that thresholds at EE_* with resolution 10410^{-4}. The QSVT polynomial degree is 1/ϵ1/log(1/δ)104\sim 1/\epsilon \cdot 1/\log(1/\delta) \approx 10^4 for typical δ\delta, so 10410^4 block-encoding queries. For threshold-only questions, QSVT’s O(1/ϵ)O(1/\epsilon) matches QPE’s O(1/ϵ)O(1/\epsilon) with similar gate-count scaling. Specific constants vary; for some tasks QSVT wins, for others QPE wins. The structural advantage of QSVT is in acting on the phase without measuring it, which is a different application class.

Where this goes next

This concludes the four-tutorial algorithms-track final-deepening (57-60). The track now has 13 tutorials covering: simple algorithms (8-12), block encoding (29), QSVT (30), Hamiltonian simulation (31), amplitude estimation (32), quantum walks (57), HHL (58), LCU (59), and phase estimation precision (60). This is comprehensive coverage of the modern quantum-algorithm toolkit. Future tutorials in this track may dig into specific applications (quantum optimization beyond QAOA, adiabatic algorithms, post-Trotter simulation methods) or specialized techniques (quantum signal processing in detail, randomized algorithms, fast-forwarding tricks).


Weekly dispatch

Quantum, for people who already code.

One serious tutorial per week, plus the industry moves that actually matter. No hype, no hand-waving.

Free. Unsubscribe anytime. We will never sell your email.