Magic State Distillation

Magic state distillation is the machine that buys a fault-tolerant quantum computer its universality. A code built to protect qubits gives you the Clifford group — CNOT, Hadamard, the phase gate SS — cheaply, either transversally or through lattice surgery. But the Gottesman–Knill theorem says a circuit made only of Clifford gates, stabilizer inputs and Pauli measurements runs on a laptop in polynomial time, so a machine restricted to free Clifford operations is no quantum computer at all: it needs at least one gate outside the Clifford group, canonically the π/8\pi/8 gate T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}). And here is the trap Eastin–Knill sets — no code admits a universal transversal gate set, so the non-Clifford gate can never be applied the easy, intrinsically protected way. The resolution is to move the difficulty off the data qubits and into a consumable resource. A magic state — the ancilla ∣A⟩=T∣+⟩|A\rangle=T|+\rangle — is prepared, purified, stockpiled, and spent through gate teleportation to enact a TT using nothing but Clifford operations and a measurement. But magic states cannot be made cleanly by a Clifford machine; they are born noisy. Distillation is the purification: encode many noisy copies into a stabilizer code whose logical state is itself a magic state and whose syndromes flag the dangerous errors, measure the stabilizers, and keep only the clean outcomes. The reward is nonlinear error suppression, ϵ→c ϵd\epsilon\to c\,\epsilon^d, driving the infidelity toward zero exponentially in the rounds — at a spacetime cost that, in real algorithms, is usually the single largest line item on the bill.

Key takeaways
  • Clifford gates on stabilizer states with Pauli measurements are efficiently classically simulable (Gottesman–Knill), so they alone cannot compute — universality needs one non-Clifford gate, the T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}) gate.
  • No code has a universal transversal gate set (Eastin–Knill), so TT is supplied indirectly: a magic state ∣A⟩=T∣+⟩|A\rangle=T|+\rangle is consumed by gate teleportation to enact TT with only Clifford operations.
  • Physical magic states are noisy; distillation encodes nn copies into a stabilizer code whose logical state is a magic state and whose syndromes detect the relevant errors, then postselects on the clean syndrome.
  • The Bravyi–Kitaev 15-to-1 protocol uses the [[15,1,3]][[15,1,3]] punctured Reed–Muller code: it consumes 15 noisy copies and outputs one with error suppressed from ϵ\epsilon to 35 ϵ3+O(ϵ4)35\,\epsilon^3+O(\epsilon^4).
  • A state is distillable only above a threshold: below it the noisy state sits inside the stabilizer octahedron, is a stabilizer mixture, and yields nothing — for depolarized ∣A⟩|A\rangle the polytope boundary is at pc=1−1/2≈0.293p_c=1-1/\sqrt2\approx0.293.
  • Distillation usually dominates the qubit and time budget of fault-tolerant algorithms, driving research into low-overhead block codes, magic state cultivation, and resource-theory bounds on distillation rates.
  • Key idea: Clifford operations are free but non-universal; a magic state is a teleportable non-Clifford resource that lives outside the stabilizer polytope, and distillation encodes many noisy copies into a stabilizer code whose syndromes detect the relevant errors so postselection yields fewer, purer copies with error suppressed nonlinearly ϵ→c ϵd\epsilon\to c\,\epsilon^d.
The core insight

Clifford operations are free but non-universal; a magic state is a teleportable non-Clifford resource that lies outside the stabilizer polytope. Distillation encodes many noisy copies into a stabilizer code whose logical state is a magic state and whose syndromes detect the relevant errors, so postselecting on clean syndromes yields fewer, purer copies with error suppressed nonlinearly ϵ→c ϵd\epsilon\to c\,\epsilon^d.

Where this lives today

Distillation is the dominant line item in every credible estimate of what it takes to run a useful quantum algorithm. In surface-code architectures the Clifford group is cheap — lattice surgery moves and merges logical patches — but every TT gate must be fed a freshly distilled magic state, and resource studies of Shor's algorithm and of quantum chemistry routinely find that magic state factories occupy the majority of the physical qubits and much of the runtime, which is why compilers minimize TT-count and TT-depth above all else. The frontier is lowering that overhead: Bravyi–Haah block codes distill many qubits per round, "synthillation" fuses gate synthesis with distillation, and magic state cultivation grows high-fidelity states directly inside a small code patch, cutting spacetime cost for moderate target errors by large factors and threatening to make dedicated factories far smaller than the surface-code era assumed. Meanwhile the same monotones bound classical simulation: a circuit with tt TT-gates simulates at cost scaling with the stabilizer extent of ∣A⟩⊗t|A\rangle^{\otimes t}, roughly 2∼0.23t2^{\sim0.23t} — the yardstick for quantum-advantage claims on near-Clifford circuits.

