AUTHORS:
Bases: sage.rings.finite_rings.finite_field_base.FiniteField
Finite fields whose cardinality is a prime power (not a prime), implemented using PARI’s FFELT type.
INPUT:
OUTPUT:
A finite field of order , generated by a distinguished
element with minimal polynomial modulus. Elements are
represented as polynomials in name of degree less than
.
Note
Direct construction of FiniteField_pari_ffelt objects requires specifying a characteristic and a modulus. To construct a finite field by specifying a cardinality and an algorithm for finding an irreducible polynomial, use the FiniteField constructor with impl='pari_ffelt'.
EXAMPLES:
Some computations with a finite field of order 9:
sage: k = FiniteField(9, 'a', impl='pari_ffelt')
sage: k
Finite Field in a of size 3^2
sage: k.is_field()
True
sage: k.characteristic()
3
sage: a = k.gen()
sage: a
a
sage: a.parent()
Finite Field in a of size 3^2
sage: a.charpoly('x')
x^2 + 2*x + 2
sage: [a^i for i in range(8)]
[1, a, a + 1, 2*a + 1, 2, 2*a, 2*a + 2, a + 2]
sage: TestSuite(k).run()
Next we compute with a finite field of order 16:
sage: k16 = FiniteField(16, 'b', impl='pari_ffelt')
sage: z = k16.gen()
sage: z
b
sage: z.charpoly('x')
x^4 + x + 1
sage: k16.is_field()
True
sage: k16.characteristic()
2
sage: z.multiplicative_order()
15
Illustration of dumping and loading:
sage: K = FiniteField(7^10, 'b', impl='pari_ffelt')
sage: loads(K.dumps()) == K
True
sage: K = FiniteField(10007^10, 'a', impl='pari_ffelt')
sage: loads(K.dumps()) == K
True
alias of FiniteFieldElement_pari_ffelt
Return the characteristic of self.
EXAMPLE:
sage: F = FiniteField(3^4, 'a', impl='pari_ffelt')
sage: F.characteristic()
3
Returns the degree of self over its prime field.
EXAMPLE:
sage: F = FiniteField(3^20, 'a', impl='pari_ffelt')
sage: F.degree()
20
Return a generator of self over its prime field, which is a root of self.modulus().
INPUT:
OUTPUT:
An element of self such that self.modulus()(a) == 0.
Warning
This generator is not guaranteed to be a generator for the multiplicative group. To obtain the latter, use multiplicative_generator() or use the modulus="primitive" option when constructing the field.
EXAMPLES:
sage: R.<x> = PolynomialRing(GF(2))
sage: FiniteField(2^4, 'b', impl='pari_ffelt').gen()
b
sage: k = FiniteField(3^4, 'alpha', impl='pari_ffelt')
sage: a = k.gen()
sage: a
alpha
sage: a^4
alpha^3 + 1