alphaFeedback

WorksPhysics and Astronomy

Random encoders and expurgation improve 1,873 entries of the Grassl qubit code tables

AI contributions
  • AI agents
View details
Ancillary data
1 code link
View

Abstract

I report 192 explicit binary stabilizer codes [[n,k,d]][[n,k,d]] with 53≤n≤25453\le n\le 254 and 5≤d≤135\le d\le 13 whose minimum distance exceeds the lower bound listed in Grassl's code tables at the same (n,k)(n,k): 161 codes by one and 31 by two. Through the standard propagation rules they raise 1,873 entries of the table. For 190 of the codes, a random Clifford encoder is followed by expurgation: every logical operator of weight below the target distance is enumerated, and a few logical operators are promoted to stabilizers so that each low-weight one anticommutes with at least one of them. The other two are obtained by puncturing a code from the table and repairing it in the same way. All 192 distances are exact: the lower bound is certified by exhaustive meet-in-the-middle enumeration of up to 4×10134\times10^{13} Pauli operators, and the upper bound by an explicit logical operator of weight dd. A first-moment count explains the results. Expurgated random codes have about eight more logical qubits than a typical random code of the same length and distance, so they beat the table wherever its best known codes are no better than random. The largest gains, up to nine logical qubits, are at d≥9d\ge9 and n≳170n\gtrsim170, where the table often gives a lower bound without an explicit code. The same count predicts improvements at 619 further pairs (n,d)(n,d). The search was run by AI agents. The codes, their certificates and an independent checker are public.

Introduction

Grassl’s tables [1] list, for every length n≤256n \le256 and dimension kk, the best known lower and upper bounds on the minimum distance of qubit stabilizer codes [2, 3]. At lengths above 100, the explicit codes behind the lower bounds are mostly cyclic-type codes, shortened or extended by extra qubits: in a random sample of 26 entries with n≥100n \ge100 and 5≤d≤135 \le d \le13, 21 come from BCH, cyclic, constacyclic, quasi-cyclic or twisted codes, 2 from stored generator matrices, and 3 have no explicit code. Over the whole table, more than half of the entries with n≥100n \ge100 (15,011 of 27,946 with k≥1k \ge1) give a lower bound but no explicit code. Random stabilizer codes reach the quantum Gilbert–Varshamov bound [4], and over most of the table the best known codes are much better than that random-code level (Figure 1).

Figure 1. Number of stabilizer generators n−kn-k needed at length nn for distance dd; lower is better, and at fixed (n,d)(n,d) a vertical step of one is one logical qubit. Solid gray: quantum Singleton bound n−k≥2(d−1)n-k \ge2(d-1). Dotted gray: random-code (Gilbert–Varshamov) level n−krand(n,d)n-k_{\rm rand}(n,d). Blue: best code in Grassl’s table [1], read on 4 November 2026. Dashed orange: the calibrated predictor of Sec. III for random encoders with expurgation. Orange dots: the 192 new codes. Where the blue line lies above the orange dashed one, the predictor expects random encoders with expurgation to improve the table.

This note reports that random Clifford codes, improved by expurgation and certified by exhaustive enumeration, beat the table at 192 coordinates (n,k)(n,k). The codes have dense generators and are not low-density parity-check codes; their interest lies in their parameters. Section II describes the construction, Sec. III a counting argument that explains and predicts where it wins, Sec. IV the results, and Sec. V the distance certification. The work was done in the Genesis project, during a three-day hackathon at Argonne National Laboratory: AI agents wrote and ran the search, and all heavy computations ran on the Aurora supercomputer of the Argonne Leadership Computing Facility. Section VII describes the agents’ role.

Construction

A stabilizer group SS with n−Kn-K independent generators on nn qubits defines an [[n,K]][[n,K]] code. Pauli operators up to phase are vectors in F22n\mathbb{F}_2^{2n} with the symplectic form, N(S)N(S) denotes the normalizer of SS, and the logical group L=N(S)/S≅F22K\mathcal{L}=N(S)/S \cong\mathbb{F}_2^{2K} inherits a nondegenerate symplectic form. The distance is d=min⁡{wt⁡(P):P∈N(S)∖S}d=\min\{\operatorname{wt}(P):P\in N(S)\setminus S\}. A code is given by its (n−K)×2n(n-K)\times2n check matrix HH in [X∣Z][X|Z] form, whose rows are the generators.

