Skip to content

numthy · PadicValuation

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

Worked example

The complete checked program Build and verify an isomorphism between two presentations of F_25 uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Build and verify an isomorphism between two presentations of F_25."""

from noether.numthy import FiniteField


def main() -> None:
    source = FiniteField.extension(5, 2)
    target = FiniteField.with_modulus(5, [2, 0, 1])
    isomorphism = source.isomorphism_to(target)
    isomorphism.verify()
    value = source.element_from_coefficients([3, 2])
    assert isomorphism.apply_inverse(isomorphism(value)) == value
    print(f"a maps to {isomorphism.generator_image}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/09_finite_field_isomorphisms.py.

numthy.PadicValuation

A p-adic valuation that preserves a finite-precision lower bound.

class PadicValuation

noether::numthy::PadicValuation · Direct Rust declaration

pub enum PadicValuation { Exact(i64), AtLeast(i64), }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded

Executable usage: validation/unit/numthy/test_padic_ring_facade.py:18 · validation/unit/numthy/test_padic_ring_facade.py:48

numthy.PadicValuation.is_exact

Test whether this PadicValuation is exact.

(self) -> bool

noether::numthy::PadicValuation · 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

Executable usage: validation/unit/commalg/test_polynomial_ideal_facade.py:319 · validation/unit/commalg/test_polynomial_ideal_facade.py:332 · validation/unit/homalg/test_padic_homology_facade.py:36 · validation/unit/numthy/test_padic_ring_facade.py:49 · validation/unit/numthy/test_padic_ring_facade.py:52 · validation/unit/test_ball_facade.py:19

numthy.PadicValuation.lower_bound

Return the lower bound recorded by this PadicValuation.

(self) -> int

noether::numthy::PadicValuation · 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

Executable usage: validation/unit/commalg/test_surface_facade.py:74 · validation/unit/numthy/test_padic_ring_facade.py:51 · validation/unit/numthy/test_padic_ring_facade.py:54 · validation/corpus/numthy/padic-newton-cube-root.py:19

numthy.PadicValuation.value

Return the value recorded by this PadicValuation.

(self) -> int | None

noether::numthy::PadicValuation · 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

Executable usage: examples/09_finite_field_isomorphisms.py:13 · examples/09_finite_field_isomorphisms.py:14 · examples/13_chinese_remainder_theorem.py:12 · examples/13_chinese_remainder_theorem.py:13 · examples/13_chinese_remainder_theorem.py:14 · examples/17_weighted_power_series.py:18