Skip to content

root · RealBallField

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

Worked example

The complete checked program Certify a familiar identity with real and complex balls uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Certify a familiar identity with real and complex balls."""

from fractions import Fraction

from noether import ComplexBallField, RealBallField


def main() -> None:
    reals = RealBallField(192)
    one_third = reals(Fraction(1, 3))
    assert (3 * one_third).overlaps(reals.one())

    complexes = ComplexBallField(192)
    imaginary_unit = complexes(0, 1)
    assert (imaginary_unit**2).overlaps(complexes(-1))
    assert (1 + imaginary_unit).overlaps(complexes(1, 1))
    print(f"1/3 = {one_third}; i^2 = {imaginary_unit**2}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/02_ball_arithmetic.py.

RealBallField

A fixed-working-precision certified real-ball context.

RealBallField(precision: int)

noether::RealBallField · Direct Rust declaration

pub struct RealBallField { /* private fields */ }
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBallField@1

Executable usage: examples/02_ball_arithmetic.py:11 · examples/02_ball_arithmetic.py:7 · validation/unit/infra/test_public_api_index.py:155 · validation/unit/linalg/test_sparse_matrix_facade.py:133 · validation/unit/linalg/test_sparse_matrix_facade.py:7 · validation/unit/test_ball_facade.py:12

RealBallField.__call__

Call self as a function.

(self, value: int | _Fraction) -> RealBall

noether::root::RealBallField · Python projection

Python projection convenience over this Rust mathematical type
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBallField@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

RealBallField.from_json

Restore and validate a canonical context representation.

Detailed contract

Deserialize and validate a real-ball context from canonical JSON.

(cls, value: str) -> RealBallField

noether::root::RealBallField::from_json · Direct Rust declaration

pub fn from_json(value: &str) -> Result<Self, NoetherError>
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBallField@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

RealBallField.interval

Enclose an exact rational interval.

Detailed contract

Enclose the exact rational interval [lower, upper].

(self, lower: int | _Fraction, upper: int | _Fraction) -> RealBall

noether::root::RealBallField::interval · Direct Rust declaration

pub fn interval<L: Into<Rational>, U: Into<Rational>>( self, lower: L, upper: U, ) -> Result<RealBall, BallError>
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBallField@1

Executable usage: validation/unit/topology/test_simplicial_complex_facade.py:145 · validation/unit/topology/test_simplicial_complex_facade.py:146 · validation/unit/topology/test_simplicial_complex_facade.py:152 · validation/unit/topology/test_simplicial_complex_facade.py:153 · validation/unit/topology/test_simplicial_complex_facade.py:154 · validation/unit/topology/test_simplicial_complex_facade.py:159

RealBallField.one

Multiplicative identity.

(self) -> RealBall

noether::root::RealBallField::one · Direct Rust declaration

fn one(&self) -> Self::Element
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBallField@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

RealBallField.precision

Working precision in bits.

(self) -> int

noether::root::RealBallField::precision · Direct Rust declaration

fn precision(&self) -> &Self::Precision
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBallField@1

Executable usage: examples/10_padic_hensel_lifting.py:3 · examples/11_qadic_witt_vectors.py:3 · examples/31_local_fields_and_precision.py:3 · examples/31_local_fields_and_precision.py:34 · examples/31_local_fields_and_precision.py:38 · validation/unit/commalg/test_polynomial_facade.py:102

RealBallField.to_json

Canonical JSON representation.

Detailed contract

Serialize this context to canonical JSON.

(self) -> str

noether::root::RealBallField::to_json · Direct Rust declaration

pub fn to_json(self) -> Result<String, NoetherError>
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBallField@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

RealBallField.zero

Additive identity.

(self) -> RealBall

noether::root::RealBallField::zero · Direct Rust declaration

fn zero(&self) -> Self::Element
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBallField@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