The physical picture

Every single-qubit density matrix is a point in the Bloch ball, and the geometry tells you exactly what a Clifford computer can make for free. The six pure stabilizer states — the ±1\pm1 eigenstates of XX, YY, ZZ — are the vertices of an octahedron inscribed in the sphere, and their convex hull, the stabilizer polytope ∣x∣+∣y∣+∣z∣≤1|x|+|y|+|z|\le1, is everything a stabilizer machine can prepare and mix at no cost. Magic states stick out through the faces: ∣A⟩|A\rangle has Bloch vector (1/2,1/2,0)(1/\sqrt2,1/\sqrt2,0), so ∣x∣+∣y∣+∣z∣=2>1|x|+|y|+|z|=\sqrt2>1. Distillation takes a noisy copy just outside — or drives one back toward the pure vertex — by sacrificing many copies. The first figure fixes this geometry, with the depolarizing threshold pc=1−1/2≈0.293p_c=1-1/\sqrt2\approx0.293 at which a noisy magic state falls back inside the octahedron and becomes useless.

Figure
The single-qubit Bloch ball: the six stabilizer states are the vertices of an octahedron, the stabilizer polytope where the absolute values of x, y, z sum to at most 1. The magic state A has Bloch vector (1/√2, 1/√2, 0), whose absolute-value sum is √2 > 1, so it pokes outside the octahedron; a depolarized copy returns to the boundary at the critical noise p_c = 1 − 1/√2 ≈ 0.293, below which the state is a stabilizer mixture that no protocol can distill
Stabilizer states fill an octahedron; magic states poke out — distillation pushes noisy copies back toward the vertex the stabilizer polytope (3D) +Z −Z +X +Y |A⟩ outside the X–Y slice with the real numbers stabilizer mixtures |A⟩ = (1/√2, 1/√2) sum = √2 (outside) p_c: sum = 1 1 − 1/√2 ≈ 0.293 distillation drives the noisy point outward toward the magic vertex

Storing a magic state is only half the trick; the other half is spending it. Gate teleportation converts a stockpiled ∣A⟩|A\rangle into an applied TT the way a Bell pair teleports a qubit: couple data to ancilla with a CNOT, measure the ancilla, and apply an outcome-conditioned Clifford correction. The non-Clifford content is pre-paid in the resource state, so the runtime circuit stays inside the cheap, protected Clifford set — which is why architectures devote whole regions of the chip to magic state factories and why compilers obsess over TT-count. The second figure is the engine of the subject: the distillation map from input to output error, and the unstable fixed point that decides whether a round purifies or poisons.

Figure
The distillation map ε_out = 35 ε_in³ for the 15-to-1 protocol, plotted against the break-even line ε_out = ε_in. They cross at the unstable fixed point ε* = 1/√35 ≈ 0.169: start below it and each round drives the error down the cubic staircase toward zero, for example 10⁻² → 3.5×10⁻⁵ → 1.5×10⁻¹² in two rounds; start above it and the error is amplified
The punchline: one round of 15-to-1 maps ε → 35ε³ — below ε* the error cascades to zero 0 .05 .10 .15 .20 0 .05 .10 .15 .20 .25 input error ε_in output error ε_out ε_out = ε_in ε_out = 35 ε_in³ ε* = 1/√35 ≈ 0.169 unstable fixed point distillation wins ε_out below ε_in error amplified ε_out above ε_in cascade: 10⁻² → 3.5×10⁻⁵ → 1.5×10⁻¹²

The core equations

The whole subject rests on one non-Clifford gate and the ancilla that enacts it. The TT gate applies a relative phase eiπ/4e^{i\pi/4} between the basis states, and its magic state is what you get by feeding ∣+⟩|+\rangle through it.

T=(100eiπ/4),∣A⟩=T∣+⟩=12(∣0⟩+eiπ/4∣1⟩)(1)T=\begin{pmatrix}1&0\\0&e^{i\pi/4}\end{pmatrix},\qquad |A\rangle = T|+\rangle = \tfrac{1}{\sqrt2}\big(|0\rangle + e^{i\pi/4}|1\rangle\big) \qquad (1)

