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

# dim(LinearCode) -- dimension of a linear code

- Function: dim
- Usage:
    `dim C`
- Inputs:
  - C, an instance of the type LinearCode,
- Outputs:
  - a number,

## 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 1 0 1 |
                                  | 1 0 1 1 |
                                  | 1 1 1 0 |
                                  | 1 0 0 0 |
                                  | 0 1 0 0 |
                                  | 0 0 1 0 |
                                  | 0 0 0 1 |
                    GeneratorMatrix => | 1 1 1 1 0 0 0 |
                                       | 1 0 1 0 1 0 0 |
                                       | 0 1 1 0 0 1 0 |
                                       | 1 1 0 0 0 0 1 |
                    Generators => {{1, 1, 1, 1, 0, 0, 0}, {1, 0, 1, 0, 1, 0, 0}, {0, 1, 1, 0, 0, 1, 0}, {1, 1, 0, 0, 0, 0, 1}}
                    ParityCheckMatrix => | 1 1 1 1 0 0 0 |
                                         | 0 0 1 1 1 1 0 |
                                         | 0 1 0 1 0 1 1 |
                    ParityCheckRows => {{1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 0}, {0, 1, 0, 1, 0, 1, 1}}

    o3 : LinearCode

    i4 : dim H

    o4 = 4

## Ways to use this method:

- dim(LinearCode) -- dimension of a linear code

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/CodingTheory.m2:4204:0.