← All papers
First page of Toric codes all the way down: decoupling translation-invariant topological CSS codes in higher dimensions

Toric codes all the way down: decoupling translation-invariant topological CSS codes in higher dimensions

Mingxin He, Yifei Wang, Hao Song, Yingfei Gu

quant-ph Oct 29, 2026 · v1 cond-mat.str-el
Main theorem, propositions, corollaries, lemmas and Algorithm 1 correctness are formalized in Lean 4 with Mathlib; Algorithm 2 is implemented in Lean.
Topological Calderbank-Shor-Steane (CSS) codes in more than two spatial dimensions offer features useful for fault-tolerant quantum computation, such as transversal non-Clifford gates and single-shot decoding, but a systematic understanding of them is still lacking. One approach is to decouple a code: map it to a stack of higher-form toric codes by a finite-depth local CSS-preserving Clifford circuit, possibly after adding ancillas. For translation-invariant $p$-ary CSS codes, where $p$ is prime ($p=2$ for qubits), we require the circuit to commute with the translations of a superlattice. In two dimensions, such a decoupling exists once these translations act trivially on every anyon type. In higher dimensions, excitations are sorted by their dimension into superselection layers, which can remain glued together even when translations act trivially on each layer. We show that this gluing is the only remaining obstruction: a code can be decoupled on a superlattice exactly when, after coarse-graining to it, translations act trivially on every layer and the gluing vanishes. Moreover, for a code with finitely many excitation types in each layer and $m$ nonzero layers, once translations act trivially on every layer, further coarse-graining by a factor of $p^{m-1}$ in every direction removes the aforementioned gluing. Physically, the same criterion determines when the code encodes the maximal number of logical qudits on a finite torus. Finally, we give an explicit algorithm that constructs the decoupling as a circuit of SUM (qudit CNOT) and SWAP gates.

Topological CSS codes in three or more dimensions offer transversal non-Clifford gates and single-shot decoding, but it is unclear when such a code is locally equivalent (decouplable) to a stack of higher-form toric codes. Making translations act trivially on excitations is not enough in higher dimensions, because the superselection layers can remain glued together.

Translation-invariant p-ary CSS codes are encoded as modules over a Laurent polynomial ring. Excitations are organized into a superselection profile in the derived category, with inter-layer gluing given by connecting morphisms (Ext classes). Coarse-graining is shown to kill positive-degree Ext classes layer by layer. Explicit algorithms build the decoupling as a circuit of SUM and SWAP gates, and the results are formalized in Lean 4 with Mathlib.

A code decouples on a superlattice exactly when translations act trivially on every layer and the gluing vanishes. With m nonzero layers, an additional coarse-graining by p^{m-1} in every direction removes the gluing. The same criterion characterizes when the code encodes the maximal number of logical qudits on a torus. The Lean development proves the main theorem, the supporting lemmas, the correctness of Algorithm 1, and the glued-code example.