Magma supplies functions for decoding vectors from the ambient space of a
linear code C.
Decode(C, v) : Code, ModTupFldElt -> BoolElt, ModTupFldElt
Al: MonStgElt Default: "Euclidean"
Given a linear code C and a vector v from the ambient space V of C, attempt to decode v with respect to C. Currently the accessible algorithms are: syndrome decoding (which is demonstrated manually in the example in the Coset Leaders section above); and a Euclidean algorithm, which operates on alternant codes (BCH, Goppa, and Reed-Solomon codes, etc.). The Euclidean algorithm cannot correct as many errors as the syndrome algorithm can, but in general it is much faster, since the syndrome algorithm requires the coset leaders of the code and is also inapplicable as soon as the codimension of the code is moderately large. If the code is alternant, the Euclidean algorithm is used by default, but the syndrome algorithm will be used if the parameter Al is assigned the value "Syndrome". For non-alternant codes, only syndrome decoding is possible, so the parameter Al is not relevant. If the decoding algorithm succeeds in computing a vector v' as the decoded version of v, then the function returns true and v'. (In the Euclidean case it may even happen that v' is not in C because there are too many errors in v to correct.) If the decoding algorithm does not succeed in decoding v, then the function returns false and the zero vector.
Al: MonStgElt Default: "Euclidean"
Given a linear code C and a sequence Q of vectors from the ambient space V of C, attempt to decode the vectors of Q with respect to C. This function is like the last but takes a sequence of vectors and returns a sequence of booleans and a sequence of decoded vectors corresponding to the given sequence. The algorithm used and parameter Al is just as in the last function.
> C := GolayCode(GF(2), false); > v := C ! [1,1,1,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,1,1,1]; > w := v; > w[5] := 1 - w[5]; > w[20] := 1 - w[20]; > v; (1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 1 1) > w; (1 1 1 1 1 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 1 1 1) > v - w; (0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0) > b, d := Decode(C, w); > b; true > d; (1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 1 1) > d eq v; true > Decode(C, [w]); [ true ] [ (1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 1 1) ]