The circuit
The 28\times256 matrix. Rows are wires and columns are rotations. A 1 means the wire takes part in the rotation, and the number beside each wire is its row weight. Scroll sideways to see every column.
| wire | 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 |
|---|---|
| out 0 (114) | ···11·111·····1····1·1··1···11·1111··1··1·····1····1·1···111··1··11111·1111··1··1···11·1···1·1···11111·1···11·11·111··1····1·1···1·····111·11····1··111·11·1·1111·11111·11·11····1··111···1·1···11·11····1··1·11··1·1···11·1··1·11···11···1111···11·11·········· |
| out 1 (150) | 111·1·1111·1·111111··1··11·11····11111·11·11111·1···11·1·1··111·111··1··11·11···111·1·1111·1·1111···11·1·1··111··11111·11·11111·1·11111··11111·1·1··111·1···11·111·1·111111·1·1111·11···111··1···111···1111·11·11·1111·1·1··1···11··1·1·11·······1·111··11······ |
| out 2 (122) | 1·11···1·111··1·1·11111··11111·1··1··111···11·1111·1·111111·1·11·1·····11·····1··1··111·1···11·1··1·1······1·1··11·11···111··1··111··1··11·11······1·1····1·1···1···11·1·1·11111···11·11·11·11····11·111··1··11····11··1··11·1···11·11·111··1···1·1111··1······· |
| out 3 (102) | ·1·11·1·········1·1··1·11111111111··11··1··1·11···11··11·11·1··111··11··1··1·11·11··11··1··1·11··1·11·1··········1·11·1··········1·1·1·11111·····1·1·1·11111····1111··1····111··1···11··1·1·111·1·····11·····1····111·111·······1·1······1·1···················· |
| out 4 (130) | ···1111·11·111·111·111·1111····1111·111···1·11·111·1··1·111·111·11·1··1·111·111····1···111·1··1·11·111·1111····1111····1··1···1·1·11·1···111·111·1·11·111··11····1··1···11····11111·1·1·····1····1111··1···1·11·1·1111·1·1···1···11···1·1·111·1·11·11··········· |
| out 5 (108) | 1··1··11··11·11·1·1·····11111·1··11···11··111··1·1·1····1111·1·111···11·1··111······1·1·1·1·1111··11·11·1··1··1111111·1·1·1······11····11··1···111·1···111·1111·11·1·1·11·1····11·1·1··1···1111·11·········1···1·····1··1·········1····1·1··1····1·······1······ |
| out 6 (124) | 1·111·11··1···1·1····111111····1··1···1·1·111·11111····11····111111····11····111··1···1·1·111·111····111111····11··1·····1·111··1111··1·1······111····1··11111·1·11111··1··111··1·1111··1111·11·1····1·····111···1111·11··1·····11···1·11111··1··1111····1······ |
| out 7 (136) | 1···1····1··1·11·1··1·11·111·1111····111·1···1··1·111·111····1111·111·111····111·1111···1·111·11·1···1·1····1···11111···1·111·1··111111·····11·1·1111·111111·111···11·11111··11·111111····11··1··1·1·1·1111·11··11·1··1·······1·1111·1···111111·111·····11······ |
| out 8 (116) | 111····1·1111···11·111·11·111·11·1111···111····11·111·1111·111·1·1···1····1···1·1·····11·111·11···11····1···1····1·1·1··1···········1···11··111111··111·111··1···111·····1···1··1··1··1·11·1··1·1·11··1·11··1·1111·11·1·11·1··1··11·······11·1··1·1111·········· |
| out 9 (126) | ·11··11··11··11··11··11··11··11·1··11··11··11··11··11··11··11··1·11··11·1···1··1··1··111·111111111·111···11···111···1111111·111····11·1·1···11··1·11··1·1···1···111··1111··1·11····11·1·1·1·111·1·11·11·1·11·111·11··11··1······1····1·11·1·1·1··1··1····1······ |
| out 10 (100) | 1··1··1111··1··11·1··········1·1·11···1111···11··1·1·····11··1·1·1·1·······1··············1···11··1···1111········1·1111··11······1111····11·1··1·1111·11····11···1·1111·1····1········1·1·1·11···111···1·····111111111·1·11····11··1·1111·1·····11·1···1······· |
| out 11 (122) | 1·1·····11111·1·1··1··11··11·11·1·1·1111·····11·1·1·11··1111·11··11·11··1········11·111··11·1··11··1·11····1··11·1·1·111·11······1·····1·1·1111··1111·11··11111···111·11··11·····1··1111·1··1······111·111······11··11·11·1·111····1·11·11·111···1··1···11······ |
| out 12 (126) | ·11111·1···11·11·111··1····1·1··11111··11··11··11··1··1·11··11·11··1·1···11·1···1·1···11·1·1·······111··1·1··1··1···1·1·11··111·11··1111·11·11111·111·11···1··1·1··1111111····11·1··111111·11·1··11111··1···1·1··1··11·1···11···1·1·111···1·1·1··1·1·1··1······· |
| out 13 (126) | ··1··1111·11111·11·11··1·111·1·11·1···1·1·11····11·······1·1·1·11··1·····11··111111·1··1··111111···1··11···11·11··1·1·111···11··1111··1·111··1··1·11·111·1·11···1·11·111····111····1·11·11·11····11·111····111··111·11·1··1·1·········111·1·1·1·111·11···1······ |
| out 14 (108) | ·1111·1··11······111·1·1·11·11·111111······1·1·1·11··1··1·····1·······111·1··1··1··11·1·1·11·111·····1····1·1·1·11111·11·11·1·1·1···1·····111·1·1···1·1····1111·11·······1····11·11111··1···1·1··1····111111···11·111·····11··1··········11··1··1···11···1······ |
| out 15 (120) | 111·····1111111111111·1·11·1·1·1·1·1·11··11···1·11·1··11111111··1··11·1111·11··1·111··1·1111····1·1·1·11·11···1·····1·1···1·1·····1··111·1·1·1····11·1··11111··1·1···1·····11·1··111·1·11·11111··11·········11··11··1···111·1·1····11·1······1··1····1·········· |
| check 16 (136) | 1·····1····11·11·111··1·111·1·11·11111·1···11·11·111··1····1·1·····11·111·····1····1·1··1···11·1···11·11·11111·1111·1·111···11·1··1··1111·11111·11·1·111·1··111·11·11···1·11111·11·1·1111·11···1·1·····111·11····1··111·11·1·111·1·····1··1··1111·11···111·1·111 |
| check 17 (120) | ·1·····1··1··111·1··111···1·1····1·····111·11···1·11···1··1·1·····1··111·1·····111·1·1111·11···111·11····1·····111·1·111·1··111····11·11·11111·1···1·1···111··1····11·111·····1·111·1·11·111··1·1·····1·111··1···111··1····1·1···11111·1111··1···111··1·111·1·11 |
| check 18 (120) | ··1···1····1111····1111·11·111·1··1·11·1···1···1111·111···1·11·1···1···111·1··1···1·11·1···1···1111····1··1···1···1···1····1111··111·111·1··1·11·1··1·111···1····1111····1···1··1·111·11·1111····1···1··1····111·1111····1···1··1·11·1···111·111·111·111·1··1·11 |
| check 19 (120) | ···1···1··1·11·1··1·11·1111·111····1111···1···1·11·111·1···1111···1···1·111····1···1111···1···1·11·1··1····1···1···1···1··1·11·1·1···1···1111····1111···1·111·11·1··1·11·111·1111···1····1··1·11·111·1111·11·1···1··1·11·111·1111····111·1···1···1···1···1111··· |
| check 20 (120) | ····1·1·····1·1···111··111···11··11·11··1··1··11·1·11111·1·11111··11·11·11··1··1·····1·1·····1·1·1·1·····1·1·····11···111··111······1·1·1111·1·111···11·11···11·1··1··111··1··11·1·111111·1·····11··1··111··1··1·····1·111111·1··1·1····1·1·11111··111··1··111·· |
| check 21 (120) | ·····1·1·····1·1··11·11·11··1··1·11···111··111···1·1·····1·1······111··111···11·····1·1·····1·1··1·11111·1·11111·11·11··1··1··11·····1·111111·1·11··1··111··1··11··111··1··111···1·1····1·1·111111···11·11···11·····1·1·1111·1·1·1·111111·1·····1··1··111··1··11 |
| check 22 (120) | ········1·1··1·1········1·1··1·1·11·1··111··11···11·1··111··11···11·1··111··11··1··1·11···11··11········1·1··1·111111111·1·11·1·····1111·1·1·1·11111····1·1·1·1·1··11··111····11·11··11···1111···11··11···1111···11··11···1111··1111····1·1·1·1·1111····1·1·1·1· |
| check 23 (120) | ·········1·11·1··········1·11·1··11·1··1··11··11·11·1··1··11··11·11·1··1··11··111··1·11·11··11···········1·11·1·111111111·1··1·1····11111·1·1·1·1111·····1·1·1·11··11··1··1111···11··11·11····11·11··11·11····11·11··11·11····111111·····1·1·1·11111·····1·1·1·1 |
| check 24 (128) | ················1111111111111111················1111111111111111················1111111111111111················1111111111111111················1111111111111111················1111111111111111················1111111111111111················1111111111111111 |
| check 25 (128) | ································11111111111111111111111111111111································11111111111111111111111111111111································11111111111111111111111111111111································11111111111111111111111111111111 |
| check 26 (128) | ································································1111111111111111111111111111111111111111111111111111111111111111································································1111111111111111111111111111111111111111111111111111111111111111 |
| check 27 (128) | ································································································································11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 |
The gate is read off the output rows. An output row of odd weight gives a T, a pair of output rows with odd overlap gives a CS, and an odd triple overlap gives a CCZ. The circuit is a valid factory because every such parity that touches a check row is even.
Figures of merit
Output gate
As gates: CCZ0,1,2·CCZ0,1,4·CCZ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11·CCZ2,6,12·CCZ2,6,13·CCZ2,7,8·CCZ2,7,9·CCZ2,7,11·CCZ2,7,13·CCZ2,7,14·CCZ2,7,15·CCZ2,8,10·CCZ2,8,11·CCZ2,8,12·CCZ2,8,13·CCZ2,8,14·CCZ2,8,15·CCZ2,9,10·CCZ2,9,14·CCZ2,9,15·CCZ2,10,13·CCZ2,10,14·CCZ2,11,13·CCZ2,13,15·CCZ2,14,15·CCZ3,4,5·CCZ3,4,7·CCZ3,4,8·CCZ3,4,9·CCZ3,4,11·CCZ3,4,13·CCZ3,5,6·CCZ3,5,10·CCZ3,5,11·CCZ3,5,15·CCZ3,6,7·CCZ3,6,8·CCZ3,6,10·CCZ3,6,12·CCZ3,7,8·CCZ3,7,10·CCZ3,7,13·CCZ3,7,14·CCZ3,7,15·CCZ3,8,11·CCZ3,8,14·CCZ3,9,11·CCZ3,10,14·CCZ3,11,12·CCZ3,11,15·CCZ3,12,13·CCZ3,13,14·CCZ3,13,15·CCZ3,14,15·CCZ4,5,8·CCZ4,5,9·CCZ4,5,10·CCZ4,5,11·CCZ4,5,12·CCZ4,5,13·CCZ4,5,14·CCZ4,6,8·CCZ4,6,12·CCZ4,6,13·CCZ4,6,15·CCZ4,7,9·CCZ4,7,12·CCZ4,7,13·CCZ4,8,9·CCZ4,8,10·CCZ4,8,11·CCZ4,8,14·CCZ4,8,15·CCZ4,9,10·CCZ4,9,13·CCZ4,10,11·CCZ4,10,12·CCZ4,11,13·CCZ4,12,13·CCZ4,12,14·CCZ4,12,15·CCZ4,13,14·CCZ4,14,15·CCZ5,6,11·CCZ5,6,14·CCZ5,6,15·CCZ5,7,8·CCZ5,7,10·CCZ5,7,11·CCZ5,7,14·CCZ5,8,9·CCZ5,8,10·CCZ5,8,11·CCZ5,9,10·CCZ5,9,11·CCZ5,9,14·CCZ5,9,15·CCZ5,10,11·CCZ5,10,15·CCZ5,11,12·CCZ5,11,13·CCZ5,11,15·CCZ5,12,13·CCZ5,12,14·CCZ5,12,15·CCZ5,13,14·CCZ5,14,15·CCZ6,7,8·CCZ6,7,9·CCZ6,7,10·CCZ6,7,12·CCZ6,7,15·CCZ6,8,9·CCZ6,8,12·CCZ6,9,11·CCZ6,9,13·CCZ6,9,14·CCZ6,10,12·CCZ6,10,13·CCZ6,10,14·CCZ6,10,15·CCZ6,11,12·CCZ6,11,13·CCZ6,11,15·CCZ6,13,14·CCZ6,13,15·CCZ7,8,9·CCZ7,8,10·CCZ7,8,11·CCZ7,8,12·CCZ7,8,13·CCZ7,8,14·CCZ7,8,15·CCZ7,9,11·CCZ7,9,12·CCZ7,9,13·CCZ7,10,11·CCZ7,10,13·CCZ7,10,14·CCZ7,11,12·CCZ7,11,13·CCZ7,13,14·CCZ8,9,12·CCZ8,9,13·CCZ8,9,14·CCZ8,9,15·CCZ8,10,11·CCZ8,10,12·CCZ8,10,13·CCZ8,10,14·CCZ8,11,13·CCZ8,12,15·CCZ8,13,15·CCZ8,14,15·CCZ9,10,11·CCZ9,10,14·CCZ9,10,15·CCZ9,11,12·CCZ9,11,13·CCZ9,11,15·CCZ9,12,13·CCZ9,12,14·CCZ9,12,15·CCZ9,13,14·CCZ10,11,12·CCZ10,11,13·CCZ10,11,14·CCZ10,12,15·CCZ10,13,15·CCZ11,12,14·CCZ11,13,15·CCZ11,14,15·CCZ12,13,14·CCZ12,13,15·CCZ12,14,15·CCZ13,14,15
As monomials: 0,1,2+0,1,4+0,1,9+0,1,10+0,1,12+0,1,14+0,2,4+0,2,8+0,2,10+0,2,11+0,2,12+0,2,13+0,2,14+0,2,15+0,4,8+0,4,9+0,4,11+0,4,13+0,4,15+0,8,9+0,8,10+0,8,12+0,8,14+0,9,10+0,9,11+0,9,12+0,9,13+0,9,14+0,9,15+0,10,11+0,10,13+0,10,15+0,11,12+0,11,14+0,12,13+0,12,15+0,13,14+0,14,15+1,2,3+1,2,4+1,2,7+1,2,10+1,2,11+1,2,12+1,2,13+1,2,14+1,2,15+1,3,10+1,3,12+1,4,6+1,4,8+1,4,10+1,4,11+1,4,13+1,4,15+1,6,7+1,6,8+1,6,10+1,6,12+1,6,13+1,6,14+1,6,15+1,7,9+1,7,12+1,7,13+1,7,15+1,8,10+1,8,13+1,8,14+1,8,15+1,9,11+1,9,13+1,9,15+1,10,11+1,10,12+1,10,13+1,10,14+1,10,15+1,11,12+1,11,14+1,13,14+1,14,15+2,3,6+2,3,9+2,3,11+2,3,13+2,3,14+2,4,5+2,4,7+2,4,10+2,4,11+2,4,12+2,4,13+2,4,15+2,5,6+2,5,7+2,5,8+2,5,9+2,5,10+2,5,11+2,5,14+2,6,7+2,6,8+2,6,9+2,6,11+2,6,12+2,6,13+2,7,8+2,7,9+2,7,11+2,7,13+2,7,14+2,7,15+2,8,10+2,8,11+2,8,12+2,8,13+2,8,14+2,8,15+2,9,10+2,9,14+2,9,15+2,10,13+2,10,14+2,11,13+2,13,15+2,14,15+3,4,5+3,4,7+3,4,8+3,4,9+3,4,11+3,4,13+3,5,6+3,5,10+3,5,11+3,5,15+3,6,7+3,6,8+3,6,10+3,6,12+3,7,8+3,7,10+3,7,13+3,7,14+3,7,15+3,8,11+3,8,14+3,9,11+3,10,14+3,11,12+3,11,15+3,12,13+3,13,14+3,13,15+3,14,15+4,5,8+4,5,9+4,5,10+4,5,11+4,5,12+4,5,13+4,5,14+4,6,8+4,6,12+4,6,13+4,6,15+4,7,9+4,7,12+4,7,13+4,8,9+4,8,10+4,8,11+4,8,14+4,8,15+4,9,10+4,9,13+4,10,11+4,10,12+4,11,13+4,12,13+4,12,14+4,12,15+4,13,14+4,14,15+5,6,11+5,6,14+5,6,15+5,7,8+5,7,10+5,7,11+5,7,14+5,8,9+5,8,10+5,8,11+5,9,10+5,9,11+5,9,14+5,9,15+5,10,11+5,10,15+5,11,12+5,11,13+5,11,15+5,12,13+5,12,14+5,12,15+5,13,14+5,14,15+6,7,8+6,7,9+6,7,10+6,7,12+6,7,15+6,8,9+6,8,12+6,9,11+6,9,13+6,9,14+6,10,12+6,10,13+6,10,14+6,10,15+6,11,12+6,11,13+6,11,15+6,13,14+6,13,15+7,8,9+7,8,10+7,8,11+7,8,12+7,8,13+7,8,14+7,8,15+7,9,11+7,9,12+7,9,13+7,10,11+7,10,13+7,10,14+7,11,12+7,11,13+7,13,14+8,9,12+8,9,13+8,9,14+8,9,15+8,10,11+8,10,12+8,10,13+8,10,14+8,11,13+8,12,15+8,13,15+8,14,15+9,10,11+9,10,14+9,10,15+9,11,12+9,11,13+9,11,15+9,12,13+9,12,14+9,12,15+9,13,14+10,11,12+10,11,13+10,11,14+10,12,15+10,13,15+11,12,14+11,13,15+11,14,15+12,13,14+12,13,15+12,14,15+13,14,15 (output wires per term, separated by +)
This row stands for every gate that a CNOT circuit and S, Z and CZ gates on the outputs can reach from this one. They all prepare the same magic state. The wires are shown in the labelling of the stored circuit.
Clifford correction
With every rotation a \mathrm{T}=\mathrm{diag}(1,e^{i\pi/4}), the rotations deposit the gate above times a diagonal Clifford. Undo it after the rotations and before the checks are measured, with 14 single-wire gates and 163 \mathrm{CZ} gates: \mathrm{S}^\dagger on output 0, \mathrm{S} on output 1, \mathrm{S}^\dagger on output 2, \mathrm{S} on output 3, \mathrm{S}^\dagger on output 4, \mathrm{Z} on output 5, \mathrm{Z} on output 6, \mathrm{Z} on output 8, \mathrm{S} on output 9, \mathrm{Z} on output 10, \mathrm{S}^\dagger on output 11, \mathrm{S} on output 12, \mathrm{S} on output 13, \mathrm{Z} on output 14, \mathrm{CZ} on output 0, output 1, \mathrm{CZ} on output 0, output 2, \mathrm{CZ} on output 0, output 3, \mathrm{CZ} on output 0, output 5, \mathrm{CZ} on output 0, output 6, \mathrm{CZ} on output 0, output 7, \mathrm{CZ} on output 0, output 9, \mathrm{CZ} on output 0, output 10, \mathrm{CZ} on output 0, output 11, \mathrm{CZ} on output 0, output 12 and 153 more (listed below). The circuit's action is then exactly the gate above, and an error-free run passes every check with certainty.
All 177 correction gates
\mathrm{S}^\dagger on output 0, \mathrm{S} on output 1, \mathrm{S}^\dagger on output 2, \mathrm{S} on output 3, \mathrm{S}^\dagger on output 4, \mathrm{Z} on output 5, \mathrm{Z} on output 6, \mathrm{Z} on output 8, \mathrm{S} on output 9, \mathrm{Z} on output 10, \mathrm{S}^\dagger on output 11, \mathrm{S} on output 12, \mathrm{S} on output 13, \mathrm{Z} on output 14, \mathrm{CZ} on output 0, output 1, \mathrm{CZ} on output 0, output 2, \mathrm{CZ} on output 0, output 3, \mathrm{CZ} on output 0, output 5, \mathrm{CZ} on output 0, output 6, \mathrm{CZ} on output 0, output 7, \mathrm{CZ} on output 0, output 9, \mathrm{CZ} on output 0, output 10, \mathrm{CZ} on output 0, output 11, \mathrm{CZ} on output 0, output 12, \mathrm{CZ} on output 0, output 13, \mathrm{CZ} on output 0, check 17, \mathrm{CZ} on output 0, check 18, \mathrm{CZ} on output 0, check 22, \mathrm{CZ} on output 0, check 23, \mathrm{CZ} on output 0, check 24, \mathrm{CZ} on output 0, check 26, \mathrm{CZ} on output 0, check 27, \mathrm{CZ} on output 1, output 3, \mathrm{CZ} on output 1, output 6, \mathrm{CZ} on output 1, output 8, \mathrm{CZ} on output 1, output 11, \mathrm{CZ} on output 1, output 13, \mathrm{CZ} on output 1, output 14, \mathrm{CZ} on output 1, output 15, \mathrm{CZ} on output 1, check 17, \mathrm{CZ} on output 1, check 18, \mathrm{CZ} on output 1, check 22, \mathrm{CZ} on output 1, check 23, \mathrm{CZ} on output 1, check 24, \mathrm{CZ} on output 1, check 26, \mathrm{CZ} on output 1, check 27, \mathrm{CZ} on output 2, output 4, \mathrm{CZ} on output 2, output 5, \mathrm{CZ} on output 2, output 6, \mathrm{CZ} on output 2, output 7, \mathrm{CZ} on output 2, output 9, \mathrm{CZ} on output 2, output 10, \mathrm{CZ} on output 2, output 12, \mathrm{CZ} on output 2, output 13, \mathrm{CZ} on output 2, output 14, \mathrm{CZ} on output 2, check 17, \mathrm{CZ} on output 2, check 19, \mathrm{CZ} on output 2, check 20, \mathrm{CZ} on output 2, check 23, \mathrm{CZ} on output 2, check 27, \mathrm{CZ} on output 3, output 4, \mathrm{CZ} on output 3, output 5, \mathrm{CZ} on output 3, output 9, \mathrm{CZ} on output 3, output 13, \mathrm{CZ} on output 3, output 14, \mathrm{CZ} on output 3, output 15, \mathrm{CZ} on output 3, check 19, \mathrm{CZ} on output 3, check 21, \mathrm{CZ} on output 3, check 24, \mathrm{CZ} on output 3, check 26, \mathrm{CZ} on output 3, check 27, \mathrm{CZ} on output 4, output 5, \mathrm{CZ} on output 4, output 9, \mathrm{CZ} on output 4, output 10, \mathrm{CZ} on output 4, output 14, \mathrm{CZ} on output 4, check 16, \mathrm{CZ} on output 4, check 17, \mathrm{CZ} on output 4, check 18, \mathrm{CZ} on output 4, check 19, \mathrm{CZ} on output 4, check 21, \mathrm{CZ} on output 4, check 22, \mathrm{CZ} on output 4, check 23, \mathrm{CZ} on output 4, check 24, \mathrm{CZ} on output 4, check 27, \mathrm{CZ} on output 5, output 6, \mathrm{CZ} on output 5, output 9, \mathrm{CZ} on output 5, output 13, \mathrm{CZ} on output 5, output 14, \mathrm{CZ} on output 5, check 16, \mathrm{CZ} on output 5, check 17, \mathrm{CZ} on output 5, check 18, \mathrm{CZ} on output 5, check 19, \mathrm{CZ} on output 5, check 20, \mathrm{CZ} on output 5, check 23, \mathrm{CZ} on output 5, check 24, \mathrm{CZ} on output 5, check 25, \mathrm{CZ} on output 6, output 8, \mathrm{CZ} on output 6, output 9, \mathrm{CZ} on output 6, output 12, \mathrm{CZ} on output 6, output 14, \mathrm{CZ} on output 6, check 20, \mathrm{CZ} on output 6, check 23, \mathrm{CZ} on output 6, check 24, \mathrm{CZ} on output 6, check 27, \mathrm{CZ} on output 7, output 8, \mathrm{CZ} on output 7, output 9, \mathrm{CZ} on output 7, output 10, \mathrm{CZ} on output 7, output 12, \mathrm{CZ} on output 7, output 13, \mathrm{CZ} on output 7, output 14, \mathrm{CZ} on output 7, output 15, \mathrm{CZ} on output 7, check 16, \mathrm{CZ} on output 7, check 17, \mathrm{CZ} on output 7, check 18, \mathrm{CZ} on output 7, check 19, \mathrm{CZ} on output 7, check 20, \mathrm{CZ} on output 7, check 22, \mathrm{CZ} on output 7, check 23, \mathrm{CZ} on output 7, check 27, \mathrm{CZ} on output 8, output 9, \mathrm{CZ} on output 8, output 11, \mathrm{CZ} on output 8, output 13, \mathrm{CZ} on output 8, output 14, \mathrm{CZ} on output 8, output 15, \mathrm{CZ} on output 8, check 17, \mathrm{CZ} on output 8, check 19, \mathrm{CZ} on output 8, check 20, \mathrm{CZ} on output 8, check 22, \mathrm{CZ} on output 8, check 24, \mathrm{CZ} on output 8, check 25, \mathrm{CZ} on output 9, output 10, \mathrm{CZ} on output 9, output 13, \mathrm{CZ} on output 9, output 14, \mathrm{CZ} on output 9, check 16, \mathrm{CZ} on output 9, check 18, \mathrm{CZ} on output 9, check 19, \mathrm{CZ} on output 9, check 20, \mathrm{CZ} on output 9, check 23, \mathrm{CZ} on output 10, output 13, \mathrm{CZ} on output 10, output 14, \mathrm{CZ} on output 10, output 15, \mathrm{CZ} on output 10, check 18, \mathrm{CZ} on output 10, check 21, \mathrm{CZ} on output 10, check 25, \mathrm{CZ} on output 10, check 26, \mathrm{CZ} on output 11, output 12, \mathrm{CZ} on output 11, output 15, \mathrm{CZ} on output 11, check 17, \mathrm{CZ} on output 11, check 19, \mathrm{CZ} on output 11, check 20, \mathrm{CZ} on output 11, check 24, \mathrm{CZ} on output 11, check 25, \mathrm{CZ} on output 12, output 14, \mathrm{CZ} on output 12, check 17, \mathrm{CZ} on output 12, check 18, \mathrm{CZ} on output 12, check 21, \mathrm{CZ} on output 12, check 22, \mathrm{CZ} on output 12, check 27, \mathrm{CZ} on output 13, output 14, \mathrm{CZ} on output 13, output 15, \mathrm{CZ} on output 13, check 16, \mathrm{CZ} on output 13, check 17, \mathrm{CZ} on output 13, check 20, \mathrm{CZ} on output 13, check 22, \mathrm{CZ} on output 13, check 23, \mathrm{CZ} on output 13, check 25, \mathrm{CZ} on output 13, check 27, \mathrm{CZ} on output 14, check 19, \mathrm{CZ} on output 14, check 21, \mathrm{CZ} on output 14, check 22, \mathrm{CZ} on output 14, check 24, \mathrm{CZ} on output 15, check 16, \mathrm{CZ} on output 15, check 19, \mathrm{CZ} on output 15, check 20, \mathrm{CZ} on output 15, check 21, \mathrm{CZ} on output 15, check 23, \mathrm{CZ} on output 15, check 27
These Clifford gates cannot be avoided. No choice of \mathrm{T}, \mathrm{T}^3, \mathrm{T}^5 or \mathrm{T}^\dagger for each rotation removes them; the catalogue proves this by showing that the linear system over \mathbb{Z}_4 the powers would have to solve has no solution.
Rotations are numbered by matrix column, from 0. The correction comes from the columns by the weight expansion of Bravyi and Haah (2012). verify_catalog.py re-derives it, checks the corrected circuit's phase input by input against the gate, and on small circuits simulates it gate by gate.
Convert the output with CNOT and S
A CNOT circuit on the outputs, followed by S, Z and CZ gates, turns this factory's gate into other gates that prepare the same magic state. Type a target gate to check whether it is reachable. If it is, you get the circuit, checked on every basis state.
Or list every gate it reaches. The list is built in your browser and saved as a text file, one gate per line.
Python code that writes the same list
import json, urllib.request
NAMES = {1: "T", 2: "CS", 3: "CCZ"}
def equivalent_gates(k, terms, limit=1_000_000):
"""Every gate a CNOT circuit and S, Z, CZ gates reach from this one.
A gate is its set of terms mod Clifford: {a} is T, {a,b} is CS and
{a,b,c} is CCZ on those outputs. CNOT c->t sends x_t to
x_c + x_t - 2 x_c x_t, so a term on t but not c adds the term with t
replaced by c, and, below CCZ, the term with c added.
"""
start = frozenset(frozenset(m) for m in terms)
seen, queue = {start}, [start]
for gate in queue:
for c in range(k):
for t in range(k):
if c == t:
continue
new = set(gate)
for m in gate:
if t in m and c not in m:
new ^= {(m - {t}) | {c}}
if len(m) < 3:
new ^= {m | {c}}
new = frozenset(new)
if new not in seen:
seen.add(new)
queue.append(new)
if len(seen) > limit:
raise RuntimeError(f"more than {limit} equivalent gates")
return seen
def name(gate, k):
sep = "," if k > 10 else ""
terms = sorted((sorted(m) for m in gate), key=lambda m: (len(m), m))
return "·".join(NAMES[len(m)] + sep.join(map(str, m)) for m in terms) or "I"
url = "https://shubhamj810.github.io/magic-state-factory-repo/data/factories/256.16.4.a.json"
record = json.load(urllib.request.urlopen(url))
k = record["parameters"]["k"]
gates = equivalent_gates(k, record["gate"]["monomials"])
lines = sorted(name(g, k) for g in gates)
print(len(lines), "equivalent gates")
with open("equivalent-gates-256.16.4.a.txt", "w") as out:
out.write("\n".join(lines) + "\n")
Distance
d=4, exact. No fault of weight below 4 is both undetectable and damaging. One of weight 4 is.
Exactly 91,734 faults of weight 4 are undetectable and damaging, so A_{4}=91{,}734. If each rotation fails independently with probability p, an accepted run has a damaged output with probability A_{4}\,p^{4}+O(p^{5}).
A damaging fault of weight 4 sits on columns [0,1,60,61].
A fault is a set of faulty columns. It is undetectable when their check parts cancel, and damaging when their output parts do not.
Original source
S. P. Jain, A. Wills, and S. Singh, "Symmetry and AI-assisted discovery of magic-state factories," arXiv:2610.06535 (2026). arxiv.org/abs/2610.06535
Provenance
found by an AI search campaign; a verified witness, not a maximum
Found by: AI search
Discovery: AI search
1 recorded source
[
{
"regime": "AI search",
"file": "master_catalog/catalogue_new",
"label": "CCZ012.CCZ014.CCZ019.CCZ0,1,10.CCZ0,1,12.CCZ0,1,14.CCZ024.CCZ028.CCZ0,2,10.CCZ0,2,11.CCZ0,2,12.CCZ0,2,13.CCZ0,2,14.CCZ0,2,15.CCZ048.CCZ049.CCZ0,4,11.CCZ0,4,13.CCZ0,4,15.CCZ089.CCZ0,8,10.CCZ0,8,12.CCZ0,8,14.CCZ0,9,10.CCZ0,9,11.CCZ0,9,12.CCZ0,9,13.CCZ0,9,14.CCZ0,9,15.CCZ0,10,11.CCZ0,10,13.CCZ0,10,15.CCZ0,11,12.CCZ0,11,14.CCZ0,12,13.CCZ0,12,15.CCZ0,13,14.CCZ0,14,15.CCZ123.CCZ124.CCZ127.CCZ1,2,10.CCZ1,2,11.CCZ1,2,12.CCZ1,2,13.CCZ1,2,14.CCZ1,2,15.CCZ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CCZ10,11,13.CCZ10,11,14.CCZ10,12,15.CCZ10,13,15.CCZ11,12,14.CCZ11,13,15.CCZ11,14,15.CCZ12,13,14.CCZ12,13,15.CCZ12,14,15.CCZ13,14,15",
"N": 28,
"d": 4,
"d_is_exact": true,
"origin": "frontier_campaign",
"provenance": "frontier_campaign \u00b7 catalogue.jsonl:340"
}
]Use it in code
Load this factory and re-derive every number from its circuit with the catalogue's own verifier.
# git clone https://github.com/shubhamj810/magic-state-factory-repo
# cd magic-state-factory-repo/master_catalog
import json, urllib.request
import verify_catalog as VC
url = "https://shubhamj810.github.io/magic-state-factory-repo/data/factories/256.16.4.a.json"
record = json.load(urllib.request.urlopen(url))
columns = record["circuit"]["columns"]
k, N = record["parameters"]["k"], record["parameters"]["N"]
facts, problems = VC.derive(columns, k, N) # gate, T-count, degree, ...
distance = VC.measure_distance(columns, k, N) # exhaustive fault search
print(facts["gate_human"], distance["d_exact"] or distance["d_at_least"],
problems or "verified")
Raw record
Show the JSON this page is built from
Source: master_catalog.json, factories[926].