Skip to content

commalg · RationalChowClass

16 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.RationalChowClass

A canonical sparse rational Chow class.

class RationalChowClass

noether::commalg::RationalChowClass · Direct Rust declaration

pub struct RationalChowClass { /* 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/RationalChowClass@1

Executable usage: validation/unit/commalg/test_intersection_theory.py:16 · validation/unit/commalg/test_intersection_theory.py:39

commalg.RationalChowClass.__add__

Add another compatible value to this value.

Detailed contract

Exact sum. Returns the argument unchanged.

(self, other: RationalChowClass) -> RationalChowClass

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

pub fn add(&self, other: &Self) -> Result<Self, IntersectionTheoryError>
fn add(self, rhs: &RationalChowClass) -> 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/RationalChowClass@1

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

commalg.RationalChowClass.__eq__

Test mathematical equality with another value.

(self, other: object) -> bool

noether::commalg::RationalChowClass · 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/RationalChowClass@1

commalg.RationalChowClass.__mul__

Multiply this value by another compatible value.

Detailed contract

Product modulo the projective-space relations.

(self, other: RationalChowClass) -> RationalChowClass

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

pub fn mul(&self, other: &Self) -> Result<Self, IntersectionTheoryError>
fn mul(self, rhs: &RationalChowClass) -> 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/RationalChowClass@1

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

commalg.RationalChowClass.__neg__

Return the additive inverse of this value.

Detailed contract

Additive inverse.

(self) -> RationalChowClass

noether::commalg::RationalChowClass::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/RationalChowClass@1

commalg.RationalChowClass.__pow__

Raise this value to the supplied power.

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

noether::commalg::RationalChowClass · 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/RationalChowClass@1

commalg.RationalChowClass.__sub__

Subtract another compatible value from this value.

Detailed contract

Exact difference.

(self, other: RationalChowClass) -> RationalChowClass

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

pub fn sub(&self, other: &Self) -> Result<Self, IntersectionTheoryError>
fn sub(self, rhs: &RationalChowClass) -> 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/RationalChowClass@1

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

commalg.RationalChowClass.codimension

Return the codimension recorded by this RationalChowClass.

Detailed contract

Codimension when homogeneous.

(self) -> int | None

noether::commalg::RationalChowClass::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/RationalChowClass@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.RationalChowClass.from_json

Deserialize and revalidate a RationalChowClass from typed JSON.

Detailed contract

Deserialize and verify a canonical class.

(cls, value: str) -> RationalChowClass

noether::commalg::RationalChowClass::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/RationalChowClass@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.RationalChowClass.is_zero

Test whether this RationalChowClass is zero.

Detailed contract

Whether this is zero.

(self) -> bool

noether::commalg::RationalChowClass::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/RationalChowClass@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.RationalChowClass.ring

Return the ring recorded by this RationalChowClass.

Detailed contract

Parent Chow ring.

(self) -> ChowRing

noether::commalg::RationalChowClass::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/RationalChowClass@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.RationalChowClass.scalar_mul

Compute scalar mul for this RationalChowClass.

Detailed contract

Exact scalar multiplication.

(self, scalar: int | _Fraction) -> RationalChowClass

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

pub fn scalar_mul(&self, scalar: &Rational) -> 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/RationalChowClass@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.RationalChowClass.terms

Compute terms for this RationalChowClass.

Detailed contract

Canonical sparse terms.

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

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

pub fn terms(&self) -> &BTreeMap<Vec<usize>, Rational>
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/RationalChowClass@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.RationalChowClass.to_json

Serialize this RationalChowClass to its canonical typed JSON representation.

Detailed contract

Serialize this class to canonical typed JSON.

(self) -> str

noether::commalg::RationalChowClass::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/RationalChowClass@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.RationalChowClass.truncate

Compute truncate for this RationalChowClass.

Detailed contract

Keep only terms of total codimension at most maximum.

(self, maximum: int) -> RationalChowClass

noether::commalg::RationalChowClass::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/RationalChowClass@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.RationalChowClass.verify

Replay and verify the mathematical evidence carried by this RationalChowClass.

Detailed contract

Recheck the canonical sparse representation.

(self) -> None

noether::commalg::RationalChowClass::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/RationalChowClass@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