Cyclic Codes

Cyclic codes are a subtype of LinearCode and inherit its methods. For more information on how to use these functions, see the cyclic code tutorial.

Cyclotomic Cosets

The following set of functions are useful for defining cyclic codes.

CodingTheory.cyclotomic_cosetFunction
cyclotomic_coset(x::Int, q::Int, n::Int, to_sort::Bool=true, verbose::Bool=false)

Return the q-cyclotomic coset of x modulo n.

Notes

  • If the optional parameter to_sort is set to false, the result will not be

sorted. If the optional parameter verbose is set to true, the result will pretty print.

source
CodingTheory.all_cyclotomic_cosetsFunction
all_cyclotomic_cosets(q::Int, n::Int, to_sort::Bool=true, verbose::Bool=false)

Return all q-cyclotomic cosets modulo n.

Notes

  • If the optional parameter to_sort is set to false, the result will not be

sorted. If the optional parameter verbose is set to true, the result will pretty print.

source
CodingTheory.complement_qcosetsFunction
complement_qcosets(q::Int, n::Int, qcosets::Vector{Vector{Int64}})

Return the complement of the q-cyclotomic cosets modulo n of qcosets.

source
CodingTheory.qcoset_pairingsFunction
qcoset_pairings(arr::Vector{Vector{Int64}}, n::Int)

Return the q-cyclotomic cosets modulo n collected into complementary pairs.

source
Missing docstring.

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

CodingTheory.dual_qcosetsFunction
dual_qcosets(q::Int, n::Int, qcosets::Vector{Vector{Int64}})

Return the dual of the q-cyclotomic cosets modulo n of qcosets.

source

Constructors

CodingTheory.CyclicCodeType
CyclicCode(q::Int, n::Int, cosets::Vector{Vector{Int}})

Return the CyclicCode of length n over GF(q) with q-cyclotomic cosets cosets.

Notes

  • This function will auto determine if the constructed code is BCH or Reed-Solomon

and call the appropriate constructor.

Examples

julia> q = 2; n = 15; b = 3; δ = 4;
julia> cosets = defining_set([i for i = b:(b + δ - 2)], q, n, false);
julia> C = CyclicCode(q, n, cosets)
source
CyclicCode(n::Int, g::fq_nmod_poly)

Return the length n cyclic code generated by the polynomial g.

source
CodingTheory.BCHCodeType
BCHCode(q::Int, n::Int, δ::Int, b::Int=0)

Return the BCHCode of length n over GF(q) with design distance δ and offset b.

Notes

  • This function will auto determine if the constructed code is Reed-Solomon

and call the appropriate constructor.

Examples

julia> q = 2; n = 15; b = 3; δ = 4;
julia> B = BCHCode(q, n, δ, b)
[15, 5, ≥7; 1]_2 BCH code over splitting field GF(16).
2-Cyclotomic cosets:
        C_1 ∪ C_3 ∪ C_5
Generator polynomial:
        x^10 + x^8 + x^5 + x^4 + x^2 + x + 1
Generator matrix: 5 × 15
        1 1 1 0 1 1 0 0 1 0 1 0 0 0 0
        0 1 1 1 0 1 1 0 0 1 0 1 0 0 0

        0 0 1 1 1 0 1 1 0 0 1 0 1 0 0
        0 0 0 1 1 1 0 1 1 0 0 1 0 1 0
        0 0 0 0 1 1 1 0 1 1 0 0 1 0 1
source
BCHCode(C::AbstractCyclicCode)

Return the BCH supercode of the cyclic code C.

source
CodingTheory.ReedSolomonCodeType
ReedSolomonCode(q::Int, δ::Int, b::Int=0)

Return the ReedSolomonCode over GF(q) with distance d and offset b.

Examples

julia> ReedSolomonCode(8, 3, 0)
[7, 5, ≥3; 0]_8 Reed Solomon code.
8-Cyclotomic cosets:
        C_0 ∪ C_1
Generator polynomial:
        x^2 + (α + 1)*x + α
Generator matrix: 5 × 7
        α α + 1 1 0 0 0 0
        0 α α + 1 1 0 0 0
        0 0 α α + 1 1 0 0
        0 0 0 α α + 1 1 0
        0 0 0 0 α α + 1 1

julia> ReedSolomonCode(13, 5, 1)
[12, 8, ≥5; 1]_13 Reed Solomon code.
13-Cyclotomic cosets:
        C_1 ∪ C_2 ∪ C_3 ∪ C_4
Generator polynomial:
        x^4 + 9*x^3 + 7*x^2 + 2*x + 10
Generator matrix: 8 × 12
        10 2 7 9 1 0 0 0 0 0 0 0
        0 10 2 7 9 1 0 0 0 0 0 0
        0 0 10 2 7 9 1 0 0 0 0 0
        0 0 0 10 2 7 9 1 0 0 0 0
        0 0 0 0 10 2 7 9 1 0 0 0
        0 0 0 0 0 10 2 7 9 1 0 0
        0 0 0 0 0 0 10 2 7 9 1 0
        0 0 0 0 0 0 0 10 2 7 9 1
source

Attributes

CodingTheory.qcosets_repsFunction
qcosets_reps(C::AbstractCyclicCode)

Return the set of representatives for the q-cyclotomic cosets of the cyclic code.

source
CodingTheory.defining_setFunction
defining_set(C::AbstractCyclicCode)

Return the defining set of the cyclic code.

source
defining_set(nums::Vector{Int}, q::Int, n::Int, flat::Bool=true)

Returns the set of q-cyclotomic cosets of the numbers in nums modulo n.

Notes

  • If flat is set to true, the result will be a single flattened and sorted array.
source
Missing docstring.

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

CodingTheory.is_degenerateFunction
is_degenerate(C::AbstractCyclicCode)

Return true if the cyclic code is degenerate.

Notes

  • A cyclic code is degenerate if the parity-check polynomial divides x^r - 1 for

some r less than the length of the code.

source

Methods

Missing docstring.

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

CodingTheory.is_cyclicFunction
is_cyclic(C::AbstractLinearCode)

Return true and the equivalent cyclic code object if C is a cyclic code; otherwise, return false, missing.

source
Oscar.complementFunction
complement(C::AbstractCyclicCode)

Return the cyclic code whose cyclotomic cosets are the completement of C's.

source
Base.:∩Function
∩(C1::AbstractCyclicCode, C2::AbstractCyclicCode)

Return the intersection code of C1 and C2.

source
Base.:+Function
+(C1::AbstractCyclicCode, C2::AbstractCyclicCode)

Return the addition code of C1 and C2.

source