# 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, name=None, check=True)

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

Returns the degree of the finite field, which is a positive integer.

EXAMPLES:

sage: FiniteField(3).degree()
1

gen(n=0)

Return generator of this finite field as an extension of its prime field.

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 minimal polynomial of self, which is always $$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