where: TT — the π/8\pi/8 non-Clifford phase gate, whose square is the Clifford S=diag(1,i)S=\mathrm{diag}(1,i); ∣A⟩|A\rangle — the magic state that teleports a TT gate, an eigenstate of the Clifford SHSH up to phase; ∣+⟩=(∣0⟩+∣1⟩)/2|+\rangle=(|0\rangle+|1\rangle)/\sqrt2 — the +1+1 eigenstate of XX. Reading it: TT is Clifford-squared but not itself Clifford, and ∣A⟩|A\rangle embodies that gap. The same resource wears two other standard labels, related to ∣A⟩|A\rangle by a Clifford rotation: ∣H⟩|H\rangle, the +1+1 eigenstate of the Hadamard, and ∣T⟩|T\rangle, pointing along the body diagonal (1,1,1)/3(1,1,1)/\sqrt3. Whether a state is even a candidate for distillation is decided by its overlap with the target, a linear function of its Bloch vector, and the stabilizer polytope is the octahedron ∣x∣+∣y∣+∣z∣≤1|x|+|y|+|z|\le1 — a state is a stabilizer mixture exactly when it lies inside.

⟨A∣ρ∣A⟩=12(1+12(x+y)),ρ=12(1+xX+yY+zZ),∣x∣+∣y∣+∣z∣≤1 ⇔ ρ∈STAB(2)\langle A|\rho|A\rangle = \tfrac12\Big(1+\tfrac{1}{\sqrt2}(x+y)\Big),\qquad \rho=\tfrac12\big(\mathbb 1 + x X + yY + zZ\big),\qquad |x|+|y|+|z|\le1\ \Leftrightarrow\ \rho\in\mathrm{STAB} \qquad (2)

where: (x,y,z)(x,y,z) — the Bloch vector of the noisy ancilla ρ\rho; ⟨A∣ρ∣A⟩\langle A|\rho|A\rangle — its fidelity with the target, the quantity distillation increases; STAB\mathrm{STAB} — the stabilizer mixtures. Reading it: ∣A⟩|A\rangle has x+y=2x+y=\sqrt2 and fidelity 1, while any ρ\rho inside the octahedron carries no extractable magic. Because the Gottesman–Knill theorem makes the free operations useless on their own — any Clifford circuit on stabilizer inputs is simulable in poly(n)\mathrm{poly}(n) time — distillation must lean on a code that does real work. The original engine is the Bravyi–Kitaev protocol on a specific self-dual CSS code, chosen because its transversal TT acts as a logical T†T^\dagger and its distance-3 structure detects low-weight errors.

SRM=⟨ rows of the punctured Reed–Muller code RM(1,4)∗ ⟩,[[15,1,3]](3)S_{\mathrm{RM}}=\big\langle\,\text{rows of the punctured Reed--Muller code }RM(1,4)^*\,\big\rangle,\qquad [[15,1,3]] \qquad (3)

where: [[15,1,3]][[15,1,3]] — a CSS code on 15 physical qubits encoding 1 logical qubit with distance 3; RM(1,4)∗RM(1,4)^* — the length-16 first-order Reed–Muller code punctured to length 15. Reading it: transversal T⊗15T^{\otimes15} on the noisy inputs implements a logical T†T^\dagger, so decoding delivers a purified copy. The payoff of distance 3 is cubic error suppression. An accepted output fails only when the input errors conspire to form a logical operator, which first happens at weight 3, so the leading output error is a codeword count times ϵ3\epsilon^3.

ϵout=35 ϵin3+O(ϵin4),paccept=1−15 ϵin+O(ϵin2)(4)\epsilon_{\mathrm{out}} = 35\,\epsilon_{\mathrm{in}}^{3} + O(\epsilon_{\mathrm{in}}^{4}),\qquad p_{\mathrm{accept}} = 1 - 15\,\epsilon_{\mathrm{in}} + O(\epsilon_{\mathrm{in}}^2) \qquad (4)

where: ϵin\epsilon_{\mathrm{in}} — error probability per input copy in the relevant Pauli basis; ϵout\epsilon_{\mathrm{out}} — error of the accepted output; 3535 — the number of weight-3 logical representatives; pacceptp_{\mathrm{accept}} — probability the syndrome is trivial and the round is kept. Reading it: the coefficient 35 is a codeword count, and the overhead approaches 15 inputs per output as ϵin→0\epsilon_{\mathrm{in}}\to0. Distillation has a rigorous resource-theoretic backbone. Its currency is a set of magic monotones — quantities that cannot increase under stabilizer operations — and two standard ones bound how much magic any protocol can extract.

