Each entry of the block arrays for HX and HZ is a permutation of P positions. Its map is u ↦ au + b mod P. Affine permutation matrices (APMs) can vary both the slope a and the shift b. Circulant permutation matrices (CPMs) have slope 1.
Keep the column pairs. For each pair of X and Z block rows, pair the columns so the two relative maps in each pair agree. Their contributions cancel over the binary field, which makes the checks commute.
Extract integer parameters. Solve the pairing constraints at the original size and check that the fixed parameters reproduce the original block arrays.
Evaluate the rule at a new size. Recompute the modular block maps with the same data. Each block remains a permutation, preserving the column and check weights. Verify the resulting distance separately.
Why the extension preserves commuting checks
Look at one block column shared by X block row i and Z block row j. A qubit at local position u connects to X check x = aXu + bX and Z check z = aZu + bZ, with all arithmetic modulo P. The slope is a unit, so eliminating u gives the relative map from X checks to Z checks.
z ≡ ρx + τ (mod P) ρ ≡ aZaX−1, τ ≡ bZ − ρbX
For each row pair (i, j), the partition pairs block columns with identical (ρ, τ). Each paired column contributes the same permutation matrix to the corresponding block of HZHXT. Over the binary field the two copies add to zero. Summing over all pairs gives HZHXT = 0, the CSS commutation condition.
Worked pair. In the original APM code at P = 192, columns 3 and 5 of the first X block row use shifts 169 and 170 with slope 97. The first Z block row uses shifts 78 and 175 with slope 1. Since 97 is its own inverse modulo 192, both columns have ρ = 97. Their relative shifts are 78 − 97 × 169 and 175 − 97 × 170, both congruent to 5. The extension keeps columns 3 and 5 paired. At P = 384 both give ρ = 289 and τ = 293.
How the seed determines the new slopes and shifts
Fix the column pairs. Equal relative slopes impose multiplicative equations on the slopes. The general algorithm uses Smith normal form to express them in independent unit coordinates and records how to choose those coordinates at the next modulus. With the slopes chosen, equal relative shifts give linear congruences BPb ≡ 0. A Smith form supplies a solution matrix G(P). Extract integer coordinates θ that reproduce the seed shifts, using the same basis convention at each size.
b0 ≡ G(P0)θ (mod P0) b(P) ≡ G(P)θ (mod P)
APM example. The fixed integer slope array S gives a = 1 + DS. Since D² ≡ 0 modulo P, the inverse is 1 − DS and the relative slope is 1 + D(SZ − SX). Paired columns have the same difference. At P = 192 and 384 the example uses D = 96. It recomputes G(P) and reuses the same 48 shift coordinates.
CPM example. Every slope is 1, so pairing only requires the differences bZ − bX to agree. For the normalized check-weight-10 seed the paper gives a fixed three-column integer basis G and θ = (1, 4, 15)T. Reducing the same integer shifts modulo 37 and 127 gives the two bitmaps below.
What determines the distance after extension?
Each block is a permutation, with one 1 per row and column. A J × L array therefore gives length n = LP, column weight J and check weight L at either size. The dimension follows from the binary ranks of the two check matrices.
The X distance is the smallest weight in ker(HZ) outside the row space of HX. Exchanging X and Z defines the Z distance. The code distance is the smaller of the two. Changing the modulus changes which supports satisfy the check equations. For the APM extension the paper excludes all nontrivial logical operators below weight 32 and verifies a weight-32 witness, establishing d = 32.
Hover, tap, or focus an item to highlight its counterpart and see how they are related.
Affine permutation matrices APM–PP
Parity-check bitmaps
Dark marks locate 1s. Hover to inspect a bit. Click, tap, or press Enter to zoom into its block, then again for 32 × 32 cells. Use View to zoom out. In the cell view each square is one bit. Arrow keys move one bit at a time. Indices start at zero. The APM display groups columns by block. The readout also gives the released qubit index.
For the first X and Z block rows, the map from an X check position to a Z check position is the same for both columns. Columns 3 and 5 (zero-based) both give 97u + 5 mod 192 in the original code. In the extension, both give 289u + 293 mod 384. The two terms still cancel within the pair.
Fixed data, recomputed blocks
Keep the integer slope data S and the shift coordinates θ. Compute slopes as a(P) = 1 + DS mod P. Rebuild the shift basis G(P) from the pairing constraints at that size, then compute b(P) = G(P)θ mod P. The first two sizes use the same D under the fixed rule.
More positions per block, same check weights
Eight block columns give n = 8P. Each column meets one check in each of the three block rows, and each check has one entry from each block column. The weights stay 3 and 8 in each of the X and Z matrices.
Distance increases from 26 to 32
Exhaustive exclusion of smaller nontrivial logical operators and a matching logical witness establish the exact distance of each code.
Circulant permutation matrices CPM–PP
Parity-check bitmaps
Dark marks locate 1s. Hover to inspect a bit. Click, tap, or press Enter to zoom into its block, then again for 32 × 32 cells. Use View to zoom out. In the cell view each square is one bit. Arrow keys move one bit at a time. Indices start at zero.
For the first X and Z block rows in the normalized construction, columns 2 and 5 (zero-based) both give u + 28 mod 37 originally and u + 65 mod 127 after extension. The slope remains 1 and both terms cancel within the pair.
Same integer shifts, new modulus
The slope is 1 in every block. For this example, the pair-partition equations give a fixed integer basis G with three columns. The normalized coordinates are θ = (1, 4, 15). Reduce the same product Gθ modulo 37 or 127 to get the respective shifts.
More positions per block, same check weights
Ten block columns give n = 10P. The array continues to have four block rows and ten block columns, so each X and Z matrix retains column weight 4 and check weight 10.
From distance 22 to a verified lower bound of 34
The original distance is inherited by permutation equivalence. For the extension, the preprint reports an audited exclusion of nontrivial logical operators of weight below 34. A verified weight-70 logical operator gives the upper bound. See Section 3 of the preprint for the stronger lower bound obtained after the archived data release.
A fixed rule preserves commutation and sparsity. The distance can increase or decrease with size and is verified for each code. See Sections 2–3 and Table 1 of the preprint for the construction and distance evidence.