Skip to content

commalg · ChowClass

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

Worked example

The complete checked program Differentiate exactly and distinguish a cusp's smooth and singular points uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Differentiate exactly and distinguish a cusp's smooth and singular points."""

from noether import Q
from noether.commalg import KahlerDifferentials, PolynomialRing


def main() -> None:
    ring = PolynomialRing(Q, ["x", "y"])
    x, y = ring.generators()
    relation = y**2 - x**3
    cusp = ring.quotient(ring.ideal([relation]))
    omega = cusp.kahler_differentials()

    assert isinstance(omega, KahlerDifferentials)
    dx = omega.differentiate(cusp(x))
    dy = omega.differentiate(cusp(y))
    assert omega.differentiate(cusp(x * y)) == dx * cusp(y) + dy * cusp(x)
    assert omega.differentiate(cusp(relation)).is_zero()

    singular = cusp.cotangent_space_at([0, 0])
    smooth = cusp.cotangent_space_at([1, 1])
    assert singular.embedding_dimension == 2
    assert smooth.embedding_dimension == 1
    assert singular.presentation_matrix == singular.evaluated_jacobian.transpose()

    complex = cusp.cotangent_complex()
    assert complex.codimension == 1
    assert (complex.amplitude.lowest_degree, complex.amplitude.highest_degree) == (-1, 0)
    assert complex.hypothesis.equation_count == 1
    complex.verify()

    print(
        "cusp cotangent dimensions: "
        f"singular={singular.embedding_dimension}, smooth={smooth.embedding_dimension}; "
        "complete-intersection amplitude=[-1,0]"
    )


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/39_kahler_differentials.py.

commalg.ChowClass

A canonical sparse integral Chow class.

class ChowClass

noether::commalg::ChowClass · Direct Rust declaration

pub struct ChowClass { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

Executable usage: validation/unit/commalg/test_intersection_theory.py:108 · validation/unit/commalg/test_intersection_theory.py:11 · validation/unit/commalg/test_intersection_theory.py:36

commalg.ChowClass.__add__

Add another compatible value to this value.

Detailed contract

Exact sum. Returns the argument unchanged.

(self, other: ChowClass) -> ChowClass

noether::commalg::ChowClass::add · Direct Rust declaration

pub fn add(&self, other: &Self) -> Result<Self, IntersectionTheoryError>
fn add(self, rhs: &ChowClass) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL released
Semantic ID noether/commalg/ChowClass@1

Executable usage: validation/unit/infra/test_discovery.py:211 · validation/unit/infra/test_public_api_index.py:293

commalg.ChowClass.__eq__

Test mathematical equality with another value.

(self, other: object) -> bool

noether::commalg::ChowClass · 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, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

commalg.ChowClass.__mul__

Multiply this value by another compatible value.

Detailed contract

Product modulo the projective-space relations.

(self, other: ChowClass) -> ChowClass

noether::commalg::ChowClass::mul · Direct Rust declaration

pub fn mul(&self, other: &Self) -> Result<Self, IntersectionTheoryError>
fn mul(self, rhs: &ChowClass) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL released
Semantic ID noether/commalg/ChowClass@1

Executable usage: validation/unit/infra/test_public_api_index.py:214

commalg.ChowClass.__neg__

Return the additive inverse of this value.

Detailed contract

Additive inverse.

(self) -> ChowClass

noether::commalg::ChowClass::neg · Direct Rust declaration

pub fn neg(&self) -> Self
fn neg(self) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

commalg.ChowClass.__pow__

Raise this value to the supplied power.

(self, exponent: int, modulus: None=None) -> ChowClass

noether::commalg::ChowClass · 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, module-core, poly-core, resolution-kernel
GIL released
Semantic ID noether/commalg/ChowClass@1

commalg.ChowClass.__sub__

Subtract another compatible value from this value.

Detailed contract

Exact difference.

(self, other: ChowClass) -> ChowClass

noether::commalg::ChowClass::sub · Direct Rust declaration

pub fn sub(&self, other: &Self) -> Result<Self, IntersectionTheoryError>
fn sub(self, rhs: &ChowClass) -> Self::Output
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL released
Semantic ID noether/commalg/ChowClass@1

Executable usage: validation/unit/infra/test_discovery.py:212

commalg.ChowClass.codimension

Return the codimension recorded by this ChowClass.

Detailed contract

Codimension when the class is homogeneous; None for an inhomogeneous class.

(self) -> int | None

noether::commalg::ChowClass::codimension · Direct Rust declaration

pub fn codimension(&self) -> Option<usize>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

Executable usage: examples/39_kahler_differentials.py:29 · validation/unit/commalg/test_intersection_theory.py:31 · validation/unit/commalg/test_intersection_theory.py:32 · validation/unit/commalg/test_intersection_theory.py:50 · validation/unit/commalg/test_kahler_differentials.py:100 · validation/unit/commalg/test_kahler_differentials.py:121

commalg.ChowClass.from_json

Deserialize and revalidate a ChowClass from typed JSON.

Detailed contract

Deserialize and verify a canonical class.

(cls, value: str) -> ChowClass

noether::commalg::ChowClass::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, module-core, poly-core, resolution-kernel
GIL released
Semantic ID noether/commalg/ChowClass@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

commalg.ChowClass.is_zero

Test whether this ChowClass is zero.

Detailed contract

Whether this is zero.

(self) -> bool

noether::commalg::ChowClass::is_zero · Direct Rust declaration

pub fn is_zero(&self) -> bool
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

Executable usage: examples/17_weighted_power_series.py:16 · examples/17_weighted_power_series.py:17 · examples/39_kahler_differentials.py:20 · validation/unit/commalg/test_graded_commutative_facade.py:26 · validation/unit/commalg/test_kahler_differentials.py:113 · validation/unit/commalg/test_kahler_differentials.py:38

commalg.ChowClass.over_rationals

Compute over rationals for this ChowClass.

Detailed contract

Convert coefficients canonically from Z to Q.

(self) -> RationalChowClass

noether::commalg::ChowClass::over_rationals · Direct Rust declaration

pub fn over_rationals(&self) -> RationalChowClass
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

Executable usage: validation/unit/commalg/test_intersection_theory.py:37

commalg.ChowClass.ring

Return the ring recorded by this ChowClass.

Detailed contract

Parent Chow ring.

(self) -> ChowRing

noether::commalg::ChowClass::ring · Direct Rust declaration

pub fn ring(&self) -> &ChowRing
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

Executable usage: examples/11_qadic_witt_vectors.py:3 · examples/13_chinese_remainder_theorem.py:10 · examples/13_chinese_remainder_theorem.py:12 · examples/13_chinese_remainder_theorem.py:9 · examples/14_weighted_polynomials.py:10 · examples/14_weighted_polynomials.py:11

commalg.ChowClass.scalar_mul

Compute scalar mul for this ChowClass.

Detailed contract

Exact scalar multiplication.

(self, scalar: int) -> ChowClass

noether::commalg::ChowClass::scalar_mul · Direct Rust declaration

pub fn scalar_mul(&self, scalar: &Integer) -> Self
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

Executable usage: validation/unit/commalg/test_intersection_theory.py:30 · validation/unit/commalg/test_intersection_theory.py:37 · validation/unit/commalg/test_intersection_theory.py:51 · validation/unit/commalg/test_power_series_facade.py:152 · validation/unit/numthy/test_elliptic_curve_facade.py:36 · validation/bench/macaulay2_derived.py:693

commalg.ChowClass.terms

Compute terms for this ChowClass.

Detailed contract

Canonical sparse terms ordered lexicographically by exponent vector.

(self) -> list[tuple[list[int], int]]

noether::commalg::ChowClass::terms · Direct Rust declaration

pub fn terms(&self) -> &BTreeMap<Vec<usize>, Integer>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

Executable usage: examples/07_integer_factorization.py:14 · examples/40_exterior_algebra.py:43 · validation/unit/combin/test_acceptance_workload.py:45 · validation/unit/combin/test_acceptance_workload.py:81 · validation/unit/combinatorics/test_boundary.py:31 · validation/unit/combinatorics/test_boundary.py:44

commalg.ChowClass.to_json

Serialize this ChowClass to its canonical typed JSON representation.

Detailed contract

Serialize this class to canonical typed JSON.

(self) -> str

noether::commalg::ChowClass::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, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@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

commalg.ChowClass.truncate

Compute truncate for this ChowClass.

Detailed contract

Keep only terms of total codimension at most maximum.

(self, maximum: int) -> ChowClass

noether::commalg::ChowClass::truncate · Direct Rust declaration

pub fn truncate(&self, maximum: usize) -> Self
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@1

Executable usage: validation/unit/category/test_category.py:19 · validation/parity/commalg/test_intersection_theory_sage_parity.py:117 · validation/parity/commalg/test_intersection_theory_sage_parity.py:121 · validation/parity/commalg/test_intersection_theory_sage_parity.py:123 · validation/parity/commalg/test_intersection_theory_sage_parity.py:134 · validation/parity/commalg/test_intersection_theory_sage_parity.py:137

commalg.ChowClass.verify

Replay and verify the mathematical evidence carried by this ChowClass.

Detailed contract

Recheck the canonical sparse representation.

(self) -> None

noether::commalg::ChowClass::verify · Direct Rust declaration

pub fn verify(&self) -> Result<(), IntersectionTheoryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, flint-core, groebner-kernel, module-core, poly-core, resolution-kernel
GIL attached / bounded
Semantic ID noether/commalg/ChowClass@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