DualCode( C )
DualCode
returns the dual code of C. The dual code consists of all
codewords that are orthogonal to the codewords of C. If C is a linear
code with generator matrix G, the dual code has parity check matrix G
(or if C has parity check matrix H, the dual code has generator
matrix H). So if C is a linear [n, k] code, the dual code of C is a
linear [n, n-k] code. If C is a cyclic code with generator polynomial
g(x), the dual code has the reciprocal polynomial of g(x) as check
polynomial.
The dual code is always a linear code, even if C is non-linear.
If a code C is equal to its dual code, it is called self-dual.
gap> R := ReedMullerCode( 1, 3 ); a linear [8,4,4]2 Reed-Muller (1,3) code over GF(2) gap> RD := DualCode( R ); a linear [8,4,4]2 Reed-Muller (1,3) code over GF(2) gap> R = RD; true gap> N := WholeSpaceCode( 7, GF(4) ); a cyclic [7,7,1]0 whole space code over GF(4) gap> DualCode( N ) = NullCode( 7, GF(4) ); true
GAP 3.4.4