M(ρ)=log⁡ ⁣∑P∣1dTr(Pρ)∣  (mana),R(ρ)=min⁡{∑i∣ci∣: ρ=∑ici σi, σi∈STAB}  (robustness)(5)\mathcal{M}(\rho)=\log\!\sum_{P}\Big|\tfrac{1}{d}\mathrm{Tr}(P\rho)\Big|\ \ (\text{mana}),\qquad \mathcal{R}(\rho)=\min\Big\{\textstyle\sum_i|c_i|:\ \rho=\sum_i c_i\,\sigma_i,\ \sigma_i\in\mathrm{STAB}\Big\}\ \ (\text{robustness}) \qquad (5)

where: M\mathcal{M} — the mana, a magic monotone for odd-prime-dimension qudits built from discrete-Wigner negativity; R\mathcal{R} — the robustness of magic, the minimal ℓ1\ell_1 weight of a stabilizer decomposition; PP — Heisenberg–Weyl operators; dd — the qudit dimension. Reading it: both vanish on stabilizer states and are monotone under free operations, so they are no-go certificates. Finally, the mechanism that spends the resource is gate teleportation. It turns a stored ∣A⟩|A\rangle into an applied TT using only Clifford operations and a measurement, so the purified state is what pays for universality at runtime.

∣ψ⟩⊗∣A⟩ → CNOT+MX  T∣ψ⟩up to a Clifford correction Sm, m∈{0,1}(6)|\psi\rangle\otimes|A\rangle \ \xrightarrow{\ \text{CNOT}+M_X\ }\ T|\psi\rangle\quad\text{up to a Clifford correction }S^{m},\ m\in\{0,1\} \qquad (6)

where: MXM_X — an XX-basis measurement on the ancilla after a CNOT from data to ancilla; SmS^m — the outcome-conditioned phase-gate correction, itself Clifford. Reading it: the only non-Clifford ingredient consumed at runtime is the ancilla, so the difficulty is fully offloaded onto the distilled resource.

Derivation AWhy Clifford circuits are classically simulable, so magic is unavoidable

The goal is to establish that a computer restricted to Clifford gates, Pauli measurements, and stabilizer inputs is classically simulable in polynomial time, so a genuine quantum speedup demands an ingredient — a magic state — outside this free set. We track the stabilizer generators under Clifford conjugation and show each operation costs only polynomial work, leaving universality to the non-stabilizer resource.

Step 1. An nn-qubit stabilizer state is fully specified by nn commuting Pauli generators, a tableau of O(n2)O(n^2) bits rather than 2n2^n amplitudes. Why: this compact description is why the simulation is efficient — the exponential Hilbert space is never touched.

Step 2. A Clifford gate UU updates every generator by conjugation, P↦UPU†P\mapsto UPU^\dagger, and by definition the result is again a signed Pauli, so a whole layer costs O(n2)O(n^2). Why: closure under Pauli conjugation keeps the tableau a tableau — no non-Pauli terms are ever generated.

Step 3. A Pauli measurement either commutes with all stabilizers (deterministic, read off) or anticommutes with some (fair coin, tableau updated by Gaussian elimination) — all in poly(n)\mathrm{poly}(n). Why: measurement is the only source of randomness, and it too stays polynomial.

Step 4. Since preparation, gates, measurement, and feedforward are each polynomial, the computation is classically simulable, so Cliffords plus stabilizer inputs cannot be universal. A non-stabilizer resource is mandatory — a distilled magic state, injected by gate teleportation. Why: magic is not an optimization but the only thing standing between a stabilizer circuit and a classical algorithm.

Go deeper · Derivation B · 1 minCubic error suppression and the coefficient 35 in 15-to-1
Derivation BCubic error suppression and the coefficient 35 in 15-to-1

The goal is to derive the leading-order output error of the Bravyi–Kitaev 15-to-1 protocol directly from the distance of the underlying code, and to show why the number 35 appears out front. We model each input as independently carrying the dangerous Pauli error with probability ϵ\epsilon and count the minimum-weight undetectable patterns that survive postselection.

Step 1. Model the input noise as probability ϵ\epsilon per copy of the logical-relevant Pauli error, independently across the 15 copies. The accepted output is corrupted only by undetectable patterns. Why: only undetectable errors slip through postselection, so they alone contribute to ϵout\epsilon_{\mathrm{out}}.

