next up previous contents
Next: Some simple codes Up: Basic coding theory examples Previous: Contents   Contents

Background on finite fields

The finite fields in GAP are of the form $\mathbb{F}_{p^k}=GF(p^k)$, where $p$ is a prime power and $k\geq 1$ is an integer. Let's start with something simple: enter $\mathbb{F}_2$ and $\mathbb{F}_3$ and print out all their elements.

gap> GF2:=GF(2);
GF(2)
gap> gf2:=Elements(GF2);
[ 0*Z(2), Z(2)^0 ]
gap> GF3:=GF(3);
GF(3)
gap> gf3:=Elements(GF3);
[ 0*Z(3), Z(3)^0, Z(3) ]

What are $Z(2)$, $Z(3)$? In general, $\mathbb{F}_{p^k}^\times$ is a cyclic group. In GAP, $Z(p^k)$ denote a particular generator of this cyclic group. If $k=1$ then giving a generator of $\mathbb{F}_p^\times = (\mathbb{Z}/p\mathbb{Z})^\times$ is equivalent to giving a primitive root mod $p$. In fact, $Z(p)$ is the smallest primitive root mod $p$, as is obtained from the PrimitiveRootMod function. Here's how to verify this for $p=3,5$:

gap> PrimitiveRootMod(3);
2
gap> 2*Z(3)^0=Z(3);
true
gap> PrimitiveRootMod(5)*Z(5)^0=Z(5);
true

We turn to the analogous question for fields $\mathbb{F}_{p^k}$ with $k>1$.

gap> GF4:=GF(4);
GF(2^2)
gap> gf4:=Elements(GF4);
[ 0*Z(2), Z(2)^0, Z(2^2), Z(2^2)^2 ]
gap> GF7:=GF(7);
GF(7)
gap> GF8:=GF(8);
GF(2^3)
gap> gf8:=Elements(GF8);
[ 0*Z(2), Z(2)^0, Z(2^3), Z(2^3)^2, Z(2^3)^3, Z(2^3)^4, Z(2^3)^5, Z(2^3)^6 ]
gap> GF9:=GF(9);
GF(3^2)
gap> gf9:=Elements(GF9);
[ 0*Z(3), Z(3)^0, Z(3), Z(3^2), Z(3^2)^2, Z(3^2)^3, Z(3^2)^5, Z(3^2)^6, 
  Z(3^2)^7 ]

Note that $GF(8)$ contains $GF(2)$ but not $GF(4)$. (It is a general fact that $GF(p^m)$ contains $GF(p^k)$ as a subfield if and only if $k$ divides $m$.)

What are Z(2^2), Z(2^3), Z(3^2), ...? They are less easy to explicitly explain. $Z(p^k)$ is a root of a certain irreducible polynomial mod $p$ called a Conway polynomial, which we will not define here. GAP can construct Conway polynomials, so in any given situation we can check that this is the case by plugging this supposed root into the polynomial and see if we get $0$ or not.

gap> R:=PolynomialRing(GF2,["x"]);
<algebra-with-one over GF(2), with 1 generators>
gap> p:=ConwayPolynomial(2,3);
Z(2)^0+x+x^3
gap> Value(p,Z(8));
0*Z(2)

This tells us that the generator of $GF(8)$ is a root of the polynomial $x^3 + x + 1$ mod $2$.

Now we know how finite fields are represented as sets in GAP, notice how easy it is to use GAP to to basic arithmetic in a finite field. Let's try adding, subtracting, and multiplying field elements in GAP.

gap> gf9[3]; gf9[6]; gf9[3]+gf9[6];
Z(3)
Z(3^2)^3
Z(3^2)^5
gap> gf9[3]; gf9[6]; gf9[3]*gf9[6];
Z(3)
Z(3^2)^3
Z(3^2)^7
gap> gf8[4]; gf8[6]; gf8[4]*gf8[6];
Z(2^3)^2
Z(2^3)^4
Z(2^3)^6
gap> gf8[4]; gf8[6]; gf8[4]+gf8[6];
Z(2^3)^2
Z(2^3)^4
Z(2^3)


next up previous contents
Next: Some simple codes Up: Basic coding theory examples Previous: Contents   Contents
David Joyner 2003-02-18