Skip to content

homalg · StrongModuleTerm

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

Worked example

The complete checked program Calculate in a fixed-cap multivariate weighted power-series ring uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Calculate in a fixed-cap multivariate weighted power-series ring."""

from noether import Z
from noether.commalg import PowerSeriesRing, SeriesTruncation


def main() -> None:
    ring = PowerSeriesRing(
        Z,
        ["x", "y", "z"],
        SeriesTruncation.weighted_degree([1, 2, 3], 6),
    )
    x, y, z = ring.generators()
    assert (x**6).is_zero()
    assert not (x**2 * z + y * z).is_zero()
    value = (1 + x + y).pow(4)
    print(f"{value}; coefficient capacity <= {ring.coefficient_capacity_bound()}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/17_weighted_power_series.py.

homalg.StrongModuleTerm

One positive coefficient-bearing leading module term over Z.

class StrongModuleTerm

noether::homalg::StrongModuleTerm · Direct Rust declaration

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

Executable usage: validation/unit/homalg/test_module_facade.py:44 · validation/unit/homalg/test_module_facade.py:723

homalg.StrongModuleTerm.coefficient

Return the coefficient recorded by this StrongModuleTerm.

Detailed contract

Positive leading coefficient.

(self) -> int

noether::homalg::StrongModuleTerm::coefficient · Direct Rust declaration

pub fn coefficient(&self) -> &Integer
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/StrongModuleTerm@1

Executable usage: examples/17_weighted_power_series.py:19 · examples/22_matroids_and_tutte.py:11 · examples/22_matroids_and_tutte.py:12 · examples/22_matroids_and_tutte.py:13 · examples/33_simplicial_cohomology_operations.py:31 · validation/unit/combin/test_acceptance_workload.py:45

homalg.StrongModuleTerm.from_json

Deserialize and revalidate a StrongModuleTerm from typed JSON.

Detailed contract

Deserialize and validate a strong leading term.

(cls, value: str) -> StrongModuleTerm

noether::homalg::StrongModuleTerm::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/StrongModuleTerm@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.StrongModuleTerm.monomial

Return the monomial recorded by this StrongModuleTerm.

Detailed contract

Leading polynomial monomial and free-module component.

(self) -> ModuleMonomial

noether::homalg::StrongModuleTerm::monomial · Direct Rust declaration

pub fn monomial(&self) -> &ModuleMonomial
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/StrongModuleTerm@1

Executable usage: validation/unit/combinatorics/test_partition_types.py:50 · validation/unit/commalg/test_monomial_ideal_facade.py:3 · validation/unit/commalg/test_monomial_ideal_facade.py:43 · validation/unit/commalg/test_monomial_ideal_facade.py:45 · validation/unit/commalg/test_monomial_ideal_facade.py:46 · validation/unit/commalg/test_monomial_ideal_facade.py:47

homalg.StrongModuleTerm.to_json

Serialize this StrongModuleTerm to its canonical typed JSON representation.

Detailed contract

Serialize this exact strong leading term.

(self) -> str

noether::homalg::StrongModuleTerm::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/StrongModuleTerm@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