|q⟩ Bad Qubits

advanced · Programming · Implementing the Surface Code

Resource Costs of the Surface Code

Fault tolerance is not free. The exponential error suppression of the surface code is bought with a large, and quantifiable, overhead in physical qubits. Knowing that cost is essential for planning any real machine.

Counting qubits per logical qubit

In the rotated surface code a distance-dd patch holds one logical qubit using

ndata=d2,nancilla=d21,n_{\text{data}} = d^2, \qquad n_{\text{ancilla}} = d^2 - 1,

so the total physical-qubit count is

n(d)=d2+(d21)=2d21.n(d) = d^2 + (d^2 - 1) = 2d^2 - 1.

This grows quadratically with distance. A few concrete patches:

The leading term 2d22d^2 is what people mean by the surface code's "quadratic overhead." Because useful algorithms may need a logical error rate around 101210^{-12}, distances in the 20203030 range are typical, which is why estimates for a useful fault-tolerant machine reach into the millions of physical qubits.

Overhead in time, too

Each logical operation also takes many rounds of stabilizer measurement — on the order of dd rounds to gather enough syndrome history for a reliable decode. So the spacetime cost of one logical gate scales like d3d^3: d2d^2 qubits maintained over d\sim d rounds. This is why reducing dd (by improving physical error rates) pays off twice — fewer qubits and fewer rounds.

Try it

Compute the total number of physical qubits in a distance-33 rotated surface-code patch using n(d)=2d21n(d) = 2d^2 - 1. Return the result. The grader checks that you get 1717.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.