numthy · QadicElement¶
20 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.QadicElement¶
A fixed-cap q-adic value carrying its concrete ring or field context.
noether::numthy::QadicElement · 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/QadicElement@1 |
Executable usage: validation/unit/commalg/test_context_tower_workload.py:25 · validation/unit/commalg/test_context_tower_workload.py:76 · validation/unit/commalg/test_context_tower_workload.py:77 · validation/unit/infra/test_discovery.py:41 · validation/unit/infra/test_public_api_index.py:118 · validation/unit/numthy/test_qadic_field_facade.py:13
numthy.QadicElement.__add__¶
Add another compatible value to this value.
Detailed contract
Returns the argument unchanged.
noether::numthy::QadicElement::add · 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/QadicElement@1 |
Executable usage: validation/unit/infra/test_discovery.py:211 · validation/unit/infra/test_public_api_index.py:293
numthy.QadicElement.__mul__¶
Multiply this value by another compatible value.
noether::numthy::QadicElement::mul · 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/QadicElement@1 |
Executable usage: validation/unit/infra/test_public_api_index.py:214
numthy.QadicElement.__neg__¶
Return the additive inverse of this value.
noether::numthy::QadicElement::neg · 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/QadicElement@1 |
numthy.QadicElement.__pow__¶
Raise this value to the supplied power.
noether::numthy::QadicElement · Python projection
| 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/QadicElement@1 |
numthy.QadicElement.__sub__¶
Subtract another compatible value from this value.
noether::numthy::QadicElement::sub · 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/QadicElement@1 |
Executable usage: validation/unit/infra/test_discovery.py:212
numthy.QadicElement.coefficients¶
Return the coefficients recorded by this QadicElement.
Detailed contract
Power-basis coefficients in Z_p or Q_p, matching the concrete parent context.
noether::numthy::QadicElement::coefficients · 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/QadicElement@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.QadicElement.field¶
Return the field recorded by this QadicElement.
Detailed contract
Concrete unramified field containing this value, or None for a QadicRing element.
noether::numthy::QadicElement::field · 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/QadicElement@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.QadicElement.frobenius¶
Compute frobenius for this QadicElement.
Detailed contract
Apply the lifted residue-field Frobenius automorphism.
noether::numthy::QadicElement::frobenius · 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/QadicElement@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.QadicElement.from_json¶
Deserialize and revalidate a q-adic value and its parent context.
Detailed contract
Deserialize and revalidate a q-adic value and its complete parent context.
noether::numthy::QadicElement::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/QadicElement@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.QadicElement.inverse¶
Compute inverse for this QadicElement.
Detailed contract
Multiplicative inverse in the concrete parent context.
noether::numthy::QadicElement::inverse · 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/QadicElement@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.QadicElement.is_unit¶
Test whether this QadicElement is unit.
Detailed contract
Whether this value is invertible in its concrete parent context.
noether::numthy::QadicElement::is_unit · 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/QadicElement@1 |
Executable usage: validation/unit/commalg/test_local_algebra.py:44 · validation/unit/commalg/test_local_algebra.py:59 · validation/unit/commalg/test_prime_localization.py:25 · validation/unit/commalg/test_prime_localization.py:26 · validation/unit/commalg/test_prime_localization.py:47 · validation/unit/commalg/test_quotient_facade.py:51
numthy.QadicElement.known_absolute_precision¶
Return the known absolute precision recorded by this QadicElement.
Detailed contract
Known absolute precision, equal to the immutable context cap.
noether::numthy::QadicElement::known_absolute_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/QadicElement@1 |
Executable usage: validation/unit/numthy/test_acceptance_workload.py:106 · validation/unit/numthy/test_padic_local_field_facade.py:67 · validation/unit/numthy/test_padic_local_field_facade.py:96 · validation/unit/numthy/test_padic_ring_facade.py:68 · validation/unit/numthy/test_qadic_ring_facade.py:55 · validation/corpus/numthy/padic-newton-cube-root.py:23
numthy.QadicElement.norm¶
Compute norm for this QadicElement.
Detailed contract
Norm to the coefficient p-adic ring or field.
noether::numthy::QadicElement::norm · 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/QadicElement@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.QadicElement.pow¶
Compute pow for this QadicElement.
Detailed contract
Raise this value to a nonnegative word-sized power.
noether::numthy::QadicElement::pow · 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/QadicElement@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.QadicElement.residue¶
Compute residue for this QadicElement.
Detailed contract
Residue in the explicit finite residue field, or None when this value has negative valuation.
noether::numthy::QadicElement::residue · 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/QadicElement@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.QadicElement.ring¶
Return the ring recorded by this QadicElement.
Detailed contract
Concrete Witt-ring context containing this value, or None for a QadicField element.
noether::numthy::QadicElement::ring · 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/QadicElement@1 |
Executable usage: examples/11_qadic_witt_vectors.py:3 · examples/13_chinese_remainder_theorem.py:10 · examples/13_chinese_remainder_theorem.py:12 · examples/13_chinese_remainder_theorem.py:9 · examples/14_weighted_polynomials.py:10 · examples/14_weighted_polynomials.py:11
numthy.QadicElement.to_json¶
Serialize the complete parent and canonical power-basis coordinates.
Detailed contract
Serialize the concrete parent and canonical power-basis coordinates.
noether::numthy::QadicElement::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/QadicElement@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.QadicElement.trace¶
Compute trace for this QadicElement.
Detailed contract
Trace to the coefficient p-adic ring or field.
noether::numthy::QadicElement::trace · 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/QadicElement@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
numthy.QadicElement.valuation¶
Compute valuation for this QadicElement.
Detailed contract
Precision-aware p-adic valuation.
noether::numthy::QadicElement::valuation · 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/QadicElement@1 |
Executable usage: examples/31_local_fields_and_precision.py:37 · validation/unit/commalg/test_context_tower_workload.py:121 · validation/unit/commalg/test_context_tower_workload.py:122 · validation/unit/numthy/test_number_field_facade.py:244 · validation/unit/numthy/test_number_field_facade.py:245 · validation/unit/numthy/test_number_field_facade.py:255