Step 2. The [[15,1,3]][[15,1,3]] code has distance 3, so every weight-1 and weight-2 error produces a nontrivial syndrome and is rejected; the leading rejection probability is 15ϵ15\epsilon, giving paccept=1−15ϵ+O(ϵ2)→1p_{\mathrm{accept}}=1-15\epsilon+O(\epsilon^2)\to1. Why: detecting up to distance-minus-one =2=2 errors is what converts linear into cubic suppression.

Step 3. Of the (153)=455\binom{15}{3}=455 weight-3 patterns, exactly 35 are logical-operator representatives that flip the encoded state; the rest remain detectable. Hence ϵout=35 ϵ3/paccept+O(ϵ4)=35 ϵ3+O(ϵ4)\epsilon_{\mathrm{out}}=35\,\epsilon^3/p_{\mathrm{accept}}+O(\epsilon^4)=35\,\epsilon^3+O(\epsilon^4). Why: the coefficient is the weight-enumerator count A3=35A_3=35 of minimum-weight logical operators, not a fudge factor.

Step 4. Iterating rr rounds composes the cubic map: ϵ(r)∼35(3r−1)/2 ϵ3r\epsilon^{(r)}\sim 35^{(3^r-1)/2}\,\epsilon^{3^r}, a doubly-exponential collapse, while the qubit cost grows only like 15r15^r, so reaching target error δ\delta costs polylog(1/δ)\mathrm{polylog}(1/\delta) overhead. Why: error falls doubly-exponentially in rounds but cost only geometrically — asymptotically cheap even when it dominates in absolute terms.

Go deeper · Derivation C · 1 minThe distillation threshold: deeply depolarized magic states cannot be purified
Derivation CThe distillation threshold: deeply depolarized magic states cannot be purified

The goal is to prove that a sufficiently noisy magic state is a convex mixture of stabilizer states and cannot be distilled by any protocol, and to compute the critical depolarizing strength for ∣A⟩|A\rangle. We identify the stabilizer polytope with the octahedron ∣x∣+∣y∣+∣z∣≤1|x|+|y|+|z|\le1 and find where the depolarized Bloch vector crosses its boundary.

Step 1. The six stabilizer pure states sit at (±1,0,0)(\pm1,0,0), (0,±1,0)(0,\pm1,0), (0,0,±1)(0,0,\pm1), and their convex hull is the octahedron ∣x∣+∣y∣+∣z∣≤1|x|+|y|+|z|\le1; any ρ\rho inside is a mixture of stabilizer states. Why: these mixtures are exactly what a Gottesman–Knill machine prepares for free, so the octahedron is the "no magic here" region.

Step 2. Depolarize the magic state, ρp=(1−p) ∣A⟩⟨A∣+p 1/2\rho_p=(1-p)\,|A\rangle\langle A|+p\,\mathbb 1/2; its Bloch vector is (1−p)(1/2,1/2,0)(1-p)(1/\sqrt2,1/\sqrt2,0), so ∣x∣+∣y∣+∣z∣=(1−p)2|x|+|y|+|z|=(1-p)\sqrt2. Why: depolarizing shrinks the Bloch vector toward the origin along its own direction.

Step 3. The point reaches the boundary when (1−pc)2=1(1-p_c)\sqrt2=1, i.e. pc=1−1/2≈0.293p_c=1-1/\sqrt2\approx0.293; for p≥pcp\ge p_c the state is a stabilizer mixture and no protocol distills magic. Why: once inside, the input contains no magic, and monotonicity forbids manufacturing what is not there.

Step 4. The condition p<pcp<p_c is necessary but not sufficient — finite-round protocols purify only a subset of the exterior, and circuit noise tightens the window. Why: 15-to-1 has its own, more demanding break-even error ϵ∗=1/35≈0.169\epsilon_*=1/\sqrt{35}\approx0.169.

Limiting cases

Distillation behaves qualitatively differently depending on how noisy the inputs are and which protocol family you use. The table collects the regimes that matter.

