Magic State Distillation

Every fault-tolerant quantum computer runs into the same wall. To keep errors from spreading, you apply logical gates transversally — one physical gate per qubit, so a single fault stays contained in one block. Transversal gates are the safest thing an encoded machine can do. But the Eastin–Knill theorem proves that the transversal logical gates of any code form a finite group, and a finite group can never be dense in the unitary group. No code is universal on transversal gates alone; something continuous, hence dangerous, is always missing. Magic state distillation is the elegant way around the wall. Instead of performing the missing non-Clifford operation directly on encoded data, you factor it out of the live computation. Clifford gates — generated by Hadamard, phase, and CNOT — are fault-tolerant on good codes, but by the Gottesman–Knill theorem they are also classically simulable, so they are not enough. Universality is bought back by injecting a non-stabilizer "magic state" such as ∣T⟩|T\rangle, which drives one logical TT gate through gate teleportation using only Cliffords and a measured correction — pushing the entire non-Clifford difficulty offline into preparing these ancillas. The catch: magic states cannot be prepared fault-tolerantly — that is exactly the operation the theorem forbids — so raw copies arrive noisy, with error rate pp set by the hardware. Distillation is the purification stage: a Clifford circuit consumes many noisy copies, measures the stabilizers of a chosen code, and on the clean-syndrome outcome emits fewer copies whose error is crushed from pp to ∼c pm\sim c\,p^m. Iterate a few times and the error falls below any target. Because every round discards most of its input, this offline factory dominates the qubit-hours of real algorithms — which is why magic, not Cliffords, sets the price of quantum computation.

Key takeaways
  • The Eastin–Knill theorem forbids any code from having a universal transversal gate set; distillation dodges it by supplying the missing non-Clifford piece as an offline resource state.
  • A magic state such as ∣T⟩=(∣0⟩+eiπ/4∣1⟩)/2|T\rangle=(|0\rangle+e^{i\pi/4}|1\rangle)/\sqrt2 drives one logical TT gate through gate teleportation, using only Cliffords plus a measurement-controlled correction.
  • Distillation feeds nn noisy copies of error pp into a Clifford syndrome measurement and, on acceptance, outputs cleaner copies with error p′≈c pmp'\approx c\,p^{m}, with mm the smallest undetectable logical-error weight.
  • The Bravyi–Kitaev 15-to-1 protocol uses the Reed–Muller code's transversal TT to distill ∣T⟩|T\rangle at p′≈35 p3p'\approx 35\,p^3; the 5-qubit protocol distills ∣H⟩|H\rangle-type states at p′≈5 p3p'\approx 5\,p^3.
  • The map p↦35p3p\mapsto 35p^3 has a sharp threshold p∗=1/35≈0.169p_*=1/\sqrt{35}\approx0.169: below it error is driven super-exponentially to zero, above it distillation fails and wastes qubits.
  • Only states outside the stabilizer polytope can be distilled at all, tying the protocol to magic monotones like the robustness of magic and the stabilizer Rényi entropy.
  • Key idea: push all non-Clifford difficulty into offline, distillable ancillas — noisy non-stabilizer states are purified by Clifford-only syndrome measurement on a code whose transversal non-Clifford gate maps the magic state to itself, suppressing error from pp to ∼c pm\sim c\,p^{m}, then consumed one-by-one to apply logical TT gates via gate teleportation.

Where this lives today

Distillation is the pacing item of real fault-tolerant hardware. The surface code — the leading architecture for superconducting and trapped-ion machines — admits fault-tolerant Cliffords through lattice surgery but has no transversal TT, so practical designs wall off large chip regions as dedicated magic-state factories running 15-to-1 and its descendants, then pipe clean ∣T⟩|T\rangle states into the data. In the widely cited estimates for factoring RSA-2048 with Shor's algorithm, these factories and the TT-count dominate the qubit-hours, driving work on TT-count reduction, block codes that distill many states at once, and "cultivation" schemes that skip full distillation. The same subroutine completes topological quantum computers: Ising-anyon and Majorana platforms braid perfect Cliffords but are provably non-universal, and distilled magic states supply their missing π/8\pi/8 gate, while universal Fibonacci anyons need none. And a successful round operationally certifies non-stabilizerness — only states outside the stabilizer polytope survive — tying the enterprise back to the resource theory of magic.

The physical picture

Picture a magic state as a bottle of concentrated "non-Clifford juice." Clifford gates can pour, stir, and measure but never synthesize the juice; gate teleportation lets you spend one bottle to brew one TT gate. Hardware only hands you watery, contaminated bottles — every raw ∣T⟩|T\rangle carries error pp. Distillation is a filtration press: pour fifteen dirty bottles into a Clifford machine, check that no error syndrome lit up, and out comes a single far-purer bottle — because to slip through undetected an error must match one of the rare patterns the code cannot tell from "no error at all," costing a factor pmp^m instead of pp. The reason a specific code works is a small miracle of group theory. The 15-qubit punctured Reed–Muller code has a transversal logical TT: applying physical T†T^\dagger to all fifteen qubits realizes the logical T†T^\dagger. Feed in fifteen raw ∣T⟩|T\rangle copies, apply transversal T†T^\dagger, and the ideal component lands exactly on the code's logical ∣T⟩|T\rangle. Measuring the fourteen stabilizers with Clifford circuits then heralds errors — the all-trivial syndrome means none was detected, and decoding returns one clean physical ∣T⟩|T\rangle, as the first figure shows.

Figure
The 15-to-1 factory: fifteen noisy T-states at error p ≈ 10⁻² enter a Clifford circuit that encodes the Reed–Muller code and measures 14 stabilizers; accepting only the trivial syndrome yields one clean T-state at p′ ≈ 35p³ ≈ 3.5×10⁻⁵, any detected error rejected
Distillation as a filter: many noisy bottles in, one pure bottle out — error p → 35p³ 15 noisy copies p ≈ 10⁻² |T⟩ ×15 Clifford circuit apply transversal T† encode Reed–Muller code measure 14 stabilizers postselect syndrome = 0 accept |T⟩ p′ ≈ 3.5×10⁻⁵ reject on any flagged error

Geometrically the story is cleaner still. After a Clifford twirl, any noisy magic state sits on the segment from the pure ∣T⟩|T\rangle to the maximally mixed center of the stabilizer polytope, its position fixed by the single number pp. Distillation is then a map on that one number, p↦p′p\mapsto p', with two fixed points — purity at p=0p=0 and garbage at the polytope — split by an unstable threshold p∗p_*. Below p∗p_* iteration flows to purity super-exponentially fast; above it flows to junk. The second figure plots this map against the diagonal, and the crossing is the threshold.

Figure
The 15-to-1 distillation map p′ = 35p³ (blue) against the identity p′ = p (amber). They cross at the threshold p = 1/√35 ≈ 0.169: an input below p is pulled toward 0 (distills), one above p* is pushed up (fails). The curve lies far below the diagonal for small p, giving cubic suppression
The punchline: the map p′ = 35p³ crosses p′ = p at the threshold p* ≈ 0.169 0.00 0.05 0.10 0.15 0.20 0.00 0.10 0.20 input error rate p output error p′ p′ = p p′ = 35p³ p* = 1/√35 ≈ 0.169 distills → 0 fails → grows

The core equations

The magic states are the natural non-Clifford targets — resources for the gates that lift the Cliffords to universality. The canonical single-qubit choices are ∣T⟩|T\rangle and its Clifford cousin ∣H⟩|H\rangle.

∣T⟩=12(∣0⟩+eiπ/4∣1⟩)=T∣+⟩,∣H⟩=cos⁡π8 ∣0⟩+sin⁡π8 ∣1⟩(1)|T\rangle=\frac{1}{\sqrt2}\left(|0\rangle+e^{i\pi/4}|1\rangle\right)=T|+\rangle,\qquad |H\rangle=\cos\tfrac{\pi}{8}\,|0\rangle+\sin\tfrac{\pi}{8}\,|1\rangle \qquad (1)

where: T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}) — the π/8\pi/8 phase gate; ∣+⟩=(∣0⟩+∣1⟩)/2|+\rangle=(|0\rangle+|1\rangle)/\sqrt2 — a stabilizer state carrying no magic; ∣H⟩|H\rangle — the +1+1 eigenstate of the Hadamard, equivalent to ∣T⟩|T\rangle up to a Clifford. Why they matter: adjoining TT to the Clifford group generates a dense subgroup of SU(2n)\mathrm{SU}(2^n), so these states plus Cliffords are universal — while Cliffords alone are classically simulable. One clean copy of ∣T⟩|T\rangle is spent per logical TT by gate teleportation: a CNOT couples data to ancilla, a ZZ measurement teleports the gate through, and the only leftover is an outcome-conditioned Clifford correction.

∣ψ⟩L⊗∣T⟩a  → CNOT(L→a), MZ(a)   {T∣ψ⟩Loutcome 0S T∣ψ⟩Loutcome 1(2)|\psi\rangle_L\otimes|T\rangle_a\;\xrightarrow{\ \mathrm{CNOT}(L\to a),\ M_Z(a)\ }\;\begin{cases}T|\psi\rangle_L & \text{outcome }0\\[2pt] S\,T|\psi\rangle_L & \text{outcome }1\end{cases} \qquad (2)

where: ∣ψ⟩L|\psi\rangle_L — the logical data qubit receiving a TT; aa — an ancilla prepared in ∣T⟩|T\rangle; MZM_Z — a Pauli-ZZ measurement; S=T2=diag(1,i)S=T^2=\mathrm{diag}(1,i) — the Clifford phase gate. Reading: the outcome-1 byproduct is a fault-tolerant Clifford, so the sole non-Clifford resource consumed is the magic state itself. To make "the error rate pp" meaningful, first symmetrize the noise by a Clifford twirl — averaging over the single-qubit Cliffords that fix the ∣T⟩|T\rangle axis, collapsing any noise channel to a depolarizing mixture set by one number.

Λ(ρ)=1∣C1′∣∑C∈C1′C ρ C†  ⟹  ρp=(1−p) ∣T⟩ ⁣⟨T∣+p ∣T⊥⟩ ⁣⟨T⊥∣(3)\Lambda(\rho)=\frac{1}{|\mathcal{C}_1'|}\sum_{C\in\mathcal{C}_1'} C\,\rho\,C^\dagger \;\Longrightarrow\; \rho_p=(1-p)\,|T\rangle\!\langle T|+p\,|T^\perp\rangle\!\langle T^\perp| \qquad (3)

where: C1′\mathcal{C}_1' — the single-qubit Cliffords fixing the ∣T⟩|T\rangle axis (a Z3\mathbb{Z}_3 rotation about the magic direction); ∣T⊥⟩|T^\perp\rangle — the orthogonal magic state; pp — the depolarizing error rate. Reading: after the twirl the state is one scalar pp, so distillation reduces to the scalar recursion p↦p′p\mapsto p' of the second figure. The 15-to-1 protocol implements that map. Because the code detects every single error, the leading undetectable logical fault has weight three, with exactly 35 patterns.

p′=35 p3+O(p4)1−O(p)  ≈  35 p3(4)p'=\frac{35\,p^3+O(p^4)}{1-O(p)}\;\approx\;35\,p^3 \qquad (4)

where: 3535 — the number of weight-3 error configurations that act as a logical error; pp — the twirled input error per copy; the denominator is the acceptance probability, →1\to1 as p→0p\to0. Reading: cubic suppression with coefficient 35 — each round roughly triples the reliable digits in 1/p1/p at a factor-15 qubit cost. Iterating reaches any accuracy, and the total raw states grow only polylogarithmically in the target error, set by one figure of merit.

pk+1=c pkm,N(p0→ε)∼[log⁡(1/ε)]γ,γ=log⁡nlog⁡m(5)p_{k+1}=c\,p_k^{m},\qquad N(p_0\to\varepsilon)\sim\big[\log(1/\varepsilon)\big]^{\gamma},\qquad \gamma=\frac{\log n}{\log m} \qquad (5)

where: nn — input copies per output (15 here); mm — the suppression exponent (3 here); cc — the leading coefficient (35 here); γ\gamma — the overhead exponent, log⁡315≈2.46\log_3 15\approx2.46. Reading: reaching ε\varepsilon needs only k∼log⁡mlog⁡(1/ε)k\sim\log_m\log(1/\varepsilon) rounds, so cost is gentle in accuracy but the prefactor is large — lowering γ\gamma toward 1 is the central goal. Whether a state can be distilled is bounded by a magic monotone: the robustness of magic measures how far outside the stabilizer polytope a state lies, and never increases under Clifford operations.

R(ρ)=min⁡{∑i∣xi∣ : ρ=∑ixi σi, σi∈STAB}  ≥  1(6)\mathcal{R}(\rho)=\min\Big\{\textstyle\sum_i|x_i|\ :\ \rho=\sum_i x_i\,\sigma_i,\ \sigma_i\in\mathrm{STAB}\Big\}\;\ge\;1 \qquad (6)

where: σi\sigma_i — pure stabilizer states; xix_i — real, possibly negative, quasiprobability weights; STAB\mathrm{STAB} — the stabilizer states. Reading: R(ρ)=1\mathcal{R}(\rho)=1 exactly for stabilizer states, which carry no magic, and R\mathcal{R} upper-bounds the magic any Clifford protocol can output — resource is concentrated, never manufactured.

Derivation AFifteen-to-one distillation from the quantum Reed–Muller code

The goal is to see how fifteen noisy ∣T⟩|T\rangle copies at error pp become one copy at error ≈35p3\approx 35p^3, and to pin down the algebraic fact that makes it work — a code whose logical TT is realized by physical TT on every qubit. We recall that transversal symmetry, use it to encode the ideal input onto the logical ∣T⟩|T\rangle, herald errors with Clifford-only measurements, count the undetectable faults, and read off the output error and threshold — every number checkable against Bravyi–Kitaev (2005).

Step 1. Fix the code. The punctured 15-qubit Reed–Muller code is a self-dual CSS code with n=15n=15, k=1k=1, d=3d=3 and — crucially — a transversal logical TT: applying T†T^\dagger to all fifteen qubits realizes the logical T†T^\dagger (up to a Clifford). Why: this single algebraic coincidence is the whole engine — the code is chosen because its non-Clifford transversal gate matches the magic state we purify.

Step 2. Encode. Apply transversal T†T^\dagger to the fifteen copies. On the ideal component (T∣+⟩)⊗15(T|+\rangle)^{\otimes15} this produces the encoded ∣+⟩L|+\rangle_L acted on by logical TT — the code's logical magic state ∣T⟩L|T\rangle_L. Why: this turns fifteen physical magic states into one encoded magic state, so the code's error detection acts on the accompanying noise.

Step 3. Herald with Clifford measurements. Measure the fourteen stabilizers; the all-trivial syndrome is acceptance, and any single physical error flips a stabilizer and is rejected. Why: with d=3d=3 the code detects every weight-1 and weight-2 error, so acceptance guarantees no low-weight fault slipped through — pure postselection, no non-Clifford cost.

Step 4. Count the survivors. The lowest-weight errors that escape detection and act as a nontrivial logical operator have weight 3, with exactly 35 such configurations, each of probability ∼p3\sim p^3. Why: 35 is a fixed count of weight-3 elements in the relevant logical coset, not a fitted constant.

Step 5. Read off output and threshold. On acceptance, decode ∣T⟩L|T\rangle_L back to one physical ∣T⟩|T\rangle; its residual error is the undetected-logical-error probability pout≈35p3p_{\text{out}}\approx 35p^3, and setting 35p∗3=p∗35p_*^3=p_* gives p∗=1/35≈0.169p_*=1/\sqrt{35}\approx0.169. Why: the fixed point is where "distillation helps" turns into "distillation hurts," and the large 0.1690.169 is why raw error of a few percent is already well inside the distillable regime. *Verified: the coefficient 35 and threshold 1/35≈0.1691/\sqrt{35}\approx0.169 are the standard Bravyi–Kitaev (2005) values; recount the weight-3 logical patterns and solve 35p∗3=p∗35p_*^3=p_*.*

Go deeper · Derivation B · 1 minThreshold and round count of the iterated distillation map
Derivation BThreshold and round count of the iterated distillation map

The goal is to treat one round of distillation as a one-dimensional dynamical system on the error rate, p↦c pmp\mapsto c\,p^{m}, and extract two things a resource estimator needs: the threshold separating "purifies" from "diverges," and the round count to reach a target error. We find the fixed points, test stability, identify the basin, solve the recursion in closed form, and plug in the 15-to-1 numbers to show only a handful of rounds is needed.

Step 1. Find the fixed points. Solving p=c pmp=c\,p^{m} gives p=0p=0 or p∗=c−1/(m−1)p_*=c^{-1/(m-1)}; for 15-to-1, c=35c=35, m=3m=3, so p∗=35−1/2≈0.169p_*=35^{-1/2}\approx0.169. Why: these are the pure state and the crossover — nothing else is invariant, so they organize everything.

Step 2. Test stability. Near p=0p=0 the map p′≈c pmp'\approx c\,p^{m} with m≥2m\ge2 has vanishing derivative — the origin is super-attracting, so p∗p_* is the unstable separatrix. Why: super-attraction means convergence faster than geometric once close — the origin of "a few rounds suffice."

Step 3. Identify the basin. Any p0<p∗p_0<p_* flows to zero; any p0>p∗p_0>p_* is pushed toward the useless fixed point. Why: a sharp go/no-go with no gentle degradation.

Step 4. Solve the recursion. Writing qk=c1/(m−1)pkq_k=c^{1/(m-1)}p_k linearizes the map to qk+1=qkmq_{k+1}=q_k^{m}, so pk=c−1/(m−1)(c1/(m−1)p0)mkp_k=c^{-1/(m-1)}\big(c^{1/(m-1)}p_0\big)^{m^k}. Requiring pk≤εp_k\le\varepsilon gives k≥log⁡m ⁣[ln⁡(c1/(m−1)/ε) / ln⁡(1/(c1/(m−1)p0))]k\ge\log_{m}\!\big[\ln(c^{1/(m-1)}/\varepsilon)\,/\,\ln(1/(c^{1/(m-1)}p_0))\big]; for p0=10−2p_0=10^{-2}, ε=10−15\varepsilon=10^{-15} this gives k≈3k\approx3. Why: the double logarithm makes accuracy cheap — dropping ε\varepsilon many orders adds one round — and each round drives the polylog overhead γ=log⁡n/log⁡m\gamma=\log n/\log m. *Verified: p∗=c−1/(m−1)p_*=c^{-1/(m-1)} reproduces 0.1690.169 for (c,m)=(35,3)(c,m)=(35,3); iterating from p0=10−2p_0=10^{-2} gives 3.5×10−53.5\times10^{-5}, 1.5×10−121.5\times10^{-12}, 1.2×10−341.2\times10^{-34}.*

Go deeper · Derivation C · 1 minGate teleportation injects one logical T gate
Derivation CGate teleportation injects one logical T gate

The goal is to prove by explicit algebra that consuming one ideal ∣T⟩|T\rangle applies a logical TT to arbitrary data with only a Clifford byproduct — the fact that turns a distilled ancilla directly into a gate. We write the data–ancilla state, apply the CNOT, project onto each outcome, and identify the correction on the unwanted branch, keeping every factor of eiπ/4e^{i\pi/4} since carrying the phases is the whole point.

Step 1. Set up. Take data ∣ψ⟩=α∣0⟩+β∣1⟩|\psi\rangle=\alpha|0\rangle+\beta|1\rangle and ancilla ∣T⟩=12(∣0⟩+eiπ/4∣1⟩)|T\rangle=\tfrac{1}{\sqrt2}(|0\rangle+e^{i\pi/4}|1\rangle), data as CNOT control and ancilla as target: 12[α∣0⟩(∣0⟩+eiπ/4∣1⟩)+β∣1⟩(∣0⟩+eiπ/4∣1⟩)]\tfrac{1}{\sqrt2}\big[\alpha|0\rangle(|0\rangle+e^{i\pi/4}|1\rangle)+\beta|1\rangle(|0\rangle+e^{i\pi/4}|1\rangle)\big]. Why: making the magic state the target lets the data's ∣1⟩|1\rangle branch pick up the phase that becomes TT.

Step 2. Apply CNOT. The control's ∣1⟩|1\rangle component flips the target labels: 12[α∣0⟩(∣0⟩+eiπ/4∣1⟩)+β∣1⟩(∣1⟩+eiπ/4∣0⟩)]\tfrac{1}{\sqrt2}\big[\alpha|0\rangle(|0\rangle+e^{i\pi/4}|1\rangle)+\beta|1\rangle(|1\rangle+e^{i\pi/4}|0\rangle)\big]. Why: this entangles the ancilla phase with the data amplitude, staging it to transfer at measurement.

Step 3. Measure the ancilla in ZZ, outcome 0. The target-∣0⟩|0\rangle terms leave the data in α∣0⟩+βeiπ/4∣1⟩=T∣ψ⟩\alpha|0\rangle+\beta e^{i\pi/4}|1\rangle=T|\psi\rangle — the desired gate, no correction. Why: the phase lands cleanly on the ∣1⟩|1\rangle amplitude, realizing TT for free.

Step 4. Outcome 1. The target-∣1⟩|1\rangle terms leave αeiπ/4∣0⟩+β∣1⟩\alpha e^{i\pi/4}|0\rangle+\beta|1\rangle, and applying the Clifford S=diag(1,i)S=\mathrm{diag}(1,i) returns eiπ/4 T∣ψ⟩e^{i\pi/4}\,T|\psi\rangle. Why: the byproduct is the Clifford S=T2S=T^2, applied fault-tolerantly at negligible cost, so the only non-Clifford resource ever spent is the ancilla — which makes distilled magic states directly convertible into TT gates. *Verified: expanding the CNOT and projecting onto each outcome reproduces the Nielsen–Chuang gate-teleportation identity; outcome 1 equals ST∣ψ⟩ST|\psi\rangle up to the phase eiπ/4e^{i\pi/4}.*

Limiting cases

Behavior of the 15-to-1 map p′≈35p3p'\approx 35p^3 across regimes:

CaseResultMeaning
Deep low-noisep≪p∗ ⇒ p′≈35 p3p\ll p_*\ \Rightarrow\ p'\approx 35\,p^3Cubic suppression; three rounds take p=10−2p=10^{-2} below 10−3410^{-34}, at a factor-15 qubit cost per round.
Threshold (fixed point)35 p∗3=p∗ ⇒ p∗=1/35≈0.16935\,p_*^3=p_*\ \Rightarrow\ p_*=1/\sqrt{35}\approx0.169The leading-order crossover; higher-order terms lower it slightly but it stays O(0.1)O(0.1) — distillation tolerates surprisingly large input noise.
Yield / overheadN∼[log⁡(1/ε)]γ, γ=log⁡315≈2.46N\sim[\log(1/\varepsilon)]^{\gamma},\ \gamma=\log_3 15\approx2.46Raw states per output grow only polylogarithmically in accuracy; γ=log⁡n/log⁡m\gamma=\log n/\log m is the figure of merit, pushed toward 1 by Bravyi–Haah codes.
Vanishing acceptancePacc=1−O(p)→1P_{\text{acc}}=1-O(p)\to1For small pp almost every batch is accepted, so yield approaches 1/151/15; near threshold acceptance falls and overhead balloons.
Non-distillable regionρ∈STAB ⇒ R(ρ)=1\rho\in\mathrm{STAB}\ \Rightarrow\ \mathcal{R}(\rho)=1Inside the stabilizer polytope the magic is zero and Cliffords preserve zero — no protocol produces a magic state.

Worked examples

1 · Two rounds of 15-to-1 from a one-percent source

A raw ∣T⟩|T\rangle source has twirled error p0=10−2p_0=10^{-2}. Find the output error after one, two, and three rounds of 15-to-1, and the raw states per final copy.

Step 1. Apply the map once: p1=35×(10−2)3=35×10−6=3.5×10−5p_1=35\times(10^{-2})^3=35\times10^{-6}=\mathbf{3.5\times10^{-5}}. The error drops nearly three orders of magnitude, since the cube of 10−210^{-2} is 10−610^{-6} and the coefficient 35 only partly offsets it.

Step 2. Iterate: p2=35×(3.5×10−5)3=1.5×10−12p_2=35\times(3.5\times10^{-5})^3=\mathbf{1.5\times10^{-12}}, then p3≈1.2×10−34p_3\approx\mathbf{1.2\times10^{-34}}. The exponent roughly triples each round — the super-exponential convergence of a super-attracting fixed point.

Step 3. Count raw states (ignoring rejections): each output consumes 15 inputs, so two rounds need 152=22515^2=225 copies and three need 153=337515^3=\mathbf{3375}. Two rounds already reach ∼10−12\sim10^{-12}, below the ∼10−15\sim10^{-15} target of most algorithms. Two rounds: p2≈1.5×10−12p_2\approx1.5\times10^{-12} from 225 raw states.

2 · Is a given source above or below threshold?

Hardware A delivers twirled states at p=0.05p=0.05; hardware B at p=0.20p=0.20. Which can be distilled by 15-to-1, and what happens to each under iteration?

Step 1. Compare to p∗=1/35≈0.169p_*=1/\sqrt{35}\approx0.169. Hardware A has p=0.05<p∗p=0.05<p_* (distillable basin); hardware B has p=0.20>p∗p=0.20>p_* (above threshold).

Step 2. Iterate A: p′=35×(0.05)3=4.4×10−3p'=35\times(0.05)^3=4.4\times10^{-3} — an order of magnitude below input — and a second round gives ≈3.0×10−6\approx3.0\times10^{-6}. Error collapses toward zero.

Step 3. Iterate B: p′=35×(0.20)3=0.28>0.20p'=35\times(0.20)^3=0.28>0.20 — the error grew, and further rounds drive it toward the garbage fixed point. A distills (0.05 → 4.4×10⁻³ → 3.0×10⁻⁶ → …); B fails (0.20 → 0.28 → …), starting above p∗≈0.169p_*\approx0.169.

Physics of the portrait

Magic state distillation is a young idea with a sharp lineage: a stabilizer theory that made Cliffords "easy," a no-go theorem that made universality "hard," and a purification protocol that reconciled the two.

Origins · 1 minmagic state distillation and how this was discovered
MS
magic state distillation
the offline non-Clifford resource that completes fault-tolerant universality · stabilizer codes and quantum resource theory

The concept crystallized from a tension that took a decade to sharpen. Daniel Gottesman's stabilizer formalism and the Gottesman–Knill theorem showed by the late 1990s that Clifford circuits on stabilizer states are efficiently classically simulable — a gift for error correction, since Cliffords are the gates codes implement most naturally, but a warning that Cliffords alone can never be universal. Something non-Clifford was mandatory, yet the safe way to run gates, transversally, could not supply it. In 2004 Emanuel Knill proposed a way through: fault tolerance from noisy ancillas and postselection, hinting the hard resource could be prepared offline. The decisive step came in 2005, when Sergey Bravyi and Alexei Kitaev formalized magic states and gave explicit protocols — the 15-to-1 route on the Reed–Muller code for ∣T⟩|T\rangle, a 5-qubit route for ∣H⟩|H\rangle — with the thresholds and coefficient 35 still quoted today; Ben Reichardt extended the idea to general CSS codes that year. In 2009 Bryan Eastin and Emanuel Knill closed the loop, proving no code admits a universal transversal gate set, making offline resources unavoidable. Bravyi and Haah's 2012 low-overhead triorthogonal codes, and Howard and Campbell's 2017 bounds via the robustness of magic, turned distillation from a clever trick into the accounting backbone of fault-tolerant architecture.

History
1998
— Gottesman–Knill theorem: Clifford circuits on stabilizer states are efficiently classically simulable
2004
— Knill introduces fault-tolerant computation from noisy ancillas and postselection
2005
— Bravyi and Kitaev define magic states and the 15-to-1 and 5-qubit distillation protocols
2009
— Eastin and Knill prove no code has a universal transversal gate set
2012
— Bravyi and Haah reach low overhead with triorthogonal codes

Going further

Texts and papers. Bravyi & Kitaev, "Universal quantum computation with ideal Clifford gates and noisy ancillas," Phys. Rev. A 71, 022316 (2005) · Nielsen & Chuang, Quantum Computation and Quantum Information, ch. 10 · Preskill, Lecture Notes on Quantum Computation, ch. 7 · Kitaev, Shen & Vyalyi, Classical and Quantum Computation · Eastin & Knill, "Restrictions on transversal encoded quantum gate sets," Phys. Rev. Lett. 102, 110502 (2009) · Bravyi & Haah, "Magic state distillation with low overhead," Phys. Rev. A 86, 052329 (2012) · Reichardt, "Quantum universality from magic states distillation applied to CSS codes," Quant. Inf. Proc. 4, 251 (2005) · Howard & Campbell, "Application of a resource theory for magic states...," Phys. Rev. Lett. 118, 090501 (2017).

Provenance. Magic states, gate teleportation, and the 15-to-1 / 5-to-1 protocols follow Bravyi & Kitaev (2005); the coefficients 35 and 5 and thresholds are their standard values. The Eastin–Knill no-go is Phys. Rev. Lett. 102, 110502 (2009); overhead scaling and triorthogonal codes are Bravyi & Haah (2012); resource-theory monotones Howard & Campbell (2017). A verifier should recompute: the gate-teleportation outcomes and SS byproduct; the fixed point of 35p3=p35p^3=p giving p∗=1/35≈0.169p_*=1/\sqrt{35}\approx0.169; the three-round iteration p0=10−2→∼10−34p_0=10^{-2}\to\sim10^{-34}; and γ=log⁡315≈2.46\gamma=\log_3 15\approx2.46.

Prerequisites. Stabilizer Formalism and Clifford Group · Quantum Error-Correcting Codes · Gate Teleportation · The Cost of Magic and Magic Resource Theory. Leads to. The Cost of Magic and Magic Resource Theory · Topological Quantum Computation · Fibonacci and Ising Anyons · Majorana Zero Modes.

Ask the tutor: Want to walk through why the Reed–Muller code's transversal TT is the exact ingredient that makes 15-to-1 distill ∣T⟩|T\rangle — or trace a magic state from hardware noise all the way to a logical gate?

Why can't we just apply a T gate transversally like the Cliffords?

Because the Eastin–Knill theorem forbids it. The transversal logical gates of any code form a finite group, and a finite group cannot be dense in the continuous unitary group — so it cannot contain a universal gate set. Intuitively, a continuous family of transversal gates would rotate logical information by arbitrarily small angles without leaving the codespace, defeating the error detection the code exists for. Cliffords fit inside the allowed finite set on good codes, but the TT gate does not. Distillation sidesteps the theorem by never performing TT on encoded data directly: it prepares the resource offline and teleports it in.

Where does the specific number 35 come from?

It is a combinatorial property of the punctured 15-qubit Reed–Muller code, not a fitted parameter. That code has distance 3, so it detects every weight-1 and weight-2 error and rejects them on the trivial syndrome. The lowest-weight errors that both evade detection and act as a logical operator have weight 3, and enumerating the code's logical cosets gives exactly 35 such configurations, each of probability ∼p3\sim p^3 — so the output error is ≈35p3\approx 35p^3. Change the code and you change both the exponent (via distance) and the coefficient (via this count); the 5-qubit code for ∣H⟩|H\rangle gives 5p35p^3.

What does the Clifford twirl actually do, and why is it needed?

Real hardware noise on a magic state can be any channel — biased, coherent, complicated. The twirl averages the state over the single-qubit Cliffords that fix the magic axis, symmetrizing that noise into a simple depolarizing mixture along the ∣T⟩|T\rangle direction. Afterward the state is one number, the error rate pp, so distillation becomes a clean scalar recursion p↦p′p\mapsto p'. Twirling costs nothing — it is built from Cliffords — and it is what makes "input error pp, output error 35p335p^3" well-defined rather than channel-dependent.

Is distillation the same thing as error correction?

They are cousins, not the same. Error correction protects a logical qubit already carrying data, decoding syndromes and applying corrections to keep the information intact. Distillation is state preparation: it manufactures a specific known ancilla — a magic state — by postselection, throwing away any batch with a nontrivial syndrome rather than repairing it. Error correction cannot discard the data it protects; distillation freely discards, because it is only making disposable fuel. The two run together: distillation feeds clean magic states into an error-corrected computation.

Why does distillation dominate the cost of a fault-tolerant algorithm?

Because Cliffords are nearly free and TT gates are not. Clifford operations are transversal or lattice-surgery-based and need no special ancillas, but every non-Clifford TT gate consumes one distilled magic state — the output of a factory that burned 15 raw states per round over several rounds, hundreds to thousands of physical qubit-rounds apiece. Algorithms like Shor factoring or quantum chemistry have enormous TT-counts, so the factories occupy most of the chip area and runtime — which is why the field works hard to lower both the TT-count and the overhead exponent γ\gamma.

Can any noisy state be distilled if I just run enough rounds?

No — two conditions must hold. First, the state must actually contain magic: inside the stabilizer polytope (robustness of magic equal to 1) it has zero distillable resource, and since Clifford operations cannot increase magic, no number of rounds helps. Second, even a magical state must start below threshold, p∗≈0.169p_*\approx0.169 for 15-to-1; above it the map 35p335p^3 lies above the diagonal, so each round makes the state worse. Only inputs both non-stabilizer and below threshold converge to a pure magic state.

Before this

Where this leads