Skip to content

category · SignedBoundary

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

Worked example

The complete checked program Decompose a polynomial by a nonstandard positive grading uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Decompose a polynomial by a nonstandard positive grading."""

from noether import Z
from noether.commalg import PolynomialRing, WeightedGrading


def main() -> None:
    ring = PolynomialRing(Z, ["x", "y", "z"], grading=WeightedGrading([1, 2, 3]))
    x, y, z = ring.generators()
    sparse = ring.from_terms([([0, 0, 0], 1), ([2, 0, 0], 1), ([0, 1, 0], 1)])
    polynomial = sparse + z
    assert sparse * (x + y) == (1 + x**2 + y) * (x + y)
    components = polynomial.homogeneous_components()
    assert [degree for degree, _ in components] == [0, 2, 3]
    assert x**2 + y == components[1][1]
    print(f"weighted homogeneous degrees: {[degree for degree, _ in components]}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/14_weighted_polynomials.py.

category.SignedBoundary

Disjoint signed support of one atomic boundary.

SignedBoundary(negative: Sequence[int]=..., positive: Sequence[int]=...)

noether::category::SignedBoundary · Direct Rust declaration

pub struct SignedBoundary { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether
GIL attached / bounded

Executable usage: validation/unit/category/test_category.py:43 · validation/unit/category/test_category.py:45 · validation/unit/category/test_category.py:9

category.SignedBoundary.negative

Return the negative recorded by this SignedBoundary.

Detailed contract

Negative support, in increasing degree-local order.

(self) -> list[int]

noether::category::SignedBoundary::negative · Direct Rust declaration

pub fn negative(&self) -> &[usize]
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether
GIL attached / bounded

Executable usage: validation/unit/category/test_category.py:42 · validation/unit/combin/test_graph_facade.py:75 · validation/unit/combin/test_graph_facade.py:76 · validation/unit/combin/test_graph_facade.py:77 · validation/unit/commalg/test_polynomial_facade.py:203 · validation/unit/topology/test_filtration_builders.py:87

category.SignedBoundary.positive

Return the positive recorded by this SignedBoundary.

Detailed contract

Positive support, in increasing degree-local order.

(self) -> list[int]

noether::category::SignedBoundary::positive · Direct Rust declaration

pub fn positive(&self) -> &[usize]
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether
GIL attached / bounded

Executable usage: examples/14_weighted_polynomials.py:3 · validation/unit/category/test_category.py:42 · validation/unit/combinatorics/test_partition_composition.py:25 · validation/unit/combinatorics/test_partition_composition.py:47 · validation/unit/combinatorics/test_tableau_rsk.py:26 · validation/unit/commalg/test_polynomial_facade.py:182