numthy · PadicLocalPrecision¶
4 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.
Worked example¶
The complete checked program Use a ramified local field, its maximal order, and explicit precision loss uses this API directly.
# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Use a ramified local field, its maximal order, and explicit precision loss."""
from noether.commalg import PolynomialRing
from noether.numthy import FiniteField, PadicLocalField, PadicLocalPrecision, QadicRing
def main() -> None:
residue = FiniteField.extension(3, 2)
coefficients = QadicRing(residue, absolute_precision=4)
polynomials = PolynomialRing(coefficients, ["T"])
t = polynomials.generator(0)
field = PadicLocalField(
coefficients,
t**2 + 3,
PadicLocalPrecision(7),
uniformizer_name="pi",
)
pi = field.uniformizer()
order = field.maximal_order()
frobenius = field.coefficient_frobenius_conjugate(1)
frobenius.verify()
assert order.is_maximal()
assert pi in order
assert frobenius(field.one() + pi).field == frobenius.target
try:
field.precision_restriction(PadicLocalPrecision(8))
except ValueError as error:
precision_failure = type(error).__name__
else:
raise AssertionError("increasing fixed precision must fail closed")
print(
f"degree={field.degree}, discriminant valuation={order.discriminant_valuation()}, "
f"Frobenius exponent={frobenius.exponent}, precision failure={precision_failure}"
)
if __name__ == "__main__":
main()
Run it with .venv/bin/python examples/31_local_fields_and_precision.py.
numthy.PadicLocalPrecision¶
Absolute precision measured in powers of a ramified uniformizer.
noether::numthy::PadicLocalPrecision · Direct Rust declaration
| 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/PadicLocalPrecision@1 |
Executable usage: examples/31_local_fields_and_precision.py:17 · examples/31_local_fields_and_precision.py:30 · examples/31_local_fields_and_precision.py:6 · validation/unit/numthy/test_padic_local_field_facade.py:101 · validation/unit/numthy/test_padic_local_field_facade.py:125 · validation/unit/numthy/test_padic_local_field_facade.py:19
numthy.PadicLocalPrecision.absolute_uniformizer_precision¶
Return the absolute uniformizer precision recorded by this PadicLocalPrecision.
Detailed contract
Number M in the precision ideal (pi^M).
noether::numthy::PadicLocalPrecision::absolute_uniformizer_precision · Direct Rust declaration
| 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/PadicLocalPrecision@1 |
numthy.PadicLocalPrecision.from_json¶
Deserialize and revalidate a PadicLocalPrecision from typed JSON.
Detailed contract
Deserialize and revalidate a typed local precision.
noether::numthy::PadicLocalPrecision::from_json · Direct Rust declaration
| 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/PadicLocalPrecision@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.PadicLocalPrecision.to_json¶
Serialize this PadicLocalPrecision to its canonical typed JSON representation.
Detailed contract
Canonical typed JSON.
noether::numthy::PadicLocalPrecision::to_json · Direct Rust declaration
| 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/PadicLocalPrecision@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