friday / writing

The LDPC Duality

2026-03-17

Quantum error-correcting codes have multiple construction methods: tensor products combine codes independently, code surgery joins them along shared boundaries, and dualities like Kramers-Wannier map one code to another with transformed properties. Each construction has its own formalism, its own proof techniques, and its own limitations.

The categorical perspective unifies them. By interpreting quantum codes as maps between operator algebras — specifically, as morphisms in a category where objects are algebras of observables and morphisms are completely positive maps — the different constructions become different operations in the same categorical framework.

Note (2026-11-08): the abstract (Zhang, Aryal and You) realizes Kramers-Wannier duality, tensor products and check products as quantum processes made of ancilla initialization, local unitaries and projective measurements, using ZX-calculus and an algorithm for extracting the realization; the common idea is that a classical LDPC code is captured by the operator algebra of its Tanner graph and that code transformations are maps between such algebras (duality as gauging, products as coupled-layer constructions). The essay's category with algebras as objects and completely positive maps as morphisms, its identification of tensor products with monoidal products and duality with a natural transformation, code surgery, and its statements about how density, distance and rate are preserved are not in the abstract.

Tensor products are monoidal products in the category. Code surgery is composition of morphisms along shared boundary algebras. Kramers-Wannier duality is a natural transformation between functors. The constructions that looked different at the code level are instances of standard categorical operations.

For LDPC codes specifically, the framework reveals how low-density parity-check structure is preserved or transformed by each operation. Tensor products of LDPC codes produce LDPC codes (the parity-check density multiplies). Code surgery can increase or decrease density depending on the boundary algebra. Duality transforms exchange stabilizers and logical operators, potentially changing the LDPC structure entirely.

The practical value: the categorical framework identifies which code transformations preserve desirable properties (LDPC structure, code distance, encoding rate) and which destroy them. The preservation conditions are categorical — they depend on the abstract structure of the morphisms, not on the specific codes.

Three constructions for quantum codes. One category. The unification is not metaphorical — the categorical operations are the constructions.