---
title: 'MacKay–Neal Codes: Sparse-Graph Innovations'
url: https://www.emergentmind.com/topics/mackay-neal-codes
type: topic
---

# MacKay–Neal Codes: Sparse-Graph Innovations

Searching arXiv for MacKay–Neal code papers to ground the article in the cited literature.
MacKay–Neal (MN) codes are sparse-graph coding constructions characterized by a punctured/transmitted variable-node split and a corresponding two-edge-type decoding structure. In the classical formulation, they are non-systematic or punctured multi-edge-type LDPC-like ensembles defined entirely by sparse parity constraints; in more recent rate-adaptive formulations, they appear as nonlinear concatenations of an outer constant-composition distribution matcher and an inner LDPC encoder, with the punctured variables carrying a priori information rather than direct channel observations [1102.4612]. Across these formulations, the defining feature is the coexistence of hidden or punctured variables and transmitted variables within a single sparse-graph representation, which gives MN codes a distinctive operating point: strong asymptotic performance under MAP decoding with bounded degrees, poor uncoupled BP behavior in some settings, and substantial gains under spatial coupling, where BP thresholds approach capacity or symmetric-information-rate limits on several channel families [1501.06736].

## 1. Definition and structural forms

MacKay–Neal codes were originally associated with sparse constructions based on very sparse matrices, and in the binary channel-coding setting they can be written through a parity-check matrix of the form
\[
(H_1 \;\; H_2),
\]
where \(H_1\) connects punctured or state variables and \(H_2\) connects transmitted parity variables [1102.4612]. In the \((\ell,r,g)\)-MN description, \(H_1\) is an \(N \times (\ell/r)N\) random binary matrix with column weight \(\ell\) and row weight \(r\), while \(H_2\) is an \(N \times N\) random binary matrix with column and row weight \(g\). The parity constraints are
\[
H_1 s + H_2 n = 0,
\]
with \(s\) punctured and \(n\) transmitted [1102.4612].

In the multi-edge-type formulation used for erasure analysis, MN codes comprise two variable-node classes and one check-node class. Type-1 variables are punctured; type-2 variables are transmitted; check nodes connect to both edge types [1401.7289]. The corresponding degree-distribution pair for uncoupled \((l,r,g)\) MN codes on the BEC is
\[
\nu(x;\epsilon)=\frac{r}{l}x_1^{\,l}+\epsilon x_2^{\,g}, \qquad \mu(x)=x_1^{\,r}x_2^{\,g},
\]
which makes explicit that only the type-2 class is observed through the channel [1401.7289].

A distinct recent formulation uses a nonlinear outer encoder. In that construction, an MN code is the concatenation of an outer nonlinear constant-composition distribution matcher and an inner nonsystematic LDPC encoder, often protograph-based and, in the strongest reported results, spatially coupled [2510.14843]. The outer matcher maps messages to binary sequences of fixed Hamming weight \(\omega \ell\), while the inner LDPC acts on those sequences and produces transmitted parity bits. The punctured-node class is then initialized by a priori log-likelihood ratios derived from the matcher rather than by channel observations [2510.14856]. This differs from standard LDPC, repeat-accumulate, and turbo-like constructions in that rate adaptation is driven by the outer nonlinear component while the inner sparse graph remains fixed [2510.14843].

A unifying interpretation is that MN codes are sparse-graph systems in which some variables are never transmitted directly but remain inferable through check constraints and, in nonlinear variants, through external priors. This suggests that the punctured/transmitted split is the central invariant across the literature, even though the exact algebraic realization varies.

## 2. Graph-theoretic viewpoint and relation to other code families

MN codes are routinely described as two-edge-type LDPC codes, or more generally as multi-edge-type sparse-graph ensembles with punctured and transmitted variable-node classes [1401.7289]. In this sense they are closely related to generalized LDPC and turbo-like graph families, but they are distinguished by deliberate puncturing of one variable class and by the role this hidden class plays in the sparse representation [2510.14843].

A standard contrast is with ordinary LDPC ensembles, where all variable nodes are transmitted. In MN codes, punctured variables carry no direct channel observation and are reconstructed through parity constraints and, in rate-adaptive variants, through a priori information supplied by an outer distribution matcher [2303.09887]. This puncturing mechanism is not a secondary implementation detail; it is what enables the bounded-degree capacity-achieving behavior under MAP decoding emphasized in the early MN/HA literature [1102.4612].

The literature also places MN codes in a dual relationship with Hsu–Anastasopoulos (HA) codes. In the bounded-density setting, HA codes are dual in spirit to MN codes, and with matched parameter choices the MN generator matrix equals the HA parity-check matrix [1102.4612]. This duality later reappears in quantum CSS constructions based on punctured MN/HA constituents, where the same hidden-variable architecture is used to obtain nested sparse systems with finite degrees [2606.32001]. In the classical nested-CSS construction built from MN and HA ingredients, the visible MN-side code \(C_X\) is defined through the extended sparse constraint
\[
H_X' := [A_X^T \;\; B^T],
\]
and the visible HA-side code \(C_Z\) through
\[
H_Z' := [ A_Z \;\; 0 ; B \;\; I_n ],
\]
with CSS orthogonality induced by the inclusion \(\mathrm{Row}(A_Z)\subseteq \mathrm{Row}(A_X)\) [2603.24588].

Another persistent comparison is with LDGM-like structures. In several expositions, the transmitted-node side of an MN graph is described as LDGM-like, while the punctured side is LDPC-like [1401.7289]. This suggests that MN codes occupy an intermediate position between sparse parity-check and sparse generator constructions. A plausible implication is that much of their asymptotic behavior is governed by how these two sparse substructures interact under puncturing and iterative inference.

## 3. Density evolution, belief propagation, and threshold behavior

On the BEC, the uncoupled MN recursion is explicit and exposes the main difficulty of the ensemble under BP decoding. For \((\ell,r,g)\)-MN codes, with \(x^{(\ell)}\) and \(y^{(\ell)}\) the erasure probabilities on punctured and transmitted edges, density evolution obeys
\[
x^{(\ell+1)} = \bigl[ 1 - (1 - x^{(\ell)})^{r-1} (1 - y^{(\ell)})^{g} \bigr]^{\ell-1},
\]
\[
y^{(\ell+1)} = \epsilon \bigl[ 1 - (1 - x^{(\ell)})^{r} (1 - y^{(\ell)})^{g-1} \bigr]^{g-1},
\]
with initialization \(x^{(0)}=1\), \(y^{(0)}=1\) [1102.4612]. In uncoupled form, this system has the fixed trajectory \(x^{(\ell)}=1\), \(y^{(\ell)}=\epsilon\), so the punctured side never resolves, which is why uncoupled MN codes have no useful BP threshold on the BEC despite strong MAP behavior [1102.4612].

In the multi-edge-type BEC formalism, the same phenomenon is written as
\[
x^{(t+1)} = f(g(x^{(t)});\epsilon),
\]
with
\[
f(x;\epsilon)=\bigl(x_1^{l-1},\, \epsilon x_2^{g-1}\bigr),
\]
\[
g(x)=\Bigl(1-(1-x_1)^{r-1}(1-x_2)^g,\; 1-(1-x_1)^r(1-x_2)^{g-1}\Bigr),
\]
or, for generalized erasure channels with detector transfer \(\phi\),
\[
f(x;\epsilon)=\bigl(x_1^{d_l-1},\, \phi(x_2^{d_g};\epsilon)\bigr)
\]
with the corresponding check update \(g\) [1401.7289]. This generalization is central in universality proofs over erasure channels with memory [1501.06736].

