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

toString(LinearCode) -- string with the vectors of a generator matrix of a code

Synopsis

Description

Given a linear code C, this function returns a string that contains the rows of a generator matrix of C.

i1 : L = {{0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 1, 1, 0,1, 0, 0}, {1, 1, 0, 0, 0, 1, 0, 0, 1, 0}, {1, 0, 0, 1, 0, 0, 0, 1, 1, 1}}

o1 = {{0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 1, 1, 0, 1, 0, 0}, {1, 1,
     ------------------------------------------------------------------------
     0, 0, 0, 1, 0, 0, 1, 0}, {1, 0, 0, 1, 0, 0, 0, 1, 1, 1}}

o1 : List
i2 : C = linearCode(GF(2),L)

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

o2 : LinearCode
i3 : S=toString C

o3 = {{0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 1, 1, 0, 1, 0, 0}, {1, 1,
     0, 0, 0, 1, 0, 0, 1, 0}, {1, 0, 0, 1, 0, 0, 0, 1, 1, 1}}

Ways to use this method: