Skip to content

numthy · FiniteField

20 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.

Worked example

The complete checked program Calculate trace and norm in a concrete quadratic finite field uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Calculate trace and norm in a concrete quadratic finite field."""

from noether.numthy import FiniteField


def main() -> None:
    field = FiniteField.extension(5, 2)
    generator = field.generator()
    assert generator**2 + field(4) * generator + field(2) == field.zero()
    assert generator.trace() == field(1)
    assert generator.norm() == field(2)
    print(f"{field}: Tr(a)={generator.trace()}, Nm(a)={generator.norm()}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/08_finite_field_extensions.py.

numthy.FiniteField

A finite field with one explicit, verified presentation.

class FiniteField

noether::numthy::FiniteField · Direct Rust declaration

pub struct FiniteField { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/08_finite_field_extensions.py:5 · examples/08_finite_field_extensions.py:9 · examples/09_finite_field_isomorphisms.py:10 · examples/09_finite_field_isomorphisms.py:5 · examples/09_finite_field_isomorphisms.py:9 · examples/11_qadic_witt_vectors.py:5

numthy.FiniteField.__call__

Coerce the supplied input through this context or mathematical map.

(self, value: int) -> FiniteFieldElement

noether::numthy::FiniteField · Python projection

Python projection convenience over this Rust mathematical type
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: validation/unit/infra/test_discovery.py:57 · validation/unit/infra/test_public_api_index.py:155 · validation/unit/infra/test_public_api_index.py:169

numthy.FiniteField.cardinality

Compute cardinality for this FiniteField.

(self) -> int

noether::numthy::FiniteField::cardinality · Direct Rust declaration

fn cardinality(&self) -> Integer
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/27_weight_characters.py:10 · validation/unit/commalg/test_residue_ring_facade.py:23 · validation/unit/groups/test_weight_characters.py:25 · validation/unit/numthy/test_finite_field_facade.py:29 · validation/unit/numthy/test_qadic_ring_facade.py:33 · validation/parity/combinatorics/test_poset_parity.py:59

numthy.FiniteField.characteristic

Return the characteristic recorded by this FiniteField.

Detailed contract

The prime characteristic.

(self) -> int

noether::numthy::FiniteField::characteristic · Direct Rust declaration

pub fn characteristic(&self) -> &Integer
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/37_complete_intersection_theory.py:3 · validation/unit/homalg/test_finite_group_cohomology.py:129 · validation/unit/numthy/test_finite_field_facade.py:199 · validation/unit/numthy/test_finite_field_facade.py:26 · validation/unit/numthy/test_finite_field_facade.py:76 · validation/unit/numthy/test_finite_field_facade.py:77

numthy.FiniteField.defining_modulus

Return the defining modulus recorded by this FiniteField.

Detailed contract

The ascending coefficients of the normalized defining modulus. Prime fields return None because they need no extension presentation.

(self) -> list[int] | None

noether::numthy::FiniteField::defining_modulus · Direct Rust declaration

pub fn defining_modulus(&self) -> Option<&[u64]>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: validation/unit/numthy/test_finite_field_facade.py:98

numthy.FiniteField.degree

Return the degree recorded by this FiniteField.

Detailed contract

Extension degree over the prime field.

(self) -> int

noether::numthy::FiniteField::degree · Direct Rust declaration

pub fn degree(&self) -> usize
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/14_weighted_polynomials.py:16 · examples/14_weighted_polynomials.py:18 · examples/15_groebner_twisted_cubic.py:15 · examples/15_groebner_twisted_cubic.py:28 · examples/31_local_fields_and_precision.py:37 · examples/33_simplicial_cohomology_operations.py:26

numthy.FiniteField.element_from_coefficients

Compute element from coefficients for this FiniteField.

Detailed contract

Construct an element from ascending coefficients in the power basis. Missing high coefficients are zero. Each supplied coefficient must be the canonical integer in [0, p), and at most degree coefficients may be supplied.

(self, coefficients: list[int]) -> FiniteFieldElement

noether::numthy::FiniteField::element_from_coefficients · Direct Rust declaration

pub fn element_from_coefficients( &self, coefficients: &[u64], ) -> Result<FiniteFieldElement, InvalidFiniteFieldElementError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/09_finite_field_isomorphisms.py:13 · validation/unit/commalg/test_base_change.py:92 · validation/unit/commalg/test_context_tower_workload.py:157 · validation/unit/linalg/test_semilinear_facade.py:37 · validation/unit/numthy/test_finite_field_facade.py:111 · validation/unit/numthy/test_finite_field_facade.py:144

numthy.FiniteField.embedding_to

Build a checked embedding by specifying the image of this field's distinguished generator.

Detailed contract

Build a checked embedding by specifying the image of this field's distinguished generator.

(self, target: FiniteField, generator_image: FiniteFieldElement) -> FiniteFieldEmbedding

noether::numthy::FiniteField · Python projection

Python projection convenience over this Rust mathematical type
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: validation/unit/commalg/test_base_change.py:101 · validation/unit/numthy/test_finite_field_facade.py:173

numthy.FiniteField.extension

Construct the canonical Conway-style extension field of order p^degree.

Detailed contract

Construct FLINT’s deterministic Conway presentation of F_{p^degree}. Degree one returns the prime field. Higher degrees are currently word-characteristic, matching FLINT fq_nmod. A missing Conway-table entry is a typed error rather than a FLINT process abort; callers may then use Self::with_modulus.

(cls, characteristic: int, degree: int) -> FiniteField

noether::numthy::FiniteField::extension · Direct Rust declaration

pub fn extension( characteristic: u64, degree: usize, ) -> Result<Self, FiniteFieldConstructionError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Dispatch / backing flint
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1
Contexts word-sized prime-power finite fields
Failures nonprime characteristic, zero degree, unavailable Conway polynomial

Executable usage: examples/08_finite_field_extensions.py:9 · examples/09_finite_field_isomorphisms.py:9 · examples/11_qadic_witt_vectors.py:9 · examples/31_local_fields_and_precision.py:10 · validation/unit/commalg/test_acceptance_workload.py:128 · validation/unit/commalg/test_acceptance_workload.py:25

numthy.FiniteField.from_json

Deserialize and revalidate a finite-field presentation.

(cls, value: str) -> FiniteField

noether::numthy::FiniteField::from_json · Direct Rust declaration

pub fn from_json(value: &str) -> Result<Self, NoetherError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: validation/unit/category/test_category.py:14 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combin/test_acceptance_workload.py:86 · validation/unit/combin/test_graph_facade.py:106 · validation/unit/combin/test_graph_facade.py:25 · validation/unit/combinatorics/test_kashiwara_crystal.py:32

numthy.FiniteField.generator

Compute generator for this FiniteField.

Detailed contract

The distinguished power-basis generator. It is 1 for a prime field.

(self) -> FiniteFieldElement

noether::numthy::FiniteField::generator · Direct Rust declaration

pub fn generator(&self) -> FiniteFieldElement
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/08_finite_field_extensions.py:10 · examples/08_finite_field_extensions.py:11 · examples/08_finite_field_extensions.py:12 · examples/08_finite_field_extensions.py:13 · examples/08_finite_field_extensions.py:14 · examples/10_padic_hensel_lifting.py:12

numthy.FiniteField.inverse

Compute inverse for this FiniteField.

(self, value: FiniteFieldElement) -> FiniteFieldElement

noether::numthy::FiniteField::inverse · Direct Rust declaration

fn inverse( &self, value: &Self::Element, ) -> Result<Self::Element, InversionError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/distributed/f2_linear_algebra.py:37 · examples/distributed/f2_linear_algebra.py:39 · validation/unit/commalg/test_context_tower_workload.py:121 · validation/unit/commalg/test_context_tower_workload.py:122 · validation/unit/commalg/test_context_tower_workload.py:75 · validation/unit/commalg/test_context_tower_workload.py:77

numthy.FiniteField.isomorphism_to

Return a deterministic checked map to an equal-order presentation.

Detailed contract

Construct a deterministic checked isomorphism to another presentation. The bounded 0.1 implementation chooses the first target root in canonical element order and supports distinct presentations of field order at most 4096. Identity maps have no size bound.

(self, target: FiniteField) -> FiniteFieldIsomorphism

noether::numthy::FiniteField::isomorphism_to · Direct Rust declaration

pub fn isomorphism_to( &self, target: &Self, ) -> Result<FiniteFieldIsomorphism, FiniteFieldIsomorphismError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/09_finite_field_isomorphisms.py:11 · validation/unit/commalg/test_context_tower_workload.py:150 · validation/unit/infra/test_public_api_index.py:162 · validation/unit/numthy/test_finite_field_facade.py:133 · validation/unit/numthy/test_finite_field_facade.py:154 · validation/unit/numthy/test_finite_field_facade.py:88

numthy.FiniteField.one

Compute one for this FiniteField.

(self) -> FiniteFieldElement

noether::numthy::FiniteField::one · Direct Rust declaration

fn one(&self) -> Self::Element
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/02_ball_arithmetic.py:13 · examples/11_qadic_witt_vectors.py:11 · examples/24_homology_and_persistence.py:3 · examples/31_local_fields_and_precision.py:27 · validation/unit/combinatorics/test_poset.py:3 · validation/unit/commalg/test_acceptance_workload.py:37

numthy.FiniteField.order

Return the order recorded by this FiniteField.

Detailed contract

Exact field order.

(self) -> int

noether::numthy::FiniteField::order · Direct Rust declaration

pub fn order(&self) -> Integer
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/11_qadic_witt_vectors.py:14 · examples/12_number_field_ideals.py:13 · examples/12_number_field_ideals.py:14 · examples/12_number_field_ideals.py:17 · examples/15_groebner_twisted_cubic.py:18 · examples/19_permutation_groups.py:13

numthy.FiniteField.prime

Construct a FiniteField using prime.

Detailed contract

Construct the prime field F_p after a proved primality test.

(cls, characteristic: int) -> FiniteField

noether::numthy::FiniteField::prime · Direct Rust declaration

pub fn prime<T: Into<Integer>>( characteristic: T, ) -> Result<Self, InvalidCharacteristicError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/07_integer_factorization.py:12 · examples/12_number_field_ideals.py:16 · examples/12_number_field_ideals.py:19 · examples/18_finite_field_schemes.py:10 · examples/24_homology_and_persistence.py:22 · examples/33_simplicial_cohomology_operations.py:24

numthy.FiniteField.prime_subfield_embedding

Return the canonical embedding of this field's prime subfield.

Detailed contract

Canonical embedding of this field’s prime subfield.

(self) -> PrimeSubfieldEmbedding

noether::numthy::FiniteField::prime_subfield_embedding · Direct Rust declaration

pub fn prime_subfield_embedding(&self) -> PrimeSubfieldEmbedding
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: validation/unit/commalg/test_base_change.py:42 · validation/unit/commalg/test_base_change.py:78 · validation/unit/commalg/test_rational_function_facade.py:120 · validation/unit/commalg/test_rational_function_facade.py:148 · validation/unit/test_coefficient_maps.py:50 · validation/unit/test_coefficient_maps.py:67

numthy.FiniteField.to_json

Canonical JSON containing the complete verified presentation.

Detailed contract

Serialize the complete verified presentation as canonical typed JSON.

(self) -> str

noether::numthy::FiniteField::to_json · Direct Rust declaration

pub fn to_json(&self) -> Result<String, NoetherError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: validation/unit/category/test_category.py:14 · validation/unit/category/test_category.py:15 · validation/unit/combin/test_acceptance_workload.py:30 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combin/test_acceptance_workload.py:86 · validation/unit/combin/test_graph_facade.py:106

numthy.FiniteField.with_modulus

Construct a FiniteField using with modulus.

Detailed contract

Construct F_p[a] / (modulus) from ascending coefficients. The modulus must have degree at least two, be monic, have every coefficient in [0, p), and be irreducible over F_p. These requirements make the coefficient list a normalized context identity.

(cls, characteristic: int, modulus: list[int]) -> FiniteField

noether::numthy::FiniteField::with_modulus · Direct Rust declaration

pub fn with_modulus( characteristic: u64, modulus: Vec<u64>, ) -> Result<Self, FiniteFieldConstructionError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/09_finite_field_isomorphisms.py:10 · validation/unit/commalg/test_base_change.py:41 · validation/unit/commalg/test_base_change.py:78 · validation/unit/commalg/test_base_change.py:86 · validation/unit/commalg/test_context_tower_workload.py:149 · validation/unit/commalg/test_polynomial_facade.py:139

numthy.FiniteField.zero

Compute zero for this FiniteField.

(self) -> FiniteFieldElement

noether::numthy::FiniteField::zero · Direct Rust declaration

fn zero(&self) -> Self::Element
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/numthy/FiniteField@1

Executable usage: examples/08_finite_field_extensions.py:11 · examples/10_padic_hensel_lifting.py:15 · examples/40_exterior_algebra.py:26 · examples/distributed/f2_linear_algebra.py:28 · examples/distributed/f2_linear_algebra.py:29 · examples/distributed/f2_linear_algebra.py:30