zorch.testkit.random_field¶
Deterministic random field elements for tests.
Draws canonical integers in [0, 2**30) (< every supported prime) and casts to the field dtype, which Montgomery-encodes the canonical integer.
rand_ext_field ¶
rand_ext_field(
seed: int, shape: Sequence[int], base: Any, ext: Any
) -> Array
Random extension-field tensor: an ext element is k base-field limbs,
so draw (*shape, k) base elements and bitcast.
Source code in zorch/testkit/random_field.py
44 45 46 47 48 | |