Macaulay2 » Documentation
Packages » CodingTheory > size(LinearCode)
next | previous | forward | backward | up | index | toc

size(LinearCode) -- gives the number of codewords in a linear code

Synopsis

Description

Given a linear code C of dimension $k$ over a Galois field with $q$ elements, returns the number of codewords in C, which is $q^k$.

This method is provided by the package CodingTheory.

i1 : C = linearCode(GF(4),{{1,1,1,1}});
i2 : size C

o2 = 4
i3 : H = hammingCode(2,3);
i4 : size H

o4 = 16
i5 : F = GF(4,Variable=>a);
i6 : L = {{1,a,a+1},{a+1,1,a},{a,a+1,1},{1,0,1}};
i7 : C = linearCode(F,L);
i8 : size C

o8 = 16

The next example illustrates how to use this function for the class of Evaluation Codes.

i9 : RM = reedMullerCode(2,3,1);
i10 : size RM.LinearCode

o10 = 16

Ways to use this method: