In the case of a linear code, the minimum weight and distance are equivalent. For codes over Z_4, one may compute the minimum weight, but currently none of the other functions which work over finite fields are applicable.
Determine the minimum weight of the words belonging to the code C, which is also the minimum distance between any two codewords.
Determine the (Hamming) weight distribution for the code C. The distribution is returned in the form of a sequence of tuples, where the i-th tuple contains the i-th weight, w_i say, and the number of codewords having weight w_i.
The weight distribution of the dual code of C (see WeightDistribution).
Suppose C is a Z_4 code, and for a codeword v of C, let w_a(v) denote the number of components of v equal to a. This function returns the complete weight enumerator ( W)_C(X_0, X_1, X_2, X_3) of C, which is defined by: ( W)_C(X_0, X_1, X_2, X_3) = sum_(v in C)((X_0)^(s_0(v))(X_1)^(s_1(v))(X_2)^(s_2(v))(X_3)^(s_3(v))). See [Wan97, p. 9] for more information. The result will lie in a global multivariate polynomial ring over Z with 4 variables. The angle-bracket notation may be used to assign names; e.g.: CW<X0,X1,X2,X3> := CompleteWeightEnumerator(C);.
Suppose C is a Z_4 code. This function returns the symmetric weight enumerator swe_C(X_0, X_1, X_2) of C, which is defined by: swe_C(X_0, X_1, X_2) = ( W)_C(X_0, X_1, X_2, X_1), where ( W)_C is the complete weight enumerator, defined above. See [Wan97, p. 14] for more information. The result will lie in a global multivariate polynomial ring over Z with 3 variables. The angle-bracket notation may be used to assign names; e.g.: SWE<X0,X1,X2> := SymmetricWeightEnumerator(C);.
Suppose C is a Z_4 code. This function returns the Lee weight enumerator Lee_C(X, Y) of C, which is defined by: Lee_C(X, Y) = sum_(v in C)(X^(n - w_L(v))Y^(w_L(v))), where w_L(v) is the Lee weight function, defined in Section Lee Weights. The result will lie in a global multivariate polynomial ring over Z with 2 variables. The angle-bracket notation may be used to assign names; e.g.: Lee<X,Y> := LeeWeightEnumerator(C);.
Suppose C is a Z_4 code. This function returns the Hamming weight enumerator Ham_C(X, Y) of C, which is defined by: Ham_C(X, Y) = sum_(v in C)(X^(n - w_H(v))Y^(w_H(v))), where w_H(v) is the Hamming weight function. The result will lie in a global multivariate polynomial ring over Z with 2 variables. The angle-bracket notation may be used to assign names: Ham<X,Y> := HammingWeightEnumerator(C);.
> Z4 := IntegerRing(4);
> O8 := LinearCode<Z4, 8 |
> [1,0,0,0,3,1,2,1],
> [0,1,0,0,1,2,3,1],
> [0,0,1,0,3,3,3,2],
> [0,0,0,1,2,3,1,1]>;
> #O8;
256
> C<X0,X1,X2,X3> := CompleteWeightEnumerator(O8);
> C;
X0^8 + 14*X0^4*X2^4 + 56*X0^3*X1^3*X2*X3 + 56*X0^3*X1*X2*X3^3 +
56*X0*X1^3*X2^3*X3 + 56*X0*X1*X2^3*X3^3 + X1^8 + 14*X1^4*X3^4 +
X2^8 + X3^8
> S<X0,X1,X2> := SymmetricWeightEnumerator(O8);
> S;
X0^8 + 14*X0^4*X2^4 + 112*X0^3*X1^4*X2 + 112*X0*X1^4*X2^3 + 16*X1^8 +
X2^8
> L<X,Y> := LeeWeightEnumerator(O8);
> L;
X^16 + 112*X^10*Y^6 + 30*X^8*Y^8 + 112*X^6*Y^10 + Y^16
> HammingWeightEnumerator(O8);
X^8 + 14*X^4*Y^4 + 112*X^3*Y^5 + 112*X*Y^7 + 17*Y^8