Computing Library › Quantum Error Correction
Quantum Error Correction

Tanner Graphs for Quantum Codes

A Tanner graph draws qubits and checks as two sets of nodes joined by edges, the picture that both defines LDPC codes and drives message-passing decoders.

Qubits and checks as a bipartite graph

A Tanner graph has two kinds of nodes: variable nodes for the qubits and check nodes for the stabilizers. An edge connects a qubit to a check whenever that stabilizer acts nontrivially on that qubit. For a quantum CSS code there are two Tanner graphs, one for the X checks and one for the Z checks, or a combined graph with typed edges.

Sparsity made visual

Kronos motion — error correction

The LDPC condition is simply that both node degrees are bounded: each check touches few qubits and each qubit touches few checks. Low degree keeps the graph sparse no matter how large the code grows, which is what keeps syndrome-extraction circuits shallow.

The Tanner graph is also the data structure a decoder runs on. Belief propagation passes probability messages along the edges, each check node combining incoming beliefs and each variable node updating its estimate. The graph's girth, the length of its shortest cycle, controls how well this converges, which is why designers avoid short cycles.

For quantum codes the two check types create an obstacle: the X and Z Tanner graphs share qubits, so decoding one can spoil the other, and degeneracy creates many equivalent solutions. This is why plain belief propagation often needs an extra ordered-statistics or matching post-step for quantum LDPC codes, unlike the classical case where it works directly.