[Next] [Prev] [Right] [Left] [Up] [Index] [Root]
Structural Properties of Codes
Structural Properties of Codes
Subsections
The Minimum Weight
MinimumWeight(C) : Code -> RngIntElt
Determine the minimum weight of the words belonging to the code C.
By setting the verbose flag "Code", information during the computation
can be obtained.
MinimumWords(C) : Code -> { ModTupFldElt }
The set of words of the code C having minimum weight.
The Weight Distribution
WeightDistribution(C) : Code -> [ <RngIntElt, RngIntElt> ]
Determine the 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.
WeightDistribution(C, u) : Code, ModTupFldElt -> [ <RngIntElt, RngIntElt> ]
Determine the weight distribution of the coset C + u of the
linear 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.
DualWeightDistribution(C) : Code -> [ <RngIntElt, RngIntElt> ]
The weight distribution of the dual code of C (see WeightDistribution).
The MacWilliams Transform
MacWilliamsTransform(n, k, q, W) : RngIntElt, RngIntElt, RngIntElt, [ <RngIntElt, RngIntElt> ] -> [ <RngIntElt, RngIntElt> ]
Let C be a hypothetical [n, k] linear code over a finite field of
cardinality q. Let W be the weight distribution of C (in the form as
returned from the function WeightDistribution). This function applies the
MacWilliams transform to W to obtain the weight distribution W' of the
dual code of C. The transform is a combinatorial algorithm based on n, k,
q and W alone. Thus C itself need not exist of course---the function
simply manipulates the integers given to it. Furthermore, if W is not
the weight distribution of an actual code, the result W' will be meaningless
and even negative weights may be returned.
MacWilliamsTransform(K, n, k, W) : FldFin, RngIntElt, RngIntElt, RngDPol -> RngDPol
Let C be a hypothetical [n, k] linear code over a finite field K
W be the complete weight enumerator of C (in the form as
returned from the function CompleteWeightEnumerator).
This function applies the
MacWilliams transform to W to obtain the complete weight
enumerator W' of the
dual code of C. The transform is a combinatorial algorithm based on K,
n, k, and W alone.
Thus C itself need not exist of course---the function
simply manipulates the polynomial given to it. Furthermore, if W is not
the weight distribution of an actual code, the result W' will be meaningless.
The Weight Enumerator
WeightEnumerator(C): Code -> RngDPolElt
The (Hamming) weight enumerator W_C(x, y) for the linear code C.
The weight enumerator is the sum over u in C of (x^(n - wt(u))y^(wt(u))).
WeightEnumerator(C, u): Code, ModTupFldElt -> RngDPolElt
The (Hamming) weight enumerator W_(C + u)(x, y) for the coset C + u.
CompleteWeightEnumerator(C): Code -> RngDPolElt
The complete weight enumerator ( W)_C(z_0, ..., z_(q - 1))
for the linear code C where q is the size of the alphabet K of C.
Let the q elements of K be denoted by
omega _0, ..., omega _(q - 1). If K is a prime field, we let
omega _i be i (i.e. take the natural representation of each number).
If K is a non-prime field, we let omega _0 be the zero element of K
and let omega _i be alpha^(i - 1) for i = 1 ... q - 1 where alpha
is a primitive element of K. Now for a codeword u of C, let
s_i(u) be the number of components of u equal to omega _i.
The complete weight enumerator is the
sum over u in C of ((z_0)^(s_0(u)) ... (z_(q - 1))^(s_(q - 1)(u))).
CompleteWeightEnumerator(C, u): Code, ModTupFldElt -> RngDPolElt
The complete weight enumerator ( W)_(C + u)(z_0, ..., z_(q - 1))
for the coset C + u.
Words
Words(C, i) : Code, RngIntElt -> { ModTupFldElt }
Given a linear code C, return the set of all words of C having
weight i.
NumberOfWords(C, i) : Code, RngIntElt -> RngIntElt
Given a linear code C, return the number of words of C having
weight i.
Other Structural Properties
CosetDistanceDistribution(C) : Code -> [ <RngIntElt, RngIntElt> ]
Given a linear code C, determine the coset distance
distribution of C, relative to C. The distance between
C and a coset D of C is the Hamming weight of a
vector of minimum weight in D.
CoveringRadius(C) : Code -> RngIntElt
The covering radius of the linear code C.
Diameter(C) : Code -> RngIntElt
The diameter of the code C (the largest weight of the codewords of C).
Example Code_WeightDistribution (H40E15)
We construct the second order Reed-Muller code of length 64, and calculate
the weight distribution of it and its dual code.
> R := ReedMullerCode(2, 6);
> print #R;
4194304
> print WeightDistribution(R);
[ <0, 1>, <16, 2604>, <24, 291648>, <28, 888832>, <32, 1828134>, <36, 888832>,
<40, 291648>, <48, 2604>, <64, 1> ]
> D := Dual(R);
> print #D;
4398046511104
> print WeightDistribution(D);
[ <0, 1>, <8, 11160>, <12, 1749888>, <14, 22855680>, <16, 232081500>, <18,
1717223424>, <20, 9366150528>, <22, 38269550592>, <24, 119637587496>, <26,
286573658112>, <28, 533982211840>, <30, 771854598144>, <32, 874731154374>,
<34, 771854598144>, <36, 533982211840>, <38, 286573658112>, <40,
119637587496>, <42, 38269550592>, <44, 9366150528>, <46, 1717223424>,
<48, 232081500>, <50, 22855680>, <52, 1749888>, <56, 11160>, <64, 1> ]
Example Code_WeightEnumerator (H40E16)
We construct the unextended Ternary Golay code and calculate its weight
enumerator and its complete weight enumerator. To make the polynomials
print out nicely, we assign names to the parent polynomial rings in each
case. These names will stay for further calls to WeightEnumerator
and CompleteWeightEnumerator over the same alphabet.
> G := GolayCode(GF(3), false);
> W := WeightEnumerator(G);
> P<x, y> := Parent(W);
> print W;
x^11 + 132*x^6*y^5 + 132*x^5*y^6 + 330*x^3*y^8 + 110*x^2*y^9 + 24*y^11
> CW := CompleteWeightEnumerator(G);
> CP<z0, z1, z2> := Parent(CW);
> print CW;
z0^11 + 11*z0^6*z1^5 + 55*z0^6*z1^3*z2^2 + 55*z0^6*z1^2*z2^3 + 11*z0^6*z2^5 +
11*z0^5*z1^6 + 110*z0^5*z1^3*z2^3 + 11*z0^5*z2^6 + 55*z0^3*z1^6*z2^2 +
110*z0^3*z1^5*z2^3 + 110*z0^3*z1^3*z2^5 + 55*z0^3*z1^2*z2^6 +
55*z0^2*z1^6*z2^3 + 55*z0^2*z1^3*z2^6 + z1^11 + 11*z1^6*z2^5 + 11*z1^5*z2^6
+ z2^11
[Next] [Prev] [Right] [Left] [Up] [Index] [Root]