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

dim(LinearCode) -- dimension of a linear code

Synopsis

Description

Given a linear code C, returns the dimension of C. The dimension of C is defined as the dimension of C as a vector space.

i1 : C = linearCode(GF(2),{{1,1,0,0},{0,0,1,1}});
i2 : dim C

o2 = 2
i3 : H = hammingCode(2,3)

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

o3 : LinearCode
i4 : dim H

o4 = 4

Ways to use this method: