Skip to content

commalg · HirzebruchRiemannRochResult

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

Worked example

The complete checked program Compute characteristic numbers of a smooth complete intersection uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Compute characteristic numbers of a smooth complete intersection."""

from fractions import Fraction

from noether.commalg import ChowRing, ProjectiveCompleteIntersection


def main() -> None:
    # The Chow ring of P^1 x P^2 is Z[h1,h2]/(h1^2,h2^3).
    chow = ChowRing([1, 2])
    h1, h2 = chow.generators()
    assert chow.integrate(h1 * h2**2) == 1

    # A smooth (1,1),(1,2) complete intersection is a curve. Smoothness is an
    # explicit hypothesis here.
    variety = ProjectiveCompleteIntersection.assuming_smooth(chow, [[1, 1], [1, 2]])
    assert variety.dimension == 1
    assert variety.integrate_restriction(h1) == 2
    assert variety.integrate_restriction(h2) == 3

    euler = variety.line_bundle_euler_characteristic([2, -1])
    euler.verify()
    assert euler.hrr_integral == Fraction(euler.koszul_value)
    print(
        f"smooth (1,1),(1,2) curve in P^1 x P^2: chi(O(2,-1))={euler.value}; HRR and Koszul agree"
    )


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/37_complete_intersection_theory.py.

commalg.HirzebruchRiemannRochResult

Exact HRR result with independent Koszul evidence.

class HirzebruchRiemannRochResult

noether::commalg::HirzebruchRiemannRochResult · Direct Rust declaration

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

Executable usage: validation/unit/commalg/test_intersection_theory.py:14 · validation/unit/commalg/test_intersection_theory.py:61

commalg.HirzebruchRiemannRochResult.__eq__

Test mathematical equality with another value.

(self, other: object) -> bool

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

commalg.HirzebruchRiemannRochResult.complete_intersection

Return the complete intersection recorded by this HirzebruchRiemannRochResult.

Detailed contract

Complete-intersection input.

(self) -> ProjectiveCompleteIntersection

noether::commalg::HirzebruchRiemannRochResult::complete_intersection · Direct Rust declaration

pub fn complete_intersection(&self) -> &ProjectiveCompleteIntersection
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/HirzebruchRiemannRochResult@1

Executable usage: validation/unit/commalg/test_intersection_theory.py:78 · validation/unit/commalg/test_intersection_theory.py:82 · validation/unit/commalg/test_intersection_theory.py:83 · validation/unit/commalg/test_intersection_theory.py:84 · validation/unit/commalg/test_intersection_theory.py:85 · validation/unit/commalg/test_intersection_theory.py:86

commalg.HirzebruchRiemannRochResult.from_json

Deserialize and revalidate a HirzebruchRiemannRochResult from typed JSON.

Detailed contract

Deserialize and verify a canonical HRR result.

(cls, value: str) -> HirzebruchRiemannRochResult

noether::commalg::HirzebruchRiemannRochResult::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/HirzebruchRiemannRochResult@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.HirzebruchRiemannRochResult.hrr_integral

Return the hrr integral recorded by this HirzebruchRiemannRochResult.

Detailed contract

Exact rational HRR integral before its integrality check.

(self) -> _Fraction

noether::commalg::HirzebruchRiemannRochResult::hrr_integral · Direct Rust declaration

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

Executable usage: examples/37_complete_intersection_theory.py:25 · validation/unit/commalg/test_intersection_theory.py:58

commalg.HirzebruchRiemannRochResult.koszul_value

Return the koszul value recorded by this HirzebruchRiemannRochResult.

Detailed contract

Independent Koszul inclusion–exclusion value.

(self) -> int

noether::commalg::HirzebruchRiemannRochResult::koszul_value · Direct Rust declaration

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

Executable usage: examples/37_complete_intersection_theory.py:25 · validation/unit/commalg/test_intersection_theory.py:57 · validation/unit/commalg/test_intersection_theory.py:59

commalg.HirzebruchRiemannRochResult.line_bundle_multidegree

Return the line bundle multidegree recorded by this HirzebruchRiemannRochResult.

Detailed contract

Multidegree of the line bundle.

(self) -> list[int]

noether::commalg::HirzebruchRiemannRochResult::line_bundle_multidegree · Direct Rust declaration

pub fn line_bundle_multidegree(&self) -> &[i64]
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/HirzebruchRiemannRochResult@1

commalg.HirzebruchRiemannRochResult.to_json

Serialize this HirzebruchRiemannRochResult to its canonical typed JSON representation.

Detailed contract

Serialize this result to canonical typed JSON.

(self) -> str

noether::commalg::HirzebruchRiemannRochResult::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/HirzebruchRiemannRochResult@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.HirzebruchRiemannRochResult.validity

Return the validity recorded by this HirzebruchRiemannRochResult.

Detailed contract

Logical validity inherited from the complete-intersection hypothesis.

(self) -> MathematicalValidity

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

commalg.HirzebruchRiemannRochResult.value

Return the value recorded by this HirzebruchRiemannRochResult.

Detailed contract

Exact Euler characteristic.

(self) -> int

noether::commalg::HirzebruchRiemannRochResult::value · Direct Rust declaration

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

Executable usage: examples/09_finite_field_isomorphisms.py:13 · examples/09_finite_field_isomorphisms.py:14 · examples/13_chinese_remainder_theorem.py:12 · examples/13_chinese_remainder_theorem.py:13 · examples/13_chinese_remainder_theorem.py:14 · examples/17_weighted_power_series.py:18

commalg.HirzebruchRiemannRochResult.verify

Replay and verify the mathematical evidence carried by this HirzebruchRiemannRochResult.

Detailed contract

Replay HRR and Koszul calculations from retained inputs.

(self) -> None

noether::commalg::HirzebruchRiemannRochResult::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 released
Semantic ID noether/commalg/HirzebruchRiemannRochResult@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