Operations on Codewords
Construction of a Codeword
- C ! [a₁, ..., aₙ]: Code, [ RngElt ] -> ModTupRngElt
- elt< C | a₁, ..., aₙ>: Code, List -> ModTupRngElt
Given a length \(n\) additive code \(C\) with alphabet \(F\), then the codewords of \(C\) lie in \(F^{(n)}\). Given elements \(a_1, \ldots, a_n\) belonging to \(F\), construct the codeword \((a_1, \ldots, a_n)\) of \(C\). A check is made that the vector (\(a_1, \ldots, a_n\)) is an element of \(C\).
Arithmetic Operations on Codewords
- u + v: ModTupRngElt, ModTupRngElt -> ModTupRngElt
Sum of the codewords \(u\) and \(v\), where \(u\) and \(v\) belong to the same linear code \(C\).
- - u: ModTupRngElt -> ModTupRngElt
Additive inverse of the codeword \(u\) belonging to the linear code \(C\).
- u - v: ModTupRngElt, ModTupRngElt -> ModTupRngElt
Difference of the codewords \(u\) and \(v\), where \(u\) and \(v\) belong to the same linear code \(C\).
Distance and Weight
Predicates for Codewords
- u eq v: ModTupRngElt, ModTupRngElt -> BoolElt
The function returns
trueif and only if the codewords \(u\) and \(v\) belonging to the same additive code are equal.