How many counting qubits does phase estimation need?
Accuracy of n bits with failure chance ε costs about n plus a few extra qubits, but the real price is the number of times U must be applied: it doubles with every extra counting qubit.
8 min read · reviewed December 2026
Two knobs: accuracy and confidence
With t counting qubits, the grid of possible answers has spacing 1/2^t turns. Doubling the grid resolution costs one qubit. But because the true phase generally falls between grid points, the reading is random, and a tighter promise about how often the reading is good costs more qubits again.
The standard counting rule has two inputs. You choose n, the number of bits of φ you want correct, and ε, the largest chance of failing that you accept. Then the number of counting qubits that is enough is:
t = n + ⌈ log₂( 2 + 1/(2ε) ) ⌉
Reading the rule
The first term is the obvious one: n bits of answer need n counting qubits. The second term is the safety margin and depends only on ε, not on n. A failure chance of 25 percent needs 2 extra qubits, 10 percent needs 3, and 1 percent needs 6. The table below lists the values. Note that the rule is sufficient, not exact. For a particular phase a smaller register may do as well, and the lab’s Within one step number lets you test that on your own φ.
| Bits n | ε = 25% | ε = 10% | ε = 1% |
|---|---|---|---|
| 4 | 6 | 7 | 10 |
| 8 | 10 | 11 | 14 |
| 12 | 14 | 15 | 18 |
| 16 | 18 | 19 | 22 |
The real cost: applications of U
Counting qubit j controls U^(2^j). If you build U^(2^j) by applying U that many times, the total number of applications of U across the whole circuit is 1 + 2 + 4 + … + 2^(t−1) = 2^t − 1. So each extra counting qubit doubles the cost, and this exponential factor is the price of a precision that improves like 1/2^t.
This is a feature, not a flaw, because the precision gain is also exponential in t. Estimating a phase to precision 1/N takes about N applications of U. A classical sampling approach that averages repeated noisy measurements improves with the square root of the number of samples, so its cost to reach precision 1/N grows roughly like N². Phase estimation’s linear scaling in 1/precision is often called Heisenberg-type scaling, and it is why the method is attractive for simulation.
In some problems U^(2^j) can be built directly with fewer gates than 2^j repetitions of U. Modular exponentiation in Shor’s algorithm is such a case: repeated squaring gives U^(2^j) at the cost of one modular multiplication. The lab counts nothing here; it simulates exact, ideal gates.
A worked choice
Suppose you want 8 bits of φ and can accept a 10 percent chance of a bad reading. The rule gives t = 8 + ⌈log₂(2 + 5)⌉ = 8 + 3 = 11 counting qubits. The deepest controlled gate is U raised to 2^10 = 1,024, and the total number of U applications, if built by repetition, is 2,047.
Now suppose you accept a 1 percent failure chance instead: t = 8 + ⌈log₂(2 + 50)⌉ = 8 + 6 = 14. Three more qubits mean a factor of eight in the cost, for a modest gain in confidence. Slide the two controls in the lab to see this trade-off. The lab does not simulate more than 8 counting qubits, because the full state has to fit in the browser; the rule itself is plain arithmetic and works for any size.
Variants that save qubits
One well-known variant uses a single counting qubit, measured and reused, with classical feedback that adjusts later rotations. It reads the phase one bit at a time and needs fewer qubits at the cost of more sequential steps. Several such iterative and semi-classical schemes exist, under different names in different papers, so check the specific source when you need one. The accuracy–cost relationship above still applies: more bits need deeper powers of U.
The qubit count is small. The depth is what grows: each extra bit of precision doubles the length of the longest controlled power of U.
On real devices
Long controlled powers of U mean deep circuits. Without error correction, noise accumulates over the circuit and wipes out the phase information, which is why phase estimation at useful precision is generally associated with fault-tolerant machines rather than today’s devices. The Noise Lab on this site shows how errors flatten the kind of interference patterns that phase estimation relies on.
Try it
Questions
Why does failure chance cost qubits?
Because φ rarely sits exactly on the grid. Extra qubits make the grid finer than the accuracy you want, so the correct n bits are read with high probability even when the last bits are noisy.
Is t = n + something always enough?
The textbook rule says it is enough for the stated accuracy and failure chance. It may be more than you need for a particular phase.
Can I get the precision without the deep circuits?
Not by this method. The 1/N precision is paid for by running a power of U that is about N long, whether in one deep circuit or across several steps.
Read next
Sources and further reading
- P. Shor, “Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer” (1994, journal version 1997)
- A. Kitaev, “Quantum measurements and the Abelian stabilizer problem” (1995)
- R. Cleve, A. Ekert, C. Macchiavello and M. Mosca, “Quantum algorithms revisited” (1998)
- D. Coppersmith, “An approximate Fourier transform useful in quantum factoring” (1994, IBM research report)
- J. Cooley and J. Tukey, “An algorithm for the machine calculation of complex Fourier series” (1965)
- M. Nielsen and I. Chuang, Quantum Computation and Quantum Information, chapter 5
Check the original sources for exact citations.