Weight Enumerators

CompleteWeightEnumerator(C): Code -> RngMPolElt
Let C be a code over a finite ring R of cardinality q, and suppose that the elements of R are ordered in some way. Then for a codeword v ∈C and the i-th element a ∈R, let si(v) denote the number of components of v equal to a.

This function returns the complete weight enumerator (W)C(X0, X1, ..., Xq - 1) of C, which is defined by: (W)C(X0, X1, ..., Xq - 1) = ∑v ∈C((X0)s0(v)(X1)s1(v) ... (Xq - 1)sq - 1(v)). See [Wan97, p. 9] for more information. The result will lie in a global multivariate polynomial ring over Z with q variables. The angle-bracket notation may be used to assign names to the indeterminates.

WeightEnumerator(C): Code -> RngMPolElt
HammingWeightEnumerator(C): Code -> RngMPolElt
Suppose C is a code over some finite ring R. This function returns the Hamming weight enumerator HamC(X, Y) of C, which is defined by: HamC(X, Y) = ∑v ∈C(Xn - wH(v)YwH(v)), where wH(v) is the Hamming weight function. The result will lie in a global multivariate polynomial ring over Z with two variables. The angle-bracket notation may be used to assign names to the indeterminates.

Example CodeRng_weightEnum-galois-rings (H164E15)

We compute the complete weight enumerator of a cyclic code over the Galois ring GR(4, 2).
> R<w> := GR(4,2);
> P<x> := PolynomialRing(R);
> L := CyclotomicFactors(R, 3);
> g := L[1];
> g;
x + 3
> C := CyclicCode(3, g);
> C;
(3, 256, 2) Cyclic Code over GaloisRing(2, 2, 2)
Generator matrix:
[1 0 3]
[0 1 3]
> CWE<[X]> := CompleteWeightEnumerator(C);
> CWE;
X[1]^3 + 6*X[1]*X[2]*X[4] + 3*X[1]*X[3]^2 + 6*X[1]*X[5]*X[13] +
    6*X[1]*X[6]*X[16] + 6*X[1]*X[7]*X[15] + 6*X[1]*X[8]*X[14] +
    3*X[1]*X[9]^2 + 6*X[1]*X[10]*X[12] + 3*X[1]*X[11]^2 +
    3*X[2]^2*X[3] + 6*X[2]*X[5]*X[16] + 6*X[2]*X[6]*X[15] +
    6*X[2]*X[7]*X[14] + 6*X[2]*X[8]*X[13] + 6*X[2]*X[9]*X[12] +
    6*X[2]*X[10]*X[11] + 3*X[3]*X[4]^2 + 6*X[3]*X[5]*X[15] +
    6*X[3]*X[6]*X[14] + 6*X[3]*X[7]*X[13] + 6*X[3]*X[8]*X[16] +
    6*X[3]*X[9]*X[11] + 3*X[3]*X[10]^2 + 3*X[3]*X[12]^2 +
    6*X[4]*X[5]*X[14] + 6*X[4]*X[6]*X[13] + 6*X[4]*X[7]*X[16] +
    6*X[4]*X[8]*X[15] + 6*X[4]*X[9]*X[10] + 6*X[4]*X[11]*X[12] +
    3*X[5]^2*X[9] + 6*X[5]*X[6]*X[12] + 6*X[5]*X[7]*X[11] +
    6*X[5]*X[8]*X[10] + 3*X[6]^2*X[11] + 6*X[6]*X[7]*X[10] +
    6*X[6]*X[8]*X[9] + 3*X[7]^2*X[9] + 6*X[7]*X[8]*X[12] +
    3*X[8]^2*X[11] + 3*X[9]*X[13]^2 + 6*X[9]*X[14]*X[16] +
    3*X[9]*X[15]^2 + 6*X[10]*X[13]*X[16] + 6*X[10]*X[14]*X[15] +
    6*X[11]*X[13]*X[15] + 3*X[11]*X[14]^2 + 3*X[11]*X[16]^2 +
    6*X[12]*X[13]*X[14] + 6*X[12]*X[15]*X[16]
V2.28, 13 July 2023