CaseResultMeaning
High-fidelity inputϵout≈35 ϵin3\epsilon_{\mathrm{out}}\approx35\,\epsilon_{\mathrm{in}}^3For 15-to-1 with small input error, output error is cubic; iterating gives ∼35(3r−1)/2ϵ3r\sim35^{(3^r-1)/2}\epsilon^{3^r} after rr rounds — doubly-exponential convergence.
Break-even fixed point35 ϵ∗3=ϵ∗⇒ϵ∗=1/35≈0.16935\,\epsilon_*^3=\epsilon_*\Rightarrow\epsilon_*=1/\sqrt{35}\approx0.169Above this unstable fixed point a single round increases the error; below it the round decreases it. Circuit-level noise pushes the usable threshold well below 0.1690.169.
Deep inside the polytopeρ=(1−p) ∣A⟩⟨A∣+p 1/2, p≥pc\rho=(1-p)\,|A\rangle\langle A|+p\,\mathbb1/2,\ p\ge p_cFor p≥pc=1−1/2≈0.293p\ge p_c=1-1/\sqrt2\approx0.293 the state is a stabilizer mixture: no protocol distills magic, and the circuit is classically simulable.
Low-overhead asymptoticscost=O ⁣(log⁡γ(1/ϵ)), γ→1\text{cost}=O\!\big(\log^{\gamma}(1/\epsilon)\big),\ \gamma\to1Bravyi–Haah and later block codes drive the overhead exponent toward 1, versus γ≈log⁡315≈2.46\gamma\approx\log_3 15\approx2.46 for naive iterated 15-to-1.

Worked examples

1 · Distilling to algorithmic fidelity with two rounds (fully worked)

A machine injects magic states with error ϵin=10−2\epsilon_{\mathrm{in}}=10^{-2}, but a long algorithm needs logical TT states good to 10−1210^{-12}. How many rounds of 15-to-1 are required, what fidelity do they reach, and how many raw states does one output cost?

Step 1. One round maps ϵ→35ϵ3\epsilon\to35\epsilon^3. Since 10−2<ϵ∗=1/35≈0.16910^{-2}<\epsilon_*=1/\sqrt{35}\approx0.169, we are on the purifying side, and the first round gives ϵ(1)=35(10−2)3=3.5×10−5\epsilon^{(1)}=35(10^{-2})^3=\mathbf{3.5\times10^{-5}}.

Step 2. Feed it back: ϵ(2)=35 (3.5×10−5)3=35×4.29×10−14=1.5×10−12\epsilon^{(2)}=35\,(3.5\times10^{-5})^3=35\times4.29\times10^{-14}=\mathbf{1.5\times10^{-12}}, which clears the target. So two rounds suffice.

Step 3. Count raw states: each round's output consumes 15 inputs, so two nested rounds consume 15×15=22515\times15=\mathbf{225} ignoring rejections. With paccept≈(1−ϵ)15≈0.86p_{\mathrm{accept}}\approx(1-\epsilon)^{15}\approx0.86 in round 1 and ≈1\approx1 in round 2, the true cost is ≈225/0.86≈262\approx225/0.86\approx\mathbf{262} raw states per output.

Step 4. Two rounds bought nine orders of magnitude of fidelity for a few hundred raw states; that multiplicative overhead, replicated across every TT, is what makes factories the bulk of the machine. Answer: two rounds, ϵout≈1.5×10−12\epsilon_{\mathrm{out}}\approx1.5\times10^{-12}, about 260 raw states per output.

2 · Is this state distillable at all?

You are handed two noisy ancillas: state A with Bloch vector (0.6,0.6,0)(0.6,0.6,0), and state B, a depolarized magic state with p=0.32p=0.32. For each, decide whether it carries magic, and for A compute the fidelity with the target.

Step 1. Octahedron test on A: ∣x∣+∣y∣+∣z∣=0.6+0.6+0=1.2>1|x|+|y|+|z|=0.6+0.6+0=1.2>1, so A is outside the polytope — magic in principle. Its fidelity is ⟨A∣ρ∣A⟩=12(1+(x+y)/2)=12(1+1.2/2)=0.924\langle A|\rho|A\rangle=\tfrac12(1+(x+y)/\sqrt2)=\tfrac12(1+1.2/\sqrt2)=\mathbf{0.924}.

Step 2. Test on B: its Bloch vector is 0.68 (1/2,1/2,0)0.68\,(1/\sqrt2,1/\sqrt2,0), so ∣x∣+∣y∣+∣z∣=0.682=0.962<1|x|+|y|+|z|=0.68\sqrt2=0.962<1. Since p=0.32>pc=0.293p=0.32>p_c=0.293, B is inside the octahedron — a stabilizer mixture that cannot be distilled.

Step 3. "Outside the octahedron" is the admission ticket, not fidelity alone: A at 0.9240.924 is usable, while a state just past pcp_c is worthless however it was prepared. Answer: A is distillable (fidelity 0.924); B is not.

3 · Break-even and why a bad round hurts

15-to-1 is applied to inputs with ϵin=0.10\epsilon_{\mathrm{in}}=0.10 and, in a separate run, ϵin=0.20\epsilon_{\mathrm{in}}=0.20. What does one round do in each case?

