Skip to content

numthy · PadicLocalFractionalIdeal

17 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.PadicLocalFractionalIdeal

A nonzero certified fractional lattice over a p-adic local order.

PadicLocalFractionalIdeal(order: PadicLocalFieldOrder, generators: list[PadicLocalFieldElement])

noether::numthy::PadicLocalFractionalIdeal · Direct Rust declaration

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

Executable usage: validation/unit/infra/test_discovery.py:246 · validation/unit/numthy/test_padic_local_field_facade.py:18 · validation/unit/numthy/test_padic_local_field_facade.py:224 · validation/unit/numthy/test_padic_local_field_facade.py:239

numthy.PadicLocalFractionalIdeal.__add__

Add another compatible value to this value.

Detailed contract

Sum of two fractional ideals of the same certified order. Returns the argument unchanged.

(self, other: PadicLocalFractionalIdeal) -> PadicLocalFractionalIdeal

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

pub fn add(&self, other: &Self) -> Result<Self, PadicLocalIdealError>
fn add(self, rhs: &PadicLocalFractionalIdeal) -> 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/PadicLocalFractionalIdeal@1

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

numthy.PadicLocalFractionalIdeal.__contains__

Test whether the supplied value belongs to this object.

Detailed contract

Whether an ambient value lies in this fractional lattice.

(self, value: object) -> bool

noether::numthy::PadicLocalFractionalIdeal::contains · Direct Rust declaration

pub fn contains(&self, value: &PadicLocalFieldElement) -> 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/PadicLocalFractionalIdeal@1

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

numthy.PadicLocalFractionalIdeal.__mul__

Multiply this value by another compatible value.

Detailed contract

Product of two fractional ideals of the same certified order.

(self, other: PadicLocalFractionalIdeal) -> PadicLocalFractionalIdeal

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

pub fn mul(&self, other: &Self) -> Result<Self, PadicLocalIdealError>
fn mul(self, rhs: &PadicLocalFractionalIdeal) -> 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/PadicLocalFractionalIdeal@1

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

numthy.PadicLocalFractionalIdeal.add

Compute add for this PadicLocalFractionalIdeal.

Detailed contract

Sum of two fractional ideals of the same certified order. Returns the argument unchanged.

(self, other: PadicLocalFractionalIdeal) -> PadicLocalFractionalIdeal

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

pub fn add(&self, other: &Self) -> Result<Self, PadicLocalIdealError>
fn add(self, rhs: &PadicLocalFractionalIdeal) -> 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/PadicLocalFractionalIdeal@1

Executable usage: validation/unit/infra/test_corpus_acceptance.py:119 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:1009 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:1044 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:1046 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:323 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:957

numthy.PadicLocalFractionalIdeal.basis

Return the basis recorded by this PadicLocalFractionalIdeal.

Detailed contract

Canonical certified Z_p-basis of this fractional lattice.

(self) -> list[PadicLocalFieldElement]

noether::numthy::PadicLocalFractionalIdeal::basis · Direct Rust declaration

pub fn basis(&self) -> &[PadicLocalFieldElement]
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/PadicLocalFractionalIdeal@1

Executable usage: examples/26_elliptic_descent_functions.py:28 · examples/30_modules_and_resolutions.py:27 · examples/30_modules_and_resolutions.py:28 · examples/30_modules_and_resolutions.py:29 · examples/33_simplicial_cohomology_operations.py:26 · examples/33_simplicial_cohomology_operations.py:27

numthy.PadicLocalFractionalIdeal.certified_precision

Return the certified precision recorded by this PadicLocalFractionalIdeal.

Detailed contract

Uniform p-adic coefficient cap at which this fractional lattice is certified.

(self) -> int

noether::numthy::PadicLocalFractionalIdeal::certified_precision · Direct Rust declaration

pub const fn certified_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/PadicLocalFractionalIdeal@1

Executable usage: validation/unit/numthy/test_padic_local_field_facade.py:179 · validation/unit/numthy/test_padic_local_field_facade.py:238

numthy.PadicLocalFractionalIdeal.from_json

Deserialize and revalidate a PadicLocalFractionalIdeal from typed JSON.

Detailed contract

Restore and revalidate the fractional lattice and order action.

(cls, value: str) -> PadicLocalFractionalIdeal

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

Compute inverse for this PadicLocalFractionalIdeal.

Detailed contract

Inverse fractional ideal, when the coefficient order is the maximal DVR.

(self) -> PadicLocalFractionalIdeal

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

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

Test whether this PadicLocalFractionalIdeal is integral.

Detailed contract

Whether the fractional lattice is contained in its coefficient order.

(self) -> bool

