AUTHORS:
TESTS:
sage: k = GF(3)
sage: TestSuite(k).run()
Bases: sage.rings.finite_rings.finite_field_base.FiniteField, sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic
Finite field of order where
is prime.
EXAMPLES:
sage: FiniteField(3)
Finite Field of size 3
sage: FiniteField(next_prime(1000))
Finite Field of size 1009
Return the characteristic of code{self}.
EXAMPLES:
sage: k = GF(7)
sage: k.characteristic()
7
Returns the construction of this finite field (for use by sage.categories.pushout)
EXAMPLES:
sage: GF(3).construction()
(QuotientFunctor, Integer Ring)
Return the degree of self over its prime field.
This always returns 1.
EXAMPLES:
sage: FiniteField(3).degree()
1
Return a generator of self over its prime field, which is a root of self.modulus().
Unless a custom modulus was given when constructing this prime
field, this returns .
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: k = GF(13)
sage: k.gen()
1
sage: k = GF(1009, modulus="primitive")
sage: k.gen() # this gives a primitive element
11
sage: k.gen(1)
Traceback (most recent call last):
...
IndexError: only one generator
Return True since this is a prime field.
EXAMPLES:
sage: k.<a> = GF(3)
sage: k.is_prime_field()
True
sage: k.<a> = GF(3^2)
sage: k.is_prime_field()
False
Return the order of this finite field.
EXAMPLES:
sage: k = GF(5)
sage: k.order()
5
Returns the polynomial name.
EXAMPLES:
sage: k.<a> = GF(3)
sage: k.polynomial()
x