Step 1. For ϵin=0.10<ϵ∗=0.169\epsilon_{\mathrm{in}}=0.10<\epsilon_*=0.169 the round should purify: ϵout=35(0.10)3=0.035\epsilon_{\mathrm{out}}=35(0.10)^3=\mathbf{0.035}, below the input — the error dropped by about 3×3\times.

Step 2. For ϵin=0.20>ϵ∗\epsilon_{\mathrm{in}}=0.20>\epsilon_* it should backfire: ϵout=35(0.20)3=0.28\epsilon_{\mathrm{out}}=35(0.20)^3=\mathbf{0.28}, larger than the input — the "distillation" made things worse.

Step 3. The two runs straddle the unstable fixed point ϵ∗=1/35\epsilon_*=1/\sqrt{35}: below it the cubic map contracts toward zero, above it it diverges toward 1. Answer: 0.10→0.0350.10\to0.035 (purifies), 0.20→0.280.20\to0.28 (poisons); the divide is ϵ∗≈0.169\epsilon_*\approx0.169.

Physics of the portrait

Magic state distillation is the idea that made fault tolerance practical rather than merely possible — the bridge from protecting qubits to computing with them.

Origins · 1 minmagic state distillation and how this was discovered
MS
magic state distillation
the non-Clifford resource behind universal fault tolerance · stabilizer codes and fault-tolerant quantum computation

The route to distillation runs through a sequence of no-go results and their circumventions. Daniel Gottesman's 1997 stabilizer formalism, and the Gottesman–Knill theorem it powered, showed Clifford circuits on stabilizer states are classically efficient — a triumph that doubled as a warning that something more was needed for a quantum advantage. That something is a non-Clifford gate, but the Eastin–Knill theorem (Bryan Eastin and Emanuel Knill, 2009) proved no error-detecting code implements a universal gate set transversally. Sergey Bravyi and Alexei Kitaev supplied the detour in 2005: prepare a noisy magic state non-fault-tolerantly, then purify it — their 15-to-1 protocol on the [[15,1,3]][[15,1,3]] punctured Reed–Muller code turns error ϵ\epsilon into 35ϵ335\epsilon^3, and gate teleportation spends the purified state to enact a TT with only Clifford operations. The daunting overhead drew a second wave: Bravyi and Jeongwan Haah's 2012 triorthogonal block codes distill many qubits at once with asymptotically vanishing overhead, and around 2014 Victor Veitch, Mark Howard, and collaborators built a resource theory of magic — mana, robustness, relative entropy of magic — tying it to the contextuality that "supplies the magic." The modern picture places distilled magic states at the centre of every fault-tolerant cost estimate, with recent cultivation schemes (2024) growing high-fidelity states in place to shrink the factories.

History
1997
— Gottesman formalizes the stabilizer picture, and the Gottesman–Knill theorem makes Clifford circuits classically simulable
2005
— Bravyi and Kitaev introduce magic state distillation and the 15-to-1 protocol
2009
— Eastin and Knill prove no code has a universal transversal gate set
2012
— Bravyi and Haah cut overhead with triorthogonal block codes
2014
— Veitch, Howard and collaborators build the resource theory of magic
2024
— magic state cultivation grows high-fidelity states in place, shrinking the factories

Going further

Texts. Nielsen and Chuang, Quantum Computation and Quantum Information, ch. 10 and §10.6 · Preskill, Lecture Notes on Quantum Computation, ch. 7 · Bravyi and Kitaev, "Universal quantum computation with ideal Clifford gates and noisy ancillas," Phys. Rev. A 71, 022316 (2005) · Bravyi and Haah, "Magic-state distillation with low overhead," Phys. Rev. A 86, 052329 (2012) · Eastin and Knill, "Restrictions on transversal encoded quantum gate sets," Phys. Rev. Lett. 102, 110502 (2009) · Veitch, Mousavian, Gottesman, Emerson, "The resource theory of stabilizer quantum computation," New J. Phys. 16, 013009 (2014) · Watrous, The Theory of Quantum Information. The key anchor values are: the Bloch vector of ∣A⟩|A\rangle satisfies ∣x∣+∣y∣+∣z∣=2>1|x|+|y|+|z|=\sqrt2>1 and the depolarizing threshold is pc=1−1/2≈0.293p_c=1-1/\sqrt2\approx0.293; the 15-to-1 protocol gives leading error 35ϵ335\epsilon^3 with acceptance 1−15ϵ1-15\epsilon and code parameters [[15,1,3]][[15,1,3]], where 35 is the count of weight-3 logical representatives; the break-even fixed point is ϵ∗=1/35≈0.169\epsilon_*=1/\sqrt{35}\approx0.169 and the two-round cascade runs 10−2→3.5×10−5→1.5×10−1210^{-2}\to3.5\times10^{-5}\to1.5\times10^{-12}; the gate-teleportation circuit uses a CNOT, an XX-basis measurement, and a conditioned SmS^m correction; and the monotones mana M\mathcal{M} and robustness R\mathcal{R} are defined via discrete-Wigner negativity and minimal stabilizer decomposition respectively.

