Modifying Codes

Constructors

The first two constructors throw an error when one of the arguments is the zero code.

CodingTheory.u_u_plus_vFunction
u_u_plus_v(C1::AbstractLinearCode, C2::AbstractLinearCode)
Plotkin_construction(C1::AbstractLinearCode, C2::AbstractLinearCode)

Return the Plotkin (u | u + v)-construction with u ∈ C1 and v ∈ C2.

source

Let C1 be an $[n, k1, d1]$ and C2 an $[n, k2, d2]$ linear code. This construction produces an $[3n, 2k1 + k2]$ linear code. For binary codes, $\mathrm{wt}(u + w \mid v + w \mid u + v + w) = 2 \mathrm{wt}(u \veebar v) - \mathrm{wt}(w) + 4s$, where $s = |\{i \mid u_i = v_i = 0, w_i = 1\}|$.

Let C1 be an $[n, k, d]$, C2 an $[n, k - l, d + e]$, and C3 an $[m, l, e]$ linear code with C2 ⊂ C1 be proper. Construction X creates a $[n + m, k, d + e]$ linear code.

CodingTheory.construction_XFunction
construction_X(C1::AbstractLinearCode, C2::AbstractLinearCode, C3::AbstractLinearCode)

Return the code generated by the construction X procedure.

source

Let C1 be an $[n, k1, d1]$, C2 an $[n, k2, d2]$, C3 an $[n, k3, d3]$, C4 an $[n4, k2 - k1, d4]$, and C5 an $[n5, k3 - k2, d5]$ linear code with C1 ⊂ C2 ⊂ C3. Construction X3 creates an $[n + n4 + n5, k3, d]$ linear code with $d \geq \min\{d1, d2 + d4, d3 + d5\}$.

CodingTheory.construction_X3Function
construction_X3(C1::AbstractLinearCode, C2::AbstractLinearCode, C3::AbstractLinearCode,
    C4::AbstractLinearCode, C5::AbstractLinearCode))

Return the code generated by the construction X3 procedure.

source

The direct sum code has generator matrix G1 ⊕ G2 and parity-check matrix H1 ⊕ H2.

Missing docstring.

Missing docstring for CodingTheory.⊕. Check Documenter's build log for details.

The generator matrix of the (direct) product code is the kronecker product of the generator matrices of the inputs.

Missing docstring.

Missing docstring for CodingTheory.×. Check Documenter's build log for details.

The parity-check matrix of the tensor product code is the kronecker product of the parity-check matrices of the inputs.

Missing docstring.

Missing docstring for CodingTheory.⊗. Check Documenter's build log for details.

There is some debate on how to define this product. This is known to often be the full ambient space.

CodingTheory.entrywise_product_codeFunction
entrywise_product_code(C::AbstractLinearCode, D::AbstractLinearCode)
*(C::AbstractLinearCode, D::AbstractLinearCode)
Schur_product_code(C::AbstractLinearCode, D::AbstractLinearCode)
Hadamard_product_code(C::AbstractLinearCode, D::AbstractLinearCode)
componentwise_product_code(C::AbstractLinearCode, D::AbstractLinearCode)

Return the entrywise product of C and D.

source
Missing docstring.

Missing docstring for CodingTheory./. Check Documenter's build log for details.

juxtaposition is representation dependent and therefore works on the potentially over-complete generator matrices, not on the standard form.

CodingTheory.juxtapositionFunction
juxtaposition(C1::AbstractLinearCode, C2::AbstractLinearCode)

Return the code generated by the horizontal concatenation of the generator matrices of C1 then C2.

source

Methods

If C is a quasi-cyclic code, permute_code returns a LinearCode object.

CodingTheory.permute_codeFunction
permute_code(C::AbstractLinearCode, σ::Union{PermGroupElem, Perm{Int}, Vector{Int}})

Return the code whose generator matrix is C's with the columns permuted by σ.

source

The most common way to extend a code is to add an extra column to the generator matrix whose values make the sum of the rows zero. This is called an even extension and is the default for extend(C). Alternatively, this new column may be inserted at any index c in the matrix, e.g. extend(C, c). In the most general case, one may provide a vector a and define the values of the new column to be -a dot the row. The standard definition is clearly just the special case that a is the all-ones vector.

Hecke.extendFunction
extend(C::AbstractLinearCode, a::CTMatrixTypes, c::Integer)
extend(C::AbstractLinearCode, c::Integer)
extend(C::AbstractLinearCode, a::CTMatrixTypes)
extend(C::AbstractLinearCode)
even_extension(C::AbstractLinearCode)

Return the extended code of C extending on column c. For each row g of the generator matrix for C, a digit -a ⋅ g is inserted in the cth position. If c isn't given, it is appended. If a isn't given, then the all 1's vector is used giving an even extension.

