This page fixes the convention used by constructor.py and pays the commutation argument in full. The purpose is not just to remember the formula \(H_X=[A|B]\), \(H_Z=[B^T|A^T]\), but to see why that particular formula is the natural one.
Let \(e_{i,j}\) be the standard basis vector at \((i,j)\in\mathbb Z_l\times\mathbb Z_m\). The constructor's cyclic matrix \(S_l\) has a one in row \(i\), column \(i+1\), with indices modulo \(l\). With the flattened index \(im+j\), define
The first operator changes only the \(i\) coordinate; the second changes only the \(j\) coordinate. Therefore
These matrices give the regular representation of
In characteristic two, \(x^l-1=x^l+1\), so the plus-sign convention used in some papers describes the same quotient.
Every monomial \(x^a y^b\) is a permutation matrix. Its transpose is its inverse:
with negative exponents reduced modulo \(l,m\). This is why transposition has a geometric meaning: it reverses a torus translation.
For a binary polynomial
each row contains one entry contributed by each distinct monomial. If the reduced exponent pairs in \(T_A\) are distinct, every row and every column has weight \(|T_A|\). Repeated terms cancel over \(\mathbb F_2\); the constructor therefore reduces exponent pairs modulo the two cyclic orders before applying XOR.
The gross inputs are
on \(l=12,m=6\). Both matrices have row and column weight three. No geometric plaquette was separately specified: the check graph is the incidence graph of these translations.
Place two qubits at each torus site. The first \(lm\) columns form the left data block and the second \(lm\) columns the right block. Define
A CSS Z-check matrix must obey \(H_XH_Z^T=0\). Choose
Then
The third line uses \(AB=BA\), which follows from the abelian torus algebra. The last line uses characteristic two.
Both the transpose and the swap have jobs. Transpose reverses the Z-side incidence so that it is the dual map. The swap routes the overlap through \(AB+BA\). If the candidate were instead \([A^T|B^T]\), its product with \(H_X\) would be \(A^2+B^2\), which is not constrained to vanish.
The same calculation is the boundary-of-a-boundary identity in
Here
In the binary CSS convention, \(\partial_1=H_X\) and \(\partial_2^T=H_Z\). An X-type Pauli that commutes with every Z check is a cycle; multiplying by an X stabilizer adds a boundary. The nontrivial X-logical classes are therefore a quotient of cycles by boundaries. The Z-logical classes are the dual quotient.
This is the exact place where the homological language earns its keep: “commutes with the checks” and “is a stabilizer” are different subspaces, and logical information is the gap between them. The general binary dictionary is in CSS chain complexes.
Set \(l=m=L\) and choose
Each polynomial has two terms, so each check has weight four. The resulting complex is the periodic square-lattice toric complex in the BB column convention: two qubits per unit cell, one X check and one Z check per cell.
For the shipped \(L=3\) instance, the constructor produces two \(9\times18\) check matrices. Both have rank eight, leaving
The Atlas exact CSS enumerator finds distance three. This [[18,2,3]] anchor tests the shift orientation, swapped transpose, ranks, and exact-distance path on a small instance.
It does not prove that an arbitrary BB block is locally Clifford equivalent to independent toric codes. sahay2026matching uses a symmetry reduction to obtain toric-like cylinders for decoding, while chen2025anyon finds topological frustration in more general BB data. Those statements concern different equivalences.
pedagogy/reproduce.py independently reconstructs \(x,y,A,B\), then checks:
The card's construction-replay tree now binds the two exponent lists into versioned bivariate_polynomial@1 factors and assembles them with bivariate_bicycle@1. The verifier compares the complete output arrays, not only ranks or row spaces, so this page's block and translation conventions are part of the machine witness rather than an equivalence-only assertion.
The polynomial and syndrome-circuit presentation follows bravyi2024bicycle; the group-algebra placement follows wang2023abelian and lin2023twoblock. Every displayed matrix identity for the shipped instances is rerun locally. The general topological caveat is literature-sourced to chen2025anyon and sahay2026matching.