noether::numthy::PadicLocalFractionalIdeal::is_integral · Direct Rust declaration

pub fn is_integral(&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/PadicLocalFractionalIdeal@1

Executable usage: validation/unit/numthy/test_number_field_facade.py:181 · validation/unit/numthy/test_number_field_facade.py:193 · validation/unit/numthy/test_padic_local_field_facade.py:225 · validation/unit/numthy/test_padic_local_field_facade.py:245 · validation/corpus/numthy/quadratic-field-arithmetic.py:40

numthy.PadicLocalFractionalIdeal.is_subset_of

Test whether this PadicLocalFractionalIdeal is subset of.

Detailed contract

Whether this ideal is contained in another ideal of the same order.

(self, other: PadicLocalFractionalIdeal) -> bool

noether::numthy::PadicLocalFractionalIdeal::is_subset_of · Direct Rust declaration

pub fn is_subset_of(&self, other: &Self) -> Result<bool, PadicLocalIdealError>
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/PadicLocalFractionalIdeal@1

Executable usage: validation/unit/homalg/test_exact_submodules.py:63 · validation/unit/homalg/test_module_facade.py:117 · validation/unit/homalg/test_module_facade.py:118 · validation/unit/homalg/test_module_facade.py:119 · validation/bench/macaulay2_derived.py:560 · validation/bench/macaulay2_derived.py:602

numthy.PadicLocalFractionalIdeal.maximal_ideal_exponent

Compute maximal ideal exponent for this PadicLocalFractionalIdeal.

Detailed contract

Signed exponent of the unique maximal ideal, for the maximal order.

(self) -> int

noether::numthy::PadicLocalFractionalIdeal::maximal_ideal_exponent · Direct Rust declaration

pub fn maximal_ideal_exponent(&self) -> Result<i64, PadicLocalIdealError>
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/PadicLocalFractionalIdeal@1

Executable usage: validation/unit/numthy/test_padic_local_field_facade.py:227 · validation/unit/numthy/test_padic_local_field_facade.py:231 · validation/unit/numthy/test_padic_local_field_facade.py:234 · validation/unit/numthy/test_padic_local_field_facade.py:236

numthy.PadicLocalFractionalIdeal.mul

Compute mul for this PadicLocalFractionalIdeal.

Detailed contract

Product of two fractional ideals of the same certified order.

(self, other: PadicLocalFractionalIdeal) -> PadicLocalFractionalIdeal

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

pub fn mul(&self, other: &Self) -> Result<Self, PadicLocalIdealError>
fn mul(self, rhs: &PadicLocalFractionalIdeal) -> 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/PadicLocalFractionalIdeal@1

Executable usage: validation/parity/m1_bsgs.py:163 · validation/parity/m1_bsgs.py:164

numthy.PadicLocalFractionalIdeal.norm_valuation

Compute norm valuation for this PadicLocalFractionalIdeal.

Detailed contract

Signed p-valuation of the lattice norm relative to its coefficient order.

(self) -> int

noether::numthy::PadicLocalFractionalIdeal::norm_valuation · Direct Rust declaration

pub fn norm_valuation(&self) -> Result<i64, PadicLocalIdealError>
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/PadicLocalFractionalIdeal@1

Executable usage: validation/unit/numthy/test_padic_local_field_facade.py:226 · validation/unit/numthy/test_padic_local_field_facade.py:246

numthy.PadicLocalFractionalIdeal.order

Return the order recorded by this PadicLocalFractionalIdeal.

Detailed contract

Coefficient order.

(self) -> PadicLocalFieldOrder

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

pub fn order(&self) -> &PadicLocalFieldOrder
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/PadicLocalFractionalIdeal@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.PadicLocalFractionalIdeal.scale

Compute scale for this PadicLocalFractionalIdeal.

Detailed contract

Scale by one nonzero ambient field element.

(self, scalar: PadicLocalFieldElement) -> PadicLocalFractionalIdeal

noether::numthy::PadicLocalFractionalIdeal::scale · Direct Rust declaration

pub fn scale( &self, scalar: &PadicLocalFieldElement, ) -> Result<Self, PadicLocalIdealError>
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/PadicLocalFractionalIdeal@1

Executable usage: validation/unit/infra/test_mpi_scale_report.py:13 · validation/bench/macaulay2_normalization.py:332 · validation/bench/macaulay2_normalization.py:333 · validation/bench/macaulay2_normalization.py:337 · validation/bench/macaulay2_normalization.py:339

numthy.PadicLocalFractionalIdeal.to_json

Serialize this PadicLocalFractionalIdeal to its canonical typed JSON representation.

Detailed contract

Canonical typed JSON with full order identity and a revalidated basis.

(self) -> str

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