The surface code is the reference point of this course. Its checks are small and local, its threshold is high, and it has been demonstrated below threshold in hardware (Module 11). Its weakness is overhead. Each surface-code patch stores a single logical qubit, and protecting it at distance costs about physical qubits. A machine with a thousand logical qubits at would need over a million physical qubits.

Quantum low-density parity-check (qLDPC) codes keep the property that makes the surface code practical, small checks, but drop the requirement that checks be geometrically local. In return they can store many logical qubits in one block at the same distance. This module covers the basic ideas: why locality limits you, how to build qLDPC codes from classical ones (the hypergraph product), the bivariate bicycle codes that IBM has proposed for hardware, and what decoding and hardware challenges remain.

Learning goals. After this module you should be able to

  • define a qLDPC code family and distinguish low-density from geometrically local;
  • explain the surface code’s trade-off and state the Bravyi-Poulin-Terhal bound;
  • build the hypergraph product of two classical codes, prove that its checks commute, and compute its parameters, including recovering the toric and planar codes;
  • write down a bivariate bicycle code, prove its checks commute, and compute from a rank;
  • describe what “asymptotically good” means and why it matters for overhead;
  • explain why matching does not apply and BP+OSD is the default decoder, and why qLDPC codes need long-range connectivity.

1. Counting the cost of the surface code

Recall the parameters from Module 7 and Module 8: the toric code is , the planar code is , and the rotated code is . In all three, the quantity

is a constant ( for the rotated and toric codes). Fix , and the only way to store more logical qubits is to add more patches, so grows linearly in with slope . The encoding rate goes to zero as grows.

Classical coding theory suggests you should be able to do far better. Good classical LDPC codes have constant rate and distance linear in , with checks of bounded size. The question of this module is how much of that carries over to quantum codes.

2. What “LDPC” means

Definition 12.1 (Quantum LDPC code family).

A family of stabilizer codes , usually CSS with check matrices , , is low-density parity-check (LDPC) if there are constants and , independent of , such that

  • every check (row of or ) acts on at most qubits, and
  • every qubit is acted on by at most checks.

Equivalently, the Tanner graph has bounded degree.

Bounded check weight matters physically. A weight- check needs about two-qubit gates to measure, and each gate can spread errors (Module 8, hook errors). Large checks make circuits deep and fault tolerance hard. Bounded qubit degree keeps the number of gates per qubit per round bounded.

The surface code is LDPC: checks have weight at most 4, and each qubit is in at most 2 X-checks and 2 Z-checks. It is also geometrically local: you can place the qubits in the plane so that every check involves only nearby qubits. These are different properties. Every geometrically local code family with bounded check size is LDPC, but most LDPC codes cannot be laid out locally in 2D. As we will see, that is the whole point.

3. Locality limits you

For codes whose checks are local in two dimensions, there are hard limits.

Theorem 12.1 (Bravyi-Poulin-Terhal bound).

Let a family of stabilizer codes on qubits arranged in a 2D lattice have stabilizer generators that are each supported in a region of bounded diameter. Then

where the constant depends only on the locality range. In addition, (Bravyi and Terhal 2009).

(Bravyi, Poulin, Terhal, PRL 104, 050503 (2010), arXiv:0909.5200. The bound is stated there for commuting-projector codes in 2D.)

The surface code saturates both bounds. It has , and its is constant. Within 2D-local codes it is, up to constants, as good as it gets. To beat it, a code must have long-range checks. Baspin and Krishna (arXiv:2109.10982) quantified how much non-locality, in the form of long-range interactions, is necessary to beat these bounds by a given amount.

Here is for codes in this module, computed from their parameters:

code
rotated surface code, 25150.0401.0
toric code, 2882120.0071.0
hypergraph product of Hamming codes (§4)581630.2762.5
gross code (§5)14412120.08312.0
bivariate bicycle 28812180.04213.5

4. The hypergraph product

How do you build a quantum LDPC code? The CSS condition (Module 4) is the obstacle. Two random sparse matrices almost never satisfy it. Tillich and Zémor (arXiv:0903.0566) found a general recipe that turns any two classical codes into a quantum one.

Let be an parity-check matrix of a classical code with parameters , and similarly () for . The transpose code has parameters . If we set .

Definition 12.2 (Hypergraph product code).

The hypergraph product is the CSS code on qubits with

The first block of columns indexes “bit-bit” qubits . The second indexes “check-check” qubits . X-checks are labeled by pairs (check of , bit of ), and Z-checks by pairs (bit of , check of ).

bits of C2 (n2) checks of C2 (r2) bits of C1 (n1) checks of C1 (r1) qubits n1 x n2 Z checks n1 x r2 X checks r1 x n2 qubits r1 x r2 H2 H2^T H1 H1^T each check touches its two neighboring qubit blocks
Proposition 12.1 (The checks commute).

over .

The trick is that the two terms are forced to be equal, whatever and are. This is the same structure as for the toric code. In fact, the hypergraph product is the tensor product of two chain complexes.

Theorem 12.2 (Hypergraph product parameters (Tillich and Zémor)).

has parameters

If each has row weight at most and column weight at most , every check of the product has weight at most and every qubit is in at most checks. So LDPC inputs give an LDPC output.

The proof of uses the Künneth formula for the homology of a tensor product of chain complexes. We do not reproduce it, but you can test it. Our scripts confirm on random small seeds and on every example below. Note the second term: forgetting is a common slip.

Example 12.1 (The toric and planar codes are hypergraph products).
  • Toric code. Take the cyclic repetition check, with rows . Then , (the all-ones vector spans both kernels), and . The product is . Bit-bit and check-check qubits are the horizontal and vertical edges. Our scripts find and for , with the distance found by brute force.
  • Planar code. Take the open-chain repetition check. Now , , but has full column rank, so and . The product is : for and for , exactly the unrotated planar codes of Module 8.
Example 12.2 (Product of two Hamming codes).

Take the Hamming check

This is the matrix of Module 4 with its columns reordered into systematic form: column here is column of for . Permuting columns relabels bits, so it is the same code, but the qubit numbering of the product differs from what the Module 4 matrix would give. has rank 3, so () has trivial kernel: . The product has and . Brute force over all X and Z operators of weight at most 2 finds no logical operator, while weight 3 does, so . The result is . The checks have weights 5, 6 or 7: row weight 4 of plus a column weight between 1 and 3. Storing 16 logical qubits at distance 3 in rotated surface codes would take data qubits.

The square-root barrier

Feed the hypergraph product two good classical LDPC codes, with and . You get , (constant rate) and . That is a big improvement in rate over the surface code. The distance, however, is still stuck at . For many years no qLDPC family was known to beat by more than a polylogarithmic factor. Breaking this barrier took new ideas (§6).

5. Bivariate bicycle codes and the gross code

Hypergraph products are a general recipe. For hardware, one wants codes that are compact, highly symmetric and have good performance at small sizes. Bravyi, Cross, Gambetta, Maslov, Rall and Yoder (Nature 627, 778 (2024), arXiv:2308.07915) found such codes in the bivariate bicycle (BB) family.

Let be the cyclic shift matrix. Define commuting matrices

Think of qubits as sitting on an torus. Then shifts one step in one direction and one step in the other.

Definition 12.3 (Bivariate bicycle code).

Choose and , where each is a power of or of . The BB code has qubits, split into a “left” and a “right” block of each, and check matrices

Proposition 12.2 (BB checks commute; dimension formula).

, and the number of logical qubits is .

Every row of and of has exactly three ones, so every check has weight 6. Every qubit lies in 3 X-checks and 3 Z-checks. The flagship example:

Example 12.3 (The gross code).

Take , , and . Building the matrix explicitly, we find , so . This agrees with . The distance is computed in the paper. “Gross” means a dozen dozen, . Counting one ancilla per check, the memory uses physical qubits for logical qubits, a net rate of .

The same recipe gives a whole table. We recomputed and for each entry and took from Bravyi et al.:

