property galois.ReedSolomon.G : FieldArray

The generator matrix $$\mathbf{G}$$ with shape $$(k, n)$$.

Examples

Construct a primitive $$\textrm{RS}(15, 9)$$ code over $$\mathrm{GF}(2^4)$$.

In [1]: rs = galois.ReedSolomon(15, 9); rs
Out[1]: <Reed-Solomon Code: [15, 9, 7] over GF(2^4)>

In [2]: rs.G
Out[2]:
GF([[ 1,  0,  0,  0,  0,  0,  0,  0,  0, 10,  3,  5, 13,  1,  8],
[ 0,  1,  0,  0,  0,  0,  0,  0,  0, 15,  1, 13,  7,  5, 13],
[ 0,  0,  1,  0,  0,  0,  0,  0,  0, 11, 11, 13,  3, 10,  7],
[ 0,  0,  0,  1,  0,  0,  0,  0,  0,  3,  2,  3,  8,  4,  7],
[ 0,  0,  0,  0,  1,  0,  0,  0,  0,  3, 10, 10,  6, 15,  9],
[ 0,  0,  0,  0,  0,  1,  0,  0,  0,  5, 11,  1,  5, 15, 11],
[ 0,  0,  0,  0,  0,  0,  1,  0,  0,  2, 11, 10,  7, 14,  8],
[ 0,  0,  0,  0,  0,  0,  0,  1,  0, 15,  9,  5,  8, 15,  2],
[ 0,  0,  0,  0,  0,  0,  0,  0,  1,  7,  9,  3, 12, 10, 12]],
order=2^4)


Construct a non-primitive $$\textrm{RS}(13, 9)$$ code over $$\mathrm{GF}(3^3)$$.

In [3]: rs = galois.ReedSolomon(13, 9, field=galois.GF(3**3)); rs
Out[3]: <Reed-Solomon Code: [13, 9, 5] over GF(3^3)>

In [4]: rs.G
Out[4]:
GF([[ 1,  0,  0,  0,  0,  0,  0,  0,  0, 13, 20,  9, 16],
[ 0,  1,  0,  0,  0,  0,  0,  0,  0, 14, 12,  7,  6],
[ 0,  0,  1,  0,  0,  0,  0,  0,  0, 17, 15, 17, 21],
[ 0,  0,  0,  1,  0,  0,  0,  0,  0, 12, 25, 19, 13],
[ 0,  0,  0,  0,  1,  0,  0,  0,  0, 19, 15,  8,  3],
[ 0,  0,  0,  0,  0,  1,  0,  0,  0, 22, 24, 13,  9],
[ 0,  0,  0,  0,  0,  0,  1,  0,  0, 10, 10,  9, 18],
[ 0,  0,  0,  0,  0,  0,  0,  1,  0, 20, 22, 25,  4],
[ 0,  0,  0,  0,  0,  0,  0,  0,  1,  9,  8, 11, 22]], order=3^3)

In [5]: rs = galois.ReedSolomon(13, 9, field=galois.GF(3**3), systematic=False); rs
Out[5]: <Reed-Solomon Code: [13, 9, 5] over GF(3^3)>

In [6]: rs.G
Out[6]:
GF([[ 1,  9,  8, 11, 22,  0,  0,  0,  0,  0,  0,  0,  0],
[ 0,  1,  9,  8, 11, 22,  0,  0,  0,  0,  0,  0,  0],
[ 0,  0,  1,  9,  8, 11, 22,  0,  0,  0,  0,  0,  0],
[ 0,  0,  0,  1,  9,  8, 11, 22,  0,  0,  0,  0,  0],
[ 0,  0,  0,  0,  1,  9,  8, 11, 22,  0,  0,  0,  0],
[ 0,  0,  0,  0,  0,  1,  9,  8, 11, 22,  0,  0,  0],
[ 0,  0,  0,  0,  0,  0,  1,  9,  8, 11, 22,  0,  0],
[ 0,  0,  0,  0,  0,  0,  0,  1,  9,  8, 11, 22,  0],
[ 0,  0,  0,  0,  0,  0,  0,  0,  1,  9,  8, 11, 22]], order=3^3)

In [7]: rs.generator_poly
Out[7]: Poly(x^4 + 9x^3 + 8x^2 + 11x + 22, GF(3^3))