EvenWeightSubcode( C )
EvenWeightSubcode
returns the even weight subcode of C, consisting
of all codewords of C with even weight. If C is a linear code and
contains words of odd weight, the resulting code has a dimension of one
less. The minimum distance always increases with one if it was odd. If
C is a binary cyclic code, and g(x) is its generator polynomial, the
even weight subcode either has generator polynomial g(x) (if g(x) is
divisible by x-1) or g(x)*(x-1) (if no factor x-1 was present in
g(x)). So the even weight subcode is again cyclic.
Of course, if all codewords of C are already of even weight, the returned code is equal to C.
gap> C1 := EvenWeightSubcode( BCHCode( 8, 4, GF(3) ) ); an (8,33,4..8)3..8 even weight subcode gap> List( Elements( C1 ), WeightCodeword ); [ 0, 4, 4, 4, 4, 4, 6, 4, 4, 4, 6, 4, 4, 4, 8, 6, 8, 4, 6, 4, 4, 6, 4, 4, 6, 8, 4, 4, 6, 4, 8, 4, 6 ] gap> EvenWeightSubcode( ReedMullerCode( 1, 3 ) ); a linear [8,4,4]2 Reed-Muller (1,3) code over GF(2)
ExtendedCode
also returns a related code of only even weights, but
without reducing its dimension (see ExtendedCode).
GAP 3.4.4