Skip to content

homalg · HomologyGroup

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

Worked example

The complete checked program Decompose a polynomial by a nonstandard positive grading uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Decompose a polynomial by a nonstandard positive grading."""

from noether import Z
from noether.commalg import PolynomialRing, WeightedGrading


def main() -> None:
    ring = PolynomialRing(Z, ["x", "y", "z"], grading=WeightedGrading([1, 2, 3]))
    x, y, z = ring.generators()
    sparse = ring.from_terms([([0, 0, 0], 1), ([2, 0, 0], 1), ([0, 1, 0], 1)])
    polynomial = sparse + z
    assert sparse * (x + y) == (1 + x**2 + y) * (x + y)
    components = polynomial.homogeneous_components()
    assert [degree for degree, _ in components] == [0, 2, 3]
    assert x**2 + y == components[1][1]
    print(f"weighted homogeneous degrees: {[degree for degree, _ in components]}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/14_weighted_polynomials.py.

homalg.HomologyGroup

A checked single-degree homology or cohomology group.

class HomologyGroup

noether::homalg::HomologyGroup · Direct Rust declaration

pub struct HomologyGroup<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/HomologyGroup@1

Executable usage: validation/unit/homalg/test_acceptance_workload.py:23 · validation/unit/homalg/test_acceptance_workload.py:8 · validation/unit/homalg/test_chain_complex.py:16 · validation/unit/homalg/test_chain_complex.py:37 · validation/unit/homalg/test_chain_complex.py:49 · validation/unit/topology/test_simplicial_complex_facade.py:12

homalg.HomologyGroup.boundaries

Complete checked boundary space.

Detailed contract

Complete image representing the boundary space.

(self: HomologyGroup[_FieldContext]) -> SolutionSpace[_FieldContext]

noether::homalg::HomologyGroup::boundaries · Direct Rust declaration

pub fn boundaries(&self) -> &SolutionSpace<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/HomologyGroup@1

Executable usage: validation/unit/homalg/test_chain_complex.py:59 · validation/bench/magma_release.py:3086 · validation/bench/magma_release.py:3087 · validation/bench/magma_release.py:3099 · validation/bench/magma_release.py:3100 · validation/bench/magma_release.py:3109

homalg.HomologyGroup.coefficient_context

Coefficient ring.

Detailed contract

Coefficient context.

(self) -> R

noether::homalg::HomologyGroup::coefficient_context · Direct Rust declaration

pub fn coefficient_context(&self) -> &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/HomologyGroup@1

Executable usage: validation/unit/homalg/test_chain_complex.py:121 · validation/unit/homalg/test_chain_complex.py:66 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:599 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:689 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:877 · validation/bench/groebner_compare.py:151

homalg.HomologyGroup.cycles

Complete checked cycle space.

Detailed contract

Complete kernel representing the cycle space.

(self: HomologyGroup[_FieldContext]) -> SolutionSpace[_FieldContext]

noether::homalg::HomologyGroup::cycles · Direct Rust declaration

pub fn cycles(&self) -> &SolutionSpace<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/HomologyGroup@1

Executable usage: validation/unit/homalg/test_acceptance_workload.py:25 · validation/unit/homalg/test_chain_complex.py:40 · validation/unit/homalg/test_chain_complex.py:58 · validation/unit/topology/test_simplicial_complex_facade.py:250 · validation/bench/magma_release.py:1055 · validation/bench/magma_release.py:1056

homalg.HomologyGroup.degree

Displayed degree.

Detailed contract

Displayed homological or cohomological degree.

(self) -> int

noether::homalg::HomologyGroup::degree · Direct Rust declaration

pub fn degree(&self) -> i32
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/HomologyGroup@1

Executable usage: examples/14_weighted_polynomials.py:16 · examples/14_weighted_polynomials.py:18 · examples/15_groebner_twisted_cubic.py:15 · examples/15_groebner_twisted_cubic.py:28 · examples/31_local_fields_and_precision.py:37 · examples/33_simplicial_cohomology_operations.py:26

homalg.HomologyGroup.dimension

Dimension over the coefficient field.

Detailed contract

Dimension over the coefficient field.

Integral homology is not a vector space; use free_rank and torsion_coefficients there.

(self: HomologyGroup[_FieldContext]) -> int

noether::homalg::HomologyGroup::dimension · Direct Rust declaration

pub fn dimension(&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/HomologyGroup@1

Executable usage: examples/03_exact_linear_systems.py:15 · examples/03_exact_linear_systems.py:16 · examples/15_groebner_twisted_cubic.py:14 · examples/15_groebner_twisted_cubic.py:28 · examples/27_weight_characters.py:25 · examples/34_finite_group_cohomology.py:13

homalg.HomologyGroup.free_rank

Rank of the free part; equal to dimension over a field.

Detailed contract

Rank of the free part. Over a field this is the vector-space dimension. Over Z it is the number of infinite cyclic summands.

(self) -> int

noether::homalg::HomologyGroup::free_rank · Direct Rust declaration

pub fn free_rank(&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/HomologyGroup@1

Executable usage: examples/28_steiner_categories.py:16 · examples/32_poset_core_and_morse.py:19 · examples/35_eilenberg_maclane_spaces.py:14 · examples/35_eilenberg_maclane_spaces.py:21 · validation/unit/category/test_acceptance_workload.py:15 · validation/unit/combinatorics/test_poset.py:107

homalg.HomologyGroup.is_cohomology

Whether this result was computed from a coboundary presentation.

(self) -> bool

noether::homalg::HomologyGroup::is_cohomology · Direct Rust declaration

pub fn is_cohomology(&self) -> bool
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/HomologyGroup@1

Executable usage: validation/unit/homalg/test_acceptance_workload.py:24 · validation/unit/homalg/test_chain_complex.py:108 · validation/unit/homalg/test_chain_complex.py:39

homalg.HomologyGroup.representatives

Deterministic cycle representatives forming a basis modulo boundaries.

(self: HomologyGroup[_FieldContext]) -> list[Vector[_FieldContext]]

noether::homalg::HomologyGroup::representatives · Direct Rust declaration

pub fn representatives(&self) -> &[Vector<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/HomologyGroup@1

Executable usage: validation/unit/homalg/test_acceptance_workload.py:26 · validation/unit/homalg/test_chain_complex.py:41 · validation/unit/homalg/test_chain_complex.py:61 · validation/parity/linalg/test_lattice_enumeration_parity.py:7 · validation/bench/magma_release.py:3057 · validation/bench/magma_release.py:3060

homalg.HomologyGroup.torsion_coefficients

Positive invariant factors of the torsion subgroup.

Detailed contract

Positive nonunit invariant factors of the torsion subgroup. These are empty over a field. Over Z, a factor d denotes one summand Z/d, and the factors occur in divisibility order.

(self) -> list[int]

noether::homalg::HomologyGroup::torsion_coefficients · Direct Rust declaration

pub fn torsion_coefficients(&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/HomologyGroup@1

Executable usage: validation/unit/homalg/test_acceptance_workload.py:42 · validation/unit/homalg/test_acceptance_workload.py:44 · validation/unit/homalg/test_acceptance_workload.py:46 · validation/unit/homalg/test_chain_complex.py:153 · validation/unit/homalg/test_chain_complex.py:166 · validation/unit/homalg/test_chain_complex.py:172

homalg.HomologyGroup.validity

Mathematical assumptions under which the result is valid.

(self) -> MathematicalValidity

noether::homalg::HomologyGroup::validity · Direct Rust declaration

pub fn validity(&self) -> &MathematicalValidity
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/HomologyGroup@1

Executable usage: validation/unit/commalg/test_intersection_theory.py:48 · validation/unit/commalg/test_intersection_theory.py:83 · validation/unit/homalg/test_chain_complex.py:42 · validation/unit/homalg/test_padic_homology_facade.py:157 · validation/unit/homalg/test_padic_homology_facade.py:168 · validation/unit/homalg/test_padic_homology_facade.py:172

homalg.HomologyGroup.verify

Recheck adjacent maps, cycles, boundaries, and quotient representatives.

Detailed contract

Recompute adjacent kernels/images and check the quotient basis. Recompute both adjacent Smith forms and check the abelian invariants.

(self) -> None

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

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