Manuscript Offprint
arXiv:2610.21879One generation of the Standard Model as a quantum error-correcting code
Shiroman Prakash and K. L. Ramya
Department of Physics and Computer Science, Dayalbagh Educational Institute, Agra-282005, India
Together with a right-handed neutrino, the fermions of one generation of the Standard Model are labelled by five bits, a combinatorial structure tied to anomaly cancellation. We make this precise. Anomaly cancellation is the vanishing of a cubic form, the defining property of triorthogonal codes, the quantum error-correcting codes behind magic state distillation. Removing the right-handed neutrino gives a code for every prime , including the Bravyi–Kitaev code for . For qutrits it is the unique shortest distance-three triorthogonal code.
Introduction. The fermions of one generation of the Standard Model have an intriguing combinatorial structure. Together with a right-handed neutrino, the sixteen fields are labelled by strings of five bits with an even number of ones. In grand unification they are the states of five fermionic oscillators with an even number occupied [1–4]. Colour, isospin and hypercharge can be read off from the occupation numbers. That the generation is free of gauge anomalies is well understood group-theoretically, since has no cubic Casimir [5]. We show that this cancellation has a second meaning: it makes the generation a quantum error-correcting code, of the kind used to distill magic states for fault-tolerant quantum computation.
Anomaly cancellation and the defining property of these codes are the same cubic equation. Writing each bit as a sign turns the sixteen fields into sixteen integer charge vectors. Every cubic anomaly, a sum of triangle diagrams, is then a value of a cubic form on the lattice they define [6–8], and anomaly cancellation is the vanishing of this form. Imposed modulo a prime , the same condition defines triorthogonal codes, a class of quantum error-correcting codes with a transversal non-Clifford gate on which magic state distillation is built [9–11]. Removing the right-handed neutrino gives a [[15, 1, 3]] code for every prime . For it is the fifteen-qubit code of Bravyi and Kitaev [9]; for odd it is a new code on -level qudits.
Every ingredient of the code has a Standard Model meaning. The physical qudits are the fifteen quarks and leptons, and the removed right-handed neutrino is the logical qudit. The stabilizers are the symmetries under which is neutral. Since is a gauge singlet, they include the gauge charges, colour, weak isospin and hypercharge, and for they are exactly these. Their triorthogonality is Standard Model anomaly cancellation. The logical operator is the one remaining charge of . Its mixed anomalies with the gauge charges vanish, as triorthogonality requires, and its cubic anomaly, which would cancel, is the logical gate. The minimum-weight logical errors are charge-conserving four-fermion operators, such as the product of Dirac masses , and the construction of the code by doubling [12, 13] is the pairing of quarks and leptons with their Dirac partners.
For qutrits the code is the shortest of its kind and unique: an exhaustive search finds no shorter triorthogonal qutrit code of distance at least three, and none of length fifteen other than this one, up to equivalence. The shortest previously known had nineteen qutrits [14]. We comment on its potential for distillation below.
Background for readers from either community, proofs and further results are in the Supplemental Material.
From anomalies to codes. Consider Weyl fermions , with chiralities and integer charge vectors , with components , under a torus . A subgroup, labelled by , gives the fermion the charge . Each symmetry thus has a vector of charges, and these vectors form a lattice with an generator matrix, whose columns are the and whose rows list the charges under the factors. The mixed cubic anomaly of three symmetries, with vectors and , is the sum of triangle diagrams
The spectrum is free of cubic anomalies exactly when vanishes on , and we call such a lattice triorthogonal.
Imposed modulo a prime , the same condition defines triorthogonal codes [11, 14–16]. A subspace on which vanishes, for coefficients , is a tri-orthogonal space. Deleting coordinate 0 turns it into a CSS code on the other coordinates. Its -stabilizers are the vectors of that vanish at coordinate 0, and its logical is a vector with . Every triorthogonal code encoding one qudit arises in this way.
Triorthogonality enables a transversal non-Clifford gate on the encoded qudit. The gate is , where is the gate. For , , and for , its analogue [19, 20] is
Unlike an earlier definition [17], we do not require self-orthogonality, which the transversal gate does not need [14, 18]; our code is not self-orthogonal for any odd p.
The logical states are , summed over the stabilizers . For , the basis state labelled by , for which , picks up one phase from each qudit, and since ,
The phase is the same for every term of , so the gate acts as logical . For and the phases of are ninth and eighth roots of unity, while the code is defined only modulo 3 and 2, so the same argument fixes the gate up to a Pauli correction for [14] and a Clifford correction for [11].
Reducing a triorthogonal lattice modulo gives a tri-orthogonal space, . In physical terms, a vector lists the charges of the fermions, modulo , under a subgroup of the torus. Deleting coordinate 0 means removing a fermion, , and the remaining fermions are the physical qudits. The -stabilizers are then the symmetries under which is neutral, and the logical is one under which has charge 1. The exponent in Eq. (2) is the cubic anomaly of the symmetry on the remaining fermions, and it is fixed because the full spectrum is anomaly free. The logical gate is thus the anomaly that the removed fermion would cancel.
The distance relevant for distillation is the Z-distance d, the smallest Hamming weight of an undetectable Z-error that acts nontrivially on the encoded qudit. Such an error has v orthogonal to every X-stabilizer but not to g, so is a nonzero multiple of , where the are the columns of a generator matrix of W. The error is thus a linear relation expressing the charge vector of through those of the fermions in its support J, and
Physically, a logical error is a combination of fields containing whose total charge vanishes modulo , and is the smallest number of fields in such a combination. A vectorlike partner of has charge vector , and an identical copy has ; in either case lies in the span of a single column and . Useful triorthogonal codes therefore need spectra that are both anomaly free and chiral. Because is defined over , one spectrum gives a code for every odd prime with , with the same distance as over for all but finitely many .
We summarize the construction for odd primes in the following proposition.
Proposition 1. Let be Weyl fermions with chiralities and charge vectors , free of cubic anomalies, and let be their charge lattice. Let be an odd prime with . Then is a triorthogonal space for the coefficients , and removing gives a triorthogonal code on the other fermions. The transversal gate implements logical exactly.
Proof. The identity on holds over , and so modulo every . For the gate follows from Eq. (2). For the phases of are powers of , and the exponent must be computed modulo 9. Since , it depends only on residues modulo 3. A codeword with is the reduction of some , so , the same for every term of .
The above construction becomes degenerate for , so qubits need special treatment. In addition, depends on Hamming weights modulo 8, which does not control. When all charges are we use instead their sign bits , which together with 1 span a triply even code if, besides the gauge anomalies, the anomalies and , , of fermion number vanish modulo 16. For one generation they do, as we check below.
One generation and its anomalies. We now specialize to one generation of the Standard Model, embedded in . For a nonabelian gauge group it is enough to work with its Cartan torus, a maximal set of commuting factors. Every generator is conjugate into the Cartan algebra, so the cubic anomalies vanish exactly when they vanish on the torus. For the torus is , and each component of a multiplet is a fermion whose charge vector is its weight. The spinor 16 is the Fock space of five fermionic oscillators with an even number occupied, and its weights, scaled by 2, are the sign vectors with an even number of minus signs, where when oscillator is occupied. The states with zero, two and four oscillators occupied form the 1, 10 and 5 of , on which takes the values 5, 1 and -3. Taking oscillators 1-3 as colour and 4-5 as weak, a state with colour and weak oscillators occupied has hypercharge . The empty state, with weight , is the conjugate right-handed neutrino , and the other fifteen states are the quarks and leptons of one generation, all written as left-handed fields. The generation is chiral – flipping the sign of changes the number of occupied oscillators from to , of the opposite parity, so no weight of the 16 has its negative in the 16.
In the notation of the previous section, the spectrum consists of left-handed fermions, so , with and the weights as charge vectors. The cubic anomaly of the labelled by is , summed over the sixteen weights. Expanding the cube gives the sums , and since , each reduces to or to with distinct indices. Both vanish, because on the sixteen weights each

