qfb_reduced_forms, qfb_reduced_forms_large
#include <flint/qfb.h>Compute all reduced primitive positive definite forms of discriminant , allocate an array for them, store it in *forms and return their number, the class number . The forms are in no particular order. The array must be freed with qfb_array_clear(forms, num). Returns 0 (with *forms set to NULL) if , and throws for .
qfb_reduced_forms loops over and sieves the factorisations of with the square roots of modulo small primes; the forms are the factorisations into with . It needs the primes up to about and calls qfb_reduced_forms_large when that would require too large a table. qfb_reduced_forms_large loops over instead, with the square roots of modulo , and needs only the primes up to . Both take time and memory.
Guides#
The FLINT team, “qfb_reduced_forms, qfb_reduced_forms_large (qfb.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/qfb/qfb_reduced_forms.html (generated 2026-11-02).
@misc{flint-doc-qfb-qfb-reduced-forms,
author = {{The FLINT team}},
title = {{qfb\_reduced\_forms, qfb\_reduced\_forms\_large (qfb.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/qfb/qfb_reduced_forms.html},
note = {Generated 2026-11-02}
}