Defining polynomials
- Cost
- A table lookup for Conway polynomials; an expected irreducibility tests for random search; primitivity testing requires the factorisation of .
A field is constructed as for an irreducible of degree . Any such gives an isomorphic field, but the choice matters in practice:
- a sparse , with few nonzero terms, makes the reduction after each multiplication cheap (Reduction modulo the defining polynomial);
- a primitive , whose roots generate , is required by the Zech logarithm representation and gives a known generator of the multiplicative group (used, for example, as the non-square in
fq_sqrt); - a standard makes results reproducible across systems and allows compatible embeddings between fields of different degrees.
Counting irreducible and primitive polynomials#
The number of monic irreducible polynomials of degree over is , which lies between and [LN1997]; so a random monic polynomial of degree is irreducible with probability about , and random search with an irreducibility test (Irreducibility testing over finite fields) needs about attempts. Of the nonzero elements, are primitive, and each primitive polynomial has primitive roots, so there are primitive polynomials, roughly a fraction of the irreducible ones, which is at least for a constant . Testing primitivity requires the factorisation of (fq_multiplicative_order).
Conway polynomials#
Definition 1. The Conway polynomial is the least monic primitive polynomial of degree over , in a fixed ordering of polynomials, such that for every proper divisor of , the polynomial is divisible by .
The ordering is lexicographic on the sequence of coefficients with alternating signs, each reduced to an integer in . The compatibility condition says that if is a root of and , then is a root of ; so the roots of the Conway polynomials of all degrees form a compatible system, and the field embeds into by . Conway polynomials were defined by Parker for the computation of modular character tables and named after J. H. Conway; they are used by GAP, Magma, Sage and other systems as the standard defining polynomials. Computing them is expensive, since the definition requires a search through primitive polynomials (with the factorisation of ) and compatibility tests; Heath and Loehr give algorithms [HeaLoe2004], and Lübeck maintains the reference tables [Lüb2004].
FLINT stores a compressed copy of Lübeck's table in nmod_poly (_nmod_poly_conway), for all primes and the degrees for which a Conway polynomial is known: degrees up to 409 for , up to about 200 for , and fewer for larger primes (up to 12 for , 9 for , 6 for and 4 above), in each case with gaps. Since Conway polynomials are primitive, they are always suitable for the Zech representation, but they are not sparse in general.
Sparse and minimal-weight polynomials#
When no Conway polynomial is available, the modules choose sparse polynomials, which minimise the cost of reduction.
Binomials. By a classical theorem [LN1997], is irreducible over if and only if every prime divisor of divides the order of but not , and if . In particular an irreducible binomial of degree exists only if every prime factor of divides .
Trinomials exist for most but not all : by Swan's theorem there is no irreducible trinomial of degree over [Swa1962], and other obstructions are known. It is conjectured that an irreducible tetranomial () or pentanomial () always exists.
nmod_poly_minimal_irreducible returns a monic irreducible polynomial with the least possible number of terms, trying binomials, trinomials, tetranomials and pentanomials in this order and returning the first one in a fixed ordering, after sieving out candidates with small factors; it is deterministic. fmpz_mod_poly_randtest_sparse_irreducible draws random irreducible trinomials, then pentanomials, then random sparse polynomials, for multiprecision .
Choices in FLINT#
| Module | Default defining polynomial |
|---|---|
fq (fq_ctx_init) | Conway polynomial if and it is in the table; otherwise a random sparse irreducible polynomial (trinomial or pentanomial if one is found), with a fixed random state |
fq_nmod (fq_nmod_ctx_init_ui) | Conway polynomial if in the table; otherwise the minimal-weight polynomial of nmod_poly_minimal_irreducible |
fq_zech (fq_zech_ctx_init_ui) | Conway polynomial if in the table; otherwise a random monic primitive polynomial (nmod_poly_randtest_monic_primitive, which draws random irreducible polynomials until the root is primitive) |
fq_default | that of the representation it chooses |
In all modules a polynomial can also be given explicitly (fq_ctx_init_modulus and its analogues); it must be irreducible, and primitive for fq_zech. The choices for fq and fq_zech without a Conway polynomial are reproducible for a given FLINT version, but are not standardised; programs that exchange elements with other software should give the defining polynomial explicitly.
Use in FLINT#
_nmod_poly_conway(table lookup) is used by_fq_nmod_ctx_init_conway_ui,_fq_ctx_init_conway_uiand_fq_zech_ctx_init_conway_ui, and through them by all default context constructors.fq_nmod_ctx_init_minimal_weight_uiusesnmod_poly_minimal_irreducible;fq_ctx_initusesfmpz_mod_poly_randtest_sparse_irreducible;fq_zech_ctx_init_random_uiusesnmod_poly_randtest_monic_primitive.fq_poly_randtest_irreducibleconstructs random irreducible polynomials over itself by random search with a distinct-degree test.
Referenced from#
- Embeddings of finite fields (algorithm)
- Reduction modulo the defining polynomial (algorithm)
- Zech logarithms (algorithm)
- Arithmetic in unramified extensions (algorithm)
- Irreducibility testing over finite fields (algorithm)
arb_fmpz_poly_gauss_period_minpolyfq_ctx_initfq_default_ctx_init,fq_default_ctx_init_typegr_ctx_init_fq,gr_ctx_init_fq_nmod,gr_ctx_init_fq_zechnmod_poly_minimal_irreducible_nmod_poly_conway
References#
- [LN1997] R. Lidl and H. Niederreiter. Finite Fields. Second edition, Encyclopedia of Mathematics and its Applications 20, Cambridge University Press, 1997.
- [HeaLoe2004] L. S. Heath and N. A. Loehr. New algorithms for generating Conway polynomials over finite fields. Journal of Symbolic Computation 38:2 (2004), 1003–1024.
- [Lüb2004] F. Lübeck, "Conway polynomials for finite fields", RTWH Aachen, https://www.math.rwth-aachen.de/~Frank.Luebeck/data/ConwayPol/index.html, (accessed 2024-01-12)
- [Swa1962] R. G. Swan. Factorization of polynomials over finite fields. Pacific Journal of Mathematics 12 (1962), 1099–1106.
The FLINT team, “Defining polynomials,” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/algorithms/finite-fields/defining-polynomials.html (generated 2026-11-02).
@misc{flint-doc-algorithms-finite-fields-defining-polynomials,
author = {{The FLINT team}},
title = {{Defining polynomials}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/algorithms/finite-fields/defining-polynomials.html},
note = {Generated 2026-11-02}
}