Previous Up Next

11.8.18  Construction of a Galois field

A Galois field is a finite field. A Galois field has the characteristic p for some prime number p, and its order is pn for some integer n. Any Galois field of order pn is isomorphic to ℤ/pℤ[X]/I, where I is the ideal generated by an irreducible polynomial P(X) in ℤ/pℤ[X]

The GF command creates Galois fields.

Examples

To create a Galois field with parameters p=2 and n=8, input:

GF(2,8)
     
GF(2,k8+k4+k3+k2+1,
k,K,g
,undef)
          

The field K has 28=256 elements and g generates the multiplicative group of this field ({1,g,g2,…,g254}). The elements of this field can be written as polynomials in g or as K(P(k)), where P(k) is a polynomial in k.

g^9

or:

K(k^9)
     
(g5+g4+g3+g)           

Indeed, g8=g4+g3+g2+1 and therefore g9=g5+g4+g3+g.

Compute the inverse of a matrix in a Galois field:

GF(3,5,b):; A:=[[1,b],[b,1]]:; inv(A)
     


    (b3+b2b)(−b4b3+b2)
    (−b4b3+b2)(b3+b2b)


          

Factor a polynomial over a Galois field:

GF(5,3,c):; p:=x^2-c-1:; factor(p)
     


1%5
x+
(−2 c2+2 c)



1%5
x+
(2 c2−2 c)

          

As one can see in the these examples, the output contains many times the same information that you would prefer not to see if you work many times with the same field. For this reason, the definition of a Galois field may have an optional argument, a variable name which will be used thereafter to represent elements of the field. Since you will also most likely want to modify the name of the indeterminate, the field name is grouped with the variable name in a list passed as third argument to GF. Note that these two variable names must be quoted.

G:=GF(2,2,['w','G']):; G(w^2)
     
Done,G
w+1
          
G(w^3)
     
G(1)           

Hence, the elements of GF(2,2) are G(0), G(1), G(w) and G(w^2)=G(w+1).

We may also impose the irreducible primitive polynomial that we wish to use, by putting it as second argument (instead of n), for example:

G:=GF(2,w^8+w^6+w^3+w^2+1,['w','G'])

If the polynomial is not primitive, Xcas will replace it automatically by a primitive polynomial, for example:

G:=GF(2,w^8+w^7+w^5+w+1,['w','G'])
     
GF
2,w8+w7+w5+w+1,
w,G
,undef
          

Previous Up Next