Overview
A quantum algorithm is usually analysed in terms of logical gates and qubits. Whether it can run on real hardware, and how long it takes, depends on many more numbers: the physical error rate, the error-correcting code and its distance, the cost of producing magic states, the layout of the chip and the speed of its control system. Resource estimation composes these into physical qubit counts and wall-clock times. It is how the field compares algorithms, codes and hardware platforms, and how cryptographers judge when a quantum computer would threaten a given key size.
The standard pipeline, made explicit by work such as Fowler and co-authors, Litinski and Gidney and Ekerå, is:
- compile the algorithm to Clifford gates plus non-Clifford gates and count logical qubits, T or Toffoli gates and their depth;
- set an error budget for memory and magic states;
- choose the code distance;
- choose and size the magic state factories;
- lay out the computation with lattice surgery and compute the footprint and runtime.
Intuition
Two asymmetries drive almost every conclusion. First, the code distance needed grows only with the logarithm of the number of operations, but the qubits per logical qubit grow with the square of the distance and depend strongly on how far the hardware is below threshold. A better physical error rate therefore often saves more qubits than a much shorter algorithm. Second, runtime is set by the number of non-Clifford steps that must happen one after another, times the duration of a step, so a shorter algorithm saves time almost proportionally. Knowing whether a problem is limited by qubits or by time tells you which improvement matters.
Estimates also differ for mundane reasons: different noise models, different code cycle times, different assumptions about how fast decoding is, and different definitions of "done" (one attempt or expected time to success). Comparing two numbers without comparing their assumptions is the most common mistake in this area.
Prerequisites
Fault-tolerant quantum computing, the surface code and its logical error scaling, magic state distillation and lattice surgery.
Mathematical Definitions
Let a circuit be written over Clifford gates, gates and Toffoli (or CCZ) gates, with Pauli measurements and classical feed-forward allowed.
- The T count is the number of and gates; the Toffoli count is the number of Toffoli or CCZ gates. Each non-Clifford gate consumes one magic state (T state or CCZ state) in a fault-tolerant implementation.
- The T depth is the smallest number of layers into which the non-Clifford gates can be partitioned so that the gates within a layer can be applied simultaneously, given the circuit's dependencies, with Clifford gates allowed anywhere in between.
The counts are linked by gate identities: a Toffoli gate costs seven gates in the standard ancilla-free circuit and four with an ancilla and a measurement (Jones); a temporary logical AND computes the AND of two qubits into a fresh ancilla with four gates and uncomputes it with none, using a measurement (Gidney). Arbitrary single-qubit rotations are approximated to precision by Clifford+T sequences with T count about (Ross and Selinger).
In architectures where Clifford operations are absorbed into Pauli measurements (Litinski), the T count sets the number of magic states and the T depth, multiplied by the time per non-Clifford layer, bounds the runtime from below. When each layer must wait for decoded measurement results before the next can start, the relevant depth is the number of such dependent steps (the reaction depth or measurement depth), and the time per step includes the reaction time of the classical control system, as in the estimate of Gidney and Ekerå.
Derivation. The computation's output can be wrong only if at least one patch suffers a logical failure in at least one round, or at least one consumed magic state is faulty. By the union bound , applied to the patch-round events of probability and the magic-state events of probability , the failure probability is at most . No independence is needed.
Use. A resource estimate chooses an overall failure target , splits it between the terms (for example half each), and solves for the largest allowed and : and with . The first fixes the code distance; the second fixes the factory design. The number of patch-rounds, not the number of gates, is what the memory term scales with: every idle patch is exposed in every round. Published estimates handle the budget with more refined models (for example Gidney and Ekerå account for repeated attempts of a computation that may fail), but the union bound is the common starting point.
The bound is tight only when the events rarely overlap, which is the regime of interest (). If a computation can be checked cheaply and repeated, as for factoring, a larger is acceptable, and the expected cost becomes the cost of one attempt divided by its success probability.
- is the probability of a logical failure of one patch in one round of syndrome measurement, and the error probability of one consumed magic state; failures of distinct components are events in one probability space, not necessarily independent.
- The computation keeps patches alive for logical time steps of rounds each.
- Only the failure events listed are counted; other failure sources (decoder, leakage, classical control) must be added as further terms.
Derivation. Under the scaling ansatz, decreases with , so the set of admissible distances is an up-set and its smallest odd member is the required distance. Taking logarithms of and dividing by gives , which is the approximate closed form before rounding up to an odd integer.
Consequences. With , each increase of by 2 multiplies the logical error rate by , so reaching a target ten times smaller costs more units of distance. A rotated surface-code patch with one ancilla per check uses physical qubits (rotated surface code), so the footprint grows like : logarithmic sensitivity to the target, but strong sensitivity to , that is to the physical error rate. For example, with and , a target of per round needs , so and physical qubits per patch; with it needs , so , and qubits per patch.
- The logical error rate per round follows the scaling ansatz with fitted constants and , and .
- The result inherits every limitation of that fit; it is an algebraic inversion, not an independent physical statement.
This is an accounting model, not a theorem: it multiplies out the quantities that a lattice-surgery layout fixes. The data and routing region holds patches; in the block designs of Litinski, data qubits occupy between and patch-sized tiles depending on the desired speed. One factory supplies magic states per code cycle and the computation needs up to , so factories are needed to avoid stalling. If fewer factories are built, the step time becomes cycles instead of and the runtime grows accordingly. The product is the space-time volume, the quantity that design choices trade against each other: doubling the factories halves a factory-limited runtime, at roughly constant volume when the factories dominate the footprint and at a smaller volume otherwise.
Terms that the formula leaves out and that published estimates include when they matter: the classical reaction time between dependent steps, patches used only for a part of the computation, idle storage in denser codes, and the classical control and decoding hardware, whose size scales with .
- Rotated surface-code patches with one measurement ancilla per check ( qubits each), of them for data and routing.
- A factory uses qubits and emits magic states every code cycles; the computation consumes at most one magic state per logical time step of code cycles (often ).
- The schedule has sequential logical steps and is the duration of one syndrome round; classical reaction time is assumed hidden within a step.
Worked Examples
A complete estimate
Every input is stated; none is a claim about a particular device.
| Input | Value | Note |
|---|---|---|
| Logical data qubits | 100 | |
| Non-Clifford gates | gates, applied one per logical step | worst case: T depth equals T count |
| Layout | fast block, patches | Litinski's block design, one magic state per step |
| Step time | code cycles | |
| Code cycle | ||
| Scaling ansatz | , , , so | illustrative fit values |
| Failure budget | : memory, magic states | |
| Factory | Litinski's two-level 15-to-1 then 20-to-4 design at physical error : 46,800 qubits, 4 states per 157 cycles, error each | from Litinski |
Distance. With 230 patches, steps and rounds per step there are patch-rounds. At the budget allows , but the ansatz gives : not enough. At the budget is and the ansatz gives . So .
Magic states. The budget per state is , met by the factory's . Consumption is one state per 27 cycles; one factory supplies per cycle, so .
Qubits. Patches: . Factories: . Total about physical qubits.
Runtime. , about 45 minutes.
Sensitivity
- Halve the physical error rate (, , other inputs fixed). At the budget is and the ansatz gives , which suffices. Patch qubits fall to , about half, and the runtime to 32 minutes.
- Cut the T count tenfold (, ). The required distance drops only to ( gives against a budget of ). Patch qubits fall to , by 14%, while the runtime falls to , by a factor of 10.8.
The pattern is general: hardware quality buys qubits, algorithmic improvements buy time. Note that the factory used here was designed by its author for circuit-level noise of , whereas the memory model is the illustrative ansatz; a careful estimate uses one noise model throughout.
Applications
Published estimates and their assumptions
| Task | Estimate | Main assumptions | Source |
|---|---|---|---|
| RSA-2048 | about 20 million noisy qubits, about 8 hours | surface code on a planar nearest-neighbour grid, gate error , cycle, reaction time | Gidney and Ekerå (arXiv 2019, published 2021) |
| RSA-2048 | 13,436 processor qubits plus a multimode memory, 177 days | 3D gauge colour codes with an assumed 0.75% threshold, error , cycle, memory of 28 million spatial and 45 temporal modes | Gouzien and Sangouard (2021) |
| RSA-2048 | fewer than one million noisy qubits, less than a week | uniform gate error , cycle, reaction time, nearest-neighbour square grid | Gidney (preprint, 2025) |
| FeMoCo ground-state energy | about four million physical qubits, under four days | cycle, gate error at most , tensor-hypercontraction block encoding | Lee and co-authors (2021) |
| 256-bit elliptic-curve key | 50 million Toffoli gates per key (logical cost) | active-volume architecture with non-local connections | Litinski (preprint, 2023) |
The logical cost in the 2021 RSA estimate is given as logical qubits and Toffoli gates for an -bit modulus, about 6,200 qubits and Toffoli gates at . The 2025 estimate reaches its lower qubit count by combining approximate residue arithmetic (Chevignard, Fouque and Schrottenloher), denser storage of idle logical qubits in yoked surface codes (Gidney and co-authors) and magic state cultivation (Gidney, Shutty and Jones), and pays in runtime. Chemistry estimates descend from the FeMoCo analysis of Reiher and co-authors. Beverland and co-authors (preprint, 2022), estimating three applications with a layered framework, conclude that practical advantage needs hundreds of thousands to millions of physical qubits, and Hoefler, Häner and Troyer argue that quadratic speedups are insufficient for practical advantage once these overheads are counted.
Limitations and Common Pitfalls
- Logical qubits are not the requirement. Multiply by the patch size and add routing and factories; in the example above data patches alone are 100 of the 230.
- Assuming the scaling ansatz far outside its fitted range. Extrapolating from small-distance data to ignores rare correlated errors and leakage, which can set a floor that small-distance data do not reveal.
- Ignoring classical speed. A dependent step cannot be shorter than the reaction time of decoding plus feed-forward; estimates that assume zero reaction time are optimistic for algorithms with long chains of dependent measurements.
- Counting T gates but not T depth. Factories can raise throughput, not shorten a chain of dependent rotations.
- Mixing noise models. A threshold quoted for code-capacity or phenomenological noise is much higher than the circuit-level threshold; using it inflates every downstream number's optimism.
- Comparing headline numbers. Qubit counts traded for runtime (the 2021 and 2025 RSA estimates) are not comparable without both figures; space-time volume is a fairer single number.
State of the Art
As of 2026-11:
- The lowest published surface-code estimate for RSA-2048 that we have verified is the under-one-million-qubit, under-one-week figure of Gidney (preprint, May 2025), on the same hardware assumptions as the 2021 estimate of 20 million qubits.
- Below-threshold surface-code memories have been demonstrated (Google Quantum AI), which gives measured rather than assumed values of the suppression factor at small distances; extrapolating them to estimate distances is still an assumption.
- The drop from the 2021 to the 2025 RSA-2048 figure came from three sources at once: cheaper arithmetic (a Toffoli count lower by more than a factor of 100 than the 2024 approximate-residue construction it builds on, by the author's account), cheaper magic states (cultivation) and denser idle storage (yoked surface codes), none of them a change to Shor's algorithm itself.