gr_poly_factor_equal_deg, _gr_poly_factor_equal_deg_with_frob
#include <flint/gr_poly.h>int gr_poly_factor_equal_deg(gr_poly_vec_t fac, const gr_poly_t pol, slong d, gr_ctx_t ctx)sourceint _gr_poly_factor_equal_deg_with_frob(gr_poly_vec_t fac, const gr_poly_t f, slong d, const gr_poly_t frob, flint_rand_t state, gr_ctx_t ctx)sourceEqual-degree factorisation: for a squarefree f whose irreducible factors all have degree d, set fac to the monic irreducible factors. The result is undefined for other inputs.
This is the Cantor-Zassenhaus algorithm [CanZas1981] in the trace form of von zur Gathen and Shoup [GatSho1992]: for random a \in \mathbb{F}_q[x]/(f), the trace b = a + a^q + \cdots + a^{q^{d-1}} (computed by modular composition with the Frobenius x^q, by exponentiation, or by a doubling scheme, depending on q and d) lies in the Berlekamp subalgebra, and \gcd(f, b^{(q-1)/2} - 1) for odd q, or \gcd(f, b + b^2 + \cdots + b^{2^{k-1}}) for q = 2^k, splits f with probability about 1/2. The splitting is repeated on the factors. For d = 1 (root finding) a is a random linear polynomial, which makes the exponentiation cheaper. When several pieces remain and threads are available over a thread-safe ring, the pieces are split in parallel, each with its own random state. The underscore version assumes f monic, takes x^q \bmod f as frob (unused for d = 1) and a random state, and appends to fac.
References#
- [CanZas1981] D. G. Cantor and H. Zassenhaus. A new algorithm for factoring polynomials over finite fields. Mathematics of Computation 36 (1981), 587–592. https://doi.org/10.1090/S0025-5718-1981-0606517-5
- [GatSho1992] J. von zur Gathen and V. Shoup, "Computing Frobenius maps and factoring polynomials", Computational Complexity 2 (1992), 187-224. https://doi.org/10.1007/BF01272074
The FLINT team, “gr_poly_factor_equal_deg, _gr_poly_factor_equal_deg_with_frob (gr_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_poly/gr_poly_factor_equal_deg.html (generated 2026-10-20).
@misc{flint-doc-gr-poly-gr-poly-factor-equal-deg,
author = {{The FLINT team}},
title = {{gr\_poly\_factor\_equal\_deg, \_gr\_poly\_factor\_equal\_deg\_with\_frob (gr\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_poly/gr_poly_factor_equal_deg.html},
note = {Generated 2026-10-20}
}