GF takes as arguments a prime integer p
and an integer n>1.
GF returns a Galois field of caracteristic p having p^{n}
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 :
^
8-x^
6-x^
4-x^
3-x^
2-x-1,x,undef)
The field G has 2^{8}=256 elements and
x generates the multiplicative group
of this field ({ 1,x,x^{2},...x^{254} }).
Input :
^
9)Output :
^
8-x^
6-x^
4-x^
3-x^
2-x-1,x,x^
7+x^
5+x^
4+x^
3+x^
2+x)
indeed x^{8}=x^{6}+x^{4}+x^{3}+x^{2}+x+1, hence x^{9}=x^{7}+x^{5}+x^{4}+x^{3}+x^{2}+x.
Input :
^
255Output should be the unit, indeed:
^
8-x^
6-x^
4-x^
3-x^
2-x-1,x,1)
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 :
^
2)Output :
Input :
^
3)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 :
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'])
Output :
G:=GF(2,w^8-w^6-w^3-w^2-1,['w','G'],undef)