gr_ctx_init_random, gr_ctx_init_random_commutative_ring, gr_ctx_init_random_field, gr_ctx_init_random_finite_field
#include <flint/gr.h>void gr_ctx_init_random(gr_ctx_t ctx, flint_rand_t state)sourcevoid gr_ctx_init_random_commutative_ring(gr_ctx_t ctx, flint_rand_t state)sourcevoid gr_ctx_init_random_field(gr_ctx_t ctx, flint_rand_t state)sourcevoid gr_ctx_init_random_finite_field(gr_ctx_t ctx, flint_rand_t state)sourceInitialise ctx to a random ring, commutative ring, field or finite field. The rings are drawn from the built-in base rings (\mathbb{Z}, \mathbb{Q}, \mathbb{Z}[i], \mathbb{Z}/n\mathbb{Z} in its various representations, finite fields, number fields, balls, Calcium fields) and from rings built over some of them (polynomials, multivariate polynomials, series, vectors, matrices and debug wrappers). The base rings of the composite rings are kept in static storage, so only ctx is cleared by the caller.
Currently gr_ctx_init_random returns, with probability 1/2, the ring of power series of precision 1 over the zero ring \mathbb{Z}/1\mathbb{Z}, and only otherwise draws from the list above.
The FLINT team, “gr_ctx_init_random, gr_ctx_init_random_commutative_ring, gr_ctx_init_random_field, gr_ctx_init_random_finite_field (gr.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_domains/gr_ctx_init_random.html (generated 2026-10-20).
@misc{flint-doc-gr-domains-gr-ctx-init-random,
author = {{The FLINT team}},
title = {{gr\_ctx\_init\_random, gr\_ctx\_init\_random\_commutative\_ring, gr\_ctx\_init\_random\_field, gr\_ctx\_init\_random\_finite\_field (gr.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_domains/gr_ctx_init_random.html},
note = {Generated 2026-10-20}
}