Prerequisites. Stabilizer Formalism · Pauli Group and Clifford Group · CSS Codes · Syndrome Measurement and Decoding · Quantum Error Model and Decoherence Channels. Leads to. Code Distance and Logical Operators · Knill–Laflamme Conditions · Quantum Hamming and Singleton Bounds.

Ask the tutor: ask me to walk through the 15-to-1 circuit gate by gate, or to work out how many distillation rounds and physical qubits your target algorithm's TT-count actually demands.

Why is the number 35 exactly, and not a rounded estimate?

It is an exact codeword count. The [[15,1,3]][[15,1,3]] code has distance 3, so postselection accepts an error only if it is a logical operator. Of the (153)=455\binom{15}{3}=455 weight-3 patterns, exactly 35 are minimum-weight logical representatives — the weight-enumerator coefficient A3=35A_3=35 of the punctured Reed–Muller code. Each slips through the syndrome check and flips the encoded state, so the leading output error is 35ϵ335\epsilon^3. Change the code and the coefficient changes, but for this code the 35 is as exact as the 15.

What is the difference between the magic states |A⟩, |H⟩, and |T⟩?

They are the same resource in different labels, related by Clifford rotations. ∣A⟩=T∣+⟩|A\rangle=T|+\rangle is natural for teleporting a TT gate; ∣H⟩|H\rangle is the +1+1 eigenstate of the Hadamard on an octahedron face; ∣T⟩|T\rangle points along the body diagonal (1,1,1)/3(1,1,1)/\sqrt3. Because Cliffords are free, distilling any one is equivalent to distilling the others — you rotate between them at no cost. Papers use whichever is convenient: ∣H⟩|H\rangle-type in the protocol literature, ∣A⟩|A\rangle in the gate-teleportation description.

If distillation only postselects, why isn't the acceptance probability a killer?

Because at low input error almost every round is accepted. A round is rejected only when a copy carries a detectable error, giving rejection ≈15ϵ\approx15\epsilon, so paccept=1−15ϵ+O(ϵ2)→1p_{\mathrm{accept}}=1-15\epsilon+O(\epsilon^2)\to1. At ϵ=10−2\epsilon=10^{-2} that is about 86%86\% acceptance — an overhead of 15/0.86≈1715/0.86\approx17 inputs per output rather than 15. Postselection is cheap precisely in the high-fidelity regime where you use it; it only bites on very noisy inputs near break-even, where you should not be distilling anyway.

Does distillation ever violate no-cloning or monotonicity?

No. It does not clone: it consumes many noisy copies to produce fewer, better ones, so the total count goes down. And it respects monotonicity: robustness and mana cannot increase under stabilizer operations, so a protocol only concentrates magic already present across many copies into fewer — never manufactures it. That is why a state inside the octahedron, with zero magic, yields nothing. Distillation is purification of an existing resource, fully consistent with the resource-theory bookkeeping.

Why is distillation usually the dominant cost of a fault-tolerant algorithm?

Because Cliffords are cheap, TT gates are not, and useful algorithms need enormous TT-counts. In a surface-code machine Cliffords are lattice surgery on the same qubits that store data. But every TT needs a distilled magic state, and distillation needs its own qubits running rounds in parallel to keep up. Estimates for factoring or chemistry consistently show factories occupying most physical qubits and much of the runtime — which is why lowering distillation overhead is one of the most valuable things you can do for the whole machine.

How does magic state cultivation differ from ordinary distillation?

Ordinary distillation runs a separate factory that postselects clean outputs and ships them to the algorithm — costly in dedicated qubits and time. Cultivation instead grows a high-fidelity state directly inside a small code patch, expanding the distance while checking for errors, so there is no separate factory and far less wasted spacetime. For the moderate target errors of early machines it can produce a good state at a fraction of the 15-to-1 overhead. It is a recent (2024) refinement of the same resource-theory logic, but it can dramatically shrink the part of the chip devoted to making magic.

Before this

Where this leads