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

# genericCode -- ambient space of a code

- Usage:
    `genericCode(C)`
- Inputs:
  - C, an instance of the type LinearCode,
- Outputs:
  - an instance of the type LinearCode,

## Description

Given a code C over a finite field $F$ of length $n$, returns the code $F^n$.

    i1 : F=GF(4,Variable=>a);

    i2 : C=linearCode(matrix{{1,a,0},{0,1,a}})

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

    o2 : LinearCode

    i3 : genericCode(C)

                                      3
    o3 = LinearCode{AmbientModule => F                             }
                    BaseField => F
                    cache => CacheTable{}
                    Code => image | 1 0 0 |
                                  | 0 1 0 |
                                  | 0 0 1 |
                    GeneratorMatrix => | 1 0 0 |
                                       | 0 1 0 |
                                       | 0 0 1 |
                    Generators => {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}
                    ParityCheckMatrix => 0
                    ParityCheckRows => {}

    o3 : LinearCode

## Ways to use genericCode:

- `genericCode(LinearCode)`

## For the programmer

The object genericCode is a method function.

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