Skip to content

homalg · ModuleMonomialOrder

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

Worked example

The complete checked program Reduce a module element and certify a minimal free resolution uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Reduce a module element and certify a minimal free resolution."""

from noether import Q
from noether.commalg import Degree, MonomialOrder, PolynomialRing
from noether.homalg import (
    FreeModule,
    ModuleElement,
    ModuleHomomorphism,
    ModuleMonomialOrder,
    PresentedModule,
    Submodule,
)
from noether.linalg import Matrix, Vector


def main() -> None:
    ring = PolynomialRing(Q, ["x", "y", "z", "w"])
    x, y, z, w = ring.generators()
    order = ModuleMonomialOrder.term_over_position(MonomialOrder.GREVLEX)

    ambient = FreeModule(ring, 2)
    first = ModuleElement(ambient, Vector.from_values(ring, [x, y]))
    second = ModuleElement(ambient, Vector.from_values(ring, [y, 1]))
    submodule = Submodule.from_generators(ambient, [first, second])
    basis = submodule.groebner_basis(order)
    reduction = basis.reduce(first + second * x)
    basis.verify()
    reduction.verify()
    assert reduction.is_member()

    target = FreeModule(ring, 1, grading_rank=1, degree_shifts=[Degree([0])])
    source = FreeModule(ring, 3, grading_rank=1, degree_shifts=[Degree([-2])] * 3)
    twisted_cubic = PresentedModule(
        ModuleHomomorphism(
            source,
            target,
            Matrix.from_rows(ring, [[x * z - y**2, x * w - y * z, y * w - z**2]]),
        )
    )
    resolution = twisted_cubic.minimal_free_resolution(order)
    resolution.verify()
    betti = resolution.graded_betti_table()
    betti.verify()
    assert betti.entries == [
        (0, Degree([0]), 1),
        (1, Degree([2]), 3),
        (2, Degree([3]), 2),
    ]
    print(f"module member certified; minimal Betti entries={betti.entries}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/30_modules_and_resolutions.py.

homalg.ModuleMonomialOrder

A standard module-monomial order extending a polynomial monomial order.

class ModuleMonomialOrder

noether::homalg::ModuleMonomialOrder · Direct Rust declaration

pub enum ModuleMonomialOrder { TermOverPosition(MonomialOrder), PositionOverTerm(MonomialOrder), Schreyer { target_order: Box<Self>, leading_monomials: Vec<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/ModuleMonomialOrder@1

Executable usage: examples/30_modules_and_resolutions.py:11 · examples/30_modules_and_resolutions.py:21 · validation/unit/homalg/test_module_facade.py:256 · validation/unit/homalg/test_module_facade.py:267 · validation/unit/homalg/test_module_facade.py:278 · validation/unit/homalg/test_module_facade.py:280

homalg.ModuleMonomialOrder.base_order

Return the base order recorded by this ModuleMonomialOrder.

Detailed contract

Underlying polynomial monomial order.

(self) -> MonomialOrder

noether::homalg::ModuleMonomialOrder::base_order · Direct Rust declaration

pub fn base_order(&self) -> &MonomialOrder
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/ModuleMonomialOrder@1

Executable usage: validation/corpus/combin/circulant-double-cover-stability.py:31 · validation/corpus/combin/circulant-double-cover-stability.py:33 · validation/corpus/combin/circulant-double-cover-stability.py:34

homalg.ModuleMonomialOrder.from_json

Deserialize and revalidate a ModuleMonomialOrder from typed JSON.

Detailed contract

Deserialize and revalidate a standard module order.

(cls, value: str) -> ModuleMonomialOrder

noether::homalg::ModuleMonomialOrder::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/ModuleMonomialOrder@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.ModuleMonomialOrder.kind

Return the kind recorded by this ModuleMonomialOrder.

(self) -> Literal['term_over_position', 'position_over_term', 'schreyer']

noether::homalg::ModuleMonomialOrder · Python projection

Python projection convenience over this Rust mathematical type
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/ModuleMonomialOrder@1

Executable usage: validation/unit/combinatorics/test_poset.py:95 · validation/unit/commalg/test_curve_facade.py:137 · validation/unit/commalg/test_curve_facade.py:43 · validation/unit/commalg/test_curve_facade.py:44 · validation/unit/commalg/test_curve_facade.py:45 · validation/unit/commalg/test_curve_facade.py:80

homalg.ModuleMonomialOrder.position_over_term

Construct a ModuleMonomialOrder using position over term.

(cls, base_order: MonomialOrder) -> ModuleMonomialOrder

noether::homalg::ModuleMonomialOrder · Python projection

Python projection convenience over this Rust mathematical type
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/ModuleMonomialOrder@1

homalg.ModuleMonomialOrder.schreyer

Construct a ModuleMonomialOrder using schreyer.

Detailed contract

Construct the exact order induced by an ordered target leading frame.

(cls, target_order: ModuleMonomialOrder, leading_monomials: Sequence[ModuleMonomial]) -> ModuleMonomialOrder

noether::homalg::ModuleMonomialOrder::schreyer · Direct Rust declaration

pub fn schreyer( target_order: Self, leading_monomials: Vec<ModuleMonomial>, ) -> Self
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/ModuleMonomialOrder@1

Executable usage: validation/unit/homalg/test_module_facade.py:658 · validation/unit/homalg/test_module_facade.py:659 · validation/unit/homalg/test_module_facade.py:660 · validation/unit/homalg/test_module_facade.py:661 · validation/unit/homalg/test_module_facade.py:662

homalg.ModuleMonomialOrder.schreyer_leading_monomials

Return the schreyer leading monomials recorded by this ModuleMonomialOrder.

(self) -> list[ModuleMonomial] | None

noether::homalg::ModuleMonomialOrder · Python projection

Python projection convenience over this Rust mathematical type
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/ModuleMonomialOrder@1

Executable usage: validation/unit/homalg/test_module_facade.py:661

homalg.ModuleMonomialOrder.schreyer_target_order

Return the schreyer target order recorded by this ModuleMonomialOrder.

(self) -> ModuleMonomialOrder | None

noether::homalg::ModuleMonomialOrder · Python projection

Python projection convenience over this Rust mathematical type
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/ModuleMonomialOrder@1

Executable usage: validation/unit/homalg/test_module_facade.py:660

homalg.ModuleMonomialOrder.term_over_position

Construct a ModuleMonomialOrder using term over position.

(cls, base_order: MonomialOrder) -> ModuleMonomialOrder

noether::homalg::ModuleMonomialOrder · Python projection

Python projection convenience over this Rust mathematical type
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/ModuleMonomialOrder@1

Executable usage: examples/30_modules_and_resolutions.py:21 · validation/unit/homalg/test_module_facade.py:256 · validation/unit/homalg/test_module_facade.py:267 · validation/unit/homalg/test_module_facade.py:278 · validation/unit/homalg/test_module_facade.py:279 · validation/unit/homalg/test_module_facade.py:296

homalg.ModuleMonomialOrder.to_json

Serialize this ModuleMonomialOrder to its canonical typed JSON representation.

Detailed contract

Serialize this mathematical module order as typed JSON.

(self) -> str

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