Skip to content

numthy · PadicRing

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

Worked example

The complete checked program Lift a simple square root from F_5 to fixed-precision Z_5 uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Lift a simple square root from F_5 to fixed-precision Z_5."""

from noether.commalg import PolynomialRing
from noether.numthy import PadicRing


def main() -> None:
    integers = PadicRing(5, absolute_precision=6)
    polynomials = PolynomialRing(integers, ["x"])
    x = polynomials.generator("x")
    equation = x**2 - 6
    root = integers.hensel_lift(equation, integers.residue_field(1))
    assert equation.evaluate([root]) == integers.zero()
    print(f"sqrt(6) in Z_5 mod 5^6 is represented by {int(root)}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/10_padic_hensel_lifting.py.

numthy.PadicRing

Fixed-cap p-adic integers known modulo p^N.

PadicRing(prime: int, absolute_precision: int)

noether::numthy::PadicRing · Direct Rust declaration

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

Executable usage: examples/10_padic_hensel_lifting.py:10 · examples/10_padic_hensel_lifting.py:6 · validation/unit/commalg/test_acceptance_workload.py:21 · validation/unit/commalg/test_acceptance_workload.py:26 · validation/unit/commalg/test_context_tower_workload.py:24 · validation/unit/commalg/test_context_tower_workload.py:35

numthy.PadicRing.__call__

Coerce the supplied input through this context or mathematical map.

(self, value: int) -> PadicElement

noether::numthy::PadicRing · 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/PadicRing@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.PadicRing.absolute_precision

Return the absolute precision recorded by this PadicRing.

Detailed contract

Immutable absolute precision cap N.

(self) -> int

noether::numthy::PadicRing::absolute_precision · Direct Rust declaration

pub fn absolute_precision(&self) -> 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/PadicRing@1

Executable usage: examples/10_padic_hensel_lifting.py:10 · examples/11_qadic_witt_vectors.py:10 · examples/31_local_fields_and_precision.py:11 · validation/unit/commalg/test_acceptance_workload.py:26 · validation/unit/commalg/test_acceptance_workload.py:27 · validation/unit/commalg/test_context_tower_workload.py:111

numthy.PadicRing.coefficient_frobenius

Compute coefficient frobenius for this PadicRing.

Detailed contract

Checked coefficient Frobenius power, the identity on Z_p coefficients.

(self, exponent: int) -> PadicRingFrobenius

noether::numthy::PadicRing::coefficient_frobenius · Direct Rust declaration

pub fn coefficient_frobenius(&self, exponent: u64) -> PadicRingFrobenius
fn coefficient_frobenius(&self, exponent: u64) -> Self::Frobenius
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/PadicRing@1

Executable usage: validation/unit/commalg/test_power_series_facade.py:279 · validation/unit/commalg/test_power_series_facade.py:286 · validation/unit/numthy/test_padic_field_facade.py:109 · validation/unit/numthy/test_padic_ring_facade.py:132 · validation/unit/numthy/test_padic_ring_facade.py:138 · validation/unit/numthy/test_qadic_field_facade.py:125

numthy.PadicRing.divide_uniformizer_exact

Compute divide uniformizer exact for this PadicRing.

Detailed contract

Divide by p^exponent, requiring the quotient to remain integral.

(self, value: PadicElement, exponent: int) -> PadicElement

noether::numthy::PadicRing::divide_uniformizer_exact · Direct Rust declaration

pub fn divide_uniformizer_exact( &self, value: &PadicElement, exponent: u64, ) -> Result<PadicElement, PadicUniformizerDivisionError>
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/PadicRing@1

Executable usage: validation/unit/numthy/test_padic_field_facade.py:100 · validation/unit/numthy/test_padic_ring_facade.py:147 · validation/unit/numthy/test_padic_ring_facade.py:153 · validation/unit/numthy/test_qadic_field_facade.py:92 · validation/unit/numthy/test_qadic_ring_facade.py:84 · validation/unit/numthy/test_qadic_ring_facade.py:89

numthy.PadicRing.from_json

Deserialize and revalidate a fixed-precision p-adic ring context.

(cls, value: str) -> PadicRing

noether::numthy::PadicRing::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/PadicRing@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.PadicRing.hensel_lift

Lift a verified simple residue root to the full fixed precision.

Detailed contract

Lift a simple root modulo p to a root at this context’s full precision. The polynomial must be univariate over this exact PadicRing, the supplied value must be a root in its residue field, and the derivative must be nonzero there. The returned value is checked to annihilate the polynomial modulo p^N; unmet hypotheses fail closed.

(self, polynomial: Polynomial[PadicRing], residue_root: FiniteFieldElement) -> PadicElement

noether::numthy::PadicRing::hensel_lift · Direct Rust declaration

pub fn hensel_lift( &self, polynomial: &Polynomial<Self>, residue_root: &FiniteFieldElement, ) -> Result<PadicElement, HenselLiftError>
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/PadicRing@1

Executable usage: examples/10_padic_hensel_lifting.py:14 · validation/unit/commalg/test_context_tower_workload.py:107 · validation/unit/infra/test_public_api_index.py:163 · validation/unit/numthy/test_padic_ring_facade.py:162 · validation/unit/numthy/test_padic_ring_facade.py:175 · validation/unit/numthy/test_padic_ring_facade.py:177

numthy.PadicRing.inverse

Compute inverse for this PadicRing.

(self, value: PadicElement) -> PadicElement

noether::numthy::PadicRing · 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/PadicRing@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.PadicRing.modulus

Return the modulus recorded by this PadicRing.

Detailed contract

Storage modulus p^N; every element has a representative in [0, p^N), giving the promised per-element coefficient bound.

(self) -> int

noether::numthy::PadicRing::modulus · Direct Rust declaration

pub fn modulus(&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/PadicRing@1

Executable usage: validation/unit/commalg/test_context_tower_workload.py:87 · validation/unit/commalg/test_residue_ring_facade.py:101 · validation/unit/commalg/test_residue_ring_facade.py:105 · validation/unit/commalg/test_residue_ring_facade.py:110 · validation/unit/commalg/test_residue_ring_facade.py:128 · validation/unit/commalg/test_residue_ring_facade.py:141

numthy.PadicRing.one

Compute one for this PadicRing.

(self) -> PadicElement

noether::numthy::PadicRing::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/PadicRing@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.PadicRing.precision_restriction

Compute precision restriction for this PadicRing.

Detailed contract

Construct a first-class restriction to a coarser fixed-cap ring.

(self, absolute_precision: int) -> PadicRingRestriction

noether::numthy::PadicRing::precision_restriction · Direct Rust declaration

pub fn precision_restriction( &self, target_absolute_precision: u64, ) -> Result<PadicRingRestriction, PadicRestrictionError>
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/PadicRing@1

Executable usage: examples/31_local_fields_and_precision.py:30 · validation/unit/commalg/test_power_series_facade.py:319 · validation/unit/homalg/test_padic_homology_facade.py:204 · validation/unit/numthy/test_padic_field_facade.py:58 · validation/unit/numthy/test_padic_field_facade.py:78 · validation/unit/numthy/test_padic_local_field_facade.py:101

numthy.PadicRing.prime

Return the prime recorded by this PadicRing.

Detailed contract

Residue characteristic p.

(self) -> int

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

pub fn prime(&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/PadicRing@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.PadicRing.residue

Compute residue for this PadicRing.

Detailed contract

Reduce a p-adic integer to its prime residue field.

(self, value: PadicElement) -> FiniteFieldElement

noether::numthy::PadicRing::residue · Direct Rust declaration

pub fn residue( &self, value: &PadicElement, ) -> Result<FiniteFieldElement, ContextMismatchError>
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/PadicRing@1

Executable usage: examples/11_qadic_witt_vectors.py:11 · examples/11_qadic_witt_vectors.py:12 · examples/11_qadic_witt_vectors.py:13 · examples/11_qadic_witt_vectors.py:15 · examples/13_chinese_remainder_theorem.py:3 · examples/31_local_fields_and_precision.py:10

numthy.PadicRing.residue_field

Return the residue field recorded by this PadicRing.

Detailed contract

Prime residue field F_p.

(self) -> FiniteField

noether::numthy::PadicRing::residue_field · Direct Rust declaration

pub fn residue_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/PadicRing@1

Executable usage: examples/10_padic_hensel_lifting.py:14 · examples/11_qadic_witt_vectors.py:10 · examples/11_qadic_witt_vectors.py:11 · examples/11_qadic_witt_vectors.py:14 · examples/11_qadic_witt_vectors.py:9 · validation/unit/commalg/test_acceptance_workload.py:25

numthy.PadicRing.restrict

Compute restrict for this PadicRing.

Detailed contract

Discard high p-adic digits explicitly, producing a value in the distinct context (p, requested_absolute_precision).

(self, value: PadicElement, absolute_precision: int) -> PadicElement

noether::numthy::PadicRing::restrict · Direct Rust declaration

pub fn restrict( &self, value: &PadicElement, requested_absolute_precision: u64, ) -> Result<PadicElement, PadicRestrictionError>
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/PadicRing@1

Executable usage: validation/unit/commalg/test_local_algebra.py:93 · validation/unit/groups/test_weight_characters.py:48 · validation/unit/numthy/test_padic_local_field_facade.py:100 · validation/unit/numthy/test_padic_ring_facade.py:62 · validation/unit/numthy/test_qadic_ring_facade.py:48

numthy.PadicRing.teichmuller

Compute teichmuller for this PadicRing.

Detailed contract

Lift a residue-field element to its Teichmüller representative modulo p^N, characterized by [a]^p = [a] and [a] mod p = a.

(self, value: FiniteFieldElement) -> PadicElement

noether::numthy::PadicRing::teichmuller · Direct Rust declaration

pub fn teichmuller( &self, value: &FiniteFieldElement, ) -> Result<PadicElement, ContextMismatchError>
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/PadicRing@1

Executable usage: examples/11_qadic_witt_vectors.py:12 · validation/unit/commalg/test_acceptance_workload.py:33 · validation/unit/commalg/test_acceptance_workload.py:38 · validation/unit/commalg/test_context_tower_workload.py:101 · validation/unit/commalg/test_context_tower_workload.py:113 · validation/unit/infra/test_public_api_index.py:164

numthy.PadicRing.to_json

Serialize the fixed prime and absolute precision as canonical typed JSON.

(self) -> str

noether::numthy::PadicRing::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/PadicRing@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.PadicRing.zero

Compute zero for this PadicRing.

(self) -> PadicElement

noether::numthy::PadicRing::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/PadicRing@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