Macaulay2 » Documentation
Packages » CodingTheory > LinearCode > linearCode > cyclicCode
next | previous | forward | backward | up | index | toc

cyclicCode -- cyclic codes

Synopsis

Description

A linear code is called cyclic if $(a_{n},a_1,\ldots,a_{n-1})\in C$ for all $(a_1,a_2,\ldots,a_n)\in C$. A cyclic code can be defined by a polynomial.

a polynomial is given

Given a finite field F, an integer n, and a polynomial g in F$[x]\setminus$F that is a divisor of $x^n-1$, this function returns the cyclic code $C$ with generating polynomial g and length n.

If the polynomial g is not a divisor of $x^n-1$, the function returns a code with a circulant matrix as generator matrix.

i1 : F=GF(5);
i2 : R=F[x];
i3 : g=x-1;
i4 : C=cyclicCode(F,g,8)

                                  8
o4 = LinearCode{AmbientModule => F                                                                                                                                                                                         }
                BaseField => F
                cache => CacheTable{}
                Code => image | -1 0  0  0  0  0  0  |
                              | 1  -1 0  0  0  0  0  |
                              | 0  1  -1 0  0  0  0  |
                              | 0  0  1  -1 0  0  0  |
                              | 0  0  0  1  -1 0  0  |
                              | 0  0  0  0  1  -1 0  |
                              | 0  0  0  0  0  1  -1 |
                              | 0  0  0  0  0  0  1  |
                GeneratorMatrix => | -1 1  0  0  0  0  0  0 |
                                   | 0  -1 1  0  0  0  0  0 |
                                   | 0  0  -1 1  0  0  0  0 |
                                   | 0  0  0  -1 1  0  0  0 |
                                   | 0  0  0  0  -1 1  0  0 |
                                   | 0  0  0  0  0  -1 1  0 |
                                   | 0  0  0  0  0  0  -1 1 |
                Generators => {{-1, 1, 0, 0, 0, 0, 0, 0}, {0, -1, 1, 0, 0, 0, 0, 0}, {0, 0, -1, 1, 0, 0, 0, 0}, {0, 0, 0, -1, 1, 0, 0, 0}, {0, 0, 0, 0, -1, 1, 0, 0}, {0, 0, 0, 0, 0, -1, 1, 0}, {0, 0, 0, 0, 0, 0, -1, 1}}
                ParityCheckMatrix => | 1 1 1 1 1 1 1 1 |
                ParityCheckRows => {{1, 1, 1, 1, 1, 1, 1, 1}}

o4 : LinearCode

a constant polynomial is given

If m is a nonzero constant, then this function returns the universal code of length n over the field F.

If m is zero, then this function returns the zero code of length n.

i5 : F=GF(5);
i6 : R=F[x];
i7 : C=cyclicCode(F,0,5)

                                  5
o7 = LinearCode{AmbientModule => F                                                                                      }
                BaseField => F
                cache => CacheTable{}
                GeneratorMatrix => 0
                Generators => {{}}
                ParityCheckMatrix => | 1 0 0 0 0 |
                                     | 0 1 0 0 0 |
                                     | 0 0 1 0 0 |
                                     | 0 0 0 1 0 |
                                     | 0 0 0 0 1 |
                ParityCheckRows => {{1, 0, 0, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}

o7 : LinearCode
i8 : C=cyclicCode(F,2,5)

                                  5
o8 = LinearCode{AmbientModule => F                                                                                 }
                BaseField => F
                cache => CacheTable{}
                GeneratorMatrix => | 1 0 0 0 0 |
                                   | 0 1 0 0 0 |
                                   | 0 0 1 0 0 |
                                   | 0 0 0 1 0 |
                                   | 0 0 0 0 1 |
                Generators => {{1, 0, 0, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}
                ParityCheckMatrix => 0
                ParityCheckRows => {{}}

o8 : LinearCode

Ways to use cyclicCode :

For the programmer

The object cyclicCode is a method function.

Menu

Related functions: