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

zeroSumCode -- linear code in which the entries of each codeword add up zero

Synopsis

Description

Returns the code $C$ of length n over F such that for any $c\in C$, $\sum_{i=1}^n c_i=0$. The dual of the code $C$ is the repetition code. In the binary case, this code $C$ equals the code of all even-weight codewords.

i1 : D = zeroSumCode(GF 3,5)

                                       5
o1 = LinearCode{AmbientModule => (GF 3)                                                               }
                BaseField => GF 3
                cache => CacheTable{}
                Code => image | -1 -1 -1 -1 |
                              | 1  0  0  0  |
                              | 0  1  0  0  |
                              | 0  0  1  0  |
                              | 0  0  0  1  |
                GeneratorMatrix => | -1 1 0 0 0 |
                                   | -1 0 1 0 0 |
                                   | -1 0 0 1 0 |
                                   | -1 0 0 0 1 |
                Generators => {{-1, 1, 0, 0, 0}, {-1, 0, 1, 0, 0}, {-1, 0, 0, 1, 0}, {-1, 0, 0, 0, 1}}
                ParityCheckMatrix => | 1 1 1 1 1 |
                ParityCheckRows => {{1, 1, 1, 1, 1}}

o1 : LinearCode
i2 : E = zeroSumCode(GF 8,5)

                                       5
o2 = LinearCode{AmbientModule => (GF 8)                                                           }
                BaseField => GF 8
                cache => CacheTable{}
                Code => image | 1 1 1 1 |
                              | 1 0 0 0 |
                              | 0 1 0 0 |
                              | 0 0 1 0 |
                              | 0 0 0 1 |
                GeneratorMatrix => | 1 1 0 0 0 |
                                   | 1 0 1 0 0 |
                                   | 1 0 0 1 0 |
                                   | 1 0 0 0 1 |
                Generators => {{1, 1, 0, 0, 0}, {1, 0, 1, 0, 0}, {1, 0, 0, 1, 0}, {1, 0, 0, 0, 1}}
                ParityCheckMatrix => | 1 1 1 1 1 |
                ParityCheckRows => {{1, 1, 1, 1, 1}}

o2 : LinearCode

Ways to use zeroSumCode :

For the programmer

The object zeroSumCode is a method function.