code
6, 6
15, 3
9, 6
12, 6
12, 12

Where do the checks reach? With shifting the first torus coordinate and the second, the X-check at position touches left-block qubits at , , and right-block qubits at , , . Most of these are short hops on the torus. The terms and are longer jumps. This is the code’s non-locality, and by Theorem 12.1 it is unavoidable for a code with . Bravyi et al. show the Tanner graph has thickness 2: its edges split into two planar layers. Each layer could be implemented as one layer of couplers on a chip, though the couplers in each layer are still long.

x^3 y^3 check squares: left block diamonds: right block a = 0..11 to the right, b = 0..5 downward, periodic in both

Performance. Bravyi et al. simulated circuit-level noise. A syndrome cycle uses one ancilla per check and seven layers of CNOT gates along Tanner-graph edges, and decoding used BP-OSD. They report a threshold of about , comparable to the surface code. At a physical error rate of , the gross code preserves 12 logical qubits for nearly a million syndrome cycles using 288 physical qubits. They estimate the surface code would need nearly 3000 physical qubits for the same task, more than a tenfold saving.

gross code surface code 288 qubits nearly 3000 qubits 12 logical qubits, p = 0.1%, about 1e6 cycles

6. Asymptotically good qLDPC codes

Definition 12.4 (Good code family).

A code family is asymptotically good if and : constant rate and linear distance.

For a decade after the hypergraph product, the best known qLDPC distance was up to polylogarithmic factors. Then progress came quickly. Fiber bundle codes (Hastings, Haah and O’Donnell, arXiv:2009.03921) broke the barrier with . Lifted and balanced products followed (Panteleev and Kalachev; Breuckmann and Eberhardt). Finally Panteleev and Kalachev (arXiv:2111.03654, STOC 2022) constructed asymptotically good qLDPC codes, from a lifted product over a non-abelian group. In the same work they constructed good classical locally testable codes. Leverrier and Zémor’s quantum Tanner codes (arXiv:2202.13641) gave a related construction.

Why it matters: Gottesman (arXiv:1310.2984) showed that qLDPC codes with constant rate, together with good enough decoders, allow fault-tolerant computation with constant space overhead, that is, a constant number of physical qubits per logical qubit, no matter how long the computation. Good codes are the asymptotic end point of this program. The codes that matter for the next few years of hardware are small, structured ones like the BB family.

7. Decoding qLDPC codes

The decoders of Module 10 do not carry over directly.

  • Matching needs graphlike errors. In a BB code each qubit is in 3 X-checks, so a single Z error flips 3 detectors: a hyperedge. MWPM does not apply.
  • BP alone is not enough. Short cycles and degeneracy hurt BP on qLDPC codes as they do on the toric code (Module 11), although the effect is milder for codes with fewer short loops.
  • BP+OSD is the default. It works for any sparse , and it is what Bravyi et al. used for the gross code (on a circuit-level error model, with X and Z decoded separately).
Example 12.4 (BP versus BP+OSD on a small BB code).

Independent X errors with probability on each of the 72 qubits, decoded from the Z-checks with the ldpc package (3000 shots per point). A run counts as a failure if the residual error anticommutes with any of the 12 independent Z-logicals:

BP alone (non-converged)BP+OSD-CS, order 7
0.020.012 (0.005)0.010
0.040.099 (0.037)0.089
0.060.277 (0.139)0.251

OSD removes every non-converged failure, since its output always satisfies the syndrome (Proposition 11.1). The improvement here is smaller than on the toric code, where BP alone failed in about half the runs at .

The open problem is speed. Gaussian elimination is cubic, and qLDPC codes are decoded jointly over many rounds with a circuit-level model, so the matrices are large. A memory needs a decoder that keeps up with a microsecond-scale cycle (Remark 10.1). Faster BP variants and cheaper post-processors are an active research area.

8. What the hardware needs

By Theorem 12.1, a code that beats the surface code’s cannot be laid out with only nearest-neighbor couplings in 2D. Some options under study:

  • Superconducting qubits with long-range couplers. The thickness-2 structure of BB codes suggests two layers of planar wiring, with some couplers spanning several sites. Engineering long, low-crosstalk couplers is the main hardware challenge.
  • Neutral atoms. Atoms can be physically moved between gate layers, so the “connectivity” is reconfigurable. Xu et al. (Nature Physics 20, 1084 (2024), arXiv:2308.08648) proposed qLDPC memories with constant overhead on reconfigurable atom arrays.
  • Trapped ions. Ions in a single chain, or shuttled between zones, can interact all-to-all, at the cost of slower gates.

Two further challenges are often underestimated. Logical gates on qLDPC codes are harder than on surface codes. Because many logical qubits share one block, addressing one of them needs extra machinery, such as ancilla systems for lattice-surgery-like measurements or code automorphisms. And the decoder must be fast. A plausible near-term architecture uses qLDPC blocks as dense memory next to surface-code or other processors that do the computing.

Summary

  • qLDPC means bounded check weight and bounded qubit degree (Definition 12.1), which is not the same as geometric locality.
  • Codes that are local in 2D obey and (Theorem 12.1). The surface code saturates these bounds, so beating it requires long-range checks.
  • The hypergraph product (Definition 12.2) turns two classical codes into a quantum code whose checks commute for structural reasons (Proposition 12.1). It has parameters (Theorem 12.2). It reproduces the toric and planar codes (Example 12.1) and gives constant-rate codes like (Example 12.2), but its distance is stuck at .
  • Bivariate bicycle codes (Definition 12.3) have weight-6 checks, commute because , and have (Proposition 12.2). The gross code (Example 12.3) stores 12 logical qubits in 288 physical qubits, with a threshold near .
  • Asymptotically good qLDPC codes now exist (Definition 12.4), opening the way to constant-overhead fault tolerance.
  • Decoding uses BP+OSD (Example 12.4), and its speed is an open problem. The hardware needs long-range connectivity.

Practice in Homework 12.

Further reading

  • N. P. Breuckmann, J. N. Eberhardt, “Quantum low-density parity-check codes”, PRX Quantum 2, 040101 (2021), arXiv:2103.06309. A readable perspective covering all of this module.
  • S. Bravyi, D. Poulin, B. Terhal, “Tradeoffs for reliable quantum information storage in 2D systems”, PRL 104, 050503 (2010), arXiv:0909.5200; S. Bravyi, B. Terhal, NJP 11, 043029 (2009), arXiv:0810.1983.
  • J.-P. Tillich, G. Zémor, “Quantum LDPC codes with positive rate and minimum distance proportional to the square root of the blocklength”, IEEE TIT 60, 1193 (2014), arXiv:0903.0566.
  • S. Bravyi, A. W. Cross, J. M. Gambetta, D. Maslov, P. Rall, T. J. Yoder, “High-threshold and low-overhead fault-tolerant quantum memory”, Nature 627, 778 (2024), arXiv:2308.07915.
  • P. Panteleev, G. Kalachev, “Asymptotically good quantum and locally testable classical LDPC codes”, STOC 2022, arXiv:2111.03654.
  • A. Leverrier, G. Zémor, “Quantum Tanner codes”, FOCS 2022, arXiv:2202.13641.
  • M. B. Hastings, J. Haah, R. O’Donnell, “Fiber bundle codes”, STOC 2021, arXiv:2009.03921.
  • D. Gottesman, “Fault-tolerant quantum computation with constant overhead”, QIC 14, 1338 (2014), arXiv:1310.2984.
  • N. Baspin, A. Krishna, “Quantifying nonlocality: how outperforming local quantum codes is expensive”, PRL 129, 050505 (2022), arXiv:2109.10982.
  • Q. Xu et al., “Constant-overhead fault-tolerant quantum computation with reconfigurable atom arrays”, Nature Physics 20, 1084 (2024), arXiv:2308.08648.
  • J. Roffe et al., arXiv:2005.07016 (BP+OSD for qLDPC codes), and the Error Correction Zoo pages on hypergraph product and qLDPC codes (errorcorrectionzoo.org).