Surface Code Logical Error Rate Calculator

Stephanie Ben-Joseph headshot Stephanie Ben-Joseph

The planar surface code is a leading candidate for fault-tolerant quantum computation because it combines a high threshold with a simple 2D nearest-neighbor layout. It encodes quantum information into a larger patch of physical qubits and uses repeated stabilizer measurements to detect and correct local errors without directly measuring (and collapsing) the logical state. The key design dial is the code distance d: roughly speaking, it is the minimum number of physical errors required to create an undetectable error chain that implements a logical fault. When the physical error rate is below a threshold, increasing d suppresses logical errors approximately exponentially.

What this calculator computes

Symbols and definitions

Symbol Meaning Typical range / notes
p Physical error probability (per gate / measurement / round, depending on your modeling) Often 10−4 to 10−2 in projections; must be < pth for the scaling to be meaningful
pth Threshold physical error rate for the chosen code+decoder+circuit/noise assumptions Common ballpark: ~0.5%–1% (0.005–0.01), but it varies substantially
d Code distance (minimum length of a nontrivial logical operator) Integer, typically odd in many planar layouts (but the scaling is often used for any integer)
pL Logical error rate (probability of a logical fault per effective round) Decreases rapidly with increasing d when p < pth
n Approximate physical qubit count for one planar logical qubit Here estimated as n ≈ 2d2 (very rough)

Formulas used

A widely used empirical approximation for the planar surface code logical error rate (in the below-threshold regime) is:

pL 0.1 ppth d+1 2

Interpretation:

For qubit overhead, the calculator uses a common “rule of thumb” for a planar patch that includes data and ancilla qubits:

n ≈ 2d2

If you enter a target logical error rate pL,target, the same empirical law can be inverted to estimate the distance needed (still assuming p < pth):

( d+1 )/2 ≈ log( pL,target/0.1 ) / log( p/pth )

and then d is rounded up to an integer (often you may choose the next odd distance for a standard planar layout).

Interpreting the results

Worked example

Suppose you have:

Compute the ratio: p/pth = 0.1. The exponent is (5+1)/2 = 3. Then:

pL ≈ 0.1 × (0.1)3 = 0.1 × 0.001 = 1×10−4

Overhead estimate: n ≈ 2d2 = 2×25 = 50 physical qubits for one planar logical qubit (roughly).

If you instead want a target pL,target = 1×10−6 at the same p and pth, solve:

0.1×(0.1)(d+1)/2 = 1×10−6 ⇒ (0.1)(d+1)/2 = 1×10−5 ⇒ (d+1)/2 = 5 ⇒ d = 9.

Quick comparison table (how distance impacts overhead)

Distance d Exponent (d+1)/2 Estimated qubits n ≈ 2d² Scaling intuition (for fixed p/pth < 1)
5 3 50 Baseline example distance
7 4 98 One more power of (p/pth) suppression
9 5 162 Often a big step toward very low logical error
11 6 242 Higher reliability, rapidly increasing qubit cost

Assumptions & limitations

Use this tool for fast intuition and back-of-the-envelope planning. For hardware-level predictions, validate with decoder- and circuit-specific simulations under a realistic noise model.

Enter parameters and compute.

Embed this calculator

Copy and paste the HTML below to add the Surface Code Logical Error Rate Calculator to your website.