Skip to content

homalg · RankBounds

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

Worked example

The complete checked program Apply and multiply canonical sparse exact operators uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Apply and multiply canonical sparse exact operators."""

from noether import Z
from noether.linalg import SparseMatrix, Vector


def main() -> None:
    operator = SparseMatrix.from_triplets(
        Z,
        (3, 3),
        [(0, 0, 2), (0, 2, -1), (1, 1, 3), (2, 0, 4)],
    )
    vector = Vector.from_values(Z, [5, 7, 11])
    image = operator.apply(vector)
    assert image.to_values() == [-1, 21, 20]
    assert (operator @ operator).nnz == 4
    print(f"A v = {image.to_values()}; nnz(A^2) = {(operator @ operator).nnz}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/05_sparse_exact_operators.py.

homalg.RankBounds

Inclusive lower and upper bounds for a finite free rank.

class RankBounds

noether::homalg::RankBounds · Direct Rust declaration

pub struct RankBounds { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/RankBounds@1

Executable usage: validation/unit/homalg/test_padic_homology_facade.py:17 · validation/unit/homalg/test_padic_homology_facade.py:33 · validation/unit/homalg/test_padic_homology_facade.py:34

homalg.RankBounds.exact

Return the exact recorded by this RankBounds.

Detailed contract

The exact rank, when both bounds agree.

(self) -> int | None

noether::homalg::RankBounds::exact · Direct Rust declaration

pub fn exact(&self) -> Option<usize>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/RankBounds@1

Executable usage: examples/05_sparse_exact_operators.py:3 · examples/16_rational_functions.py:3 · examples/25_exact_geometry.py:3 · examples/35_eilenberg_maclane_spaces.py:3 · examples/36_affine_normalization.py:3 · examples/38_exact_linear_systems.py:78

homalg.RankBounds.from_json

Deserialize and revalidate a RankBounds from typed JSON.

Detailed contract

Deserialize and revalidate canonical typed JSON.

(cls, value: str) -> RankBounds

noether::homalg::RankBounds::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, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/RankBounds@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

homalg.RankBounds.is_exact

Test whether this RankBounds is exact.

Detailed contract

Whether the rank is uniquely determined.

(self) -> bool

noether::homalg::RankBounds::is_exact · Direct Rust declaration

pub fn is_exact(&self) -> bool
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/RankBounds@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

homalg.RankBounds.lower

Return the lower recorded by this RankBounds.

Detailed contract

Inclusive lower bound.

(self) -> int

noether::homalg::RankBounds::lower · Direct Rust declaration

pub fn lower(&self) -> usize
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/RankBounds@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:101 · validation/unit/commalg/test_polynomial_facade.py:98 · validation/unit/commalg/test_polynomial_facade.py:99 · validation/unit/commalg/test_surface_facade.py:72 · validation/unit/commalg/test_surface_facade.py:74 · validation/unit/commalg/test_surface_facade.py:76

homalg.RankBounds.to_json

Serialize this RankBounds to its canonical typed JSON representation.

Detailed contract

Canonical typed JSON.

(self) -> str

noether::homalg::RankBounds::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, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/RankBounds@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

homalg.RankBounds.upper

Return the upper recorded by this RankBounds.

Detailed contract

Inclusive upper bound.

(self) -> int

noether::homalg::RankBounds::upper · Direct Rust declaration

pub fn upper(&self) -> usize
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/RankBounds@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:101 · validation/unit/commalg/test_polynomial_facade.py:98 · validation/unit/commalg/test_polynomial_facade.py:99 · validation/unit/commalg/test_surface_facade.py:73 · validation/unit/commalg/test_surface_facade.py:75 · validation/unit/commalg/test_surface_facade.py:76

homalg.RankBounds.verify

Replay and verify the mathematical evidence carried by this RankBounds.

Detailed contract

Recheck the ordering of the two bounds.

(self) -> None

noether::homalg::RankBounds::verify · Direct Rust declaration

pub fn verify(&self) -> Result<(), VerificationError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, m4rst, m4rste, module-core, resolution-kernel, sparla
GIL attached / bounded
Semantic ID noether/homalg/RankBounds@1

Executable usage: examples/01_bezout_certificates.py:10 · examples/01_bezout_certificates.py:3 · examples/03_exact_linear_systems.py:13 · examples/03_exact_linear_systems.py:3 · examples/04_smith_normal_form.py:12 · examples/06_shortest_lattice_vectors.py:12