---
title: 'Hsu–Anastasopoulos Codes: Sparse-Graph Ensembles'
url: https://www.emergentmind.com/topics/hsu-anastasopoulos-codes
type: topic
---

# Hsu–Anastasopoulos Codes: Sparse-Graph Ensembles

Searching arXiv for relevant papers on Hsu–Anastasopoulos codes and related spatially coupled / quantum generalizations.
Hsu–Anastasopoulos codes are sparse-graph code ensembles constructed by combining an LDPC-type outer constraint system with an LDGM-type inner mapping so as to obtain bounded-density, capacity-achieving behavior under optimal decoding on memoryless binary-input symmetric channels. In the formulations summarized in the literature, they appear both as classical linear codes and, through spatial coupling and CSS nesting, as building blocks for finite-degree quantum code families. A central structural fact is that HA codes are dual to MacKay–Neal codes; a central algorithmic fact is that spatial coupling changes their practical decoding profile on the binary erasure channel by bringing BP thresholds close to, or in density-evolution analyses up to, the relevant information-theoretic limits [1102.4612; 1302.1511; 2606.32001; 2603.24588].

## 1. Classical definition and ensemble structure

In the formulation given by Kasai and Sakaniwa, a basic \((\tilde l,\tilde r,g)\) HA code is specified by two random binary matrices: \(H_3^T\), whose columns have weight \(\tilde l\) and rows have weight \(\tilde r\), and \(H_4^T\), an invertible \(N\times N\) matrix with both column and row weight \(g\). The parity-check matrix of the HA code is then
\[
H_{\mathrm{HA}} = H_3^T\cdot (H_4^T)^{-1},
\]
and an equivalent representation is the set of \(x\in\{0,1\}^N\) satisfying \(H_3^T s + H_4^T x = 0\) for some state-vector \(s\), with puncturing applied appropriately [1102.4612].