For binary-input AWGN analysis in modern rate-adaptive MN codes, density evolution is formulated in the LLR domain on an equivalent parallel-channel model. Variable-node and check-node updates take the standard forms
\[
m_{v\to c}^{(\ell+1)} = L_{\mathrm{ch}}(v) + \sum_{c' \in N(v)\setminus\{c\}} m_{c'\to v}^{(\ell)},
\]
\[
m_{c\to v}^{(\ell+1)} = 2 \,\mathrm{atanh}\!\Bigl(\prod_{v' \in N(c)\setminus\{v\}} \tanh(m_{v'\to c}^{(\ell)}/2)\Bigr),
\]
with separate tracking of edge classes for punctured and transmitted nodes [2510.14843]. The punctured class is initialized either by the prior
\[
L = \ln\!\frac{1-\omega}{\omega}
\]
or, in the equivalent model, by a binary symmetric a priori channel with crossover probability \(\omega\) [2510.14856].

The BP threshold is then defined as the minimum \(E_s/N_0\) or \(E_b/N_0\) such that density evolution drives all message means to \(+\infty\), equivalently to zero bit error probability [2510.14843]. In the rate-adaptive setting, one fixes the entropy \(h_A=H(\omega)\) of the punctured-node prior and finds the largest communication-channel entropy \(h_C\) permitting successful decoding. For a rate-\(1/2\) inner code, the Shannon bound is
\[
h_A + h_C \le 1,
\]
which provides the benchmark against which thresholds are reported [2510.14843].

## 4. Spatial coupling, threshold saturation, and universality

Spatial coupling is the mechanism that transforms the poor uncoupled BP behavior of MN codes into near-capacity performance. In coupled constructions, the protograph or graph is replicated across sections and edges are spread across neighboring positions, while termination or shortening outside the active range seeds highly reliable boundary regions [1102.4612]. Decoding then proceeds as a wave from the boundaries into the chain interior, producing threshold saturation in the now-standard sense associated with coupled LDPC systems [2510.14843].

On the BEC, coupled MN codes with bounded degrees were shown empirically to approach capacity. For the base-matrix SC-MN family with \((\ell,r,g)=(4,2,2)\), the reported BP thresholds move toward \(0.5\) as \(L\) increases and the rate tends to \(1/2\): for \(L=32\), \(\epsilon_{\mathrm{BP}} \approx 0.499908\) and \(R \approx 0.488550\) [1102.4612]. This established the basic phenomenon before later rigorous proofs.

A stronger BEC result concerns ensembles with no degree-2 bit nodes. For \((l,3,3)\) SC-MN codes with \(l \ge 3\), the asymptotic BP threshold under spatial coupling satisfies
\[
\lim_{w\to\infty}\lim_{L\to\infty}\epsilon_{\mathrm{BP}}^{\mathrm{SC\text{-}MN}(l,3,3;w,L)}
= 1 - \frac{3}{l} = 1-R,
\]
so these coupled MN codes achieve BEC capacity with \(\lambda_2=0\) [1401.7289]. The removal of degree-2 variable nodes is important because earlier \((l,2,2)\) designs had many such nodes and correspondingly higher error floors [1401.7289].

For generalized erasure channels with memory, the universality claim is sharper. Spatially coupled MN codes with bounded degrees universally achieve the symmetric information rate of arbitrary generalized erasure channels with memory under BP decoding, in the sense that the transmitter need only know the SIR while the receiver uses a channel-matched APP detector and BP decoder [1501.06736]. In that setting the proof is based on the potential-function method, and for \((d_r,d_g)\in\{(2,2),(3,3)\}\) with \(d_l>d_r\), the potential threshold equals the SIR limit:
\[
\epsilon^*(d_l,d_r,d_g)=\epsilon^{\rm SIR}\!\left(\frac{d_r}{d_l}\right),
\]
and the coupled BP threshold saturates to that value as \(L,w\to\infty\) [1501.06736].

