← SCPN-Quantum-Control

Redundancy helps — but only below a threshold

The simplest code stores one bit in $d$ copies and takes a majority vote; it fails only if more than half the copies flip. With independent physical error $p$ per copy, the logical error is a tail of the binomial — and its behaviour flips sign at $p=\tfrac12$. Below that, more copies drive the logical error down exponentially in the code distance $d$; above it, more copies drive it up. That sign change is the threshold theorem in miniature.

$$p_L(d,p) \;=\; \sum_{k=\lceil d/2\rceil}^{d}\binom{d}{k}\,p^{k}(1-p)^{d-k}\qquad\big(\,d=3:\ p_L = 3p^2-2p^3\,\big)$$
Live — repetition-code logical error, exact
no encoding (p_L = p) coded, distance d threshold p = ½
logical error pL: vs unencoded p: suppression p/pL:

The left plot is the logical error against the physical error, one curve per distance, with the unencoded diagonal $p_L=p$ for reference. Where a coded curve dips below the diagonal, the code is helping; the curves all cross the diagonal at $p=\tfrac12$, the threshold. The right plot fixes the physical error and sweeps the distance: below threshold it falls away exponentially, above threshold it climbs — adding qubits to a too-noisy device makes it worse, not better.

Deeper: the repetition code, real codes, and parity-protected subspaces
The repetition code is a teaching code: it catches bit-flips but not phase errors, so it is not a full quantum code. Real codes — the surface code among them, which the library's qec package builds — protect against both by measuring two families of stabiliser syndromes, and their threshold is a device property near a percent rather than the repetition code's clean $\tfrac12$. What the repetition code shows exactly is the shape every code shares: a threshold below which distance is your friend. This portal has a second angle on it — the parity sectors of the XY Hamiltonian are a naturally protected subspace, and the library studies encoding logical information there, where the dynamics themselves conserve the code. The curves here are exact binomial tails, checked against a reference to machine precision.

Where it fits

Error correction is the layer that turns the mitigation of a single noisy run into the durability of a long computation. Mitigation cleans up an answer after the fact; correction keeps the state alive as it goes. The platform's interest is specific: the same parity symmetry that splits the XY dynamical Lie algebra also defines a subspace the noise struggles to leave, which is a route to protection that comes from the physics rather than bolted on top.

ApproachWhat it doesCost
Error mitigationextrapolate noise away after the runmore shots, some bias
Repetition codemajority vote over copies (bit-flip only)$d$ physical per logical
Surface code2-D stabilisers, both error types$\sim d^2$ physical per logical
Parity-protected subspaceencode where the dynamics conserve the codestructural, XY-specific

Evidence boundary: the panel computes the exact repetition-code logical error — a binomial tail — live in your browser, checked against a reference to machine precision. It is the threshold idea in its cleanest form, not a simulation of a specific code on specific hardware; real codes and their measured thresholds live in the library's qec package and the results pages.