Skip to content

root · RealBall

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

Worked example

The complete checked program Calculate trace and norm in a concrete quadratic finite field uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Calculate trace and norm in a concrete quadratic finite field."""

from noether.numthy import FiniteField


def main() -> None:
    field = FiniteField.extension(5, 2)
    generator = field.generator()
    assert generator**2 + field(4) * generator + field(2) == field.zero()
    assert generator.trace() == field(1)
    assert generator.norm() == field(2)
    print(f"{field}: Tr(a)={generator.trace()}, Nm(a)={generator.norm()}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/08_finite_field_extensions.py.

RealBall

A certified real enclosure in one fixed precision context.

class RealBall

noether::RealBall · Direct Rust declaration

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

Executable usage: validation/unit/infra/test_discovery.py:44 · validation/unit/infra/test_public_api_index.py:121 · validation/unit/test_ball_facade.py:17 · validation/unit/test_ball_facade.py:44 · validation/unit/test_ball_facade.py:52 · validation/unit/test_ball_facade.py:8

RealBall.__add__

Add another compatible value to this value.

Detailed contract

Returns the argument unchanged.

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

noether::root::RealBall::add · Direct Rust declaration

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

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

RealBall.__mul__

Multiply this value by another compatible value.

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

noether::root::RealBall::mul · Direct Rust declaration

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

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

RealBall.__neg__

Return the additive inverse of this value.

(self) -> RealBall

noether::root::RealBall::neg · Direct Rust declaration

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

RealBall.__pow__

Raise this value to the supplied power.

(self, exponent: int, modulus: None=None) -> RealBall

noether::root::RealBall · 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/RealBall@1

RealBall.__radd__

Add this value to a compatible value on its left.

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

noether::root::RealBall · 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/RealBall@1

RealBall.__rmul__

Multiply this value by a compatible value on its left.

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

noether::root::RealBall · 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/RealBall@1

RealBall.__rsub__

Subtract this value from a compatible value on its left.

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

noether::root::RealBall · 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/RealBall@1

RealBall.__sub__

Subtract another compatible value from this value.

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

noether::root::RealBall::sub · Direct Rust declaration

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

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

RealBall.contains_zero

Whether zero belongs to the enclosure.

Detailed contract

Whether zero is contained in this enclosure.

(self) -> bool

noether::root::RealBall::contains_zero · Direct Rust declaration

pub fn contains_zero(&self) -> bool
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBall@1

Executable usage: validation/unit/test_ball_facade.py:35 · validation/unit/test_ball_facade.py:36 · validation/corpus/commalg/k3-univariate-certificates.py:109 · validation/corpus/numthy/cubic-field-embeddings.py:25 · validation/corpus/numthy/cubic-field-embeddings.py:35

RealBall.field

Concrete precision context.

Detailed contract

The concrete precision context containing this ball.

(self) -> RealBallField

noether::root::RealBall::field · Direct Rust declaration

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

RealBall.from_json

Restore and validate an exact enclosure representation.

Detailed contract

Deserialize and validate an exact real enclosure from canonical JSON.

(cls, value: str) -> RealBall

noether::root::RealBall::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/RealBall@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

RealBall.is_exact

Whether the enclosure has zero radius.

Detailed contract

Whether this enclosure is a point ball with radius zero.

(self) -> bool

noether::root::RealBall::is_exact · Direct Rust declaration

pub fn is_exact(&self) -> bool
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBall@1

Executable usage: validation/unit/commalg/test_polynomial_ideal_facade.py:319 · validation/unit/commalg/test_polynomial_ideal_facade.py:332 · validation/unit/homalg/test_padic_homology_facade.py:36 · validation/unit/numthy/test_padic_ring_facade.py:49 · validation/unit/numthy/test_padic_ring_facade.py:52 · validation/unit/test_ball_facade.py:19

RealBall.overlaps

Whether two same-context enclosures intersect.

Detailed contract

Test whether two same-context enclosures intersect.

(self, other: RealBall) -> bool

noether::root::RealBall::overlaps · Direct Rust declaration

pub fn overlaps(&self, other: &Self) -> Result<bool, ContextMismatchError>
Contract Value
Guarantee rigorous enclosure
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core
GIL attached / bounded
Semantic ID noether/root/RealBall@1

Executable usage: examples/02_ball_arithmetic.py:13 · examples/02_ball_arithmetic.py:17 · examples/02_ball_arithmetic.py:18 · validation/unit/numthy/test_number_field_facade.py:57 · validation/unit/test_ball_facade.py:20 · validation/unit/test_ball_facade.py:21

RealBall.to_json

Canonical JSON representation.

Detailed contract

Serialize this exact enclosure and context to canonical JSON.

(self) -> str

noether::root::RealBall::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/RealBall@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