Finite Prime Fields

AUTHORS:

  • William Stein: initial version
  • Martin Albrecht (2008-01): refactoring

TESTS:

sage: k = GF(3)
sage: TestSuite(k).run()
class sage.rings.finite_rings.finite_field_prime_modn.FiniteField_prime_modn(p, check=True)

Bases: sage.rings.finite_rings.finite_field_base.FiniteField, sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic

Finite field of order \(p\) where \(p\) is prime.

EXAMPLES:

sage: FiniteField(3)
Finite Field of size 3

sage: FiniteField(next_prime(1000))
Finite Field of size 1009
characteristic()

Return the characteristic of code{self}.

EXAMPLES:

sage: k = GF(7)
sage: k.characteristic()
7
construction()

Returns the construction of this finite field (for use by sage.categories.pushout)

EXAMPLES:

sage: GF(3).construction()
(QuotientFunctor, Integer Ring)
degree()

Return the degree of self over its prime field.

This always returns 1.

EXAMPLES:

sage: FiniteField(3).degree()
1
gen(n=0)

Return a generator of self over its prime field.

This always returns 1.

Note

If you want a primitive element for this finite field instead, use multiplicative_generator().

EXAMPLES:

sage: k = GF(13)
sage: k.gen()
1
sage: k.gen(1)
Traceback (most recent call last):
...
IndexError: only one generator
is_prime_field()

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
modulus()

Return the defining polynomial of self.

This always returns \(x - 1\).

EXAMPLES:

sage: k = GF(199)
sage: k.modulus()
x + 198
order()

Return the order of this finite field.

EXAMPLES:

sage: k = GF(5)
sage: k.order()
5
polynomial(name=None)

Returns the polynomial name.

EXAMPLES:

sage: k.<a> = GF(3)
sage: k.polynomial()
x

Previous topic

Finite fields implemented via PARI’s FFELT type

Next topic

Homset for Finite Fields

This Page