FIG. 1. The fifteen-qudit code as a doubled code. Vertical lines join the right-handed fields (top), one copy of a code with , to their Dirac partners (bottom). The seed is ; its partner (dashed) is the logical qudit. Red and blue mark the minimum-weight logicals , within one copy, and , through the seed.
of and equals +1 and -1 equally often, so the charge lattice is triorthogonal – every cubic anomaly of the generation, including mixed anomalies, vanishes. The quadratic sums are , so the fermion-number anomalies that the qubit construction needs, and for , vanish modulo 16.
We remove , whose weight is . A generator matrix of the resulting code, with the logical row above the Cartan generators of as stabilizers, is
with . Its first ten columns are the fields of the 10, and its last five are those of the .
Theorem 1. For every prime , removing from one generation gives a triorthogonal code on the fifteen Standard Model fermions, on which implements logical exactly. For it is the fifteen-qubit code of Bravyi and Kitaev [9].
Proof. For odd , triorthogonality and the exact gate follow from Proposition 1, because all sixteen fields are left-handed and is nonzero modulo every . For the distance, the relation among weights (Fig. 1) gives . Conversely, no one or two of the other weights span that of over (Proposition S5). Such a span could appear modulo only if the rank of the weights involved dropped, that is, only if divided a nonzero or minor of their entries. These minors are or , which no odd prime divides, so for every odd .
For , the sign bits of the sixteen weights, together with 1, span the first-order Reed–Muller code , which is triply even. Deleting the coordinate of gives the fifteen-qubit code, whose distance is 3, and on which implements logical .
| triorthogonal code | chiral gauge theory |
|---|---|
| physical qudit | Weyl fermion |
| logical qudit | removed fermion |
| coefficient | chirality |
| triorthogonal space | anomaly-free spectrum |
| X-stabilizer | symmetry under which is neutral |
| logical X | symmetry under which has charge 1 |
| logical gate | cubic anomaly that would cancel |
| minimum-weight logical | neutral set of fermions containing |
| automorphisms | Weyl group fixing |
| doubled copies | Dirac pairs |
| linking row | weak isospin |
TABLE I. The dictionary. The last three rows hold for the code of Theorems 1 and 2.
Physical interpretation of the code. Table I summarizes the dictionary. The stabilizers are the Cartan generators of , which over span those of the Standard Model gauge group, so their triorthogonality is anomaly cancellation in the form [3]. The logical operator can be taken to be , or equivalently , since the two differ by stabilizers. The anomaly of on the fifteen fermions is , as the general argument requires.
The minimum-weight logical errors have 25 supports. Each is a Cartan-neutral combination of with three other fields, all with coefficients . They are four-fermion monomials, such as the product of Dirac masses , the right-handed current of Fig. 1, and the -conserving . They are not Standard Model invariants by themselves, but each has the charge structure of an operator generated at tree level by exchange of a 10 of .
The code is the 16 of with one weight removed, and the Standard Model enters through our choice of which weight to remove. Because the Weyl group is transitive, removing any of the sixteen fields gives an equivalent code. Gauge symmetry singles out . Requiring the Cartan generators of to be stabilizers, over or modulo any , forces the removed field to be . Modulo 3 the positron also satisfies this requirement, because its hypercharge in integral units is . It is the singlet of flipped [21, 22].
Doubling and Dirac pairing. Doubling [12, 23, 24] is the standard way to build small triorthogonal codes of growing distance [25]. It extends to odd [13]. Its inputs are a triorthogonal seed , with logical exponent and distance , and a -code , a space with coefficients such that for all and . Such a code carries a transversal phase gate, and for a code of length we write its parameters as . Doubling places two copies of side by side, with every stabilizer of acting oppositely on paired columns, and connects them to the seed by a single linking row that is nonzero on only one copy. For a scalar with , the result is triorthogonal with distance .
Doubling thus needs pairs of qudits on which the stabilizers are vectorlike, together with one chiral linking row. A generation has this structure. It is vectorlike under , because the Weyl group element of maps each to its Dirac partner , with opposite colour and electric charge, and all of its chirality resides in weak isospin. In terms of the weights,
with and [26].
Theorem 2. After rescaling columns by , the code of Theorem 1 is the doubling of the trivial seed with a code with coefficients , which for is the Steane code. The first copy holds , and , with coefficients . The second copy holds their Dirac partners , and , each in the column paired with its partner. The seed is the neutrino , whose partner was removed. The paired stabilizers are the charges , , which over span the Cartan algebra of , and the linking row is .
The proof is in the Supplemental Material.
Minimality and uniqueness for qutrits. The shortest distance-three triorthogonal qutrit code known before had nineteen qutrits [14]. The code from a generation is shorter, and a computer search reveals the following result.
Theorem 3 (computer-assisted). No triorthogonal qutrit code with has fewer than fifteen qutrits, and every triorthogonal code is equivalent to the code of Theorem 1. Its monomial automorphism group is , where negates every qutrit.
The proof reduces triorthogonality to polynomial conditions on a normal form and searches them exhaustively. The permutes the five oscillators. It is the stabilizer of in the Weyl group, and its orbits are the 10 and the 5. The smallest distance-three qutrit triorthogonal code thus admits a description as a generation of the Standard Model, with exactly the symmetry that the generation keeps, up to an overall sign.
For magic state distillation [29–32], the leading output error of the qutrit code at equal input infidelity is , against for the fifteen-qubit code, since on each of its 25 weight-three logical supports only 2 of the 8 error patterns are logical.
Outlook. For p = 2, the generation is Bravyi-Kitaev's famous 15-qubit code, a standard benchmark for magic state distillation. The qutrit code is also particularly interesting for its potential applications to distillation. Combined with high-rate qutrit codes [32], the fifteen-qutrit code could lower the cost of qutrit magic state distillation in some noise regimes, which we study, in part, elsewhere [13].
Doubling preserves integrality, so it can be iterated within anomaly-free spectra, but only with P-codes whose coefficients take both signs. Doubling the fifteen-qutrit code with the ternary Golay code [33, 34] gives a [[37, 1, 5]]₃ code [13], but since the Golay coefficients are all 1, this doubling does not lift to an anomaly-free spectrum; an integral P-lattice of distance five with would give one that does.
The construction applies beyond . The larger spinors, of with , give codes for odd in the same way, and the 27 of gives . Heterotic compactifications on Calabi–Yau three-folds, which give chiral and spectra [35], are natural further inputs, provided their generations are not identical copies.
This work was supported by a DST-SERB grant (CRG/2021/009137) and by the DST-WISE KIRAN Ph.D. fellowship (grant DST/WISE-PhD/PM/2023/32(G)). We thank the International Centre for Theoretical Sciences (ICTS) for hospitality during several visits, including the discussion meeting “A Hundred Years of Quantum Mechanics” (ICTS/qm100/2025/01) and the programme “Monopole Moduli” (ICTS/MM/2026/09), and R. Loganayagam for discussions. A large language model (Claude Opus 5.5) was used to assist with coding and drafting; we verified all results and take full responsibility for the content. Scripts reproducing all numerical results are available in the accompanying repository [36]. SP thanks Prof. P. S. Satsangi for discussions on qudit magic state distillation some years ago that inspired this work [37].
[1] H. Georgi, The state of the art—gauge theories, AIP Conf. Proc. 23, 575 (1975).
[2] H. Fritzsch and P. Minkowski, Unified interactions of leptons and hadrons, Ann. Phys. 93, 193 (1975).
The fifteen-qubit code, also the shortest distance-three qubit tri-orthogonal code [15, 27], has instead the larger group , which contains this but is transitive on all fifteen qubits [28], mixing the 10 with the 5.
[3] H. Georgi and S. L. Glashow, Unity of all elementary-particle forces, Phys. Rev. Lett. 32, 438 (1974).
[4] J. C. Baez and J. Huerta, The Algebra of Grand Uni-fied Theories, Bull. Am. Math. Soc. 47, 483 (2010), arXiv:0904.1556 [hep-th].
[5] R. Slansky, Group Theory for Unified Model Building, Phys. Rept. 79, 1 (1981).
[6] S. L. Adler, Axial-vector vertex in spinor electrodynamics, Phys. Rev. 177, 2426 (1969).
[7] J. S. Bell and R. Jackiw, A PCAC puzzle: in the -model, Nuovo Cimento A 60, 47 (1969).
[8] D. J. Gross and R. Jackiw, Effect of anomalies on quasi-renormalizable theories, Phys. Rev. D 6, 477 (1972).
[9] S. Bravyi and A. Kitaev, Universal quantum computation with ideal Clifford gates and noisy ancillas, Phys. Rev. A 71, 022316 (2005).
[10] E. Knill, Fault-tolerant postselected quantum computation: Schemes (2004), arXiv:quant-ph/0402171 [quant-ph].
[11] S. Bravyi and J. Haah, Magic-state distillation with low overhead, Phys. Rev. A 86, 052329 (2012).
[12] M. Sullivan, Code conversion with the quantum Golay code for a universal transversal gate set, Phys. Rev. A 109, 042416 (2024), arXiv:2307.14425 [quant-ph].
[13] S. Prakash and K. L. Ramya, Short qudit triorthogonal codes from doubling, to appear (2026).
[14] S. Prakash, Cyclic triorthogonal codes in prime dimension (2026), arXiv:2610.08012 [quant-ph].
[15] S. Nezami and J. Haah, Classification of small triorthogonal codes, Phys. Rev. A 106, 012437 (2022).
[16] T. Saha and S. Prakash, Sublogarithmic distillation in all prime dimensions using punctured Reed-Muller codes, Phys. Rev. A 113, 042405 (2026), arXiv:2510.10852 [quant-ph].
[17] A. Krishna and J.-P. Tillich, Towards low overhead magic state distillation, Phys. Rev. Lett. 123, 070507 (2019).
[18] T. Saha, Qudit CSS-T codes (2026), unpublished notes.
[19] M. Howard and J. Vala, Qudit versions of the qubit gate, Phys. Rev. A 86, 022316 (2012).
[20] S. X. Cui, D. Gottesman, and A. Krishna, Diagonal gates in the Clifford hierarchy, Phys. Rev. A 95, 012329 (2017).
[21] S. M. Barr, A New Symmetry Breaking Pattern for SO(10) and Proton Decay, Phys. Lett. B 112, 219 (1982).
[22] J. P. Derendinger, J. E. Kim, and D. V. Nanopoulos, Anti-SU(5), Phys. Lett. B 139, 170 (1984).
[23] K. Betsumiya and A. Munemasa, On triply even binary codes, J. Lond. Math. Soc. 86, 1 (2012), arXiv:1012.4134 [math.CO].
[24] S. Bravyi and A. Cross, Doubled Color Codes (2015), arXiv:1509.03239 [quant-ph].
[25] S. P. Jain and V. V. Albert, Transversal Clifford and T-gate codes of short length and high distance, IEEE Journal on Selected Areas in Information Theory 6, 127 (2025).
[26] J. C. Pati and A. Salam, Lepton number as the fourth “color”, Phys. Rev. D 10, 275 (1974).
[27] A. Wills, S. P. Jain, and S. Singh, Classification of generalised triorthogonal codes through length 54 (2026), arXiv:2609.30860 [quant-ph].
[28] F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, North-Holland Mathematical Library, Vol. 16 (North-Holland Publishing Company, Amsterdam, 1977).
[29] H. Anwar, E. T. Campbell, and D. E. Browne, Qutrit magic state distillation, New J. Phys. 14, 063006 (2012).
[30] E. T. Campbell, H. Anwar, and D. E. Browne, Magic-state distillation in all prime dimensions using quantum
Reed-Muller codes, Phys. Rev. X 2, 041021 (2012).
[31] E. T. Campbell, Enhanced fault-tolerant quantum computing in d-level systems, Phys. Rev. Lett. 113, 230501 (2014).
[32] S. Prakash and T. Saha, Low Overhead Qutrit Magic State Distillation, Quantum 9, 1768 (2025), arXiv:2403.06228 [quant-ph].
[33] M. J. E. Golay, Notes on digital coding, Proc. IRE 37, 657 (1949).
[34] S. Prakash, Magic state distillation with the ternary Golay code, Proc. R. Soc. A 476, 20200187 (2020).
[35] P. Candelas, G. T. Horowitz, A. Strominger, and E. Witten, Vacuum configurations for superstrings, Nucl. Phys. B 258, 46 (1985).
[36] S. Prakash and K. L. Ramya, standard-model-code: Scripts reproducing the computations of this Letter, https://github.com/spdei/standard-model-code (2026), version v1.0.
[37] D. P. Srivastava, V. Sahni, and P. S. Satsangi, From n-qubit multi-particle quantum teleportation modelling to n-qudit contextuality based quantum teleportation and beyond, Int. J. Gen. Syst. 46, 414 (2017).
[38] D. Gottesman, The Heisenberg representation of quantum computers, in 22nd International Colloquium on Group Theoretical Methods in Physics (1998) pp. 32–43, arXiv:quant-ph/9807006.
[39] D. Gottesman and I. L. Chuang, Demonstrating the viability of universal quantum computation using teleportation and single-qubit operations, Nature 402, 390 (1999), arXiv:quant-ph/9908010.
[40] D. B. Costa, B. A. Dobrescu, and P. J. Fox, General Solution to the U(1) Anomaly Equations, Phys. Rev. Lett. 123, 151601 (2019), arXiv:1905.13729 [hep-th].
[41] B. C. Allanach, B. Gripaios, and J. Tooby-Smith, Geometric general solution to the U(1) anomaly equations, JHEP 05, 065, arXiv:1912.04804 [hep-th].
[42] B. Gripaios and K. Le Nguyen Nguyen, Anomaly cancellation for a U(1) factor, JHEP 01, 055, arXiv:2508.11583 [hep-th].
[43] B. Gripaios and K. Le Nguyen Nguyen, Anomaly cancellation for two U(1) factors (2026), arXiv:2607.09879 [hep-th].
[44] B. C. Allanach, B. Gripaios, and J. Tooby-Smith, Solving local anomaly equations in gauge-rank extensions of the Standard Model, Phys. Rev. D 101, 075015 (2020), arXiv:1912.10022 [hep-th].
[45] B. C. Allanach, B. Gripaios, and J. Tooby-Smith, Anomaly cancellation with an extra gauge boson, Phys. Rev. Lett. 125, 161601 (2020), arXiv:2006.03588 [hep-th].
[46] L. E. Ibáñez and G. G. Ross, Discrete gauge symmetry anomalies, Phys. Lett. B 260, 291 (1991).
[47] T. Banks and M. Dine, Note on discrete gauge anomalies, Phys. Rev. D 45, 1424 (1992), arXiv:hep-th/9109045.
[48] C.-T. Hsieh, Discrete gauge anomalies revisited (2018), arXiv:1808.02881 [hep-th].
[49] A. Baldelli, O. Å. Mostad, H.-Y. Lin, E. Rosnes, and M. Battaglioni, On constructing and decoding quantum triorthogonal codes (2026), arXiv:2605.24519 [quant-ph].
[50] A. K. Sharma and S. S. Garani, Near-threshold qudit stabilizer codes with efficient encoding circuits for magic-state distillation, Phys. Rev. A 109, 062426 (2024), [Erratum: Phys. Rev. A 110, 049902 (2024)].
[51] S. Prakash and R. Singhal, Search for high-threshold qutrit magic-state distillation routines, Phys. Rev. A 113, 042404 (2026), arXiv:2408.00436 [quant-ph].
[52] J. R. Stryker, Oracles for Gauss's law on digital quantum computers, Phys. Rev. A 99, 042301 (2019), arXiv:1812.01617 [quant-ph].
[53] A. Rajput, A. Roggero, and N. Wiebe, Quantum error correction with gauge symmetries, npj Quantum Inf. 9, 41 (2023), arXiv:2112.05186 [quant-ph].
[54] L. Spagnoli, A. Roggero, and N. Wiebe, Fault-tolerant simulation of Lattice Gauge Theories with gauge covariant codes, Quantum 10, 1968 (2026), arXiv:2405.19293 [quant-ph].
[55] N. Bao, C. Cao, A. Chatwin-Davies, G. Cheng, and G. Zhu, Superselection rules, quantum error correction, and quantum chromodynamics, JHEP 05, 236, arXiv:2306.17230 [quant-ph].
[56] J. H. Conway and N. J. A. Sloane, Sphere Packings, Lat-tices and Groups, 3rd ed., Grundlehren der mathematischen Wissenschaften, Vol. 290 (Springer, New York, 1999).
[57] A. Dymarsky and A. Shapere, Quantum stabilizer codes, lattices, and CFTs, JHEP 03, 160, arXiv:2009.01244 [hep-th].
[58] W. Bosma, J. Cannon, and C. Playoust, The Magma algebra system I: The user language, J. Symbolic Comput. 24, 235 (1997).
Supplemental Material
This Supplement has three parts. Part A gives background for readers from either community, lists the sixteen weights as Standard Model fields (Table II), and relates this work to previous literature. Part B proves the main-text results: the reduction of triorthogonal lattices, the generator matrix and the qubit case, doubling and Theorem 2, minimality and uniqueness (Theorem 3), and distillation performance. Part C interprets the minimal logical errors as four-fermion operators, explains which fermions can be removed, from alone to several at once, and treats other representations, which completes the proof of Theorem 1. The final section describes the code that reproduces every statement.
and its Z-type stabilizers are the with v orthogonal to A and to g, which leave every such state unchanged.
Unitaries that map Pauli operators to Pauli operators under conjugation are Clifford gates. For odd they include the diagonal gates with a polynomial of degree at most two. Clifford gates are comparatively easy to implement fault-tolerantly, but circuits of Clifford gates acting on stabilizer states, with Pauli measurements, can be simulated efficiently on a classical computer [38], so universal quantum computation needs one further, non-Clifford gate. The Clifford hierarchy [39] organizes such gates. Its first level is the Pauli group, and level consists of the unitaries that map Pauli operators, under conjugation, into level . The Clifford gates form the second level, and the diagonal gate with cubic phases used below lies in the third. Magic state distillation, described at the end of this section, supplies such a gate.
Now apply the transversal gate , with for and coefficients . It is diagonal, so it multiplies each basis state by a phase, raised to the power
where . If the last three terms vanish for every , the phase is with , the same for every term of , so the gate acts on the encoded qudit as , a non-Clifford gate when . Triorthogonality guarantees this. It demands that vanish on every triple of vectors of containing at least one vector of . Appending to each vector a new coordinate equal to , with coefficient , turns into the triorthogonal space of the main text, and deleting the coordinate again is puncturing.
For the cube is trivial modulo 3, since , so is a Clifford gate. The non-Clifford qutrit gate uses ninth roots of unity instead, with and , and the exponent above must then be computed modulo 9. Triorthogonality modulo 3 controls the cross terms, whose coefficients are 3, but fixes the remaining phases only up to multiples of 3 in the exponent, which is a Pauli correction. When no correction is needed the gate is exact. For codes that lift to an anomaly-free spectrum it always is (Proposition 1).
In magic state distillation the code is used in reverse [9, 11]. Noisy copies of the magic state are twirled so that each suffers a random error , then decoded, and checked by measuring the X-stabilizers. An error is detected unless is orthogonal to . If it is also orthogonal to , it acts trivially, and otherwise it is a logical error. The protocol therefore fails only on the Z-logicals, the vectors of not orthogonal to , and the output error is dominated by the number of those of minimum Hamming weight. Only the Z-distance matters, and for triorthogonal codes it is never larger than the X-distance [11, 14]. The quadratic analogue of triorthogonality, , gives a transversal phase gate in the same way. Codes with this property are the P-codes used in doubling.
Anomalies, for coding theorists. The physical input is a list of fermions and their charges. A Weyl fermion is a two-component spinor field of definite chirality, left- or right-handed. A right-handed fermion of charge is equivalent to its conjugate, a left-handed fermion of charge , so any spectrum can be written with left-handed fields only. In code terms this negates a column together with its coefficient, which leaves unchanged. A symmetry acting on the fermions by phases is a , and assigns each fermion an integer charge. For a gauge theory to be consistent, its cubic gauge anomalies must vanish. That is, for every choice of three of its symmetries, the one-loop triangle diagram of Fig. 2, to which each fermion contributes the product of its three charges with the sign of its chirality, must sum to zero. If and are the charge vectors of the three symmetries, indexed by fermions, and the vector of chiralities, the anomaly is .

