Skip to content

numthy · FiniteFieldElement

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

Worked example

The complete checked program Reproduce Fisher's order-five elliptic-function normalization uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Reproduce Fisher's order-five elliptic-function normalization."""

from noether import Q
from noether.commalg import RationalFunctionField, WeilDivisor
from noether.numthy import EllipticCurve, NthPowerClassGroup


def main() -> None:
    coefficients = RationalFunctionField(Q, "lambda")
    parameter = coefficients.generator()
    curve = EllipticCurve(
        coefficients,
        [1 - parameter, -parameter, -parameter, 0, 0],
    )
    point = curve.point(0, 0)
    point.verify_exact_order(5)

    miller = curve.miller_function(point, 5)
    divisor = WeilDivisor(
        curve.underlying_curve,
        [
            (curve.origin().underlying_curve_point.as_closed_point(), 5),
            (point.underlying_curve_point.as_closed_point(), -5),
        ],
    )
    function = divisor.riemann_roch_space().basis[0]
    assert (function / miller.function).as_constant() is not None

    evaluation_at_two = function.evaluate_at((2 * point).underlying_curve_point)
    evaluation_at_four = function.evaluate_at((4 * point).underlying_curve_point)
    assert evaluation_at_two.value is not None
    assert evaluation_at_four.value is not None
    classes = NthPowerClassGroup(coefficients, 5)
    normalization = classes.class_of(evaluation_at_two.value) ** -2 * classes.class_of(
        evaluation_at_four.value
    )
    assert normalization.is_identity()
    print("order 5 verified; Riemann--Roch and Miller agree; normalization is trivial")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/26_elliptic_descent_functions.py.

numthy.FiniteFieldElement

An exact finite-field value carrying its concrete presentation.

class FiniteFieldElement

noether::numthy::FiniteFieldElement · Direct Rust declaration

pub struct FiniteFieldElement { /* 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/FiniteFieldElement@1

Executable usage: validation/unit/commalg/test_context_tower_workload.py:20 · validation/unit/commalg/test_context_tower_workload.py:71 · validation/unit/commalg/test_context_tower_workload.py:72 · validation/unit/commalg/test_rational_function_facade.py:19 · validation/unit/commalg/test_rational_function_facade.py:82 · validation/unit/infra/test_discovery.py:35

numthy.FiniteFieldElement.__add__

Add another compatible value to this value.

Detailed contract

Returns the argument unchanged.

(self, other: FiniteFieldElement) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::add · Direct Rust declaration

fn add(self, rhs: &FiniteFieldElement) -> Self::Output
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/FiniteFieldElement@1

Executable usage: validation/unit/infra/test_discovery.py:211 · validation/unit/infra/test_public_api_index.py:293

numthy.FiniteFieldElement.__int__

Compute int for this FiniteFieldElement.

(self) -> int

noether::numthy::FiniteFieldElement · 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/FiniteFieldElement@1

numthy.FiniteFieldElement.__mul__

Multiply this value by another compatible value.

(self, other: FiniteFieldElement) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::mul · Direct Rust declaration

fn mul(self, rhs: &FiniteFieldElement) -> Self::Output
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/FiniteFieldElement@1

Executable usage: validation/unit/infra/test_public_api_index.py:214

numthy.FiniteFieldElement.__neg__

Return the additive inverse of this value.

(self) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::neg · Direct Rust declaration

fn neg(self) -> Self::Output
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/FiniteFieldElement@1

numthy.FiniteFieldElement.__pow__

Raise this value to the supplied power.

(self, exponent: int, modulus: None=None) -> FiniteFieldElement

noether::numthy::FiniteFieldElement · 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/FiniteFieldElement@1

numthy.FiniteFieldElement.__sub__

Subtract another compatible value from this value.

(self, other: FiniteFieldElement) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::sub · Direct Rust declaration

fn sub(self, rhs: &FiniteFieldElement) -> Self::Output
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/FiniteFieldElement@1

Executable usage: validation/unit/infra/test_discovery.py:212

numthy.FiniteFieldElement.coefficients

Return the coefficients recorded by this FiniteFieldElement.

Detailed contract

Ascending coefficients in the field’s canonical power basis.

(self) -> list[int]

noether::numthy::FiniteFieldElement::coefficients · Direct Rust declaration

pub fn coefficients(&self) -> Vec<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/FiniteFieldElement@1

Executable usage: examples/26_elliptic_descent_functions.py:11 · examples/26_elliptic_descent_functions.py:12 · examples/26_elliptic_descent_functions.py:14 · examples/26_elliptic_descent_functions.py:35 · examples/31_local_fields_and_precision.py:11 · examples/31_local_fields_and_precision.py:12

numthy.FiniteFieldElement.field

Return the field recorded by this FiniteFieldElement.

Detailed contract

The concrete finite field containing this value.

(self) -> FiniteField

noether::numthy::FiniteFieldElement::field · Direct Rust declaration

pub fn field(&self) -> &FiniteField
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/FiniteFieldElement@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/08_finite_field_extensions.py:3

numthy.FiniteFieldElement.frobenius

Compute frobenius for this FiniteFieldElement.

Detailed contract

Apply a power of the characteristic Frobenius.

(self, exponent: int) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::frobenius · Direct Rust declaration

pub fn frobenius(&self, exponent: u64) -> Self
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/FiniteFieldElement@1

Executable usage: examples/31_local_fields_and_precision.py:23 · examples/31_local_fields_and_precision.py:24 · examples/31_local_fields_and_precision.py:27 · examples/31_local_fields_and_precision.py:38 · validation/unit/commalg/test_acceptance_workload.py:39 · validation/unit/commalg/test_context_tower_workload.py:115

numthy.FiniteFieldElement.from_json

Deserialize and revalidate a finite-field element.

Detailed contract

Deserialize and revalidate both the field and element coordinates.

(cls, value: str) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::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/FiniteFieldElement@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.FiniteFieldElement.inverse

Compute inverse for this FiniteFieldElement.

Detailed contract

Multiplicative inverse, failing on zero.

(self) -> FiniteFieldElement

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

pub fn inverse(&self) -> Result<Self, 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/FiniteFieldElement@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.FiniteFieldElement.is_one

Test whether this FiniteFieldElement is one.

Detailed contract

Whether this value is one.

(self) -> bool

noether::numthy::FiniteFieldElement::is_one · Direct Rust declaration

pub fn is_one(&self) -> bool
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/FiniteFieldElement@1

Executable usage: validation/unit/commalg/test_rational_function_facade.py:31 · validation/unit/commalg/test_residue_ring_facade.py:25 · validation/unit/numthy/test_number_field_facade.py:29 · validation/corpus/commalg/evolution-algebra-isomorphism.py:34 · validation/corpus/numthy/diagonal-quadric-local-density-sums.py:36

numthy.FiniteFieldElement.is_zero

Test whether this FiniteFieldElement is zero.

Detailed contract

Whether this value is zero.

(self) -> bool

noether::numthy::FiniteFieldElement::is_zero · Direct Rust declaration

pub fn is_zero(&self) -> bool
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/FiniteFieldElement@1

Executable usage: examples/17_weighted_power_series.py:16 · examples/17_weighted_power_series.py:17 · examples/39_kahler_differentials.py:20 · validation/unit/commalg/test_graded_commutative_facade.py:26 · validation/unit/commalg/test_kahler_differentials.py:113 · validation/unit/commalg/test_kahler_differentials.py:38

numthy.FiniteFieldElement.norm

Compute norm for this FiniteFieldElement.

Detailed contract

Field norm to the prime subfield, embedded back into this field.

(self) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::norm · Direct Rust declaration

pub fn norm(&self) -> Self
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/FiniteFieldElement@1

Executable usage: examples/06_shortest_lattice_vectors.py:15 · examples/08_finite_field_extensions.py:13 · examples/08_finite_field_extensions.py:14 · examples/08_finite_field_extensions.py:3 · examples/12_number_field_ideals.py:16 · examples/12_number_field_ideals.py:18

numthy.FiniteFieldElement.pow

Compute pow for this FiniteFieldElement.

Detailed contract

Raise this value to a nonnegative power.

(self, exponent: int) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::pow · Direct Rust declaration

pub fn pow(&self, exponent: u64) -> Self
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/FiniteFieldElement@1

Executable usage: examples/17_weighted_power_series.py:18 · validation/unit/commalg/test_polynomial_ideal_facade.py:368 · validation/unit/commalg/test_polynomial_ideal_facade.py:369 · validation/unit/commalg/test_polynomial_ideal_facade.py:370 · validation/unit/commalg/test_polynomial_ideal_facade.py:373 · validation/unit/commalg/test_polynomial_ideal_facade.py:381

numthy.FiniteFieldElement.representative

Return the representative recorded by this FiniteFieldElement.

Detailed contract

Canonical base-p encoding of the power-basis coefficients in [0, |F|). For a prime field this is the usual residue representative.

(self) -> int

noether::numthy::FiniteFieldElement::representative · Direct Rust declaration

pub fn representative(&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/FiniteFieldElement@1

Executable usage: validation/unit/commalg/test_residue_ring_facade.py:101 · validation/unit/commalg/test_residue_ring_facade.py:110 · validation/unit/commalg/test_residue_ring_facade.py:129 · validation/unit/commalg/test_residue_ring_facade.py:26 · validation/unit/commalg/test_residue_ring_facade.py:80 · validation/unit/groups/test_acceptance_workload.py:125

numthy.FiniteFieldElement.to_json

Canonical JSON containing the field presentation and coordinates.

Detailed contract

Serialize the field presentation and canonical power-basis coordinates.

(self) -> str

noether::numthy::FiniteFieldElement::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/FiniteFieldElement@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.FiniteFieldElement.trace

Compute trace for this FiniteFieldElement.

Detailed contract

Field trace to the prime subfield, embedded back into this field.

(self) -> FiniteFieldElement

noether::numthy::FiniteFieldElement::trace · Direct Rust declaration

pub fn trace(&self) -> Self
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/FiniteFieldElement@1

Executable usage: examples/08_finite_field_extensions.py:12 · examples/08_finite_field_extensions.py:14 · examples/08_finite_field_extensions.py:3 · validation/unit/commalg/test_acceptance_workload.py:41 · validation/unit/commalg/test_context_tower_workload.py:116 · validation/unit/commalg/test_context_tower_workload.py:96