Logical Qubits vs Physical Qubits: We Measured the Exchange Rate
Last updated · 11 min read · ZKSF team
When a company announces a quantum computer with 100 qubits, they mean 100 physical qubits. When a paper says an algorithm needs 100 qubits, it usually means 100 logical ones. Those two sentences differ by a factor of somewhere between twenty and three thousand, and almost every confused argument about quantum timelines comes from sliding between them.
This post measures the factor rather than citing it. Everything below is the output of a script: Stim generates rotated surface code memory experiments, a minimum-weight matching decoder corrects them, and the logical error rate is counted over 40,000 shots per point.
What a logical qubit is
A physical qubit is a thing on a chip. It decoheres, its gates misfire, and its measurement occasionally lies. Nothing about it improves by being asked nicely.
A logical qubit is a pattern of many physical qubits, arranged so that the information is stored in correlations no single physical error can reach. The surface code is the leading arrangement: data qubits on a grid, measurement qubits between them repeatedly checking parities. A single error flips some parities, the pattern of flips says where it was, and a decoder undoes it.
The code distance `d` is the number of physical errors needed to change the logical state without being detected. A rotated surface code of distance `d` uses `d^2` data qubits and `d^2 - 1` measurement qubits.
distance data measure physical qubits per logical
3 9 8 17
5 25 24 49
7 49 48 97
9 81 80 161
11 121 120 241Those counts are exact, not estimates: `2d^2 - 1`. We verified them against the circuits Stim generates by counting the qubit indices each one actually touches, which is worth doing, because Stim's own `num_qubits` reports 26, 64 and 118 for these three. That figure counts coordinate slots rather than qubits in use, and quoting it would have overstated the overhead by about 20%.
The measurement
A memory experiment is the simplest useful test of a code. Prepare a logical zero, run `d` rounds of syndrome extraction while noise acts, measure, decode, and ask whether the logical value survived. Every operation carries depolarizing noise at rate `p`, every reset can flip, and every measurement can lie.
import stim, pymatching, numpy as np
circuit = stim.Circuit.generated(
"surface_code:rotated_memory_z",
distance=d, rounds=d,
after_clifford_depolarization=p,
after_reset_flip_probability=p,
before_measure_flip_probability=p,
before_round_data_depolarization=p,
)
sampler = circuit.compile_detector_sampler()
detections, observables = sampler.sample(40_000, separate_observables=True)
matcher = pymatching.Matching.from_detector_error_model(
circuit.detector_error_model(decompose_errors=True))
predictions = matcher.decode_batch(detections)
errors = np.sum(predictions[:, 0] != observables[:, 0])That is the whole experiment. Here is what it returns, as a logical error rate per shot, 40,000 shots per cell.
physical error p d=3 d=5 d=7
0.001 0.00072 0.00017 0.00003
0.002 0.00282 0.00095 0.00022
0.003 0.00675 0.00313 0.00168
0.005 0.01835 0.01280 0.01055
0.008 0.04030 0.04855 0.05205
0.012 0.08040 0.12662 0.16812
0.020 0.17112 0.30400 0.40623The crossing is the whole subject
Read down the first three rows. At a physical error rate of 0.1%, going from distance 3 to distance 7 takes the logical error rate from 7.2 in ten thousand to 3 in a hundred thousand: a factor of 24, bought with 80 extra physical qubits.
Now read the last three rows. At 2%, the same change makes the logical error rate worse, from 17% to 41%. More physical qubits, more places for an error to begin, and a decoder that can no longer tell which errors happened.
Between those regimes is the threshold, and our data puts it between 0.5% and 0.8%: at 0.5% the larger codes are still winning, at 0.8% they have started losing. That is the number that matters in hardware announcements, because below it error correction is an engineering problem and above it error correction does not work at all, however many qubits you buy.
What it costs to get to a useful error rate
A serious algorithm might run 10^15 logical operations, so it needs a logical error rate somewhere near 10^-15. Our measured column at p = 0.001 gives the suppression per two steps of distance: 0.00072 to 0.00017 is a factor of 4.2, and 0.00017 to 0.00003 is a factor of 5.7.
Extrapolating at that rate from distance 7:
target logical error rate 1e-15
starting point 3e-05 at distance 7
suppression per +2 distance ~5x
distance required 39
physical qubits per logical 3,041Three thousand physical qubits for one good logical qubit, at a physical error rate of 0.1% that current hardware is only now approaching. An algorithm wanting 100 logical qubits therefore wants roughly 300,000 physical ones. That is the real gap between a 100-qubit announcement and a 100-qubit algorithm, and no amount of rephrasing closes it.
The extrapolation assumes the suppression factor stays constant as distance grows, which is the standard assumption and is optimistic in at least one respect: it ignores the classical decoding load, which grows with the code and has to keep up in real time.
What today's machines actually have
Every processor you can rent today, including all eight on this service, exposes physical qubits with no error correction between you and the hardware. When you run a circuit on a 108-qubit superconducting processor, you are using 108 physical qubits and receiving their raw error rates.
That is why we attach a measured fidelity to hardware runs rather than a qubit count. A hardware certificate compares the counts a device returned against the exact distribution the circuit should have produced, which is a statement about that run on that machine. Three qubits at 95% fidelity and three qubits at 99.9% are not the same purchase, and only one of those numbers tells you which you got.
Simulating error correction is cheap, which is the useful part
The circuits above are made entirely of Clifford gates, which the Gottesman-Knill theorem says are classically simulable in polynomial time. That is why a distance-7 surface code with 40,000 shots decodes in a fraction of a second on a laptop, while simulating 97 arbitrary qubits is impossible.
It is also why error-correction research runs ahead of error-correction hardware: you can test a code, a decoder and a noise model long before anyone can build the thing. On this service the same class of circuit runs on the `clifford` engine, which handled a 1001-qubit error-correcting code for a tenth of a cent, with a certificate reporting an error bound of exactly zero because the method is exact.
Clifford circuits and Stim covers why that works, and simulating quantum error correction walks through building the codes.
The short version
- A logical qubit costs `2d^2 - 1` physical qubits in the surface code: 17 at distance 3, 97 at distance 7.
- Adding physical qubits helps only below the threshold, which we measure between 0.5% and 0.8% physical error rate. Above it, larger codes are worse.
- Reaching a 10^-15 logical error rate from today's best figures needs distance 39, about 3,041 physical qubits per logical qubit.
- Nothing you can rent today has any of this. Announced qubit counts are physical, and the useful question is the fidelity of the run you actually did.
Reproducing the table needs `pip install stim pymatching` and the loop above. It takes a couple of minutes on a laptop, and it is a better guide to quantum timelines than any roadmap slide.
Run your own 100-qubit circuit, with an error bar.
