Skip to content

commalg · Curve

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

Worked example

The complete checked program Lift a simple square root from F_5 to fixed-precision Z_5 uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Lift a simple square root from F_5 to fixed-precision Z_5."""

from noether.commalg import PolynomialRing
from noether.numthy import PadicRing


def main() -> None:
    integers = PadicRing(5, absolute_precision=6)
    polynomials = PolynomialRing(integers, ["x"])
    x = polynomials.generator("x")
    equation = x**2 - 6
    root = integers.hensel_lift(equation, integers.residue_field(1))
    assert equation.evaluate([root]) == integers.zero()
    print(f"sqrt(6) in Z_5 mod 5^6 is represented by {int(root)}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/10_padic_hensel_lifting.py.

commalg.Curve

A checked smooth projective plane or Weierstrass curve.

class Curve

noether::commalg::Curve · Direct Rust declaration

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

Executable usage: validation/unit/commalg/test_curve_facade.py:108 · validation/unit/commalg/test_curve_facade.py:131 · validation/unit/commalg/test_curve_facade.py:146 · validation/unit/commalg/test_curve_facade.py:22 · validation/unit/commalg/test_curve_facade.py:29 · validation/unit/commalg/test_curve_facade.py:8

commalg.Curve.base

Return the base recorded by this Curve.

Detailed contract

Base coefficient field.

(self) -> C

noether::commalg::Curve::base · Direct Rust declaration

pub fn base(&self) -> &R
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/Curve@1

Executable usage: validation/unit/commalg/test_acceptance_workload.py:59 · validation/unit/commalg/test_acceptance_workload.py:60 · validation/unit/commalg/test_base_change.py:112 · validation/unit/commalg/test_base_change.py:113 · validation/unit/commalg/test_polynomial_ideal_facade.py:398 · validation/unit/commalg/test_polynomial_ideal_facade.py:399

commalg.Curve.equation

Return the equation recorded by this Curve.

Detailed contract

Canonical homogeneous plane equation.

(self) -> Polynomial[C]

noether::commalg::Curve::equation · Direct Rust declaration

pub fn equation(&self) -> &Polynomial<R>
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/Curve@1

Executable usage: examples/10_padic_hensel_lifting.py:13 · examples/10_padic_hensel_lifting.py:14 · examples/10_padic_hensel_lifting.py:15 · validation/unit/commalg/test_curve_facade.py:53 · validation/unit/commalg/test_curve_facade.py:94 · validation/unit/numthy/test_number_field_facade.py:156

commalg.Curve.from_json

Deserialize and revalidate a Curve from typed JSON.

Detailed contract

Restore and recheck a serialized smooth projective curve.

(cls, value: str) -> Curve[CurveBase]

noether::commalg::Curve::from_json · Direct Rust declaration

pub fn from_json(value: &str) -> Result<Self, NoetherError>where R: DeserializeOwned, R::Element: DeserializeOwned,
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/Curve@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.Curve.function_field

Compute function field for this Curve.

Detailed contract

Construct the canonical algebraic function field in a deterministic affine chart.

(self) -> CurveFunctionField[C]

noether::commalg::Curve::function_field · Direct Rust declaration

pub fn function_field(&self) -> Result<CurveFunctionField<R>, CurveError>
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/Curve@1

Executable usage: validation/unit/commalg/test_acceptance_workload.py:60 · validation/unit/commalg/test_acceptance_workload.py:61 · validation/unit/commalg/test_acceptance_workload.py:65 · validation/unit/commalg/test_acceptance_workload.py:66 · validation/unit/commalg/test_curve_facade.py:117 · validation/unit/commalg/test_curve_facade.py:132

commalg.Curve.point

Compute point for this Curve.

Detailed contract

Validate one rational point on this curve.

(self, coordinates: Iterable[CurveCoefficient]) -> CurvePoint[C]

noether::commalg::Curve::point · Direct Rust declaration

pub fn point<I>(&self, coordinates: I) -> Result<CurvePoint<R>, CurveError>where I: IntoIterator<Item = R::Element>,
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/Curve@1

Executable usage: examples/26_elliptic_descent_functions.py:17 · examples/26_elliptic_descent_functions.py:18 · examples/26_elliptic_descent_functions.py:20 · examples/26_elliptic_descent_functions.py:25 · examples/26_elliptic_descent_functions.py:31 · examples/26_elliptic_descent_functions.py:32

commalg.Curve.presentation_kind

Return the presentation kind recorded by this Curve.

Detailed contract

Admitted presentation class.

(self) -> Literal['smooth_projective_plane', 'smooth_projective_weierstrass']

noether::commalg::Curve::presentation_kind · Direct Rust declaration

pub fn presentation_kind(&self) -> CurvePresentationKind
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/Curve@1

Executable usage: validation/unit/commalg/test_curve_facade.py:32

commalg.Curve.quotient_dimension

Return the quotient dimension recorded by this Curve.

(self) -> int

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

Executable usage: validation/unit/commalg/test_curve_facade.py:34 · validation/unit/commalg/test_kahler_differentials.py:99 · validation/unit/commalg/test_polynomial_ideal_facade.py:101 · validation/unit/commalg/test_polynomial_ideal_facade.py:113 · validation/unit/commalg/test_polynomial_ideal_facade.py:1178 · validation/unit/commalg/test_polynomial_ideal_facade.py:454

commalg.Curve.singular_cone_dimension

Return the singular cone dimension recorded by this Curve.

(self) -> int

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

Executable usage: validation/unit/commalg/test_curve_facade.py:35

commalg.Curve.smooth_projective_plane

Construct a Curve using smooth projective plane.

Detailed contract

Check one homogeneous plane equation by exact dimension and Jacobian tests.

(equation: Polynomial[C]) -> Curve[C]

noether::commalg::Curve::smooth_projective_plane · Direct Rust declaration

pub fn smooth_projective_plane( equation: Polynomial<R>, ) -> Result<Self, CurveError>
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/Curve@1

commalg.Curve.to_json

Serialize this Curve to its canonical typed JSON representation.

Detailed contract

Serialize the checked presentation and its exact coefficient context.

(self) -> str

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

Replay and verify the mathematical evidence carried by this Curve.

Detailed contract

Recompute the checked presentation and compare its canonical equation and evidence.

(self) -> None

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

commalg.Curve.weierstrass

Construct a Curve using weierstrass.

(base: C, coefficients: Iterable[CurveCoefficient]) -> Curve[C]

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

Executable usage: validation/unit/commalg/test_curve_facade.py:108 · validation/unit/commalg/test_curve_facade.py:131 · validation/unit/commalg/test_curve_facade.py:146 · validation/unit/commalg/test_curve_facade.py:22

commalg.Curve.weierstrass_coefficients

Return the weierstrass coefficients recorded by this Curve.

Detailed contract

Generalized Weierstrass coefficients (a1,a2,a3,a4,a6), when distinguished.

(self) -> list[CurveCoefficient] | None

noether::commalg::Curve::weierstrass_coefficients · Direct Rust declaration

pub fn weierstrass_coefficients(&self) -> Option<&[R::Element; 5]>
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/Curve@1

Executable usage: validation/unit/commalg/test_curve_facade.py:33