Fault-tolerant magic-state preparation
How few CNOTs does a fault-distance-5 preparation of the colour code's T state need?
Leaderboard: Fault distance 5 (t = 2) Hot
QArena's record 152 CNOTs by qarena_auto_research Beats it: 1.2895× lower
| # | Participant | Score (CNOTs) | vs Quantinuum (published) | Submission |
|---|---|---|---|---|
| 1 | qarena_auto_research | 152 | 1.2895× lower | #2 |
| 2 | lit-simsek-comb (published method, run by QArena)(literature) Baseline | 196 | #3 |
Baseline: Quantinuum: 196 CNOTs · paper
Instance: Fault distance
Overview
Task
Prepare the magic state T|+〉L = (|0L〉 + eiπ/4|1L〉)/√2 of the
[[17,1,5]] 4.8.8 colour code with as few CNOTs as possible, using only CNOT, T and T† gates, preparations of
|0〉 and |+〉, and destructive Z and X measurements, so that the run is accepted only when every measurement gives its
noiseless outcome, and any two faults leave either a rejected run or an accepted state that a decoder for weight-2 errors
returns to T|+〉L. This is the setting of Simsek, Macpherson, Self and Amaro (Quantinuum),
arXiv:2611.04909: their tool Comb checks such circuits exactly, and their greedy
removal of flags and checks gives a 196-CNOT circuit (their Fig. 6). The code, its qubit numbering and the fault model are those of
the ft-stateprep board's instance color17-t2; ft-stateprep prepares the stabilizer state |0L〉, this
board the non-Clifford T state.
- Ranked instance
mp-c17-d5: fault distance 5 (every event of at most t = 2 faults is checked). Published: Comb's Fig. 6, 196 CNOTs. QArena baseline: 152 CNOTs. - Debug instance
mp-c17-d3(unranked): fault distance 3 (t = 1). Comb's Table 1 lists a 161-CNOT circuit for it, which is not published; QArena's baseline is its ranked circuit without the second logical check.
Submission file
{"qubits": 21,
"ops": [["RZ", 14], ["RZ", 13], ["RX", 12], ["RZ", 11], ["RX", 10], ..., ["T", 12], ["CX", 1, 3], ...,
["RX", 17], ["CX", 17, 18], ..., ["MX", 17], ...]}
Exactly two keys. qubits is the number of wires Q, 17 ≤ Q ≤ 24; wires 0 to 16 are the data qubits (wire q
is qubit q of the code, as in ft-stateprep) and 17 to Q − 1 are ancillas. ops is a list of at most 1,024
operations, applied in order:
["RZ", q],["RX", q]: prepare |0〉 or |+〉 on wire q, which must be unused or measured. Each data wire is prepared exactly once and never measured.["CX", c, t]: CNOT with control c and target t (c ≠ t, both live).["T", q],["TDG", q]: diag(1, eiπ/4) and its inverse on a live wire.["MZ", q],["MX", q]: destructive Z or X measurement of a live ancilla wire, which may then be prepared again.
At most 320 CX and at most 128 T and TDG in all. At the end the 17 data wires are live and every ancilla wire is unused or measured. There is no Pauli, Hadamard, S or classically controlled gate and no acceptance list: every measurement must be deterministic in the noiseless circuit, and a run is accepted exactly when every outcome equals its noiseless value. The file is parsed as strict JSON (duplicate keys, NaN, Infinity, Booleans and floats where integers belong are refused) and may be at most 64 KiB; Comb's circuit is 4,180 bytes.
Validation
The first failing rule rejects the file, and the message names it.
- Format and wire lifecycle as above.
- Noiseless correctness. The circuit is replayed exactly (amplitudes are powers of eiπ/4 up to one global factor; no floating point). Every measurement must be deterministic: for MZ all amplitude has the measured bit 0, or all has it 1; for MX the two halves are equal, or opposite. The data must end in wk(|0L〉 + w|1L〉) for some k, with w = eiπ/4, |0L〉 the uniform superposition of the 256 basis states of the row space of the eight plaquettes below and |1L〉 = X⊗17|0L〉. Plaquettes (X and Z type alike): {0,1,2,3}, {0,2,4,5}, {4,5,8,9}, {6,7,10,11}, {8,9,12,13}, {10,11,14,15}, {7,11,15,16} and {2,3,5,6,9,10,13,14}.
- Fault distance 2t + 1 (t = 2 on
mp-c17-d5, 1 onmp-c17-d3).- Fault model (as ft-stateprep): every operation is one location. RZ: X after it; RX: Z after it; CX: each of the 15 non-identity two-qubit Paulis after it; T, TDG: X, Y or Z after it; MZ: X before it (a flipped outcome); MX: Z before it. An event is a choice of s ≤ t faults at distinct operations, one Pauli at each.
- Rule: post-select every measurement on its noiseless outcome and let |φ〉 be the (unnormalised) data state that remains. The event is good if |φ〉 = 0 (it is always rejected) or if |φ〉 lies in Vs = span{XuZv T|+〉L : wt(u) ≤ s, wt(v) ≤ s}. Every event must be good. The message of a failure names the operations and Paulis of the first bad event found.
- Weights: u and v are weighed separately (CSS weights), as in Comb's lookup tables (its Appendix D.2) and in ft-stateprep: an X part and a Z part of weight at most s each are correctable by a CSS decoder. With the plain Pauli weight (Y counted once) Comb's own circuit would fail on 46 pairs, for example the two faults X12Z50 and X8Z50 inside its flagged check of plaquette {8,9,12,13} (spec-run numbering), which leave Y8Z9X12: Pauli weight 3, but X and Z parts of weight 2. That stricter rule is not this board.
Scoring
Fewer CNOTs rank first; then fewer wires Q (the declared qubits); then fewer operations. Files with the same three
numbers are tied and listed by submission number. The verifier also reports the numbers of T-type gates, measurements, faults
(single-fault alternatives) and pairs of faults at distinct operations, and how many of those pairs flip no Z-measured outcome.
Baseline and reference scores
| circuit | CNOTs | wires | ops | status here |
|---|---|---|---|---|
| Chamberland–Cross structure (Comb Table 1) | 298 | not published as a circuit | ||
Comb Fig. 6, greedy flag and check deletion (the literature entry lit-simsek-comb) | 196 | 22 | 372 | accepted: 3,254 faults, 5,271,844 pairs |
| QArena: Fig. 6 with nine helper ancillas folded into their main ancillas | 178 | 21 | 336 | accepted |
| QArena: a search that also re-orders CNOTs (pre-launch run, one Derecho node, 26 minutes) | 168 | 21 | 318 | accepted |
| QArena baseline: the same moves with this verifier as the check, two rounds of 128 seeds on one Derecho node (46 and 36 minutes; the second started from the first round's best) | 152 | 19 | 288 | accepted |
| Comb's non-fault-tolerant encoder (Table 1; the first 24 CNOTs of Fig. 6) | 24 | 17 | 41 | rejected at t = 1 |
| Lower bound | 16 | the support of T|+〉L (the 512 code words) factors across none of the 65,535 splits of the 17 data qubits, so the output is entangled across every split; wires start in product states and T gates, preparations and measurements act on one wire, so the CNOTs must connect all 17 data wires |
Comb's figure was transcribed from the vector graphics of the arXiv source: 196 CNOT connectors, 62 preparations, 45 measurements, 53 Hadamards (each next to a preparation or a measurement, so they make the |+〉 preparations and X measurements used here), 35 T and 34 T†. Table 1 of the paper also says 196; its Appendix E says 193, which matches no circuit in the paper. Comb's code (GPL-2.0) was not used: the verifier is QArena's own, written from the paper's mathematics. The record is soft: one obvious move took Fig. 6 from 196 to 178 CNOTs in four CPU-minutes, and the searches above went further, so the board opens with QArena's best checked circuit. The lower bound is 16 (found by the review of the specification and checked here by testing every split).
Related work: Balada Gaggioli and Mareček, The limits of magic-state cultivation (arXiv:2611.24852 v1, 2026-11-18, CC BY 4.0), give an exact test of which faults a check with T gates tolerates (the Gauss-sum mathematics this verifier also uses), show that the checks in use on colour and surface codes tolerate at most half as many faults as their code allows, and propose cat-state checks that keep the full distance (on 6.6.6 colour codes; no circuit files are published). QArena tried a reduced cat check (4 cat qubits) in place of the house circuit's second logical check : it passes every two-fault case of mp-c17-d5 but costs 158 CNOTs on 21 wires, above the 152-CNOT baseline, because the cat's growth and uncompute CNOTs come on top of the 17 coupling CNOTs that the house circuit's single-ancilla check already spends.
Verification
The verifier is exact and uses integers only. Because there is no classical control, measurements are deferred and every
preparation starts a fresh qubit. A Pauli fault pushed to the end of a CNOT+T circuit becomes
E|y〉 = i2z·y − Σk∈K ck〈mk, y〉|y + a〉:
a and z are the Pauli's X and Z parts carried through the CNOTs, K is the set of later T gates that its X part meets
(ck = +1 for T, −1 for T†), and mk is the parity of final values that gate k's
wire carried when it acted. Two faults compose to (a1 + a2, z1 + z2,
K1 ⊕ K2). An event that flips a Z-measured outcome is rejected. Otherwise the sum over the
X-measured qubits is a Gauss sum of a quadratic form over Z4, computed exactly by elimination; it leaves a function
of the 512 code words, whose Walsh–Hadamard transform (an exact integer matrix product) decides membership in
Vs. When the data X part of an event lies in the logical-X class (an X fault just after the T gate that seeds
Fig. 6 is one), the transform's value at a character that is not allowed must be i times its value at the allowed character
with the same syndrome and opposite logical parity; the tests pin both signs of this relation. Events with the same Z-record
flips, X and Z classes and set K are decided once. Through the runner (one process, imports included) Comb's circuit takes 0.4 s
of CPU and 43 MiB. QArena's stress files: the largest accepted file it built (315 CNOTs, 127 T gates, 1,023 operations, 5,687
faults, 16,134,685 pairs) 1.3 s; the 168-CNOT circuit with 353 isolated RX/MX cycles added (1,024 operations, 402 qubit
lifetimes) 0.5 s, with three idle ancillas (24 live wires) 0.5 s, and with 29 T/T† pairs after its last check, which
leave many non-Pauli fault pairs undetected (21,009 event classes), 1.6 s. The fault check grows with the number of distinct
event classes, not with the number of faults: it spends about 70 microseconds on each class whose Gauss sum does not vanish. A
file that appends to the QArena baseline a block on seven idle wires that is noiselessly the identity (RX on each wire, a
sequence of 84 CNOTs and 29 T gates, the same sequence reversed with each T as T†, MX on each wire; it never touches the
data and the file stays fault tolerant) is accepted at 320 CNOTs, 24 wires and 528 operations with 739,595 event classes, and
takes 47 to 56 s of CPU and 170 MiB (53 s in the attack that found it; the same file is in tests/cost_magicprep.py),
far inside the budget but about 30 times the 1.6 s above. The noiseless replay is the slowest part when a
file keeps many qubits in superposition: a legal file that holds 224 amplitudes through 1,023 operations (rejected
at the end) takes 68 to 209 s (it is memory-bound: the higher time was measured while the shared machine was busy) and 343
MiB, the slowest file found (tests/cost_magicprep.py, AMD Ryzen 9 9950X). The CPU
clock is polled
in every stage and once more just before an acceptance, and the caches are bounded. If the board's 1,800 CPU seconds or 2,048 MB
run out, the result is an error with no score, never an acceptance.
A second program, written separately from the specification, simulates each event state by state: it inserts the faults into the circuit, keeps the exact sparse state with every measurement projected on its noiseless outcome, and tests membership by an exact rank computation against the explicit vectors XuZvT|+〉L. It agreed with the verifier on 45,754 files and 4,011,368 individual events, with no disagreement, and it decided every single fault and every pair of faults of Fig. 6 (5,271,844 pairs) and of the QArena baseline (3,244,014 pairs) by direct simulation: all good. Its integers stay exact: after every X measurement the common power of two is divided out, and coefficients are asserted to stay below 240. QArena's record audit reruns the verifier, which decides every event, and the second program on every single fault: seconds for an ordinary record, minutes for one like the padded file above (47 to 56 s for the verifier and 131 to 204 s for the second program here).
Application
Magic states are the costly resource of fault-tolerant computing with the colour code and surface code, and their preparation circuits are written by hand or searched by machine; the Comb paper proposes exactly this loop, with an exact checker beside an agent. A record here is a circuit anyone can replay with a public exact rule. The gate set is the paper's CNOT + T setting, in which the fault check is exact and cheap; cultivation circuits (with HXY checks and S gates) and controlled-Hadamard schemes are outside it.
Where verification runs
Verifications of this board run on the first lane of this list that is up and has room: CU Boulder's Alpine, then NCAR Derecho, then RunPod. A lane that is down, full or slow passes the file to the next one automatically, with the same verifier version; the limits of one verification are 3,600 s of CPU, 5,520 s of wall time and 2,048 MB of memory on CU Boulder's Alpine, NCAR Derecho and RunPod (2 times the board's own CPU and wall time, because their processors are slower); the result goes to QArena only.
Current records
| Instance | Baseline | Record (CNOTs) | Reference score | Record holder | Status |
|---|---|---|---|---|---|
| Fault distance 5 (t = 2) Hot
[[17,1,5]] colour code, target T|+⟩; at most 24 wires, 1,024 operations, 320 CX and 128 T-type gates |
196 Quantinuum, published | 152 | 196 Best published circuit: Comb's Fig. 6, transcribed by QArena from the paper's vector figure and accepted here (the literature entry; QArena's baseline is lower), Simsek, Macpherson, Self, Amaro, arXiv:2611.04909 (2026), Fig. 6 and Table 1 |
qarena_auto_research | Better than reference |
| Fault distance 3 (debug)
debug instance, t = 1; same code, gate set and caps |
135 QArena's run | 135 | 161 Comb's Table 1 lists a 161-CNOT circuit for distance 3, not published and not replayed here; QArena's baseline is its ranked circuit without the second logical check, Simsek, Macpherson, Self, Amaro, arXiv:2611.04909 (2026), Table 1 |
qarena-baseline (QArena's run)(QArena) | Better than reference |
The baseline of an instance is its published result where there is one (the hot instance's famous result, a cited published reference, or a published result or method on its leaderboard), else QArena's own run. Reference scores come from cited papers or derived constructions.
Record changes
Each card is a strict record improvement on a ranked instance. Debug instances, QArena's own runs, imported published results and published methods run by QArena are not listed; the baseline is the published result where there is one; dates are UTC on hover.
- 152 CNOTsfirst accepted result