source

Puncturing deletes columns from the generator matrix and then removes any potentially resulting zero rows.

CodingTheory.punctureFunction
puncture(C::AbstractLinearCode, cols::Vector{<:Integer})
puncture(C::AbstractLinearCode, cols::Integer)

Return the code of C punctured at the columns in cols.

source

Expurgating deletes rows from the generator matrix and then removes any potentially resulting zero columns. This function works directly on the potentially over-complete generator matrix and not on the standard form.

CodingTheory.expurgateFunction
expurgate(C::AbstractLinearCode, rows::Vector{<:Integer})
expurgate(C::AbstractLinearCode, rows::Integer)

Return the code of C expuragated at the rows in rows.

source
expurgate(S::AbstractStabilizerCode, rows::Vector{Int}; verbose::Bool = true, logs_alg::Symbol = :sys_eqs)

Return the code created by removing the stabilizers indexed by rows.

Notes

  • The goal of this function is to track how the logical operators update through this process. Here, the original logical pairs are kept and an appropriate number of new pairs are added.
source

Shortening is expurgating followed by puncturing. This implementation uses the theorem that the dual of code shortened on L is equal to the puncture of the dual code on L, i.e., dual(puncture(dual(C), L)).

CodingTheory.shortenFunction
shorten(C::AbstractLinearCode, L::Vector{<:Integer})
shorten(C::AbstractLinearCode, L::Integer)

Return the code of C shortened on the indices L.

source

Augmentation vertically joins the matrix M to the bottom of the generator matrix of C. This function works directly on the potentially over-complete generator matrix and not on the standard form.

CodingTheory.augmentFunction
augment(C::AbstractLinearCode, M::CTMatrixTypes)

Return the code of C whose generator matrix is augmented with M.

source
augment(S::AbstractSubsystemCode, row::CTMatrixTypes; verbose::Bool = true, logs_alg::Symbol = :sys_eqs)

Return the code created by added row to the stabilizers of S.

Notes

  • The goal of this function is to track how the logical operators update given the new stabilizer. The unaffected logical operators are kept during the update and only those which don't commute with the new stabilizer are recomputed.
source

Lengthening augments the all 1's row and then extends.

CodingTheory.subcodeFunction
subcode(C::AbstractLinearCode, k::Int)

Return a k-dimensional subcode of C.

source
subcode(C::AbstractLinearCode, rows::Vector{Int})

Return a subcode of C using the rows of the generator matrix of C listed in rows.

source

This function arguments generators of C1 / C2 to C2 until the desired dimenion is reached.

CodingTheory.expanded_codeFunction
expanded_code(C::AbstractLinearCode, K::CTFieldTypes, β::Vector{<:CTFieldElem})

Return the expanded code of C constructed by exapnding the generator matrix to the subfield K using the basis β for field(C) over K.

source

The subfield subcode is computed directly via an expansion, whereas the trace code is computed using Delsarte's theorem.

CodingTheory.subfield_subcodeFunction
subfield_subcode(C::AbstractLinearCode, K::CTFieldTypes, basis::Vector{<:CTFieldElem})

Return the subfield subcode code of C over K using the provided dual basis for the field of C over K.

source
CodingTheory.trace_codeFunction
trace_code(C::AbstractLinearCode, K::CTFieldTypes, basis::Vector{<:CTFieldElem})

Return the trace code of C over K using the provided dual basis for the field of C over K using Delsarte's theorem.

source
Experimental

The next two functions need significantly more testing, but appear to work so far.

Weight reduction

See the weight reduction tutorial for a more detailed explanation of this function.

CodingTheory.weight_reductionFunction

weightreduction(H::Union{CTMatrixTypes, MatElem{<: ResElem}}; rows::Bool = true, rowindices::AbstractVector{Int} = Int[], permuterows::Bool = true, rowtarget::Int = 3, columns::Bool = true, columnindices::AbstractVector{Int} = Int[], permutecolumns::Bool = true, column_target::Int = 3, compressed::Bool = false, seed::Union{Nothing, Int} = nothing)

Return the weight-reduced parity-check matrix of H with the given arguments.

source

weightreduction(C::Union{AbstractLinearCode, AbstractLDPCCode}; rows::Bool = true, rowindices::AbstractVector{Int} = Int[], permuterows::Bool = true, rowtarget::Int = 3, columns::Bool = true, columnindices::AbstractVector{Int} = Int[], permutecolumns::Bool = true, column_target::Int = 3, compressed::Bool = false, seed::Union{Nothing, Int} = nothing)

Return the code with the weight-reduced parity-check matrix of C with the given arguments.

source