Finite fields are of course domains. Thus all set theoretic functions are applicable to finite fields (see chapter Domains). This section gives further comments on the definitions and implementations of those functions for finite fields. All set theoretic functions not mentioned here are not treated specially for finite fields.
Elements
The elements of a finite field are computed using the fact that the finite field is a vector space over its prime field.
in
The membership test is of course very simple, we just have to test
whether the element is a finite field element with IsFFE
, whether it
has the correct characteristic with CharFFE
, and whether its degree
divides the degree of the finite field with DegreeFFE
(see IsFFE,
CharFFE, and DegreeFFE).
Random
A random element of GF(p^n) is computed by computing a random integer i from [0..p^n-1] and returning 0*Z(p) if i = 0 and Z(p^n)^{i-1} otherwise.
Intersection
The intersection of GF(p^n) and GF(p^m) is the finite field GF(p^{Gcd(n,m)}), and is returned as finite field record.
GAP 3.4.4