Macaulay2 » Documentation
Packages » CodingTheory > EvaluationCode > evaluationCode > cartesianCode
next | previous | forward | backward | up | index | toc

cartesianCode -- Cartesian code

Synopsis

Description

We present below the ways in how a Cartesian code $C$ can be defined.

a ring, a list and an integer are given

F is a field, L is a list of subsets of F and d is an integer. Returns the Cartesian code $C$ obtained when polynomials of degree at most d are evaluated over the points of the Cartesian product made by the subsets of L.

i1 : C=cartesianCode(ZZ/11,{{1,2,3},{2,6,8}},3)

o1 = EvaluationCode{cache => CacheTable{}                                                                                                                                                                                                                                                                                                                                                             }
                                                               ZZ 9
                    LinearCode => LinearCode{AmbientModule => (--)                                                                                                                                                                                                                                                                                                                                   }
                                                               11
                                                          ZZ
                                             BaseField => --
                                                          11
                                             cache => CacheTable{}
                                             Code => image | 1 1 1  1  -5 -5 3  -5 3  -4 |
                                                           | 1 2 4  -3 2  1  -5 -5 3  -4 |
                                                           | 1 3 -2 5  -1 -4 -2 -5 3  -4 |
                                                           | 1 1 1  1  -3 -3 -2 -3 -2 -5 |
                                                           | 1 2 4  -3 -1 5  -4 -3 -2 -5 |
                                                           | 1 3 -2 5  -5 2  5  -3 -2 -5 |
                                                           | 1 1 1  1  2  2  4  2  4  -3 |
                                                           | 1 2 4  -3 -3 4  -3 2  4  -3 |
                                                           | 1 3 -2 5  -4 -5 1  2  4  -3 |
                                             GeneratorMatrix => | 1  1  1  1  1  1  1  1  1  |
                                                                | 1  2  3  1  2  3  1  2  3  |
                                                                | 1  4  -2 1  4  -2 1  4  -2 |
                                                                | 1  -3 5  1  -3 5  1  -3 5  |
                                                                | -5 2  -1 -3 -1 -5 2  -3 -4 |
                                                                | -5 1  -4 -3 5  2  2  4  -5 |
                                                                | 3  -5 -2 -2 -4 5  4  -3 1  |
                                                                | -5 -5 -5 -3 -3 -3 2  2  2  |
                                                                | 3  3  3  -2 -2 -2 4  4  4  |
                                                                | -4 -4 -4 -5 -5 -5 -3 -3 -3 |
                                             Generators => {{1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 2, 3, 1, 2, 3, 1, 2, 3}, {1, 4, -2, 1, 4, -2, 1, 4, -2}, {1, -3, 5, 1, -3, 5, 1, -3, 5}, {-5, 2, -1, -3, -1, -5, 2, -3, -4}, {-5, 1, -4, -3, 5, 2, 2, 4, -5}, {3, -5, -2, -2, -4, 5, 4, -3, 1}, {-5, -5, -5, -3, -3, -3, 2, 2, 2}, {3, 3, 3, -2, -2, -2, 4, 4, 4}, {-4, -4, -4, -5, -5, -5, -3, -3, -3}}
                                             ParityCheckMatrix => | 1 -2 1 3 5 3 -4 -3 -4 |
                                             ParityCheckRows => {{1, -2, 1, 3, 5, 3, -4, -3, -4}}
                    Points => {{1, 6}, {2, 6}, {3, 6}, {1, 8}, {2, 8}, {3, 8}, {1, 2}, {2, 2}, {3, 2}}
                                              2   3   2             2       2   3
                    PolynomialSet => {1, t , t , t , t t , t t , t t , t , t , t }
                                          0   0   0   0 1   0 1   0 1   1   1   1
                    Sets => {{1, 2, 3}, {2, 6, 8}}
                                              3     2       3     2
                    VanishingIdeal => ideal (t  + 5t  + 5, t  - 5t  - t  + 3)
                                              0     0       1     1    1

o1 : EvaluationCode

a ring and two lists are given

F is a field, L is a list of subsets of F and S is a set of polynomials. Returns the Cartesian code $C$ obtained when polynomials in the list S are evaluated over the points of the Cartesian product made by the subsets of L.

i2 : F=GF(4);
i3 : R=F[x,y];
i4 : C=cartesianCode(F,{{0,1,a},{0,1,a}},{1+x+y,x*y})