Recent rate-adaptive spatially coupled MN codes extend the same phenomenon to the biAWGN channel over the full rate interval \([0,1]\). In the protograph SC-LDPC inner-code construction with two variable-node classes per position, the \((4,8)\) SC-MN ensemble is reported to achieve BP thresholds within approximately \(0.15\) dB of binary-input AWGN capacity uniformly across the full \([0,1]\) rate range, while the \((3,6)\) ensemble stays within approximately \(0.7\) dB [2510.14843]. The paper interprets this as near-universal operation across rates because varying the outer distribution-matcher parameter changes only the entropy of the a priori channel seen by punctured nodes, while the inner coupled decoder remains fixed [2510.14843].

## 5. Rate adaptation and equivalent parallel-channel analysis

A major modern development is the use of MN codes as rate-adaptive schemes with a fixed inner LDPC graph and an outer constant-composition distribution matcher. In that architecture, the outer matcher maps messages \(\mu_t\) to binary \(\ell\)-tuples \(v_t\) of Hamming weight \(\omega \ell\), with rate
\[
R_o = \frac{1}{\ell}\log_2 \binom{\ell}{\omega \ell} \to H(\omega),
\]
so choosing \(\omega \in [0,1/2]\) spans \(H(\omega)\in[0,1]\) [2510.14843]. The inner nonsystematic SC-LDPC encoder has rate
\[
R_i = \frac{L-(d-1)}{L+(d-1)} \to 1
\]
under zero-tail termination, and the overall code rate is
\[
R = R_o R_i \approx H(\omega)
\]
for large \(\ell\) and \(L\) [2510.14843].

The essential analytical device is an equivalent parallel channel. Because the outer distribution matcher makes the concatenation nonlinear, direct density evolution is inconvenient. The remedy is to insert a random i.i.d. bit scrambler after the matcher, known at the receiver, which preserves error probability over symmetric channels and restores the all-zero codeword assumption [2510.14843]. The resulting model replaces the nonlinear system by an inner LDPC code transmitted over two parallel channels: an a priori channel for punctured nodes and the physical communication channel for transmitted nodes. In the specific biAWGN formulation, the a priori channel is a BSC with crossover probability \(\omega\), and the physical channel is a binary-input AWGN channel [2510.14843].

This viewpoint yields concrete initial LLRs. A-type punctured nodes are initialized with
\[
L = \ln\!\frac{1-\omega}{\omega},
\]
while C-type transmitted nodes are initialized with
\[
L = \ln \frac{p(y|0)}{p(y|1)}.
\]
Under all-zero transmission on BPSK AWGN,
\[
L_{\mathrm{ch}} = \frac{2y}{\sigma^2}, \qquad L_{\mathrm{ch}} \sim \mathcal{N}(4E_s/N_0,\; 8E_s/N_0)
\]
[2510.14843].

A closely related block-protograph formulation replaces the constant-composition prior by a BSC\((\omega)\) for density-evolution purposes and combines threshold analysis with input–output weight-distribution analysis to screen out ensembles with poor error floors [2510.14856]. In that formulation, the inner code is defined by
\[
C = \{ c \in \mathbb{F}_2^n : cH_2^T = vH_1^T,\; v\in \mathbb{F}_2^h\},
\]
with puncturing of the first \(h\) variable nodes and generator
\[
G = H_1^T (H_2^T)^{-1},
\]
and the overall rate is
\[
R = R_{\mathrm{DM}} R_{\mathrm{in}} \approx H_2(\omega)\cdot \frac{h}{n}
\]
[2510.14856]. The same work reports that a single fixed inner protograph can operate within approximately \(1\) dB of the Shannon limit over broad rate ranges, while error-floor behavior depends strongly on the asymptotic input–output weight distribution near the origin [2510.14856].

The later spatially coupled rate-adaptive construction improves the waterfall threshold dramatically relative to those block designs, with the \((4,8)\) SC-MN ensemble moving from approximately \(1\) dB from capacity in the best block protograph designs to approximately \(0.15\) dB across the full rate interval [2510.14843].

## 6. Applications, extensions, and limitations

