Skip to content

homalg · ModulePrimaryDecomposition

9 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.ModulePrimaryDecomposition

Complete verified primary decomposition of a module's zero submodule.

class ModulePrimaryDecomposition

noether::homalg::ModulePrimaryDecomposition · Direct Rust declaration

pub struct ModulePrimaryDecomposition<R: Field> { /* 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/ModulePrimaryDecomposition@1

Executable usage: validation/unit/homalg/test_module_facade.py:161 · validation/unit/homalg/test_module_facade.py:181 · validation/unit/homalg/test_module_facade.py:186 · validation/unit/homalg/test_module_facade.py:35

homalg.ModulePrimaryDecomposition.associated_primes

Return the associated primes recorded by this ModulePrimaryDecomposition.

Detailed contract

Canonically ordered distinct associated-prime certificates.

(self) -> list[PolynomialPrimeCertificate[_AssociatedPrimeField]]

noether::homalg::ModulePrimaryDecomposition::associated_primes · Direct Rust declaration

pub fn associated_primes(&self) -> Vec<&PolynomialPrimeCertificate<R>>
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/ModulePrimaryDecomposition@1

Executable usage: validation/unit/commalg/test_polynomial_ideal_facade.py:1271 · validation/unit/commalg/test_polynomial_ideal_facade.py:566 · validation/unit/commalg/test_polynomial_ideal_facade.py:577 · validation/unit/commalg/test_polynomial_ideal_facade.py:623 · validation/unit/commalg/test_polynomial_ideal_facade.py:654 · validation/unit/commalg/test_polynomial_ideal_facade.py:694

homalg.ModulePrimaryDecomposition.components

Return the components recorded by this ModulePrimaryDecomposition.

Detailed contract

Primary submodules in the canonical order of the source associated primes.

(self) -> list[ModulePrimaryComponent[_AssociatedPrimeField]]

noether::homalg::ModulePrimaryDecomposition::components · Direct Rust declaration

pub fn components(&self) -> &[ModulePrimaryComponent<R>]
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/ModulePrimaryDecomposition@1

Executable usage: examples/13_chinese_remainder_theorem.py:13 · examples/13_chinese_remainder_theorem.py:14 · examples/13_chinese_remainder_theorem.py:15 · examples/14_weighted_polynomials.py:15 · examples/14_weighted_polynomials.py:16 · examples/14_weighted_polynomials.py:17

homalg.ModulePrimaryDecomposition.from_json

Deserialize and revalidate a ModulePrimaryDecomposition from typed JSON.

Detailed contract

Deserialize and exactly reverify a complete module decomposition.

(cls, value: str) -> ModulePrimaryDecomposition[RationalField | FiniteField]

noether::homalg::ModulePrimaryDecomposition::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/ModulePrimaryDecomposition@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.ModulePrimaryDecomposition.source

Return the source recorded by this ModulePrimaryDecomposition.

Detailed contract

Retained source module whose zero submodule was decomposed.

(self) -> PresentedModule[PolynomialRing[_AssociatedPrimeField]]

noether::homalg::ModulePrimaryDecomposition::source · Direct Rust declaration

pub fn source(&self) -> &PresentedModule<PolynomialRing<R>>
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/ModulePrimaryDecomposition@1

Executable usage: examples/09_finite_field_isomorphisms.py:11 · examples/09_finite_field_isomorphisms.py:13 · examples/09_finite_field_isomorphisms.py:9 · examples/30_modules_and_resolutions.py:34 · examples/30_modules_and_resolutions.py:37 · validation/unit/category/test_acceptance_workload.py:25

homalg.ModulePrimaryDecomposition.source_associated_primes

Return the source associated primes recorded by this ModulePrimaryDecomposition.

Detailed contract

Complete EHV associated-prime evidence for the source module.

(self) -> ModuleAssociatedPrimeSet[_AssociatedPrimeField]

noether::homalg::ModulePrimaryDecomposition::source_associated_primes · Direct Rust declaration

pub fn source_associated_primes(&self) -> &ModuleAssociatedPrimeSet<R>
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/ModulePrimaryDecomposition@1

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

homalg.ModulePrimaryDecomposition.theorem

Return the theorem recorded by this ModulePrimaryDecomposition.

Detailed contract

Exact reconstruction and primaryness statement certified by the result.

(self) -> str

noether::homalg::ModulePrimaryDecomposition::theorem · Direct Rust declaration

pub const fn theorem(&self) -> &'static str
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/ModulePrimaryDecomposition@1

Executable usage: examples/13_chinese_remainder_theorem.py:3 · validation/unit/commalg/test_polynomial_ideal_facade.py:1150 · validation/unit/commalg/test_polynomial_ideal_facade.py:507 · validation/unit/commalg/test_polynomial_ideal_facade.py:583 · validation/unit/commalg/test_polynomial_ideal_facade.py:659 · validation/unit/homalg/test_module_facade.py:509

homalg.ModulePrimaryDecomposition.to_json

Serialize this ModulePrimaryDecomposition to its canonical typed JSON representation.

Detailed contract

Serialize the complete exact evidence as typed JSON.

(self) -> str

noether::homalg::ModulePrimaryDecomposition::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/ModulePrimaryDecomposition@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.ModulePrimaryDecomposition.verify

Replay and verify the mathematical evidence carried by this ModulePrimaryDecomposition.

Detailed contract

Independently replay every component and reconstruction identity.

(self) -> None

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

pub fn verify(&self) -> Result<(), ModulePrimaryDecompositionError>
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/ModulePrimaryDecomposition@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