FIG. 2. The triangle diagram. A Weyl fermion in the loop couples to three gauge fields, under which it has charges and , and contributes to their mixed anomaly. Summing over the fermions gives .
The smallest instance of the dictionary has a single . Five left-handed fermions with charges have vanishing cubic and linear charge sums [40], so their charge lattice, of rank one, is triorthogonal. Removing the fermion of charge 1 leaves a code on four qudits with no stabilizers, since no nonzero symmetry leaves that fermion neutral, and with logical given by the remaining charges . Its logical exponent is , which is minus the cube of the removed charge, that is, the anomaly the removed fermion would cancel. The distance is 1, since with one every charged column is proportional to the removed one. Codes need lattices of higher rank, which nonabelian groups provide.
Nonabelian groups. For a nonabelian group such as or one keeps a maximal set of commuting generators, the Cartan torus . Each component of a multiplet is then a fermion with a definite charge vector in , a weight of the representation. There is no loss of generality when restricting to the torus, because every element of the Lie algebra is conjugate into the Cartan algebra and the anomaly is invariant under conjugation. The Weyl group, a finite group generated by reflections, permutes the weights of every representation and acts linearly on the charge lattice, so its elements that fix the removed weight are automorphisms of the code. For the weights of the spinor 16, scaled by 2, are the sign vectors with an even number of minus signs, and the Weyl group acts by permuting the five coordinates and by changing an even number of signs. Table II lists the sixteen weights as Standard Model fields. Throughout, a weight means a weight of a representation, as opposed to a Hamming weight.
| column field | q | column field | q | ||
|---|---|---|---|---|---|
| 1 | (+, -, -, -, -) | 8 | (-, +, +, -, +) | ||
| 2 | (-, +, -, -, -) | 9 | (+, -, +, -, +) | ||
| 3 | (-, -, +, +, +) | 10 | (+, +, -, +, -) | ||
| 4 | (-, -, +, -, -) | 11 | (+, +, -, -, +) | ||
| 5 | (-, +, -, +, +) | 12 | (+, -, +, +, -) | ||
| 6 | (+, -, -, +, +) | 13 | (-, +, +, +, -) | ||
| 7 | (+, +, +, -, -) | 14 | e | (-, -, -, -, +) | |
| 15 | ν (seed) | (-, -, -, +, -) | |||
TABLE II. The sixteen weights of the 16 as Standard Model fields, numbered in the order used in the section on doubling, so that columns and are Dirac partners and column 15 is the seed. Subscripts are colour labels, and the removed field is .
Relation to previous work. The structure of a generation and its anomaly cancellation, triorthogonal codes and doubling, and, for , the fifteen-qubit code itself are known. To our knowledge, the identification of anomaly cancellation with triorthogonality, the codes for odd , and the minimality and uniqueness of the qutrit code have not appeared before.
That one generation with a right-handed neutrino forms the spinor of [1, 2], labelled by five bits [4], and that its anomalies cancel because has no cubic Casimir [5], is standard, as is the triangle anomaly itself [6–8]. General solutions of the anomaly equations have been found for a single [40–42] and for two factors [43], and the equations have also been solved for extensions of the Standard Model gauge group [44, 45]. Anomaly conditions for discrete gauge symmetries (which constrain the charges that label our codewords) go back to [46, 47], with a more recent treatment in [48]. We are not aware of earlier work connecting anomaly cancellation to quantum codes.
On the coding side, triorthogonal codes were introduced for magic state distillation [9, 11], building on [10]. The fifteen-qubit code is a punctured Reed–Muller code [9], and its relation to doubling is described in [23, 24]. Short qubit triorthogonal codes have been constructed by doubling [12, 25] and by other searches [49], and small qubit triorthogonal codes have been classified [15, 27]. For qudits, the non-Clifford gate and distillation were developed in [19, 29–31], triorthogonal and related codes in prime dimension in [14, 16–18, 50], and qutrit distillation schemes in [13, 32, 51].
Three other connections between codes and field theory are close in spirit to our construction. Gauss's law in a lattice gauge theory is used for error detection or correction, with the gauge-invariant states forming the code space [52–54]. Bao et al. observed that superselection sectors supply the orthogonality part of the Knill–Laflamme condition, protecting against bit flips but not phase flips, and used the approximate isospin superselection of protons and neutrons in low-energy QCD to define a code, concatenated with a repetition code to protect against phase errors [55]. Gauge symmetry and charge conservation enter our construction too, since for the stabilizers include the Cartan generators of the Standard Model gauge group, but play a different role. Here the qudits are labelled by fermion species, the stabilizers are charge assignments rather than operators acting on states, and the property that makes the spectrum a code is the exact cancellation of anomalies rather than gauge invariance or an approximate superselection rule. Finally, real self-dual quantum stabilizer codes define even self-dual Lorentzian lattices, and hence Narain conformal field theories, through a version of Construction A [56, 57]. That correspondence relates codes and lattices through a quadratic form. In this sense triorthogonal lattices are a cubic analogue, with the anomaly in place of the inner product.
PART B: PROOFS OF THE MAIN-TEXT RESULTS
Triorthogonal lattices and their reductions
A lattice is triorthogonal, for nonzero integer coefficients , if the cubic form vanishes on it. Over a cubic form determines its trilinear form, so this is the same as the vanishing of on . A triorthogonal lattice reduces to a triorthogonal space modulo every prime that divides none of the , and linear algebra over controls the resulting codes for all but finitely many primes.
Proposition S1. Let be triorthogonal, with columns , and let . For all but finitely many odd primes , the reduction modulo punctured at coordinate is a triorthogonal code.
Proof. The cubic identity holds modulo every . A logical , a vector of the reduction with , exists unless divides every entry of , and the logical exponent is nonzero unless divides . For the distance, take a relation over of minimal support that expresses through other columns, scaled to a primitive integer vector. Unless divides one of its finitely many coefficients, it survives modulo with the same support, so the distance is at most .
For the converse we use a rank argument, which recurs below. Let be a set of columns with , and let be the rank over of the matrix with these columns. Adding raises the rank to , so the matrix has a nonzero minor of size . If does not divide that minor, still has rank modulo , while has rank at most , so is not in the span of the columns in modulo . Applying this to the finitely many sets with excludes finitely many primes, and for every other prime the distance is at least .
The fifteen-qudit code
Table III gives a generator matrix of the code of Theorem 1. The columns are the fifteen fields, ordered as the ten weights of the 10 by the positions of their two minus signs and then the five weights of the by the position of their plus sign. The first row is the logical row , and the other four are the Cartan generators associated with the simple roots of , the -stabilizers. If is restored as the column , the cubic form of the integer matrix vanishes. The rows span a triorthogonal lattice, which can be reduced modulo any odd prime.
| 12 | 13 | 14 | 15 | 23 | 24 | 25 | 34 | 35 | 45 | 1 | 2 | 3 | 4 | 5 | |
| -1 | -1 | -1 | -1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | -1 | -1 | -1 | -1 | |
| 0 | -1 | -1 | -1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | -1 | 0 | 0 | 0 | |
| -1 | 1 | 0 | 0 | 0 | -1 | -1 | 1 | 1 | 0 | 0 | 1 | -1 | 0 | 0 | |
| 0 | -1 | 1 | 0 | -1 | 1 | 0 | 0 | -1 | 1 | 0 | 0 | 1 | -1 | 0 | |
| 0 | 0 | -1 | 1 | 0 | -1 | 1 | -1 | 1 | 0 | 0 | 0 | 0 | 1 | -1 |
TABLE III. A generator matrix of the fifteen-qudit code, with columns labelled by fields and, below, by the positions of the minus signs (10) or of the plus sign (5) in the weight. The first row is the logical row, and the other four are the -stabilizers.
Qubits. For we use the sign bits , , of the sixteen weights, together with . A binary code is triply even, that is, all its Hamming weights are divisible by 8, if it has generators whose weights are divisible by 8, whose pairwise overlaps are divisible by 4 and whose triple overlaps are divisible by 2 [11, 23]. Overlaps involving reduce to overlaps without it, because : thus and . Each reduced quantity is already required to satisfy a stronger congruence (modulo 8 rather than 4, and modulo 4 rather than 2). It therefore suffices to check and, for distinct , the numbers and .
Write , and . Since , inclusion-exclusion gives
For the generation , and by anomaly cancellation, as in the main text, while for . The three numbers are therefore 8, 4 and 2, and the code is triply even. The linear and quadratic sums are mixed anomalies with fermion number , which assigns charge 1 to every field, and the cubic sum is the gauge anomaly. The same formulas show that, for any spectrum of left-handed fermions with sign charges, the sign bits give a triply even code whenever, in addition to the cubic anomalies, and vanish modulo 16; this is the sense in which qubits need more than gauge anomaly cancellation.
The span of and the is on the sixteen points of . Every vanishes at the coordinate of , because , so a codeword , with in the span of the , takes the value there. Its weight is divisible by 8, so its weight on the other fifteen coordinates is , and multiplies every term of by . Deleting the coordinate of thus gives the fifteen-qubit code [9], on which acts as on the encoded qubit.
Doubling and Dirac pairing
Doubling builds a triorthogonal code from two ingredients: a -code and a seed .
A -code is a subspace with nonzero coefficients such that
It contains with index , because the stabilizer rows correspond to half-integral , so the two lattices have the same reduc-
tion modulo every odd prime.
Its stabilizers are the vectors of , and its logical is . A logical error of is a vector with , and the distance is the smallest weight of one.
The seed is a triorthogonal code of length , with its own coefficients and cubic form , logical row and stabilizer space . Thus vanishes on every triple of vectors of that contains a vector of , and is its logical exponent. A logical error of is a vector with , and is the smallest weight of one.
The doubled code has three blocks of columns, of widths , and : a first copy of , a second copy of , with columns of one copy paired with columns of the other, and the seed. In our convention, both copies carry the same coefficients , and the seed has its original coefficients. The signs are as per the generator matrix below, which depends on a parameter ,
| first copy | second copy | seed | |
|---|---|---|---|
| logical row | |||
| paired stabilizers | |||
| linking row | |||
| seed stabilizers |
with running over a basis of and over a basis of . The rows and agree on the second copy and the seed, and differ only on the first copy, where vanishes.
Proposition S2. If , the doubled matrix, with coefficients on both copies, is triorthogonal with logical exponent , and its distance is .
Proof. Triorthogonality. A general vector of the row space is
with and . Its stabilizers are the vectors with , so we must show that for any three such vectors and . The form is a sum over columns, so it splits into one term for each block. On the first copy, expand the product of the three entries. The terms with one or two factors from vanish by the -code conditions, leaving
On the second copy the same expansion gives
because enters with the opposite sign, and the last term cancels the one from the first copy. On the seed, the triorthogonality of removes every term that contains , or , leaving . Altogether,
When , the second term vanishes and the first is , as required.
Distance. Write a -error as , on the first copy, the second copy and the seed. It commutes with the paired stabilizers, the seed stabilizers and when, respectively,
Given (iii), , and because . So is a logical error exactly when (i)-(iii) hold and . There are two cases.
-
If , then by (iii), so lies in with - a logical error of . Hence .
-
If , then by (ii) is a logical error of , so . Moreover , since , and , since . Hence .
So the distance is at least , and both bounds are attained. If is a minimum-weight logical error of , then satisfies (i)-(iii) and has . If is a minimum-weight logical error of , let equal on one column and zero elsewhere. Then satisfies (i), since , as well as (ii) and (iii), and has .
Proof of Theorem 2. The proof is a change of basis. We build two copies of a seven-qudit -code and a one-qudit seed from pieces of the generation, check the conditions of Proposition S2, and show that the doubled matrix generates the same lattice as Eq. (4). Every identity below holds over , and so modulo every odd .
The generation splits into two Pati–Salam multiplets [26]. The right-handed sector , the fields and , is a of . On it and . Its image under , the Dirac partners and , is a . On it and . We order the fields as in Table II, so that columns and hold and , and column 15 holds .
The right-handed code. Remove from , and give each of the seven remaining fields the coefficient . The charges under which is neutral are spanned by , ; these are the stabilizers. The logical row is , which is 1 at . Proposition S2 takes the logical row to be 1, so we multiply each column by its value of . Physically, this replaces and by their conjugates. The quadratic form is unchanged, since . The stabilizers become , which is 1 exactly when colour coordinate of the field differs from its weak coordinates. In the order of Table II the code is
| logical | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 | |
| 0 | 1 | 1 | 0 | 0 | 1 | 1 | |
| 0 | 0 | 0 | 1 | 1 | 1 | 1 | |
| 1 | 1 | 1 |
(5)
The columns of the are the binary numbers . The stabilizers therefore span the simplex code, and for this is the Steane code. The -code conditions can be read off directly. Each is supported on four columns and each , , on two, and in each case half of them have and half . Moreover , the anomaly that would cancel.
The distance is 3 for every . The columns of the are distinct nonzero vectors, so no two are parallel and no error of weight one or two commutes with the stabilizers. Columns 1, 2 and 3 give the logical error , which is orthogonal to every and has sum 1. Undoing the rescaling, it is the relation of Table V. The right-handed sector is thus a code.
The Dirac partners. The map takes to the left-handed doublets and to . It preserves and negates , so it takes to and each stabilizer to its negative. After the same rescaling, the column of therefore has the same coefficient as that of , since , and stabilizer entries . Without , which becomes the seed, the doublets form a second copy of the same code, with every stabilizer negated on paired columns, which is exactly the pairing that doubling requires. Physically, each has the colour and electric charge opposite to those of , and the stabilizers span, over , the Cartan algebra of . Their differences give and , and their sum gives . On these charges the generation is vectorlike.
The seed. The neutrino is the one field whose Dirac partner, , is not among the qudits. On its own it is the trivial code: one qudit, coefficient 1, no stabilizers, and logical row . Thus and .
Doubling. The linking row must vanish on the first copy and equal on the second copy and on the seed. Weak isospin does this with , because the fields are weak singlets. Since paired columns carry equal coefficients, , and the condition of Proposition S2 becomes
Weak isospin is traceless on the doublets. By Proposition S2, the doubled code is triorthogonal, with logical exponent 1 and distance . With coefficients on both copies and 1 on the seed, its generator matrix is
| f | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| L | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |||||||
| 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | |||||
| 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | |||||
| 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | |||||
| K | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
(6)
For this is the doubled Steane code [24].
Comparison with Eq. (4). Undo the rescaling by negating the columns of , , d and e. The coefficients all return to 1, and the rows become charges of the generation:
where is the row with the rescaling undone. In terms of these,
This change of basis is unimodular, so with the rescaling undone the rows of Eq. (6) and of Eq. (4) generate the same lattice over Z, with columns matched as in Tables II and III. The stabilizers, the rows that vanish at , correspond to each other. The logical row of Eq. (4) is modulo stabilizers, which relabels the logical basis by . The transversal gate, logical in the doubled form, is therefore in the basis of Theorem 1, since .
Integral doubling. For qubits, doubling maps doubly even codes to triply even ones [23], so it preserves the integral refinement that makes the transversal gate exact. For odd the same holds more simply. Call an integral -lattice if is a lattice and has nonzero entries satisfying the -code conditions over , with .
Proposition S3. Let be an integral -lattice, let be an integral triorthogonal lattice with logical exponent , and let satisfy . Then the doubled matrix, with coefficients on both copies, is an integral triorthogonal lattice with logical exponent .
Proof. The triorthogonality computation in the proof of Proposition S2 is an identity in the entries, so it holds over Z.
With unit coefficients, the doubled lattice is the charge lattice of an anomaly-free spectrum, in which the two copies are vectorlike pairs under the logical row and the paired stabilizers and chiral under the linking row. Theorem 2 is the case in which S is the right-handed sector, , , and T is the trivial seed. Doubling can therefore be iterated within anomaly-free spectra; every code obtained in this way has an exact qutrit gate (Proposition 1), and its reductions are triorthogonal codes for all but finitely many primes, with the distance of the lattice over Q.
There is one restriction. Over Z, the condition forces when all , so a nonzero integral P-lattice has coefficients of both signs. In particular, a P-code whose coefficients are all 1, such as the ternary Golay code, never lifts with unit coefficients. For unit coefficients and , the condition on forces . An integral P-lattice of distance five with is the input that would double the fifteen-qudit code to distance five.
Minimality, uniqueness and symmetry
Here . We use the matrix form of triorthogonality [14]. A generator matrix with logical rows and stabilizer rows spanning is triorthogonal if vanishes on every triple of rows except a logical row taken three times, and . The distance is . For one logical qutrit this is equivalent to the definition in the main text, and it does not impose self-orthogonality.
Proposition S4. No triorthogonal qutrit code with has length at most 14. Every triorthogonal code is equivalent to the code of Theorem 1, and there is no triorthogonal code with and no code. The monomial automorphism group of the code of Theorem 1 is . This strengthens Theorem 3.
Reduction. We first bring a shortest code with to a normal form. None of the following steps lowers the distance or lengthens the code.
-
One logical row. If there are several logical rows, keep one, g. This leaves A unchanged and only shrinks H, so the set of logical errors shrinks and d cannot decrease.
-
No zero or parallel columns. A zero column of contributes nothing to and can be deleted. Two parallel columns, and with coefficients and , contribute to as a single column with coefficient , and can be replaced by it, or deleted if that coefficient vanishes. In each case a logical error of the shorter code, extended by zero, is a logical error of the original code of the same weight, so cannot decrease. A shortest code with therefore has no zero or parallel columns.
-
Unit coefficients. Multiplying column by and setting its coefficient to 1 leaves unchanged, because in , and it does not change Hamming weights.
-
Projectivity. Now exactly when the columns of A are nonzero and pairwise non-parallel, that is, when A is projective. A Z-error of weight one or two lies in exactly when the columns of A in its support are linearly dependent, and it then lies outside , because the corresponding columns of H are independent; it is a logical error.
-
Normal form. Row reduction and a permutation of columns bring to the form , and subtracting stabilizers from makes it vanish on the first columns, so that , with and . Triorthogonality becomes polynomial conditions on and , one for each triple of rows.
Two bounds then limit . The vectors , with the rows of and the entrywise product, lie in , since for every row of , and they are independent, since on the identity block is nonzero only at position . As has dimension , this gives , a cubic analogue of the bound for self-orthogonal codes. A projective has at most as many columns as there are points in the projective space , so . Together these force .
Search. We enumerate canonical representatives, lexicographically minimal under permutations of the columns of , permutations of the rows of , and , by backtracking over the rows of . Every normal form is equivalent to a canonical one, so the search is exhaustive. For the bounds leave 19 pairs , and none has a solution, so no code with has length at most 14. For only has solutions, 36 of them.
Every code appears among these solutions. It has no zero or parallel columns, since removing them would give a shorter code with , and the other reduction steps are equivalences. Each of the 36 solutions is equivalent to the code of Theorem 1. For each, we find a permutation of columns that maps its row space onto that of Table III. Since all coefficients are 1, such a permutation preserves , and so it also maps stabilizers to stabilizers, because the stabilizer space is determined by , as the set of row-space vectors with for all in the row space. All 36 solutions have , so there is no code.
A code with would, by keeping one logical row, contain one of these codes, together with a second logical row outside the span of the stabilizers and that satisfies for all stabilizers . These conditions are linear in , and for each solution the vectors satisfying them are exactly the stabilizers, so no such exists. The number of partial matrices the search visits for each , and a check against brute-force enumeration for small , are in the repository.
Automorphisms. Magma [58] gives a monomial automorphism group of order 240, consisting of the permutations of the five coordinates of together with an overall sign. These permutations fix , and they form its whole stabilizer in the Weyl group of . That group has order 1920 and acts transitively on the sixteen weights, so the stabilizer has order . For , 7 and 11 the group is , so again no symmetries appear beyond the Weyl group and global scalars.
Distillation performance
Noisy copies of the magic state are twirled so that each suffers a random , , with total probability , its infidelity, each nonzero power being equally likely [29, 30]. Depolarizing noise of strength , which replaces the state by the maximally mixed state with probability , gives , which is for qubits and for qutrits. We compare the two codes both at equal , the usual figure of merit for distillation, and at equal , which holds the channel fixed. The qutrit code is better in both, by a factor of about 5.6 in the leading term at equal and about 3 at equal .
A round of distillation is accepted when the Z-error lies in and fails when it lies in . For the qubit code the weight-three failures are the 35 supports of weight-three codewords of the Hamming code, each with one error pattern, so . For the qutrit code they are the 25 supports of Table V. On each support, 2 of the patterns of and are logical (the relation and its double), and the other 6 are detected, so . In terms of , with , these become and . Although a qutrit has more error types than a qubit, a smaller fraction of them are logical.
Table IV gives the exact acceptance probability, output error and threshold of one round of each code, computed from the weight enumerators of the accepted errors. These begin for the qutrit code, of which the 50 weight-three terms are all logical, and for the qubit code. At equal infidelity the two codes accept with the same probability to leading order, .
Both codes have yield exponent , so the advantage is a constant factor. We conclude with an obvious caveat to this comparison: across dimensions, noisy qutrit and qubit magic states need not cost the same to prepare and the distilled gates differ.
| [[15, 1, 3]]3 | [[15, 1, 3]]2 | |
|---|---|---|
| weight-three logical supports | 25 | 35 |
| logical patterns per support | 2 of 8 | 1 of 1 |
| leading term, equal infidelity | ||
| leading term, equal | ||
| threshold | 0.230 | 0.141 |
| threshold | 0.345 | 0.283 |
| acceptance at | 0.860 | 0.860 |
| acceptance at | 0.905 | 0.928 |
| after two rounds from |
TABLE IV. Single-code distillation with the two fifteen-qudit codes, computed exactly.
PART C: PHYSICAL INTERPRETATION AND FURTHER RESULTS
The minimal logical errors as four-fermion operators
By Eq. (3), a minimum-weight -logical of the code of Theorem 1 is a linear relation among weights, where is the weight of the field (Table II). Each such relation is a statement of charge conservation. The product of with the fields for which and the conjugates for which has zero charge under every Cartan generator of (Part A), and in particular under those of the Standard Model. We call such a product a Cartan-neutral four-fermion operator. In general it is not, by itself, invariant under the full Standard Model gauge group, which also mixes colour and isospin components.
Since (Theorem 1), every such relation involves exactly three fields besides , and by direct computation all its coefficients are . There are 25, one for each weight-three support, listed in Table V.
Each relation also has the charge structure of a tree-level exchange, which the weights make explicit. In , two fermions in the 16 can couple to a scalar in the 10, the smallest representation in , which is how Yukawa couplings arise in models. Such a coupling conserves charge only if the two fermions' charge vectors add up to a weight of the 10. In the normalization used here, these weights are , where is the -th unit vector, for example . Two sign vectors therefore qualify exactly when they agree in one coordinate and are opposite in the other four. Exchanging the scalar between two such couplings gives a four-fermion operator whose fields split into two pairs of this kind. Every relation in Table V splits in this way, with in one of the pairs; for conjugated fields the charge vector is . For example, the right-handed current of Fig. 1 splits into with , which agree only in the first coordinate, and with .
The shared coordinate says which component of the 10 is exchanged. Under the 10 is a . A weak coordinate corresponds to a Higgs doublet, and a colour coordinate to a colour triplet. The products of Dirac masses and the mixed and scalar currents can arise from Higgs-doublet exchange, through the same Yukawa couplings that give fermions their masses. The right-handed currents and the nine baryon-number-violating relations require colour-triplet exchange, which mediates proton decay in models. Similarly, a pair can be joined by an gauge boson, in the adjoint , when is a root , that is, when the two weights differ in exactly two coordinates. The fifteen relations marked , those with coefficients of both signs, split into two such pairs, so they also have the charge structure of gauge-boson exchange.
Which fermions are removed
Because the Weyl group of acts transitively on the sixteen weights, removing any one of them gives an equivalent code. We single out by gauge symmetry, demanding that the -stabilizers include the Cartan generators of the Standard Model gauge group . Since the -stabilizers are the symmetries under which the removed fermion is neutral, the removed fermion must be neutral under all of these generators. As integral generators we take , , and , where and are the numbers of occupied colour and weak oscillators. Neutrality under the colour generators requires , so , and neutrality under the weak generator requires , so . Since every field of the 16 has
| type | relation | number | gauge |
|---|---|---|---|
| Dirac bilinears | 3 | g | |
| Dirac bilinears | 3 | ||
| Dirac bilinears | 1 | ||
| right-handed current | 3 | g | |
| mixed current | 3 | g | |
| 6 | g | ||
| 3 | |||
| scalar charged current | 3 | ||
| total | 25 | 15 |
TABLE V. The 25 minimum-weight logicals as four-fermion relations. Subscripts are colours. Equal subscripts denote the same colour, and are distinct, so occurs for the six orderings of three colours. All relations can arise from exchange of a 10, and those marked also arise from exchange of a gauge boson.
even, , and the removed field is either , with and , or the positron , with and . Over , or modulo any prime , only is neutral, and this is the field we remove. Modulo 3 the positron is neutral too. Either way, the removed field is the singlet of an whose Cartan generators are the stabilizers and whose 10 and 5 are the two orbits of the remaining fields. The singlet is in the Georgi–Glashow embedding [3], and in flipped [21, 22], where hypercharge combines an generator with .
We can also remove several fermions with independent weights, to obtain higher-rate codes, at the cost of reduced distance. Removing of them gives a triorthogonal code with logical qudits, whose stabilizers are the symmetries under which every removed fermion is neutral. Triorthogonality of the full lattice makes act as on each logical qudit, exactly for by the argument of Proposition 1, and exactly when some remaining fermion completes a neutral combination with removed ones. Removing any two fermions gives a [[14, 2, 2]] code for every ; for qubits it is the first member of the Bravyi–Haah family [11]. For odd , removing three keeps exactly when they belong to one quartet of Pati and Salam [26], in which lepton number is the fourth colour, such as , or to a Weyl image of one, and gives a [[13, 3, 2]] code. Any other triple lies in a four-fermion relation, a Weyl image of one in Table V, whose fourth field gives . Removing a whole quartet also gives , because . For qubits any removal of three gives , and for qutrits any removal of four gives . (For , it is possible to find an additional removal to obtain a [[12, 4, 2]] code, but we do not offer a Standard Model interpretation for this.)
Other representations
We now ask which representations other than the 16 give useful codes. The first requirement is anomaly freedom. Among the compact simple Lie algebras only with has a cubic Casimir [5], so every representation of every other one is anomaly free.
The second requirement is chirality. Real and pseudoreal representations contain each weight together with its negative, so every field has a vectorlike partner and . Several identical generations fail for a similar reason, since every field has an identical copy. Among the algebras without a cubic Casimir, only with and have complex representations. The smallest are the spinors, starting with the 16 of , and the 27 of .
The 27 gives . Under it decomposes as , so in the normalization of the main text its weights are for the sixteen weights of the 16, and . No weight is a multiple of another, even modulo an odd prime. The 27 carries an invariant cubic form of its own, distinct from a cubic Casimir, which allows the Yukawa coupling and contains 16 16 10 and 10 10 1. It gives relations among three weights, such as , and when and agree in exactly one coordinate. Every weight lies in one, so the removed weight is a combination of two others, and for every odd . In the 16 alone the 10 is a scalar and two couplings are needed, which is why the logical errors there involve four fermions.
The larger spinors give , as we now show.
Proposition S5. Let , let be the weights of a spinor of , the sign vectors with an even number of minus signs, and let . For every odd prime , removing gives a triorthogonal code.
Proof. For the upper bound we exhibit three weights whose combination is 1. Pick with an even number of minus signs and at least one sign of each kind. Then and lie in , since is even, and so does . None of them is 1, and , so .
For the lower bound, every weight other than 1 has entries of both signs, since -1 has the wrong parity for odd m. So no single weight is proportional to 1, even modulo an odd prime. Suppose that over Q, with a and b distinct weights other than 1. On the coordinates where a and b agree, a is constant; on those where they differ, a is constant and b = -a. Both sets are nonempty, since and , the latter again by parity. Whichever of a and b takes the same value on both sets is then constant, and so equals , a contradiction. Finally, the rank argument in the proof of Proposition S1 carries this to every odd prime p, since the minors it uses are nonzero and minors of matrices, which are and , so p never divides them.
For m = 5 this is the distance in Theorem 1, and for m = 7 it gives a p code.
REPRODUCIBILITY
The accompanying repository [36] contains scripts that reproduce every computational statement in the Letter and in this Supplement, and its documentation lists which script checks which statement. They cover the charge sums and triorthogonality over Z; the parameters of the code for odd primes and its qubit form; exactness of the qutrit gate; the doubling identities; the minimal logical errors and their classification; the codes obtained by removing several fermions; the spinor codes; the exhaustive search and uniqueness; the automorphism groups; and the distillation figures. The minimality, uniqueness and automorphism results were also checked independently in Magma [58].