Skip to content

homalg · DerivedModuleHomomorphism

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

Worked example

The complete checked program Exact affine systems and canonical submodules over Z and Z/nZ uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Exact affine systems and canonical submodules over Z and Z/nZ."""

from __future__ import annotations

from noether import IntegerRing, Z
from noether.commalg import ResidueRing
from noether.homalg import FreeModule, ModuleElement, ModuleHomomorphism, Submodule
from noether.linalg import Matrix, Vector

operator = Matrix.from_rows(Z, [[2, 4, 0], [0, 0, 3]])
right_hand_side = Vector.from_values(Z, [6, 9])
integer_result = operator.solve_exact(right_hand_side)
assert integer_result.is_consistent
integer_solutions = integer_result.solutions
assert integer_solutions is not None
assert operator @ integer_solutions.particular_solution == right_hand_side
assert operator @ integer_solutions.homogeneous_generators == Matrix.zeros(Z, (2, 1))
integer_result.verify()

# Empty systems retain a replayable divisibility obstruction.
impossible = Matrix.from_rows(Z, [[6]]).solve_exact(Vector.from_values(Z, [9]))
assert not impossible.is_consistent
assert impossible.obstruction is not None
assert impossible.obstruction.left_gcd == 6
assert abs(impossible.obstruction.combined_rhs) == 9
impossible.obstruction.verify()

# Composite moduli are not treated as fields.  The result is an affine module,
# including all homogeneous torsion directions.
z12 = ResidueRing(12)
congruence = Matrix.from_rows(z12, [[8]]).solve_exact(Vector.from_values(z12, [4]))
assert congruence.is_consistent
congruence_solutions = congruence.solutions
assert congruence_solutions is not None
assert {
    (int(congruence_solutions.particular_solution[0]) + 3 * offset) % 12 for offset in range(4)
} == {
    2,
    5,
    8,
    11,
}
congruence.verify()

# Submodules retain a canonical normal form, so equality and lattice operations
# compare mathematics rather than the supplied generating lists.
ambient = FreeModule(Z, 2)


def element(x: int, y: int) -> ModuleElement[IntegerRing]:
    return ModuleElement(ambient, Vector.from_values(Z, [x, y]))


lattice = Submodule.from_generators(ambient, [element(2, 0), element(0, 3)])
assert lattice.finite_index() == 6
witness = lattice.membership_witness(element(6, 9))
assert witness is not None
witness.verify()
assert lattice.saturation().finite_index() == 1

homomorphism = ModuleHomomorphism(
    FreeModule(Z, 3),
    ambient,
    operator,
)
kernel_result = homomorphism.kernel()
image_result = homomorphism.image()
kernel = kernel_result.submodule
image = image_result.submodule
assert kernel.generator_count == 1
assert image.contains(element(2, 0))
kernel_result.verify()
image_result.verify()

print(
    "exact systems: integer affine rank 1; four Z/12Z solutions; "
    "index-6 lattice saturated and verified"
)

Run it with .venv/bin/python examples/38_exact_linear_systems.py.

homalg.DerivedModuleHomomorphism

A checked functorial map between two Tor or Ext modules.

class DerivedModuleHomomorphism

noether::homalg::DerivedModuleHomomorphism · Direct Rust declaration

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

Executable usage: validation/unit/homalg/test_module_facade.py:23 · validation/unit/homalg/test_module_facade.py:396 · validation/unit/homalg/test_module_facade.py:397 · validation/unit/homalg/test_module_facade.py:445

homalg.DerivedModuleHomomorphism.coefficient_homomorphism

Return the coefficient homomorphism recorded by this DerivedModuleHomomorphism.

Detailed contract

Homomorphism of coefficient modules inducing this derived map.

(self) -> PresentedModuleHomomorphism[_GroebnerModuleRing]

noether::homalg::DerivedModuleHomomorphism::coefficient_homomorphism · Direct Rust declaration

pub fn coefficient_homomorphism(&self) -> &PresentedModuleHomomorphism<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/DerivedModuleHomomorphism@1

homalg.DerivedModuleHomomorphism.from_json

Deserialize and revalidate a DerivedModuleHomomorphism from typed JSON.

Detailed contract

Deserialize and independently revalidate a polynomial derived map. Deserialize and independently revalidate a quotient-ring derived map.

(cls, value: str) -> DerivedModuleHomomorphism[_GroebnerModuleRing]

noether::homalg::DerivedModuleHomomorphism::from_json · Direct Rust declaration

pub fn from_json(value: &str) -> Result<Self, NoetherError>where C: for<'de> Deserialize<'de>, C::Element: for<'de> Deserialize<'de>,
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/DerivedModuleHomomorphism@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.DerivedModuleHomomorphism.homomorphism

Return the homomorphism recorded by this DerivedModuleHomomorphism.

Detailed contract

Exact induced homomorphism between the resulting presented modules.

(self) -> PresentedModuleHomomorphism[_GroebnerModuleRing]

noether::homalg::DerivedModuleHomomorphism::homomorphism · Direct Rust declaration

pub fn homomorphism(&self) -> &PresentedModuleHomomorphism<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/DerivedModuleHomomorphism@1

Executable usage: examples/38_exact_linear_systems.py:63 · examples/38_exact_linear_systems.py:68 · examples/38_exact_linear_systems.py:69 · validation/unit/commalg/test_base_change.py:118 · validation/unit/commalg/test_base_change.py:123 · validation/unit/commalg/test_base_change.py:124

homalg.DerivedModuleHomomorphism.source

Return the source recorded by this DerivedModuleHomomorphism.

Detailed contract

Source derived module.

(self) -> DerivedModule[_GroebnerModuleRing]

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

pub fn source(&self) -> &DerivedModule<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/DerivedModuleHomomorphism@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.DerivedModuleHomomorphism.target

Return the target recorded by this DerivedModuleHomomorphism.

Detailed contract

Target derived module.

(self) -> DerivedModule[_GroebnerModuleRing]

noether::homalg::DerivedModuleHomomorphism::target · Direct Rust declaration

pub fn target(&self) -> &DerivedModule<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/DerivedModuleHomomorphism@1

Executable usage: examples/09_finite_field_isomorphisms.py:10 · examples/09_finite_field_isomorphisms.py:11 · examples/30_modules_and_resolutions.py:33 · examples/30_modules_and_resolutions.py:38 · examples/31_local_fields_and_precision.py:27 · examples/36_affine_normalization.py:16

homalg.DerivedModuleHomomorphism.to_json

Serialize this DerivedModuleHomomorphism to its canonical typed JSON representation.

Detailed contract

Serialize both derived evidence objects and the inducing and induced homomorphisms.

(self) -> str

noether::homalg::DerivedModuleHomomorphism::to_json · Direct Rust declaration

pub fn to_json(&self) -> Result<String, NoetherError>where R: Serialize, R::Element: Serialize,
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/DerivedModuleHomomorphism@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.DerivedModuleHomomorphism.verify

Replay and verify the mathematical evidence carried by this DerivedModuleHomomorphism.

Detailed contract

Independently replay the coefficient chain map and its induced polynomial-module homology map. Independently replay the coefficient chain map and induced quotient homology map.

(self) -> None

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

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