Skip to main content
Create your own
Lesson illustration

Introduction to Classical LDPC Codes

Hello and welcome to the first lesson in our new module on recent advances in quantum error correction.

In the previous module, we concluded with a deep dive into the surface code and its decoding via Minimum-Weight Perfect Matching (MWPM). While the surface code is a leading contender for building fault-tolerant hardware, it has limitations, particularly a low ratio of logical to physical qubits. This has spurred research into more efficient code families.

Today, we'll take a step back and explore the classical origins of one of the most promising of these families: Low-Density Parity-Check (LDPC) codes. Our goal is to define classical LDPC codes and explain the significance of their sparse parity-check matrices for efficient decoding. Understanding these classical foundations is essential, as the principles we discuss today are the direct inspiration for the quantum LDPC codes we will study in the next lesson.

1. Defining Low-Density Parity-Check Codes

You are already familiar with the concept of a parity-check matrix, , from our study of linear and stabilizer codes. A binary linear code is defined as the set of all codewords that satisfy the condition .

A Low-Density Parity-Check (LDPC) code is, simply, a linear code that can be described by a sparse parity-check matrix.

To build a strong intuition for what "sparse" or "low-density" means in this context and why it's a defining feature, please watch the first few minutes of the following lecture.

Low Density Parity Check Codes: definition, properties and introduction to protograph construction

This video from NPTEL-NOC IITM provides a clear and concise definition of LDPC codes, contrasting the number of ones with the total number of entries in the parity-check matrix.

Please watch from 00:48 to 04:12. Focus on how the 'low-density' property is defined in terms of the number of non-zero entries in the parity-check matrix H.

As the video explains, sparsity means that the number of '1's in the parity-check matrix is much smaller than the total number of entries, . Typically, the number of '1's scales linearly with the block length, , rather than quadratically.

The Tanner Graph Representation

A powerful way to visualize the structure of an LDPC code is through its Tanner graph, a bipartite graph that represents the parity-check matrix.

  • There are variable nodes, one for each bit in the codeword.
  • There are check nodes, one for each row (parity-check equation) in .
  • An edge connects variable node to check node if and only if the matrix element is 1.

The sparsity of directly translates to the Tanner graph being sparsely connected. The number of edges is equal to the number of '1's in .

The next segment of the video you just watched provides an excellent explanation of Tanner graphs.

Low Density Parity Check Codes: definition, properties and introduction to protograph construction

Let's continue with the same video to see how a parity-check matrix is translated into a Tanner graph.

Please watch from 04:20 to 08:35. Pay close attention to how columns of H map to variable nodes (circles), rows of H map to check nodes (squares), and the '1's in H map to edges.

An example of a Tanner graph.

Fig. 2 from Nozaki & Isaka (2022) shows a Tanner graph with 7 variable nodes (circles) and 4 check nodes (squares). This corresponds to a 4x7 parity-check matrix.

For a more formal definition, you can refer to the paper "Iterative Decoding of Low-Density Parity Check Codes".

Iterative Decoding of Low-Density Parity Check Codes

This paper by Venkataramanan and Pradhan offers a rigorous introduction to LDPC codes and their factor graph (Tanner graph) representation. This aligns with your preference for original sources.

Please read Section 2.1, 'Linear and LDPC codes' (the first two paragraphs on page 4). This will formalize the definitions we've just covered.

2. The Significance of Sparsity: Enabling Efficient Decoding

Now we come to the crucial question: why is this sparsity so important? The answer lies in how it transforms the decoding problem.

For a general linear code with a dense parity-check matrix, finding the most likely codeword given a noisy received vector (Maximum Likelihood decoding) is an NP-hard problem. It is computationally equivalent to finding the valid codeword with the minimum Hamming distance to the received vector, a task that generally requires an exhaustive search with complexity exponential in the block length.

LDPC codes, however, can be decoded efficiently using iterative message-passing algorithms that operate on the Tanner graph. The sparsity of the graph is what makes these algorithms tractable.

Local Constraints and Message Passing

Think about what each check node in a Tanner graph represents. It corresponds to a single parity-check equation. Because the graph is sparse, this equation involves only a small, constant number of variable nodes (bits). The video segment you watched on Tanner graphs made exactly this point.

This means the global constraint is decomposed into a set of many simple, local constraints. Each check node only "cares" about the small subset of bits it is connected to. The goal of iterative decoding is to find a set of bit values that satisfies all these local constraints simultaneously.