o4 = EvaluationCode{cache => CacheTable{}                                                                                                                                                                                                                                           }
                                                               9
                    LinearCode => LinearCode{AmbientModule => F                                                                                                                                                                                                                    }
                                             BaseField => F
                                             cache => CacheTable{}
                                             Code => image | 1   a+1 |
                                                           | 1   0   |
                                                           | 0   0   |
                                                           | 0   0   |
                                                           | 1   1   |
                                                           | a+1 0   |
                                                           | a+1 0   |
                                                           | a   a   |
                                                           | a   a   |
                                             GeneratorMatrix => | 1   1 0 0 1 a+1 a+1 a a |
                                                                | a+1 0 0 0 1 0   0   a a |
                                             Generators => {{1, 1, 0, 0, 1, a + 1, a + 1, a, a}, {a + 1, 0, 0, 0, 1, 0, 0, a, a}}
                                             ParityCheckMatrix => | 1 0 0 0 0 a+1 0 a   0 |
                                                                  | 0 1 0 0 0 a   0 0   0 |
                                                                  | 0 0 1 0 0 0   0 0   0 |
                                                                  | 0 0 0 1 0 0   0 0   0 |
                                                                  | 0 0 0 0 1 0   0 a+1 0 |
                                                                  | 0 0 0 0 0 1   1 0   0 |
                                                                  | 0 0 0 0 0 0   0 1   1 |
                                             ParityCheckRows => {{1, 0, 0, 0, 0, a + 1, 0, a, 0}, {0, 1, 0, 0, 0, a, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, a + 1, 0}, {0, 0, 0, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1, 1}}
                    Points => {{a, a}, {0, 0}, {1, 0}, {0, 1}, {1, 1}, {0, a}, {a, 0}, {a, 1}, {1, a}}
                    PolynomialSet => {x + y + 1, x*y}
                    Sets => {{0, 1, a}, {0, 1, a}}
                                              3           2         3           2
                    VanishingIdeal => ideal (x  + (a + 1)x  + a*x, y  + (a + 1)y  + a*y)

o4 : EvaluationCode
i5 : C.LinearCode

                                  9
o5 = LinearCode{AmbientModule => F                                                                                                                                                                                                                    }
                BaseField => F
                cache => CacheTable{}
                Code => image | 1   a+1 |
                              | 1   0   |
                              | 0   0   |
                              | 0   0   |
                              | 1   1   |
                              | a+1 0   |
                              | a+1 0   |
                              | a   a   |
                              | a   a   |
                GeneratorMatrix => | 1   1 0 0 1 a+1 a+1 a a |
                                   | a+1 0 0 0 1 0   0   a a |
                Generators => {{1, 1, 0, 0, 1, a + 1, a + 1, a, a}, {a + 1, 0, 0, 0, 1, 0, 0, a, a}}
                ParityCheckMatrix => | 1 0 0 0 0 a+1 0 a   0 |
                                     | 0 1 0 0 0 a   0 0   0 |
                                     | 0 0 1 0 0 0   0 0   0 |
                                     | 0 0 0 1 0 0   0 0   0 |
                                     | 0 0 0 0 1 0   0 a+1 0 |
                                     | 0 0 0 0 0 1   1 0   0 |
                                     | 0 0 0 0 0 0   0 1   1 |
                ParityCheckRows => {{1, 0, 0, 0, 0, a + 1, 0, a, 0}, {0, 1, 0, 0, 0, a, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, a + 1, 0}, {0, 0, 0, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1, 1}}

o5 : LinearCode

a ring, a list and a Matrix are given

F is a field, L is a list of subsets of F and M is the matrix whose rows are the exponents of the monomials to evaluate. Returns the Cartesian code $C$ obtained when the monomials defined by the matrix M are evaluated over the points of the Cartesian product made by the subsets of L.

i6 : F=GF(4);
i7 : R=F[x,y];
i8 : C=cartesianCode(F,{{0,1,a},{0,1,a}},matrix{{1,2},{2,3}})

o8 = EvaluationCode{cache => CacheTable{}                                                                                                                                                                                                                                       }
                                                               9
                    LinearCode => LinearCode{AmbientModule => F                                                                                                                                                                                                                }
                                             BaseField => F
                                             cache => CacheTable{}
                                             Code => image | 0   0   |
                                                           | 0   0   |
                                                           | a   a+1 |
                                                           | a+1 1   |
                                                           | 1   a+1 |
                                                           | 0   0   |
                                                           | 0   0   |
                                                           | 0   0   |
                                                           | 1   1   |
                                             GeneratorMatrix => | 0 0 a   a+1 1   0 0 0 1 |
                                                                | 0 0 a+1 1   a+1 0 0 0 1 |
                                             Generators => {{0, 0, a, a + 1, 1, 0, 0, 0, 1}, {0, 0, a + 1, 1, a + 1, 0, 0, 0, 1}}
                                             ParityCheckMatrix => | 1 0 0 0 0   0 0 0 0 |
                                                                  | 0 1 0 0 0   0 0 0 0 |
                                                                  | 0 0 1 0 a+1 0 0 0 1 |
                                                                  | 0 0 0 1 1   0 0 0 a |
                                                                  | 0 0 0 0 0   1 0 0 0 |
                                                                  | 0 0 0 0 0   0 1 0 0 |
                                                                  | 0 0 0 0 0   0 0 1 0 |
                                             ParityCheckRows => {{1, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, a + 1, 0, 0, 0, 1}, {0, 0, 0, 1, 1, 0, 0, 0, a}, {0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1, 0}}
                    Points => {{0, a}, {a, 0}, {a, 1}, {1, a}, {a, a}, {0, 0}, {1, 0}, {0, 1}, {1, 1}}
                                         2   2 3
                    PolynomialSet => {t t , t t }
                                       0 1   0 1
                    Sets => {{0, 1, a}, {0, 1, a}}
                                              3           2          3           2
                    VanishingIdeal => ideal (t  + (a + 1)t  + a*t , t  + (a + 1)t  + a*t )
                                              0           0      0   1           1      1

o8 : EvaluationCode

Caveat

While this function may work even when a ring is given, instead of a finite field, it is possible that the results are not the expected ones.

Ways to use cartesianCode :

For the programmer

The object cartesianCode is a method function with options.

Menu

Symbols that are used as a key for storing information of a Cartesian code