The same code family is described in a more recent socket-based form by fixing integers \(k\) and \(j_Z<k/2\), drawing a \((j_Z,k)\)-regular LDPC matrix
\[
A_Z\in\mathbb F_2^{m_Z\times n}, \qquad m_Z=\frac{j_Z}{k}n,
\]
together with an independent square \((k,k)\)-regular matrix
\[
B\in\mathbb F_2^{n\times n},
\]
and defining
\[
C_Z = B(\Ker A_Z)\subseteq \mathbb F_2^n.
\]
An equivalent extended parity-check representation is
\[
H_Z'=
\begin{bmatrix}
A_Z & 0\\
B & I_n
\end{bmatrix},
\]
with
\[
C_Z=\left\{x\in\mathbb F_2^n:\exists u\in\mathbb F_2^n,\; H_Z'
\begin{pmatrix}
u\\ x
\end{pmatrix}=0\right\}.
\]
The paper notes that \(H_Z'(u,x)^T=0\) is equivalent to \(A_Zx=0\) and \(x=Bu\) [2603.24588].

These two descriptions emphasize complementary aspects of the ensemble. The earlier form foregrounds the bounded row- and column-weight structure of the induced parity-check matrix, while the later form makes explicit the outer code \(\Ker A_Z\), the inner map \(B\), and the role of hidden or punctured variables. This suggests viewing HA codes as concatenated sparse ensembles in which the outer regular LDPC structure is transformed by a regular inner map rather than by a dense random transformation.

## 2. Degree profile, rate, and bounded density

The bounded-density property is explicit in the original construction. Because each column of \(H_3^T\) has \(\tilde l\) ones and each column of \((H_4^T)^{-1}\) has at most \(g\) nonzeros per column, each column of \(H_{\mathrm{HA}}\) has weight at most \(\tilde l g\), while each row inherits weight \(\tilde r\) via \(H_3^T\) [1102.4612]. The design rate of the \((\tilde l,\tilde r,g)\) HA ensemble is
\[
R_{\mathrm{HA}} = 1-\frac{\tilde r}{\tilde l},
\]
and its edge-density per information bit satisfies
\[
d_{\mathrm{HA}} \le \frac{\tilde l g+\tilde r}{R_{\mathrm{HA}}},
\]
hence remains finite for fixed \((\tilde l,\tilde r,g)\) [1102.4612].

In the socket-based formulation, the actual dimension obeys
\[
\dim C_Z = n-\rank A_Z-L_Z,
\qquad
L_Z=\dim(\Ker A_Z\cap \Ker B),
\]
and for fixed \((j_Z,k)\) one has \(\rank A_Z=m_Z\) with high probability and \(\dim(\Ker A_Z\cap\Ker B)=o(n)\) with high probability, yielding
\[
R_Z=\frac{\dim C_Z}{n}\xrightarrow{P} 1-\frac{j_Z}{k}.
\]
The design rate is therefore
\[
R_Z^{\mathrm{des}} = 1-\frac{j_Z}{k},
\]
which stays bounded away from \(0\) as long as \(j_Z<k\) [2603.24588].

A multi-edge-type description is also available. HA codes may be represented by the pair
\[
\nu(\epsilon; x_1,x_2,x_3)=x_1^{\tilde l}x_2^{\tilde r}+\epsilon x_3,
\qquad
\mu(x_1,x_2)=\frac{\tilde r}{\tilde l}x_1^{\tilde l}+x_2^g x_3,
\]
which makes explicit the two types of check-to-bit edges and the punctured information bits [1102.4612]. In coding-theoretic terms, this situates HA codes within the MET sparse-graph framework rather than as a single-edge regular LDPC ensemble.

## 3. Duality with MacKay–Neal codes

A defining structural property of HA codes is their formal duality with MacKay–Neal codes. In the MN construction, one forms
\[
H_{\mathrm{MN}}=[H_1\; H_2],
\]
where \(H_1\) is \(N\times (\frac{l}{m}N)\) with column weight \(l\) and row weight \(m\), \(H_2\) is \(N\times N\) with both row and column weight \(g\), and the first \(\frac{l}{m}N\) bits are punctured. Its generator matrix is
\[
G_{\mathrm{MN}} = H_1^T\cdot (H_2^{-1})^T.
\]
If one identifies \(H_1:=H_3\) and \(H_2:=H_4\), then
\[
G_{\mathrm{MN}} = H_3^T\cdot (H_4^T)^{-1}=H_{\mathrm{HA}},
\]
so the \((\tilde l,\tilde r,g)\) HA code is precisely the dual code of the \((\tilde l,\tilde r,g)\) MN code [1102.4612].

The same duality reappears in the quantum setting. In the CSS nesting construction, one chooses a second regular ensemble
\[
A_\Delta\in\mathbb F_2^{m_\Delta\times n}, \qquad m_\Delta=\frac{j_\Delta}{k}n,
\]
sets
\[
A_X=
\begin{bmatrix}
A_Z\\ A_\Delta
\end{bmatrix},
\qquad
m_X=\frac{j_X}{k}n,
\]
and defines
\[
C_Z=B(\Ker A_Z),\qquad C_X=[B(\Ker A_X)]^\perp.
\]
With the balanced condition \(j_X+j_Z=k\), one has \(C_Z^\perp\subseteq C_X\), making \((C_X,C_Z)\) a valid CSS pair [2603.24588]. The 2026 seeded-BP paper formulates the same relation through sparse punctured matrices \(A_Z\), \(A_\Delta\), \(B\), the stacked matrix \(A_X=[A_Z;A_\Delta]\), and the dense visible-bit parity-check matrices \(H_X,H_Z\) satisfying \(H_XH_Z^T=0\) [2606.32001].

This duality is not merely formal. It links HA codes to two major lines of work: classical punctured sparse-graph codes that achieve capacity under MAP decoding, and finite-degree CSS code constructions in which the HA side controls one constituent of the quantum code pair.

## 4. Capacity-achieving property under MAP or ML decoding

The original Hsu–Anastasopoulos theorem, as summarized in the literature, states that for any binary-input memoryless symmetric channel of capacity \(C\), and any \(\delta>0\), there exist constants \(\tilde l,\tilde r,g\) and a sequence of \((\tilde l,\tilde r,g)\) HA codes of increasing block length \(N\) such that the rate satisfies
\[
R_{\mathrm{HA}}\ge C-\delta,
\]
the bit-error probability under ML decoding tends to zero as \(N\to\infty\), and the parity-check density remains bounded [1102.4612].

The significance of this result is specific. Standard capacity-achieving sparse-graph constructions often require increasing node degrees, whereas HA codes were introduced precisely to combine asymptotic optimality under optimal decoding with bounded column and row weights. The later spatial-coupling work emphasizes this point directly: one “needs to increase the column and row weight” for capacity-achieving spatially coupled LDPC codes in the standard setting, while HA and MN codes achieve capacity of memoryless binary-input symmetric-output channels under MAP decoding with bounded column and row weight of the parity-check matrices [1102.4612].

A common misconception is to conflate this MAP/ML optimality with practical BP optimality in the uncoupled ensemble. The uncoupled HA construction is presented as capacity-achieving under ML or MAP decoding, not as a statement about the BP threshold. The later literature addresses exactly that gap by introducing spatial coupling and, in the rateless setting, by coupling both the pre-code and the LDGM inner code [1102.4612; 1302.1511].

## 5. Spatially coupled HA codes on the binary erasure channel

The protograph-based spatially coupled HA ensemble of Kasai and Sakaniwa fixes \(\tilde l,\tilde r,g\) and a coupling length \(L\), then constructs a chain of \(2L+1\) coupled sections using a band matrix \(H(\tilde l,\tilde r,L)\) for the SC-LDPC component and a band matrix \(S(g,L)\) for the SC-LDGM component. The base matrix is
\[
B_{\mathrm{HA}}(L)=
\begin{bmatrix}
H(\tilde l,\tilde r,L) & O_{\cdots}\\
S(g,L) & I_{2L+1+g-1}
\end{bmatrix},
\]
where the first \(2L+1\) variable nodes are punctured and the remaining are transmitted [1102.4612]. As \(L\to\infty\), the design rate tends to
\[
R_{\mathrm{HA}}(L)\to 1-\frac{\tilde r}{\tilde l}=R_{\mathrm{HA}},
\]
and the density per information bit remains bounded by the same \(O(\tilde l g+\tilde r)\) order [1102.4612].

For BEC decoding, the same work defines section-wise erasure probabilities \(x_i^{(\ell)}\) for punctured state nodes and \(y_i^{(\ell)}\) for unpunctured parity nodes. Successful BP decoding corresponds to convergence to the trivial fixed point \(x_i=y_i=0\) for all sections. The BP threshold \(\epsilon_{\mathrm{BP}}\) is the largest channel erasure rate for which the only DE fixed point is trivial [1102.4612].

The numerical example \((\tilde l,\tilde r,g)=(2,4,2)\) illustrates threshold saturation on the BEC:

| \(L\) | \(\epsilon_{\mathrm{BP}}(\mathrm{HA};2,4,2;L)\) | \(R_{\mathrm{HA}}(2,4,2;L)\) |
|---|---:|---:|
| 1 | 0.69542 | 0.2857 |
| 2 | 0.59444 | 0.3636 |
| 4 | 0.51697 | 0.4211 |
| 8 | 0.50046 | 0.4571 |
| 16 | 0.49998 | 0.4776 |
| 32 | 0.49991 | 0.4886 |

As \(L\to\infty\), \(\epsilon_{\mathrm{BP}}\to 0.5 = 1-R_{\mathrm{HA}}\), i.e. the Shannon limit on the BEC at rate \(1/2\) [1102.4612]. The same source remarks that with randomized window \(w>1\), the typical “wiggles” in the EXIT curve vanish as \(w\) grows [1102.4612].

This establishes the practical role of spatial coupling for HA codes. The uncoupled family provides bounded-density capacity under MAP or ML decoding; the coupled family empirically brings BP decoding close to the Shannon limit on the BEC while preserving bounded degrees.

## 6. Spatially coupled precoded rateless HA ensembles

A distinct spatially coupled HA construction appears in the rateless setting. The ensemble denoted \(\mathrm{SC\mbox{-}HA}(\ell,r,g,L,w)\) concatenates an outer SC-LDPC pre-code with an inner SC-LDGM code. Sections \(i=0,\dots,L-1\) each contain \(M\) variable nodes \(x(i,\cdot)\), forming an \((\ell,r,w,L)\) spatially coupled LDPC code of rate
\[
\mathrm{pre}(L)=1-\ell/r-(\ell/r)\cdot (w-1-2\sum_{i=1}^{w-1}(i/w)^r)/L,
\]
which tends to \(1-\ell/r\) as \(L\to\infty\). The pre-coded bits satisfy \(k=\mathrm{pre}(L)\cdot L\cdot M\) [1302.1511].

The inner SC-LDGM encoder operates indefinitely. At each time \(t=1,2,3,\dots\), it chooses a check section \(i^{(t)}\) uniformly in \(\{0,\dots,L+w-2\}\), then chooses \(g\) shifts and \(g\) indices uniformly, forms one degree-\(g\) parity check from the corresponding variables in a sliding window of width \(w\), and transmits it over \(\mathrm{BEC}(\epsilon)\). This process repeats “forever,” producing a rateless stream [1302.1511].

For BP decoding on the BEC, the ensemble tracks erasure-message densities \(p_i^{(\ell)}\) from variables to pre-code checks and \(s_i^{(\ell)}\) from variables to inner checks, with bit-error probability
\[
P_b^{(\ell)}=\frac1L\sum_{i=0}^{L-1} p_i^{(\ell)}.
\]
The overhead is defined by
\[
\alpha = \frac{n}{k}(1-\epsilon)-1,
\]
and because each variable sees a Poisson number of inner-code neighbors, the average inner degree obeys
\[
\beta=\frac{g}{1-\epsilon}\cdot \frac{\mathrm{pre}(L)\,L}{L+w-1}\cdot (1+\alpha).
\]
The asymptotic overhead threshold is
\[
\alpha_L^*=\inf\{\alpha>0: P_b^{(\infty)}=0\},
\]
and the ensemble is capacity-achieving if \(\limsup_{L\to\infty}\alpha_L^*=0\) [1302.1511].

A stability analysis yields a lower bound. Linearization around the all-zero fixed point gives a banded Jacobian \(P_L\) with spectral radius approximately
\[
\rho(P_L)\simeq (r-1)e^{-\beta(1-\epsilon)}
\left(1-\frac{(w-1)(w+1)}{3wL}\right),
\]
and successful decoding requires \(\rho(P_L)<1\). This implies
\[
\beta_L^* \ge \max\!\left[\frac{\ln(r-1)}{1-\epsilon},\;\frac{g}{1-\epsilon}\left(1-\frac{\ell}{r}\right)\right]
\equiv \underline{\beta}_L^*,
\]
hence
\[
\alpha_L^* \ge
\underline{\alpha}_L^*
=
\frac{\underline{\beta}_L^*(1-\epsilon)(L+w-1)}{gL\,\mathrm{pre}(L)}-1.
\]
As \(L\to\infty\),
\[
\lim_{L\to\infty}\underline{\alpha}_L^*
=
\max\!\left[\frac{r\ln(r-1)}{g(r-2)}-1,\;0\right]
\]
[1302.1511].

The numerical examples are particularly explicit. For \((\ell,r,g,w,\epsilon)=(2,3,3,2,0.5)\), capacity-achieving behavior requires
\[
g\ge \frac{r\ln(r-1)}{r-2}=3\ln 2 \approx 2.08.
\]
Since \(g=3>2.08\), the bound predicts \(\lim \alpha_L^*=0\) and \(\lim \beta_L^*=2\); density evolution gives \(\alpha_{1000}^*\approx 10^{-4}\) and \(\beta_L^*\to 2\) [1302.1511]. By contrast, for \((\ell,r,g,w)=(2,3,2,2)\), one has \(g=2<2.08\), so the bound predicts \(\lim \alpha_L^*>0\) with value approximately \(0.04\), and DE confirms \(\alpha_L^*\to 0.04\) and \(\beta_L^*\to 1.386\) [1302.1511].

The paper interprets this as the rateless hallmark: the transmitter never stops, the receiver stops upon decoding, and the overhead required tends to zero as the block length grows, while all variable-node degrees remain bounded [1302.1511]. It also contrasts this with SC-LDGM codes alone, whose decoding error probability is bounded away from \(0\), thereby motivating the HA-style concatenation of SC-LDPC and SC-LDGM components [1302.1511].

## 7. Quantum generalizations: CSS nesting, seeded BP decoding, and distance

HA codes now also function as constituents of quantum LDPC code constructions. In the finite-degree CSS-GV work, the HA side is the \(Z\)-constituent code \(C_Z=B(\Ker A_Z)\), while the \(X\)-constituent is built from the complementary MacKay–Neal side in a balanced triple satisfying \(j_X+j_Z=k\). The resulting CSS code has design quantum rate
\[
R_Q^{\mathrm{des}}=R_X^{\mathrm{des}}+R_Z^{\mathrm{des}}-1
=\frac{j_\Delta}{k}
=1-\frac{2j_Z}{k}>0,
\]
and the classical distance statements lift because
\[
d_Z^{\rm rel}\ge d(C_Z),\qquad d_X^{\rm rel}\ge d(C_X)
\]
[2603.24588].

For fixed degrees satisfying
\[
4\le j_Z<k/2,\qquad j_Z\equiv 0\pmod 2,
\]
there exists a constant \(\delta_Z^{\mathrm{lin}}>0\) such that
\[
\Pr[d(C_Z)\le \delta n]\to 0
\]
for every \(0<\delta<\delta_Z^{\mathrm{lin}}\); thus \(d(C_Z)=\Omega(n)\) with high probability [2603.24588]. For the finite list
\[
\mathcal T_{\mathrm{GV}}
=
\{(4,6,10),(4,8,12),(5,9,14),(6,14,20),(5,17,22),(4,20,24),(4,26,30)\},
\]
a computer-assisted proof shows attainment of the classical GV distance on the HA side, and consequently the CSS-GV distance for the resulting quantum codes [2603.24588].

A further development is the spatially coupled MN/HA CSS ensemble under hard-erasure BP decoding on the quantum erasure channel. There, one defines sparse punctured matrices \(A_Z\), \(A_\Delta\), \(B\), forms the coupled versions \(A_Z^{SC}\), \(A_\Delta^{SC}\), \(B^{SC}\), and constructs
\[
H_Z^{\prime SC}=[A_Z^{SC}\;\;0;\;B^{SC}\;\;I],\qquad
H_X^{\prime SC}=[(A_X^{SC})^T\;\;(B^{SC})^T]
\]
on a ring of length \(L\) with memory \(w\) [2606.32001]. BP uses five message types with erasure probabilities \(a,b,c,d,e\), and the uncoupled density evolution splits into a three-dimensional \(Z\)-side recursion and a two-dimensional \(X\)-side recursion [2606.32001].

Potential functions \(U_Z\) and \(U_X\) are then introduced. The resulting potential thresholds are
\[
\epsilon_{\mathrm{pot},Z}=\frac{j_Z}{k},
\qquad
\epsilon_{\mathrm{pot},X}=1-\frac{j_X}{k},
\qquad
\epsilon_{\mathrm{pot}}=\min\!\left\{\frac{j_Z}{k},\,1-\frac{j_X}{k}\right\}.
\]
In the equal-rate specialization \(j_X+j_Z=k\), this becomes
\[
\epsilon_{\mathrm{pot}}=\frac{j_Z}{k}=\frac{1-R_Q^{\mathrm{des}}}{2}=\epsilon_{\mathrm{hash}},
\]
namely the quantum-erasure hashing bound [2606.32001]. Using the coupled-vector potential method and a seed interval of \(w\) sections where all message-erasure probabilities are fixed to zero, the paper proves at the DE level that seeded BP decoding on the finite-degree factor graph reaches this threshold [2606.32001].

A plausible implication is that HA codes have become a unifying object across classical and quantum sparse-graph coding: originally introduced for bounded-density capacity under optimal decoding, then adapted through spatial coupling to improve BP thresholds on the BEC, and finally embedded into CSS constructions that simultaneously address BP decodability and asymptotic distance properties. The current literature, however, distinguishes carefully between DE-level threshold statements, finite-length concentration, block-error convergence, and explicit finite-code realizations, treating the latter as separate questions rather than automatic consequences [2606.32001].

Source: https://www.emergentmind.com/topics/hsu-anastasopoulos-codes