Skip to content

homalg · ModuleMonomial

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

Worked example

The complete checked program Project and reconstruct a residue class by the Chinese remainder theorem uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Project and reconstruct a residue class by the Chinese remainder theorem."""

from noether.commalg import ResidueRing


def main() -> None:
    ring = ResidueRing(360)
    decomposition = ring.crt()
    decomposition.verify()
    value = ring(347)
    components = decomposition.project(value)
    assert decomposition.reconstruct(components) == value
    print(f"347 mod 360 -> {[int(component) for component in components]}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/13_chinese_remainder_theorem.py.

homalg.ModuleMonomial

One polynomial monomial times an ordered free-module basis vector.

class ModuleMonomial

noether::homalg::ModuleMonomial · Direct Rust declaration

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

Executable usage: validation/unit/homalg/test_module_facade.py:32 · validation/unit/homalg/test_module_facade.py:655

homalg.ModuleMonomial.component

Return the component recorded by this ModuleMonomial.

Detailed contract

Zero-based free-module basis component.

(self) -> int

noether::homalg::ModuleMonomial::component · Direct Rust declaration

pub const fn component(&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/ModuleMonomial@1

Executable usage: examples/13_chinese_remainder_theorem.py:15 · validation/unit/commalg/test_acceptance_workload.py:78 · validation/unit/commalg/test_acceptance_workload.py:79 · validation/unit/commalg/test_affine_normalization_facade.py:187 · validation/unit/commalg/test_affine_normalization_facade.py:216 · validation/unit/commalg/test_polynomial_ideal_facade.py:1005

homalg.ModuleMonomial.exponent

Return the exponent recorded by this ModuleMonomial.

Detailed contract

Polynomial exponent vector.

(self) -> list[int]

noether::homalg::ModuleMonomial::exponent · Direct Rust declaration

pub fn exponent(&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/ModuleMonomial@1

Executable usage: examples/31_local_fields_and_precision.py:38 · validation/unit/commalg/test_base_change.py:93 · validation/unit/commalg/test_groebner_verification_budget.py:32 · validation/unit/commalg/test_groebner_verification_budget.py:33 · validation/unit/commalg/test_groebner_verification_budget.py:34 · validation/unit/commalg/test_groebner_verification_budget.py:35

homalg.ModuleMonomial.from_json

Deserialize and revalidate a ModuleMonomial from typed JSON.

Detailed contract

Deserialize an exact module monomial.

(cls, value: str) -> ModuleMonomial

noether::homalg::ModuleMonomial::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/ModuleMonomial@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.ModuleMonomial.to_json

Serialize this ModuleMonomial to its canonical typed JSON representation.

Detailed contract

Serialize this exact exponent vector and basis component.

(self) -> str

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