[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Weight Distributions

In the case of a linear code, weight and distance distributions are equivalent (in particular minimum weight and minimum distance are equivalent).

Subsections

Hamming Weight

For an element x∈R for any finite ring R, the Hamming weight wH(x) is defined by: wH(x) = 0 iff x = 0, qquad wH(x) = 1 iff x ≠0 The Hamming weight wH(v) of a vector v∈(Rn) is defined to be the sum (in Z) of the Hamming weights of its components.

The Hamming weight is often referred to as simply the weight.

MinimumWeight(C) : Code -> RngIntElt
MinimumDistance(C) : Code -> RngIntElt
Determine the minimum (Hamming) weight of the words belonging to the code C, which is also the minimum distance between any two codewords.
WeightDistribution(C) : Code -> [ <RngIntElt, RngIntElt> ]
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, wi say, and the number of codewords having weight wi.
DualWeightDistribution(C) : Code -> [ <RngIntElt, RngIntElt> ]
The (Hamming) weight distribution of the dual code of C. For more explanation, see WeightDistribution.

Example CodeRng_weight-dist-cyc (H155E18)

We calculate the weight distribution of a cyclic code over the Galois ring of size 81.

> R<w> := GR(9,2);
> P<x> := PolynomialRing(R);
> L := CyclotomicFactors(R, 4);
> g := L[3] * L[4];
> g;
x^2 + (8*w + 7)*x + w + 1
> C := CyclicCode(4, g);
> C;
(4, 6561, 3) Cyclic Code over GaloisRing(3, 2, 2)
Generator matrix:
[      1       0   w + 1 8*w + 7]
[      0       1       w 8*w + 8]
> WeightDistribution(C);
[ <0, 1>, <3, 320>, <4, 6240> ]

Lee Weight

For an element x∈Z4, the Lee weight wL(x) is defined by: wL(0) = 0, wL(1) = wL(3) = 1, wL(2) = 2. The Lee weight wL(v) of a vector v∈(Z4n) is defined to be the sum (in Z) of the Lee weights of its components. See [Wan97, p. 16].

LeeWeight(a) : RngIntRes -> RngIntElt
The Lee weight of the element a∈Z4.
LeeWeight(v) : ModTupRngElt -> RngIntElt
The Lee weight of the codeword v.
LeeDistance(u, v) : ModTupRngElt, ModTupRngElt -> RngIntElt
The Lee distance between the codewords u and v, where u and v belong to the same code C. This is defined to be the Lee weight of (u - v).
MinimumLeeWeight(C) : Code -> RngIntElt
MinimumLeeDistance(C) : Code -> RngIntElt
The minimum Lee weight of the code C.
LeeWeightDistribution(C) : Code -> SeqEnum
The Lee weight distribution of the code C.
DualLeeWeightDistribution(C) : Code -> SeqEnum
The Lee weight distribution of the dual of the code C (see LeeWeightDistribution)
WordsOfLeeWeight(C, w) : Code, RngIntElt -> SetEnum
    Cutoff: RngIntElt                   Default: ∞
Given a linear code C, return the set of all words of C having Lee weight w. If Cutoff is set to a non-negative integer c, then the algorithm will terminate after a total of c words have been found.
WordsOfBoundedLeeWeight(C, l, u) : Code, RngIntElt, RngIntElt -> SetEnum
    Cutoff: RngIntElt                   Default: ∞
Given a linear code C, return the set of all words of C having Lee weight between l and u, inclusive. If Cutoff is set to a non-negative integer c, then the algorithm will terminate after a total of c words have been found.

Example CodeRng_lee-dist (H155E19)

We calculate the Lee weight distribution of a Reed Muller code over Z4 and enumerate all words of Lee weight 8.

> C := ReedMullerCodeZ4(1, 3);
> C;
(8, 256, 4) Linear Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 3 1 2 1]
[0 1 0 0 2 1 1 3]
[0 0 1 0 1 1 3 2]
[0 0 0 1 3 2 3 3]
> LeeWeightDistribution(C);
[ <0, 1>, <6, 112>, <8, 30>, <10, 112>, <16, 1> ]
> W := WordsOfLeeWeight(C, 8);
> #W;
30

Euclidean Weight

For an element x∈Z4, the Euclidean weight wE(x) is defined by: wE(0) = 0, wE(1) = wE(3) = 1, wE(2) = 4. The Euclidean weight wE(v) of a vector v∈(Z4n) is defined to be the sum (in Z) of the Euclidean weights of its components. See [Wan97, p. 16].

EuclideanWeight(a) : RngIntRes -> RngIntElt
The Euclidean weight of the element a∈Z4.
EuclideanWeight(v) : ModTupRngElt -> RngIntElt
The Euclidean weight of the Z4-codeword v.
EuclideanDistance(u, v) : ModTupRngElt, ModTupRngElt -> RngIntElt
The Euclidean distance between the Z4-codewords u and v, where u and v belong to the same code C. This is defined to be the Euclidean weight of (u - v).
MinimumEuclideanWeight(C) : Code -> RngIntElt
MinimumEuclideanDistance(C) : Code -> RngIntElt
The minimum Euclidean weight of the Z4-code C.
EuclideanWeightDistribution(C) : Code -> SeqEnum
The Euclidean weight distribution of the Z4-code C.
DualEuclideanWeightDistribution(C) : Code -> SeqEnum
The Euclidean weight distribution of the dual of the Z4-code C.

Example CodeRng_euclidean-dist (H155E20)

We calculate the Euclidean weight distribution of quadratic residue code over Z4

> C := QRCodeZ4(17);
> C;
(17, 262144) Cyclic Code over IntegerRing(4)
Generator matrix:
[1 0 0 0 0 0 0 0 0 1 1 3 0 3 0 3 1]
[0 1 0 0 0 0 0 0 0 3 0 2 3 1 3 1 2]
[0 0 1 0 0 0 0 0 0 2 1 2 2 1 1 1 3]
[0 0 0 1 0 0 0 0 0 1 3 0 2 1 1 0 2]
[0 0 0 0 1 0 0 0 0 2 3 1 0 0 1 3 2]
[0 0 0 0 0 1 0 0 0 2 0 1 1 2 0 3 1]
[0 0 0 0 0 0 1 0 0 3 1 1 1 2 2 1 2]
[0 0 0 0 0 0 0 1 0 2 1 3 1 3 2 0 3]
[0 0 0 0 0 0 0 0 1 1 3 0 3 0 3 1 1]
> EuclideanWeightDistribution(C);
[ <0, 1>, <7, 136>, <8, 170>, <9, 170>, <10, 408>, <11, 544>, <12, 986>, <13,
1768>, <14, 3128>, <15, 5032>, <16, 6120>, <17, 6360>, <18, 8432>, <19, 12512>,
<20, 12682>, <21, 11152>, <22, 14416>, <23, 17680>, <24, 16048>, <25, 15164>,
<26, 17952>, <27, 16864>, <28, 13328>, <29, 14144>, <30, 14144>, <31, 10064>,
<32, 7837>, <33, 8024>, <34, 6800>, <35, 4896>, <36, 3485>, <37, 2992>, <38,
2992>, <39, 1768>, <40, 510>, <41, 1258>, <42, 1224>, <44, 238>, <45, 408>, <46,
136>, <47, 136>, <48, 34>, <68, 1> ]

 [Next][Prev] [Right] [Left] [Up] [Index] [Root]

Version: V2.19 of Wed Apr 24 15:09:57 EST 2013