New Codes from Old

The operations described here produce a new code by modifying in some way the codewords of a given code.

Contents

Standard Constructions

AugmentCode(C) : CodeAdd -> Code
Construct a new additive code by including the all-ones vector with the words of the additive code C.
CodeComplement(C, S) : Code, Code -> Code
Given a subcode S of the code C, return a code C' such that C=S + C'. Both C and S must be defined over the same field.
DirectSum(C, D) : Code, Code -> Code
Given codes C and D, form the code that is direct sum of C and D. The direct sum consists of all vectors u|v, where u ∈C and v ∈D.
DirectSum(Q) : [Code] -> Code
Given a sequence of codes Q = [C1, ..., Cr], all defined over the same field F, construct the direct sum of the Ci.
DirectProduct(C, D) : Code, Code -> Code
Given an [n1, k1] code C and an [n2, k2] code D, both over the same ring R, construct the direct product of C and D. The direct product has length n1.n2 and its generator matrix is the Kronecker product of the basis matrices of C and D.
ExtendCode(C) : CodeAdd -> CodeAdd
Given an [n, k, d] additive code C, form a new code C' from C by adding the appropriate extra coordinate to each vector of C such that the sum of the coordinates of the extended vector is zero.
ExtendCode(C, n) : Code, RngIntElt -> Code
Return the code obtained by extending the code C extended n times.
PadCode(C, n) : CodeAdd, RngIntElt -> CodeAdd
Add n zeros to the end of each codeword of the code C.
PlotkinSum(C1, C2) : Code, Code -> Code
Given codes C1 and C2 defined over the same alphabet, return the code consisting of all vectors of the form u|u + v, where u ∈C1 and v ∈C2. Zeros are appended where needed to make up any length differences in the two codes.
PlotkinSum(C1, C2, C3: parameters) : Code,Code,Code -> Code
    a: FldFinElt                        Default: -1
Given three codes C1, C2 and C3 defined over the same alphabet K, return the code consisting of all vectors of the form u|u + a * v|u + v + w, where u ∈C1, v ∈C2 and w ∈C3. The default value of the multiplier a is a primitive element of K. Zeros are appended where needed to ensure that every codeword has the same length.
PunctureCode(C, i) : CodeAdd, RngIntElt -> Code
Given an [n, k] code C, and an integer i, 1 ≤i ≤n, construct a new code C' by deleting the i-th coordinate from each code word of C.
PunctureCode(C, S) : CodeAdd, { RngIntElt } -> Code
Given an [n, k] code C and a set S of distinct integers { i1, ..., ir } each of which lies in the range [1, n], construct a new code C' by deleting the components i1, ..., ir from each code word of C.
ShortenCode(C, i) : Code, RngIntElt -> Code
Given an [n, k] code C and an integer i, 1 ≤i ≤n, construct a new code from C by selecting only those codewords of C having a zero as their i-th component and deleting the i-th component from these codewords. Thus, the resulting code will have length n - 1.
ShortenCode(C, S) : Code, { RngIntElt } -> Code
Given an [n, k] code C and a set S of distinct integers { i1, ..., ir}, each of which lies in the range [1, n], construct a new code from C by selecting only those codewords of C having zeros in each of the coordinate positions i1, ..., ir, and deleting these components. Thus, the resulting code will have length n - r.

Combining Codes

C1 cat C2 : CodeAdd, CodeAdd -> CodeAdd
Given codes C1 and C2, both defined over the same field K, return the concatenation C of C1 and C2. The generators of the resultant code are the concatenations of the generators of C1 and C2.
Juxtaposition(C1, C2) : Code, Code -> Code
Given an [n1, k, d1] code C1 and an [n2, k, d2] code C2 of the same dimension, where both codes are defined over the same field K, this function returns a [n1 + n2, k, ≥d1 + d2] code whose generator matrix is HorizontalJoin(A, B), where A and B are the generator matrices for codes C1 and C2, respectively.
V2.28, 13 July 2023