Previous Up Next

2.31.18  Construction of a Galois field : GF

GF takes as arguments a prime integer p and an integer n>1.
GF returns a Galois field of caracteristic p having pn elements.
Elements of the field and the field itself are represented by GF(...) where ... is the following sequence:

You should give a name to this field (for example G:=GF(p,n)), in order to build elements of the field from a polynomial in ℤ/pℤ[X], for example G(x^3+x). Note that G(x) is a generator of the multiplicative group G*.
Input :


Output :


The field G has 28=256 elements and x generates the multiplicative group of this field ({ 1,x,x2,...x254 }).
Input :


Output :


indeed x8=x6+x4+x3+x2+x+1, hence x9=x7+x5+x4+x3+x2+x.
Input :


Output should be the unit, indeed:


As one can see on these examples, the output contains many times the same informations that you would prefer no to see if you work many times with the same field. For this reason, the definition of a Galois field may have an optionnal 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.
Example, input :

G:=GF(2,2,[’w’,’G’]):; G(w^2)

Output :

Done, G(w+1)

Input :


Output :


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

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


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


Output :


Previous Up Next