CodingTheory.jl
CodingTheory.jl is a Julia library for classical, LDPC, and quantum error-correcting codes. It uses Oscar.jl for exact finite-field and polynomial arithmetic and native Julia data structures for performance-sensitive sparse and iterative algorithms.
Installation
The package is under active development. Install the development version from Julia's package prompt:
] add https://github.com/esabo/CodingTheoryThen load the package together with Oscar:
using Oscar
using CodingTheoryStart with Linear Codes, Quantum Codes, or Message-passing Decoding. The API pages document constructors and specialized code families after the tutorials establish the common workflow.
A first classical code
F = GF(2)
G = matrix(F, [
1 0 0 0 0 1 1
0 1 0 0 1 0 1
0 0 1 0 1 1 0
0 0 0 1 1 1 1
])
C = LinearCode(G)
(length(C), dimension(C), minimum_distance(C)[1])Code objects retain the presentation supplied by the user while caching derived data such as standard forms, logical operators, enumerators, and certified distance bounds. Use accessors such as generator_matrix, parity_check_matrix, stabilizers, and logicals_matrix; do not depend on internal struct fields.
Conventions
- Use
GF(p)for a prime field. Do not useGF(p, 1): extension-field representations are substantially more expensive. - A parity-check or stabilizer presentation may be overcomplete. Parameters are computed from ranks, not from the number of supplied rows.
- Many expensive quantities are cached. Use
copy(C)when an independent code object is needed. - Prefer predicates and traits such as
is_CSSandGaugeTraitto exacttypeofchecks. Constructors may return a more specific supported subtype. - Exact minimum-distance routines can be exponential. Consult Minimum-distance Computation before running them on large codes.
The Oscar banner can be suppressed by starting Julia with julia -q.
Contributing
Bug reports and contributions are welcome on GitHub. Development discussion also takes place in the #codingtheory channel of the Julia Slack workspace.