LDPC Codes

Constructors

An LDPC code is defined by a specific choice of a parity-check matrix for a code. Different parity-check matrices for the same linear code produce different LDPC codes. As such, the LDPCCode constructor does not accept a code, but rather a matrix.

CodingTheory.LDPCCodeType
LDPCCode(H::fq_nmod_mat)

Return the LDPC code defined by the parity-check matrix H.

source
LDPCCode(C::AbstractLinearCode)

Return the LDPC code given by the parity-check matrix of C.

source
julia> H = matrix(GF(2), 6, 9, [
          1 0 1 0 1 0 0 0 1;
          0 1 1 0 1 1 1 0 0;
          0 0 0 1 0 1 0 0 0;
          0 0 0 1 1 0 1 1 0;
          0 1 1 1 0 1 0 0 1;
          1 1 0 0 0 0 1 1 1]);

julia> L = LDPCCode(H)
[9, 3, 3]_2 irregular 5-limited LDPC code with density 0.46296296296296297.

Variable degree polynomial:
        21//25*x^2 + 4//25*x
Check degree polynomial:
        3//5*x^4 + 8//25*x^3 + 2//25*x
Parity-check matrix: 6 × 9
        1 0 1 0 1 0 0 0 1
        0 1 1 0 1 1 1 0 0
        0 0 0 1 0 1 0 0 0
        0 0 0 1 1 0 1 1 0
        0 1 1 1 0 1 0 0 1
        1 1 0 0 0 0 1 1 1

Random regular LDPC codes maybe be constructed via

CodingTheory.regular_LDPC_codeFunction
regular_LDPC_code(q::Int, n::Int, l::Int, r::Int [; seed=nothing])

Return a random regular LDPC code over GF(q) of length n with column degree l and row degree r.

If a seed is given, i.e. regulardLDPCCode(4, 1200, 3, 6, seed=123), the results are reproducible.

source

and irregular LDPC codes via

Missing docstring.

Missing docstring for irregular_LDPC_code. Check Documenter's build log for details.

Attributes

The polynomials $\lambda(x)$ and $\rho(x)$ as well as the degrees of each variable and check nodes are computed upon construction.

A bar graph of the degree distributions is available

For convenience, the maximum degrees are also stored.

Hecke.densityFunction
density(C::AbstractLDPCCode)

Return the density of the parity-check matrix of C.

source
Hecke.is_regularFunction
is_regular(G::SimpleGraph{Int})

Return true if G is regular.

source
is_regular(C::AbstractLDPCCode)

Return true if the C is a regular LDPC code.

Notes

  • An LDPC is regular if all the column degrees and equal and all the row degrees are equal.
source

The Tanner graph corresponding to the parity-matrix defining the LDPC code can be generated as a SimpleDiGraph and visually in a Figure object.

CodingTheory.Tanner_graphFunction
Tanner_graph(H::Union{fq_nmod_mat, Matrix{Int}})

Return the SimpleGraph object repesenting the Tanner graph of the parity-check matrix H along with the indices of the left and right vertices representing the bits and parity checks, respectively.

source
Tanner_graph(C::AbstractLinearCode)

Return the SimpleGraph object repesenting the Tanner graph of C along with the indices of the left and right vertices representing the bits and parity checks, respectively.

source
Tanner_graph(C::AbstractLDPCCode)

Return the Tanner graph of C as a Figure object.

source

Methods

Occassionally useful for small examples, the following function produces a Figure of the Tanner graph unrolled to a given level.

CodingTheory.computation_graphFunction
computation_graph(C::LDPCCode, lvl::Int, v::Int, v_type::Symbol=:v)

Return a figure representing the expansion of the Tanner graph of C to level lvl for node v. If v_type is :v, v is interpreted as a variable node; otherwise, v_type is :c and v is interpreted as a check node.

source
Oscar.girthFunction
girth(C::LDPCCode)

Return the girth of the Tanner graph of C.

An error is thrown if the maximum number of iterations is reached and $-1$ is returned to represent infinite girth.

source

To count or explicitly enumerate the short cycles of the Tanner graph, use

CodingTheory.count_short_cyclesFunction
count_short_cycles(C::LDPCCode)

Return a bar graph and a dictionary of (length, count) pairs for unique short cycles in the Tanner graph of C. An empty graph and dictionary are returned when there are no cycles.

Note

  • Short cycles are defined to be those with lengths between $g$ and $2g - 2$, where $g$ is the girth.
source
CodingTheory.shortest_cyclesFunction
shortest_cycles(C::LDPCCode, v::Int)
shortest_cycles(C::LDPCCode, vs::Vector{Int})
shortest_cycles(C::LDPCCode)

Return all the cycles of shortest length in the Tanner graph of C for the vertex v or vertices vs. If no vertices are given, all vertices are computed by default.

Note

  • The length of the shortest cycle is not necessarily the same for each vertex.
  • To reduce computational complexity, the same cycle may appear under each vertex in the cycle.
source

Various information about the ACE values of cycles in the Tanner graph may be computed with the following functions.

CodingTheory.shortest_cycle_ACEFunction
shortest_cycle_ACE(C::LDPCCode, v::Int)
shortest_cycle_ACE(C::LDPCCode, vs::Vector{Int})
shortest_cycle_ACE(C::LDPCCode)

Return a cycle of minimum length and minimum ACE in the Tanner graph of C for the vertex v or vertices vs, in the order (ACEs, cycles). If no vertices are given, all vertices are computed by default. The cycle v1 -- c1 -- ... -- cn -- vn is returned in the format [(v1, c1), (c1, v2), ..., (cn, vn)].

source
CodingTheory.ACE_distributionFunction
ACE_distribution(C::LDPCCode, v::Int)
ACE_distribution(C::LDPCCode, vs::Vector{Int})
ACE_distribution(C::LDPCCode)

Return the ACEs and cycle lengths for vertex v or vertices vs of the Tanner graph of C. If no vertices are given, all vertices are computed by default.

source
CodingTheory.average_ACE_distributionFunction
average_ACE_distribution(C::LDPCCode, v::Int)
average_ACE_distribution(C::LDPCCode, vs::Vector{Int})
average_ACE_distribution(C::LDPCCode)

Return the average ACE of the vertex v or vertices vs of the Tanner graph of C. If no vertices are given, all vertices are computed (individually) by default.

source
CodingTheory.median_ACE_distributionFunction
median_ACE_distribution(C::LDPCCode, v::Int)
median_ACE_distribution(C::LDPCCode, vs::Vector{Int})
median_ACE_distribution(C::LDPCCode)

Return the median ACE of the vertex v or vertices vs of the Tanner graph of C. If no vertices are given, all vertices are computed (individually) by default.

source
CodingTheory.mode_ACE_distributionFunction
mode_ACE_distribution(C::LDPCCode, v::Int)
mode_ACE_distribution(C::LDPCCode, vs::Vector{Int})
mode_ACE_distribution(C::LDPCCode)

Return the mode ACE of the vertex v or vertices vs of the Tanner graph of C. If no vertices are given, all vertices are computed (individually) by default.

Note

  • In case of ties, the smallest tied value is returned.
source

Greedy Construction Algorithms