Yifei Wang · Tsinghua University
3 December 2026 · Chair for Design Automation · Technical University of Munich
New problem: prepare the magic state , encoded, fault tolerantly. It is a known state, made offline: bad attempts can be discarded.
Gottesman, arXiv:quant-ph/9807006 · Gottesman, Chuang, arXiv:quant-ph/9908010 · Bravyi, Kitaev, arXiv:quant-ph/0403025 · Knill, arXiv:quant-ph/0402171
One early physical fault becomes a logical error: output error , not suppressed by the distance. Three repairs:
Many noisy encoded states → fewer better ones.
Do in a code where it is transversal, then switch.
Encode, then check so carefully that bad runs are discarded — e.g. cultivation.
Horsman et al., arXiv:1111.4022 · Li, arXiv:1410.7808
Every line is a code patch: noisy encoded in, a logical Clifford circuit, the code on top. Repeat in rounds.
A faulty input is a error. The code's checks catch one or two; three can pass: .
Any fired check rejects the run. Bravyi–Haah: inputs, outputs per run.
Bravyi, Kitaev, arXiv:quant-ph/0403025 · Bravyi, Haah, arXiv:1209.2426 · Litinski, arXiv:1905.06903 · Experiment, logical 5-to-1 on neutral atoms: arXiv:2412.15165
How? And only with the protected Clifford operations.
A bent wire is a Bell pair. Apply at one end and project onto : the gate slides around the bend, and the other end carries the magic state .
The same thing as a circuit. A CNOT prepares the Bell pair; the projection becomes an measurement with a known correction on R — teleportation again.
Encode the measured half in the code. on every qubit acts as a logical , so R again receives . The readout gives 4 parity checks: accept only if all pass.
Every is a gate-teleportation gadget. The inputs — noisy magic states — enter here, inside the circuit; the output leaves on R. A faulty input acts as a error on its line.
One faulty input is caught. Its error flips one outcome, and two of the parity checks fire: the run is rejected.
Two faulty inputs are caught too. At least one check always fires for one or two errors.
Three can pass. There are 35 such triples: . Bravyi–Haah: many outputs per run. Repeat in rounds for any target error.
Every line is a code patch. Each input is an encoded noisy magic state, and the whole circuit is a logical Clifford circuit, protected by the code.
Bravyi, Kitaev, arXiv:quant-ph/0403025 · Bravyi, Haah, arXiv:1209.2426 · Litinski, arXiv:1905.06903 · Experiment, logical 5-to-1 on neutral atoms: arXiv:2412.15165
The 15-qubit 3D color code has a transversal : apply to every qubit of .
Measure the 8 qubits off one face in . The face is the 7-qubit 2D color code, where all Clifford gates are transversal.
A correction set by the outcomes fixes the face's checks: feedforward again.
Anderson, Duclos-Cianci, Poulin, arXiv:1403.2734 · Bombín, arXiv:1412.5079
Daguerre, Kim, arXiv:2410.07327
Wang, Gu, arXiv:2503.19758 — switches directly into codes that are not subsystems of the 3D code, e.g. 3D color → 2D surface code
First fault-tolerant code switching: 7-qubit color code ↔ 10-qubit code with transversal , trapped ions.
Pogorelov et al., arXiv:2403.13732 · theory: Butt et al., arXiv:2306.17686
Magic states by switching from the code to the Steane code.
Daguerre et al., arXiv:2506.14169
Inject into a small code, check it, discard every run with a fired detector. The most successful example, cultivation, checks the state with a logical Clifford:
with : a Clifford operator. So measure the logical to check the magic state — a Clifford measurement that codes can do fault tolerantly.
Inject at → check with layers of physical → grow to , check again → escape into a large surface code. 15 at , 53 at ; acceptance 69 % and 14 % at .
Li, arXiv:1410.7808 · Gidney, Shutty, Jones, arXiv:2409.17595 · variants: Chen et al., arXiv:2503.18657 · Sahay et al., arXiv:2509.05212 · Hetényi et al., arXiv:2603.05429 · experiment: Rosenfeld et al., arXiv:2512.13908
why it is hard, and how magna uses the code structure
in collaboration with Yingfei Gu · arXiv:2610.22315
To design or compare factories we need and under circuit noise, with the actual gates: 61 qubits, 640 gates, 101 gates, one logical out.
amplitudes in a state vector
stabilizer terms for 101 gates
repeated for every noisy draw
Bravyi, Gosset, arXiv:1601.07601 · Qassim, Pashayan, Gosset, arXiv:2106.07740 · circuit: Chen et al., arXiv:2503.18657
Keep a compact representation of the intermediate state: symbolic Pauli frames, stabilizer coordinates, sparse Pauli sums, matrix product states, and others.
Bottleneck: the intermediate states carry non-Clifford content that the output does not need.
RP² : peak amplitudes; 7.5–193 ms per draw.
SOFT, arXiv:2512.23037 · SymFT, arXiv:2607.28600 · Clifft, arXiv:2604.27058 · PPVM, arXiv:2610.18225 · MPS, arXiv:2609.19116 · Tsim (state-vector strategy), arXiv:2604.01059
Rewrite the circuit globally (ZX calculus, stabilizer decompositions, cutting), then evaluate.
Bottleneck: the cost grows with the non-Clifford content left at the output; for output magic states the stabilizer rank of is believed to grow exponentially.
Kissinger, van de Wetering, arXiv:2109.01076 · Pashayan et al., arXiv:2101.12223 · Tsim (stabilizer decomposition), arXiv:2604.01059 · Wan, Zhong, Zapirain, arXiv:2509.08658 · Surti, Daguerre, Kim, arXiv:2512.23799
Also needed, and missing from most: decoders inside the circuit — feedforward that is a nonlinear function of the measurement record.
Peak sizes: our measurement of SymFT, Clifft and PPVM on the same circuit (arXiv:2610.22315, Table II) · Stabilizer rank of : Bravyi, Smith, Smolin, arXiv:1506.01396
Proxy data: Gidney, Shutty, Jones, arXiv:2409.17595 · proxies shown unreliable: Li et al., arXiv:2512.23037 · Wan, Zapirain, arXiv:2609.18922 · Chan et al., arXiv:2609.17706
| Protocol | Hidden structure | Physical | Logical output |
|---|---|---|---|
| 15-to-1 distillation | transversal on | 15 | one |
| Bravyi–Haah | triorthogonal code | copies of | |
| Code switching | transversal on the 3D color code | 15 | one |
| Cultivation (color, RP²) | layers implementing a transversal Clifford check | 15–101 | one |
The physical count grows with the distance; the logical magic is fixed by the output. Maybe the code structure can remove the difficulty.
Can a deterministic algorithm find this structure — with no human insight and no protocol-specific input?
Can the simulation cost follow the logical magic — or even less — instead of the physical count?
Push a Clifford through rotations: . A Clifford maps a Pauli axis to a Pauli axis, so every rotation stays a rotation with a new axis, and the Cliffords pile up at the ends.
Start from the gadget form. Every is teleported: ancilla , CNOT, measurement, correction. The logical outcome sets the correction on R. Shown: 3 of the 15 code qubits.
Make all feedforward coherent (deferred measurement): becomes C from the ancilla, measured at the end; becomes CNOTs from R before the readout. The checks become projections.
Push the gadget CNOT into the initial Clifford. Passing only changes its axis, : a on the parity .
Combine the diagonal gates: : a on the code qubit and one on the ancilla.
Push the CNOTs from R in as well: becomes on the parity .
One commuting layer: rotations about products of 's, which all commute.
Abstract the ends: everything before the layer is one stabilizer state; the readout and checks are stabilizer projections. Any protocol gives this form.
Related: Pashayan et al., arXiv:2101.12223
The phase is non-Clifford only in the logical quotient space
We find the Clifford directions by linear algebra over bits — deterministic, polynomial time, no knowledge of the code. how? →
The network becomes
Related: Cui, Gottesman, Krishna, arXiv:1608.06596
Third differences define a trilinear form,
Finite differences:
| Gate | first difference | second | third | Level | |
|---|---|---|---|---|---|
| Pauli | |||||
| Clifford | |||||
| non-Clifford | |||||
| C | Clifford | ||||
| C | non-Clifford | ||||
| CC | non-Clifford |
Remaining directions
Cui, Gottesman, Krishna, arXiv:1608.06596 · Heyfron, Campbell, arXiv:1712.01557 · Bravyi, Smith, Smolin, arXiv:1506.01396
A fault in the coherent 15-to-1 circuit:
Through a Clifford, the Pauli changes: the CNOT maps
Through a
At the readout:
Run the protocol
The trace joins the irrelevant legs of the two copies.
Acceptance network: the output legs are traced too. Contracting it gives
Fidelity network: the output legs meet a small noiseless target circuit
A sampling network draws the early outcomes with their correct distribution without applying any later feedforward: the future is trace preserving.
Every feedforward enters as a Pauli insertion on a fixed compiled circuit, which does not change its structure.
Validation: logical-level 15-to-1, 102 qubits, 15 decoder rounds — the exact formula is reproduced down to
The sampling network, every outcome leg open (triangles):
Trace every round after round 1. Everything after round 1 is then trace preserving, so the later decisions, still unknown, drop out.
Draw
Only now can the decoder act:
Trace every round after round 2. The future is trace preserving again, and it needs only
Draw
Insert
benchmarks from the paper · how to run your own protocol
| Protocol | Qubits | Non-Clifford | Output | Rank | ms / draw |
|---|---|---|---|---|---|
| Bravyi–Haah 14-to-2 | 30 | 1 | 0.0069 | ||
| Bravyi–Haah 38-to-10 | 86 | 1 | 0.010 | ||
| Bravyi–Haah 128-to-40 | 296 | 1 | 0.022 | ||
| Bravyi–Haah 308-to-100 | 716 | 1 | 0.050 | ||
| Cultivation, color | 15 | 1 | 0.0059 | ||
| Cultivation, color | 42 | 1 | 0.010 | ||
| Cultivation, RP² | 25 | 1 | 0.0064 | ||
| Cultivation, RP² | 61 | 1 | 0.0088 | ||
| Twisted quantum double, | 55 | 4 logical qubits | 4 | 3.2 | |
| Twisted quantum double, | 97 | 4 logical qubits | 4 | 6.7 | |
| Twisted quantum double, | 151 | 4 logical qubits | 4 | 16.5 | |
| Code switching, 3D color → 2D surface | 70 | 1 | 0.0071 | ||
| Logical-level 15-to-1 (15 decoder stages) | 102 | 1 | 1.27 |
Distillation: 2 to 100 output magic states, 30 to 716 qubits — rank 1 throughout.
Cultivation:
Twisted quantum double:
The rank stays fixed as the circuit grows — even with 100 output magic states, it is one.
Rank: largest representation rank of the reference networks. Times per draw, one thread, Apple M1 Ultra; with a decoder, they include the decoder calls.
Bravyi–Haah
Bravyi, Haah, arXiv:1209.2426
Circuits: Gidney, Shutty, Jones, arXiv:2409.17595 · Wan, Zapirain, arXiv:2609.18922 · Chen et al., arXiv:2503.18657
Logical-level 15-to-1 on distance-3 surface-code patches: 102 qubits, 15 rounds of decoder-controlled feedforward. The simulation recovers the exact logical error rates, to about
Protocol: Litinski, arXiv:1905.06903
R 0 1 2 3 H 0 T 0 # actual T gates, also CS, CCZ CX 0 1 0 2 DEPOLARIZE2(0.001) 0 1 0 2 CX 1 3 2 3 M 3 DETECTOR rec[-1] CONTROL[recovery] det[-1] -> ctrl[0] CX ctrl[0] 0 # decoder-controlled feedback POSTSELECT det[0]
{"schema_version": 1, "outputs": [0, 1, 2],
"ideal_state": "ideal.magna"}from magna import ControllerRegistry, load_circuit, run def recovery(bits, config): # detectors in, bits out return (my_decoder(bits),) reg = ControllerRegistry() reg.register("recovery", recovery, version="1") c = load_circuit("factory.magna", controllers=reg) r = run(c, task="task.json", shots=10**6)
github.com/itpyi/magna · arXiv:2610.22315
We thank Hong-Ye Hu, Kwok Ho Wan, Ainhoa Zapirain, Zikang Zhang and Tian-Gang Zhou for useful discussions.