MN codes have been studied in several channel models beyond the standard memoryless BEC. On erasure relay channels under decode-and-forward, spatially coupled protograph MN codes were reported to have achievable regions essentially at the DF capacity boundary. For the \((4,2,2,128)\) SC-MN ensemble of rate approximately \(0.49609375\), the achievable region tracks the theoretical DF limit within less than \(10^{-4}\), with the residual gap attributed to finite-\(L\) wiggles in density evolution [1102.5087]. This result emphasized that the punctured/transmitted split and coupled structure remain effective in joint decoding architectures that connect source and relay graphs through degree-2 equality checks [1102.5087].

MN codes were also analyzed for channels with \(2^m\)-ary inputs and affine-subspace outputs, motivated as a simplified model of joint iterative decoding with non-binary modulation. In that setting, binary SC-MN codes with \((l,r,g,L,w)\) structure achieve thresholds very close to the Shannon limit, but the iterative decoding threshold degrades as \(m\) increases because of EXIT-like wiggles; increasing the randomized coupling width \(w\) mitigates those wiggles [1202.0979]. For the \((l=4,r=2,g=2)\) ensemble at rate \(1/2\), thresholds with \(w=2\) remain close to \(0.5\) but worsen with \(m\), while with \(w=3\) and \(L=20\) the thresholds are essentially at \(0.499999\) for all tested \(m\) values [1202.0979].

In quantum coding, spatially coupled MN/HA constructions have been used to build CSS codes over the quantum erasure channel. There, a five-message density evolution for hard-erasure CSS decoding decomposes into Z-side and X-side constituents, and the coupled-vector potential method shows that seeded BP decoding reaches the minimum of the constituent thresholds; in the equal-rate specialization, this coincides with the hashing bound determined by the design rate [2606.32001]. A related non-coupled nested MN/HA construction was later used to obtain finite-degree quantum LDPC codes with non-vanishing rate and, for explicit balanced triples, Gilbert–Varshamov distance by rigorous computer-assisted proof [2603.24588]. These developments use the same sparse punctured-variable architecture, indicating that the MN paradigm extends naturally beyond classical binary-input channel coding.

The principal limitations stated across the literature are consistent. Many results are asymptotic in coupling length, lifting factor, or section size; finite-length BER and FER behavior is often not reported in the strongest asymptotic threshold papers [2510.14843]. Extensions beyond symmetric channels or beyond the specific detector models used in generalized erasure analysis remain open [1501.06736]. In rate-adaptive nonlinear MN constructions, the equivalent parallel-channel model relies on symmetry and scrambling; extensions to non-symmetric channels, mismatched demappers, or higher-order modulations beyond pure BPSK constraints are explicitly listed as open problems [2510.14843].

A recurrent misconception is that MN codes are simply punctured LDPC codes. The literature supports a narrower statement: they are punctured sparse-graph ensembles with a specific two-class structure and, in several important formulations, with a nonlinear outer mechanism or a duality relation to HA constructions that ordinary punctured LDPC ensembles do not automatically inherit [1102.4612]. Another misconception is that their strong asymptotic MAP behavior directly implies strong uncoupled BP performance. On the BEC, the opposite is explicit: uncoupled MN codes have no useful BP threshold, and spatial coupling is the mechanism that exposes their latent capacity-approaching behavior to iterative decoding [1102.4612].

Taken together, the literature presents MN codes as a family of punctured sparse-graph constructions whose defining structural asymmetry between hidden and transmitted variables enables bounded-degree near-capacity performance once coupled or otherwise regularized. The early BEC evidence, the later BEC and generalized-erasure proofs, and the recent rate-adaptive biAWGN constructions all point in the same direction: the practical significance of MN codes lies less in the uncoupled ensemble itself than in the coupled, protograph-based, or outer-matched realizations that convert an intrinsically strong sparse representation into an effective BP-decodable system [1401.7289].

Source: https://www.emergentmind.com/topics/mackay-neal-codes