Parent codes. The parent code is defined by a random Clifford encoder: 16–20 layers of random two-qubit Clifford gates on random pairs of qubits, applied to KK logical input qubits and n−Kn-K ancillary qubits in ∣0⟩|0\rangle. For the present purpose these parents behave like uniformly random stabilizer codes: over 683 parents, the number of logical classes of weight below the target distance agreed with the random-code expectation EE of Eq. (2) to within about 1%.

Expurgation. Promoting logical operators to stabilizers gives a subcode, the quantum counterpart of expurgating a classical code [5]; it is one of the standard constructions of the tables [1, 3]. Here the logical operators are chosen to remove every low-weight logical operator. Fix a target distance DD and let W⊂LW\subset\mathcal{L} be the set of nonzero logical classes that contain a Pauli operator of weight below DD. The set WW is computed exactly with the enumeration of Sec. V. Choose an isotropic subspace U⊆LU\subseteq\mathcal{L} of dimension qq and add representatives of its elements to the stabilizer; in terms of check matrices, qq logical operators are appended to HH as new rows. The group S′=⟨S,U⟩S'=\langle S,U\rangle defines an [[n,K−q]][[n,K-q]] code whose nontrivial logical classes are those in U⊥∖UU^\perp\setminus U, where U⊥U^\perp is the symplectic complement of UU in L\mathcal{L}. Hence

