CSS-Type decoding

2026-09-09

One fundamental difference between classical bits and qubits is that qubits can suffer from two independent types of errors: amplitude error and phase errors. These two error types can occur separately or jointly on a given qubit, and a quantum error correction code needs to account for both.

We extend ldpc_dec to handle these two types of error using two codes of matched properties and two decoder instances. We will first review the prerequisites to handle both kinds of errors, and, in a second step, apply the corresponding principles to qLDCP. In other words, we turn our attention now to real quantum error correction.

The first quantum error correction code has been proposed by Peter Shor in 1995. The basic idea behind this code is to use well-known classical codes to construct a scheme that protects qubits against amplitude errors and phase errors. Shor's 1995 proposal is a concatenation of two codes, where each component code is a simple rate-1/3 repetition code. There is a clear task separation between these two code instances: one of them protects only against amplitude errors, and the other one exclusively against phase errors. The concatenation leads to an overall code of rate 1/9: one logical qubit is encoded to nine physical qubits.

A more general approach was published in 1996 by two independent research teams: Robert Calderbank and Peter Shor published the paper "Good quantum error-correcting codes exist" and Andrew Steane published "Multiple Particle Interference and Quantum Error Correction". These efforts lead to the family of quantum error correction codes that we now call CSS codes, after the initials of the three contributing authors. Note that CSS codes contain Peter Shor's 1995 code as a special case.

CSS codes are stabilizer codes. We do not cover the stabilizer formalism in this article, but strongly suggest that you read into this topic. It is, for example, covered in course 4 of IBM's Quantum Information and Computation course series. For a code to be a valid stabilizer code, all stabilizers must commute. Further, for a code to be a CSS code, its stabilizer's group has a generating set containing exclusively only Zs (and 1s) or exclusively only (Xs and 1s). Let's rephrase these requirements such that they become more accessible for our decoder implementation:

  • To be a valid stabilizer code, the commuting condition translates to H_x \cdot H_z^T = 0 (mod 2). This is an orthogonality requirement in classical channel coding and can easily be checked in software.

  • A CSS code can be described by two parity-check matrices, H_x and H_z. H_x corrects only Z-errors (phase errors) and is oblivious to X-errors (amplitude errors). Likewise, H_z corrects only X-errors and is oblivious to Z-errors. The decoding problem is separable.

Further, we call a CSS code qLDPC if the stabilizer generators have bounded weight and each qubit participates in only a bounded number of stabilizers as the codelength grows.

Coming from a classic LDPC / Belief-Propagation background, the separability property makes CSS codes quite attractive. One can run two separate decoders, one for Z-errors and another one for X-errors. However, the commuting condition implies that the parity-check matrices will expose low-girth properties, which will cause strong performance degradation for standard Belief-Propagation decoders. Further decoder refinements will be needed to improve performance.

CSS-type decoding of qLDPC codes is implemented as follows in ldpc_dec.

  • CSS BSC Channel: to keep things simple, we assume X-errors and Z-errors to occur independently of each other and construct a CSS BSC channel from two quantum BSC channels. A quantum BSC channel is a binary symmetric channel which specifies two flipping probabilities: one for qubits flipping the amplitude (or phase), and one which describes errors during syndrome measurement. Note that this simple channel model cannot describe channels like the fully depolarizing channel.
  • Decoders: we run two separate Belief-Propagation decoders to obtains estimates for X-errors and Z-errors, respectively. These decoders report their results separately. When their outputs are combined, we obtain an estimate for X/Z-errors for every encoded qubit. These errors can, for example, be logged in a Pauli frame.
Channel and deocder setup CSS
Channel and decoder setup CSS

This functionality, including the check for the commuting condition, is implemented in ldpc_dec. Note that the selection of the simulation type has changed and is now available as a command-line option. The call for simulation of css-type decoding is:

cargo run -- css