WeightDistribution( C )
WeightDistribution
returns the weight distribution of C, as a
vector. The i^{th} element of this vector contains the number of
elements of C with weight i-1. For linear codes, the weight
distribution is equal to the inner distribution (see
InnerDistribution).
Suppose w is the weight distribution of C. If C is linear, it must have the zero codeword, so w[1] = 1 (one word of weight 0).
gap> WeightDistribution( ConferenceCode(9) ); [ 1, 0, 0, 0, 0, 18, 0, 0, 0, 1 ] gap> WeightDistribution( RepetitionCode( 7, GF(4) ) ); [ 1, 0, 0, 0, 0, 0, 0, 3 ] gap> WeightDistribution( WholeSpaceCode( 5, GF(2) ) ); [ 1, 5, 10, 10, 5, 1 ]
GAP 3.4.4