d(S′)≥D⟺W∩U⊥⊆U,(1)d(S') \ge D \Longleftrightarrow W \cap U^\perp\subseteq U, \tag*{(1)}

that is, every low-weight logical class must anticommute with some element of UU or become a stabilizer. In practice the generators u1,…,uqu_1,\ldots,u_q of UU are chosen so that every w∈Ww \in W anticommutes with at least one uju_j; they are found by a randomized search that uses linear algebra over F2\mathbb{F}_2 to impose these constraints.

Puncture and repair. Two of the codes start from a table code instead of a random one. One qubit of [[113,73,9]][[113,73,9]] or [[113,85,7]][[113,85,7]] is punctured, which gives [[112,74]][[112,74]] and [[112,86]][[112,86]] parents with distance at least 8 and 6. Expurgation with q=5q=5 and q=7q=7 then yields [[112,69,9]][[112,69,9]] and [[112,79,7]][[112,79,7]]. This beats the table only where its kk drops by more than q−1q-1 when the length decreases by one, which is rare.

Where the method wins

The random-code level. A random Pauli operator commutes with the n−kn-k generators of a random [[n,k]][[n,k]] code with probability about 2−(n−k)2^{-(n-k)}, so the expected number of nontrivial logical operators of weight below dd is

E(n,k,d)=2−(n−k)∑w=1d−1(nw)3w.(2)E(n,k,d)=2^{-(n-k)}\sum_{w=1}^{d-1}\binom{n}{w}3^w. \tag*{(2)}

A random code typically has distance at least dd when E<1E<1, that is, when k<krand(n,d)k<k_{\mathrm{rand}}(n,d) with

krand(n,d)=n−log⁡2∑w=1d−1(nw)3w.(3)k_{\mathrm{rand}}(n,d)=n-\log_2\sum_{w=1}^{d-1}\binom{n}{w}3^w. \tag*{(3)}

This is the quantum Gilbert–Varshamov bound for nondegenerate codes [4]. Each extra logical qubit doubles EE, so it is natural to measure codes on a logarithmic scale. The excess

X(n,k,d)=log⁡2E(n,k,d)=k−krand(n,d)(4)X(n,k,d)=\log_2 E(n,k,d)=k-k_{\mathrm{rand}}(n,d) \tag*{(4)}

counts how many logical qubits a code has above the random-code level. Two codes with the same nn and dd differ in kk by exactly the difference of their excesses.

What expurgation reaches. Expurgation can beat a random code because UU is chosen rather than drawn. How far it can go follows from a first-moment count, in four steps.

Step 1: what must be removed. Suppose the goal is a final code [[n,k,D]][[n,k,D]], reached from a parent with K=k+qK=k+q logical qubits by adding qq stabilizers. The parent has qq more logical qubits than the final code, so its excess is larger by qq, and its number of low-weight logical classes is, by Eq. (2),

m=∣W∣≈2X(n,K,D)=2q2X(n,k,D).(5)m=|W|\approx2^{X(n,K,D)}=2^q2^{X(n,k,D)}. \tag*{(5)}

All mm classes must be removed by the qq new stabilizers.

Step 2: a random choice of UU is no better than a random code. A class w∉Uw\notin U survives if it lies in U⊥U^\perp, that is, if it commutes with every generator u1,…,uqu_1,\ldots,u_q of UU. Whether ww commutes with uju_j is one bit, and for a randomly chosen UU each of these qq bits is zero with probability about 1/21/2, so ww survives with probability about 2−q2^{-q}. The expected number of survivors is then m 2−q=2X(n,k,D)m\,2^{-q}=2^{X(n,k,D)}: exactly the number of low-weight logical operators of a random [[n,k]][[n,k]] code. This is no coincidence, since a randomly chosen UU simply produces another random code. Treating the mm classes as independent, the number of survivors is approximately Poisson distributed, and a random UU removes every class with probability

Pgood=(1−2−q)m≈e−m2−q=e−2X(n,k,D).(6)P_{\mathrm{good}}=(1-2^{-q})^m\approx e^{-m2^{-q}}=e^{-2^{X(n,k,D)}}. \tag*{(6)}

This is tiny once XX exceeds a few units: for X=8X=8 it is e−256≈2−369e^{-256}\approx2^{-369}.

Step 3: there are many choices of UU. An isotropic subspace of dimension qq is spanned by qq mutually commuting logical operators. The first can be any of the 22K−12^{2K}-1 nonzero classes. The jj-th must commute with the previous j−1j-1, and each of these conditions halves the number of candidates; it must also lie outside their span. This leaves about 22K−j+12^{2K-j+1} choices, so there are about ∏j=1q22K−j+1=22Kq−q(q−1)/2\prod_{j=1}^{q}2^{2K-j+1}=2^{2Kq-q(q-1)/2} ordered choices. Each subspace is counted once for each of its bases, and a qq-dimensional space has about 2q22^{q^2} bases, so the number of subspaces is about

22Kq−q(q−1)/2−q2≈22Kq−32q2,(7)2^{2Kq-q(q-1)/2-q^2}\approx2^{2Kq-\frac{3}{2}q^2}, \tag*{(7)}

up to a factor 2O(q)2^{O(q)}. Choosing UU therefore offers about 2Kq−32q22Kq-\frac{3}{2}q^2 bits of freedom.

Step 4: weigh the freedom against the cost. Multiplying the number of subspaces by the probability that one of them works gives the expected number of subspaces that satisfy Eq. (1),

N≈22Kq−32q2(1−2−q)m.(8)\mathcal{N}\approx2^{2Kq-\frac{3}{2}q^2}(1-2^{-q})^m. \tag*{(8)}

If N≫1\mathcal{N}\gg1, good subspaces should exist; if N≪1\mathcal{N}\ll1, they almost certainly do not. (This is the first-moment heuristic: it ignores correlations between the events.) In base-2 logarithms, using log⁡2e−x=−x/ln⁡2\log_2 e^{-x}=-x/\ln2 and Step 2,

log⁡2N≈(2Kq−32q2)−2X(n,k,D)ln⁡2.(9)\log_2\mathcal{N}\approx\left(2Kq-\frac{3}{2}q^2\right)-\frac{2^{X(n,k,D)}}{\ln2}. \tag*{(9)}

The first term is the freedom in choosing UU; the second is the cost, in bits, of removing every low-weight class. Requiring log⁡2N≳0\log_2\mathcal{N}\gtrsim0 gives 2X(n,k,D)≲ln⁡2(2Kq−32q2)2^{X(n,k,D)}\lesssim\ln2\left(2Kq-\frac{3}{2}q^2\right), and taking the logarithm once more,

X(n,k,D)≲log⁡2[ln⁡2(2Kq−32q2)].(10)X(n,k,D)\lesssim\log_2\left[\ln2\left(2Kq-\frac{3}{2}q^2\right)\right]. \tag*{(10)}

Reading the bound. The cost of removing the low-weight classes grows exponentially with the excess, as $2^X$, while the freedom grows only like 2Kq2Kq. The excess that expurgation can reach is therefore only logarithmic in $K and qq. For example, [[180,131,9]][[180, 131, 9]] came from a K=138K = 138 parent with q=7q = 7: the freedom is 2⋅138⋅7−32⋅49≈18602 \cdot138 \cdot7 - \frac{3}{2} \cdot49 \approx1860 bits, and Eq. (10) gives X≲log⁡2(0.69×1860)≈10.3X \lesssim\log_2(0.69 \times1860) \approx10.3, while the code reached X=8.1X = 8.1. Increasing qq raises the freedom only linearly, while the number of classes that must be enumerated and removed, m=2X+qm = 2^{X+q}, doubles with each extra stabilizer; in practice q≤8q \leq8.

Over the parameters used here the right-hand side of Eq. (10) lies between 5.8 and 11.1 (median 10.2). For the 160 codes whose KK and qq were recorded, the achieved XX is 0.8 to 3.0 below it (median 2.3 below). A shortfall is expected: a first-moment estimate is optimistic, and the search does not examine every subspace. Because KK and qq enter only through a logarithm, the new codes all sit at nearly the same excess: 90% of them have 6.1≤X≤8.96.1 \leq X \leq8.9, with median 7.7.

A calibrated predictor. For a practical prediction we take, for each parent dimension KK, the smallest qq with log⁡2N≥0\log_2 \mathcal{N} \geq0 in Eq. (8) (using the exact log⁡2(1−2−q)\log_2(1-2^{-q})), add one to it, keep q≤8q \leq8, maximize K−qK-q over KK, and subtract one. These two offsets were fixed on early runs. At the 192 new codes the predictor gives the achieved kk exactly for 147 of them and within one for 178. Before the last searches were run it predicted k=106k = 106, 121 and 54 for (n,d)=(172,12)(n,d) = (172, 12), (188,12)(188, 12) and (120,13)(120, 13); the searches produced exactly these values, where the table has 98, 113 and 48.

Where the table has no explicit codes. Figure 1 compares, for each distance, the number of generators n−kn-k of the table’s best codes with the random-code level, the predictor and the new codes. Where cyclic-type codes exist, the table’s codes are far better than random and expurgated random codes cannot compete. Over long stretches of nn, however, the table is only as good as a random code, and these stretches are exactly where it lists a lower bound but no explicit code. For 70 of the new codes, the table’s best entry at the same nn and dd has no construction, and each of these 70 entries lies within one logical qubit below the random-code level (−1<X<0-1 < X < 0), as an existence bound of Gilbert–Varshamov type would. The new codes gain 8.2 logical qubits there on average, against 3.5 where the table has an explicit code. For example, the d=11d = 11 codes every four qubits from n=208n = 208 to 252 beat the table by 5 to 9 logical qubits at every length from 208 to 254, leaving the predictor at most three more there; at n=255n = 255 a BCH code takes over.

Predictions. Applying the predictor to every n≤256n \leq256 and 5≤d≤135 \leq d \leq13 gives 619 pairs (n,d)(n,d) where it expects a code better than both the table and the present codes. For 378 of them the expected gain is one to three logical qubits, spread over all distances. For 192 it is six to nine, almost all at d=12d = 12 (n≈178n \approx178–252) and d=13d = 13 (n≈138n \approx138–253), in stretches where 178 of these 192 table entries have no explicit code. Certifying one such code requires enumerating 5×10115 \times10^{11} to 2.5×10142.5 \times10^{14} Pauli operators, up to six times the largest run reported here. The predicted line is drawn in Figure 1, and the full list is in the repository.

ddcodesnn+1+2largest gain in kk
59134–25190+3: [[245,220,5]][[245, 220, 5]] (217)
6353–25230+4: [[252,220,6]][[252, 220, 6]] (216)
71362–252130+6: [[252,213,7]][[252, 213, 7]] (207)
814135–250140+4: [[215,170,8]][[215, 170, 8]] (166)
97397–251730+9: [[180,131,9]][[180, 131, 9]] (122)
102874–2541315+9: [[213,156,10]][[213, 156, 10]] (147)
113160–2521813+9: [[212,149,11]][[212, 149, 11]] (140)
121297–188111+8: [[104,46,12]][[104, 46, 12]] (38)
13978–12472+8: [[112,48,13]][[112, 48, 13]] (40)
all19253–25416131

Table 1. The new codes by distance dd: number of codes, range of nn, how many exceed the table’s lower bound at their own (n,k)(n,k) by one or by two, and the largest gain in kk at fixed (n,d)(n,d) (table value in parentheses).

Results

Table I summarizes the codes by distance. At its own (n,k)(n,k), each code exceeds the table’s lower bound, 161 by one and 31 by two. At fixed (n,d)(n,d) the gain in kk ranges from 1 to 9, and 66 codes gain at least 8. Examples are [[180,131,9]][[180, 131, 9]], [[212,149,11]][[212, 149, 11]], [[172,106,12]][[172, 106, 12]], [[188,121,12]][[188, 121, 12]], [[124,58,13]][[124, 58, 13]] and [[112,48,13]][[112, 48, 13]], where the table has k=122k = 122, 140, 98, 113, 51 and 40 at the same nn and dd.

The propagation rules [[n,k,d]]→[[n+1,k,d]][[n,k,d]] \to[[n+1,k,d]] and [[n,k,d]]→[[n,k−1,d]][[n,k,d]] \to[[n,k-1,d]] [3] carry each code to longer lengths and smaller dimensions. Together they raise 1,873 table entries with k≥1k \geq1, 1,748 by one and 125 by two; 485 of these entries had no explicit code. The comparison uses the table as read on 4 November 2026.

Distance certification

Upper bound. For every code the repository lists a logical operator of weight exactly dd, found by a random-window search. Checking it takes a few lines of linear algebra: it commutes with every generator and is not in the stabilizer group.

Lower bound. Let b=⌊(D−1)/2⌋b = \lfloor(D-1)/2\rfloor and a=D−1−ba = D-1-b. Every Pauli operator PP of weight at most D−1D-1 splits as P=ABP = AB with disjoint supports, wt⁡(B)≤b\operatorname{wt}(B) \leq b and wt⁡(A)≤a\operatorname{wt}(A) \leq a. If P∈N(S)P \in N(S) then AA and BB have the same syndrome. It therefore suffices to enumerate all Pauli operators of weight at most bb, together with all of weight exactly aa when a=b+1a = b+1, find every pair with equal syndromes, and check each product exactly: it is either a stabilizer, which is harmless, or a nontrivial logical operator, which refutes d≥Dd \geq D. The number of syndrome evaluations is

∑w=0b(nw)3w+[a>b](na)3a,(11)\sum_{w=0}^{b} \binom{n}{w} 3^{w} + [a > b]\binom{n}{a} 3^{a}, \tag*{(11)}

up to 4.2×10134.2 \times10^{13} for [[188,121,12]][[188, 121, 12]]. Every run records how many Pauli operators it visited, and in every complete run that count equals this closed form.

Implementations. The two certifiers written during the search certified 190 of the codes on Aurora. A second, independent certifier, written afterwards with an AI assistant but sharing no code with the search, was tested against brute-force distances and certified 32 codes on a laptop, including the remaining two. Every code thus has at least one complete certificate, and 30 have certificates from two independent implementations. Re-checking the codes with d≥10d \ge10 with the independent certifier needs a cluster.

Outlook

Exhaustive certification is what limits this approach. Its running time grows like nd/2n^{d/2}, and so does its memory: the half of the enumeration that must be stored has ∑w<b(nw)3w\sum_{w<b}\binom{n}{w}3^w entries, 3.3×10123.3 \times10^{12} for [[124,58,13]][[124,58,13]], or about 26 TB at 8 bytes per entry, which must be spread over many nodes or processed in passes. At n≈250n \approx250 and d≈13d \approx13 it already needs a supercomputer. Codes built as tensor networks with small cuts avoid this. Their weight enumerators, and hence their distances, can be computed by contracting the network, at a cost exponential in the cut size rather than in nn [6]. Random encoders have no small cuts. A family of encoders that is random within blocks but joined through small cuts might keep most of the excess of random codes while allowing efficient distance computation, and could reach greater lengths. Quantum-LEGO constructions [7] did not contribute to the findings here but are a natural framework for such a search.

Role of AI agents

AI agents did most of the work under my direction: they retrieved and parsed the code tables and the literature (including the table codes used as starting points for the two punctured codes), wrote the search programs and the original certifiers, managed the runs on Aurora (splitting searches and certifications into batches, submitting the jobs, and collecting and reassembling the results), and produced the figures. I chose which constructions to pursue, allocated the compute, and decided what to verify and how. This note was drafted with an AI assistant and then edited and checked by me. Every code is given explicitly, its distance upper bound is a short linear-algebra check, and its lower bound has a complete certificate whose size matches the closed form.

Other approaches. The following alternatives were also tried; none did better than random parents. These are results about the implementations and parameters tried, not general no-go statements.

  • Structured parents. Quasi-cyclic and translation-invariant encoder circuits instead of random ones. At the parameters tested they had as many low-weight logical classes as random parents.

  • Codes assembled from small pieces. Tensor networks of random few-qubit codes, and concatenation trees. They were useful as controls but did not reach the table.

  • Block expansion. Parents built from [[4,2,2]][[4,2,2]] code blocks. At n=32n = 32 they had about five times more low-weight logical classes than random parents, and none of four led to a certified code, against four of four for random parents.

  • Editing published codes. Removing generators from a table code and adding others. Removing generators exposed logical operators of weight one or two.

Data availability

The public repository [8] contains, for every code, the stabilizer matrix in [X∣Z][X|Z] form, a logical operator of weight dd, and the records of its lower-bound runs: which certifier ran, how many Pauli operators it enumerated (compared with Eq. (11)) and the result. It also contains the comparison with the table, the predictions of Sec. III, and two checking programs: a short pure-Python script that checks each code and its weight-dd logical operator, and the independent lower-bound certifier with its tests. The project initially aimed to design codes as quantum-LEGO tensor networks [7], and the random encoders were generated in that framework, so the repository also gives, for each code, the tensor-network recipe from which it can be rebuilt. The stabilizer matrices alone are enough to use and check the codes.

Acknowledgments

I thank ChunJun Cao for supervision and discussions, and Argonne National Laboratory for hosting the Genesis hackathon. This work utilized resources made available by the U.S. Department of Energy’s Genesis Mission.

References

  1. [1]M. Grassl, Bounds on the minimum distance of linear codes and quantum codes, http://www.codetables.de, accessed 4 November 2026.
  2. [2]D. Gottesman, Stabilizer codes and quantum error correction, Ph.D. thesis, California Institute of Technology (1997), arXiv:quant-ph/9705052.DOI
  3. [3]A. R. Calderbank, E. M. Rains, P. W. Shor, and N. J. A. Sloane, Quantum error correction via codes over GF(4), IEEE Trans. Inf. Theory 44, 1369 (1998).
  4. [4]A. Ekert and C. Macchiavello, Quantum error correction for communication, Phys. Rev. Lett. 77, 2585 (1996).pubmed.ncbi.nlm.nih.gov/10061991
  5. [5]F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes (North-Holland, Amsterdam, 1977).
  6. [6]C. Cao, M. J. Gullans, B. Lackey, and Z. Wang, Quantum Lego expansion pack: Enumerators from tensor networks, PRX Quantum 5, 030313 (2024).arxiv.org/abs/2308.05152
  7. [7]C. Cao and B. Lackey, Quantum Lego: Building quantum error correction codes from tensor networks, PRX Quan- tum 3, 020332 (2022).
  8. [8]M. Girard, qubit-stabilizer-codes-2026, GitHub repository (2026), https://github.com/MarinAndreGirard/qubit-stabilizer-codes-2026.

Paper details

vlnc:W_77shuwxn
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Physics and Astronomy

AI agents · View statement →

Looking for related papers…
Contents