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

# cyclicMatrix -- cyclic matrix

- Usage:
    `cyclicMatrix(v)`
    `cyclicMatrix(F,v)`
- Inputs:
  - v, a list,
  - F, a Galois field,
- Outputs:
  - a matrix, $M$

## Description

A cyclic matrix (also known as circulant matrix) is a square matrix whose every row (starting from the second) is the right cyclic shift by one entry of the previous row. Below we present ways to define a cyclic matrix $M$.

## a list is given

- Usage:
    `cyclicMatrix(v)`
- Inputs:
  - v, a list,
- Outputs:
  - a matrix, $M$

Assume that $v_1,\ldots,v_n$ are the entries of v. The output is an $n\times n$ matrix. The entries of row 1 are $v_1,\ldots,v_n$, the entries of row 2 are $v_2,\ldots,v_n,v_1$, in general, the entries of row $i$ are $v_i,\ldots,v_n,v_1,\ldots, v_{i-1}$.

    i1 : v=toList(1,0,2,0);

    i2 : M =cyclicMatrix(v)

    o2 = | 1 0 2 0 |
         | 0 1 0 2 |
         | 2 0 1 0 |
         | 0 2 0 1 |

                  4       4
    o2 : Matrix ZZ  <-- ZZ

## a finite field and a list are given

- Usage:
    `cyclicMatrix(v,F)`
- Inputs:
  - v, a list,
  - F, a Galois field,
- Outputs:
  - a matrix, $M$

Assume that $v_1,\ldots,v_n$ are the entries of v. The output is an $n\times n$ matrix over F. The entries of row 1 are $v_1,\ldots,v_n$, the entries of row 2 are $v_2,\ldots,v_n,v_1$, in general, the entries of row $i$ are $v_i,\ldots,v_n,v_1,\ldots, v_{i-1}$.

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

    i4 : v={0,1,a};

    i5 : M=cyclicMatrix(F,v)

    o5 = | 0 1 a |
         | a 0 1 |
         | 1 a 0 |

                 3      3
    o5 : Matrix F  <-- F

## Ways to use cyclicMatrix:

- `cyclicMatrix(GaloisField,List)`
- `cyclicMatrix(List)`

## For the programmer

The object cyclicMatrix is a method function.

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