The process works by passing "messages" back and forth along the edges of the Tanner graph:

  1. Variable-to-Check: Each variable node sends a message to its connected check nodes, indicating its current belief about its own value (e.g., based on the received channel value).
  2. Check-to-Variable: Each check node receives messages from its connected variables. Based on these inputs and its own constraint (the parity of its inputs must be even), it sends an updated message back to each variable, essentially advising it on what its value should be to satisfy that local check.

This process repeats, and with each iteration, the beliefs are refined. For a well-designed LDPC code below a certain noise threshold, these beliefs converge to the correct codeword.

A Concrete Example: The Peeling Decoder

To make this tangible, let's consider a simple yet powerful iterative decoder for the Binary Erasure Channel (BEC), where bits are either received correctly or erased. This is known as the peeling decoder.

Iterative Decoding of Low-Density Parity Check Codes

The paper on 'Iterative Decoding of LDPC Codes' provides a superb explanation of the peeling decoder. This algorithm beautifully illustrates how sparsity is exploited.

Please read Section 5.2, 'Decoding on the binary erasure channel' (pages 11-12). Focus on the algorithmic description: how a check node of degree one allows a variable's value to be determined, which in turn might simplify other checks, leading to a cascade.

The efficiency of the peeling decoder comes directly from sparsity. The total number of operations is proportional to the number of edges in the Tanner graph. Since this is linear in the block length for an LDPC code, the decoding complexity is . This is an exponential improvement over the complexity of brute-force decoding.

Test your understanding!

Imagine a check node in a Tanner graph connected to 5 variable nodes. In the context of the peeling decoder for the BEC, if 4 of these variable nodes have their values determined (i.e., they were not erased or were recovered in previous steps), what happens next?

Show answer

The check node can now determine the value of the 5th, previously erased, variable node. Since the sum (modulo 2) of all 5 bits must be 0, the 5th bit's value is simply the sum of the 4 known bits. This newly recovered bit's value is then propagated, potentially enabling other check nodes to solve for more erasures. This is the "peeling" or cascading effect.

Decoding Thresholds

The performance of these iterative decoders can be analyzed with remarkable precision. By modeling the message-passing process, one can calculate a sharp threshold for the channel noise. Below this threshold, the decoder succeeds with a probability approaching 1 as the block length goes to infinity.

The analysis involves tracking the probability of error (or erasure) in the messages from one iteration to the next. The sparsity and regularity of the graph (the degrees of the nodes) are the key parameters in these calculations. Given your background in theoretical modeling, the mathematical derivation of this threshold for the peeling decoder will be particularly insightful.

Iterative Decoding of Low-Density Parity Check Codes

Let's continue with the same paper to see the mathematical analysis of the peeling decoder's performance.

Please read the first part of Section 5.2, starting from 'Let us analyze this decoding algorithm...' on page 12 up to the end of Remark 3 on page 13. Focus on how the recursive equation (1) for the erasure probability p_{i+1} is derived. Note how it depends explicitly on the variable and check node degrees, d_v and d_c, which are direct measures of the graph's sparsity.

This analysis solidifies the connection: the structure of the sparse graph (via ) directly determines the performance of an efficient, linear-time decoding algorithm. This is the fundamental reason LDPC codes are so powerful. While we focused on the peeling decoder, similar principles apply to more general decoders like the Sum-Product Algorithm (also known as Belief Propagation), which is used for channels with noise rather than just erasures.

Conclusion

In this lesson, we have established the classical foundations of Low-Density Parity-Check codes. We saw that their defining characteristic is a sparse parity-check matrix, a feature that radically changes the nature of the decoding problem.

Key Takeaways:

  • Definition: An LDPC code is a linear block code defined by a parity-check matrix that is sparse, meaning it contains a number of non-zero entries that scales linearly with the block length, not quadratically.
  • Tanner Graph: The structure of an LDPC code is naturally represented by a sparse bipartite Tanner graph, where variable nodes connect to check nodes.
  • Significance for Decoding: Sparsity decomposes the global decoding problem into a system of simple, coupled local constraints.
  • Efficient Algorithms: This local structure enables efficient, linear-time iterative message-passing algorithms (like the peeling decoder or sum-product algorithm) to find the correct codeword, avoiding the exponential complexity of maximum likelihood decoding for dense codes.

Preview of the next lesson:
Now that we have a solid grasp of what makes classical LDPC codes special, we are ready to bring these concepts into the quantum realm. In our next lesson, we will explore quantum LDPC codes. We will define them using the stabilizer formalism, analyze their properties, and understand why they are considered a leading candidate for overcoming the limitations of surface codes and achieving fault-tolerant quantum computation with fewer physical qubits.

Can't find a good explanation? Sign up and we'll make it for you

Sign up