Skip to content

commalg · AffineSpace

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

Worked example

The complete checked program Enumerate and certify rational points on a finite-field hyperbola uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Enumerate and certify rational points on a finite-field hyperbola."""

from noether.commalg import AffineSpace
from noether.numthy import FiniteField


def main() -> None:
    field = FiniteField.prime(5)
    plane = AffineSpace(field, 2, names=["x", "y"])
    x, y = plane.coordinate_ring.generators()
    hyperbola = plane.closed_subscheme(plane.coordinate_ring.ideal([x * y - 1]))
    count, certificate = hyperbola.point_count(shards=3)
    certificate.verify(hyperbola)
    assert count == 4
    assert len(list(hyperbola.rational_points())) == count
    print(f"xy=1 over F_5 has {count} rational points")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/18_finite_field_schemes.py.

commalg.AffineSpace

Affine space over Q or a finite field.

AffineSpace(base: C, dimension: int, *, names: Sequence[str] | None=None)

noether::commalg::AffineSpace · Direct Rust declaration

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

Executable usage: examples/18_finite_field_schemes.py:11 · examples/18_finite_field_schemes.py:5 · validation/unit/commalg/test_acceptance_workload.py:11 · validation/unit/commalg/test_acceptance_workload.py:147 · validation/unit/commalg/test_base_change.py:102 · validation/unit/commalg/test_base_change.py:43

commalg.AffineSpace.base

Return the base recorded by this AffineSpace.

Detailed contract

Base coefficient context.

(self) -> C

noether::commalg::AffineSpace::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/AffineSpace@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.AffineSpace.base_change

Extend a finite-field affine presentation along a checked embedding.

Detailed contract

Extend the base while preserving the exact affine coordinate-ring presentation.

(self: AffineSpace[FiniteField], map: PrimeSubfieldEmbedding | FiniteFieldEmbedding) -> AffineSpace[FiniteField]

noether::commalg::AffineSpace::base_change · Direct Rust declaration

pub fn base_change<M>( &self, map: &M, ) -> Result<AffineSpace<M::Target>, BaseChangeError>where M: CoefficientMap<Source = 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/AffineSpace@1

Executable usage: validation/unit/commalg/test_base_change.py:108 · validation/unit/commalg/test_base_change.py:110 · validation/unit/commalg/test_base_change.py:111 · validation/unit/commalg/test_base_change.py:112 · validation/unit/commalg/test_base_change.py:113 · validation/unit/commalg/test_base_change.py:114

commalg.AffineSpace.closed_subscheme

Compute closed subscheme for this AffineSpace.

Detailed contract

Construct a closed subscheme from an ideal in this coordinate ring.

(self, ideal: Ideal[PolynomialRing[C]]) -> Scheme[C]

noether::commalg::AffineSpace::closed_subscheme · Direct Rust declaration

pub fn closed_subscheme( &self, ideal: Ideal<PolynomialRing<RationalField>>, ) -> Result<Scheme<RationalField>, SchemeError>
pub fn closed_subscheme( &self, ideal: Ideal<PolynomialRing<FiniteField>>, ) -> Result<Scheme<FiniteField>, SchemeError>
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/AffineSpace@1

Executable usage: examples/18_finite_field_schemes.py:13 · validation/unit/commalg/test_acceptance_workload.py:133 · validation/unit/commalg/test_acceptance_workload.py:148 · validation/unit/commalg/test_acceptance_workload.py:95 · validation/unit/commalg/test_base_change.py:105 · validation/unit/commalg/test_base_change.py:46

commalg.AffineSpace.coordinate_ring

Return the coordinate ring recorded by this AffineSpace.

Detailed contract

Exact polynomial coordinate ring.

(self) -> PolynomialRing[C]

noether::commalg::AffineSpace::coordinate_ring · Direct Rust declaration

pub fn coordinate_ring(&self) -> &PolynomialRing<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/AffineSpace@1

Executable usage: examples/18_finite_field_schemes.py:12 · examples/18_finite_field_schemes.py:13 · validation/unit/commalg/test_acceptance_workload.py:106 · validation/unit/commalg/test_acceptance_workload.py:107 · validation/unit/commalg/test_acceptance_workload.py:113 · validation/unit/commalg/test_acceptance_workload.py:114

commalg.AffineSpace.coordinates

Return the coordinates recorded by this AffineSpace.

Detailed contract

Ordered coordinate names.

(self) -> list[str]

noether::commalg::AffineSpace::coordinates · Direct Rust declaration

pub fn coordinates(&self) -> &[String]
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/AffineSpace@1

Executable usage: validation/unit/commalg/test_base_change.py:114 · validation/unit/commalg/test_base_change.py:54 · validation/unit/commalg/test_base_change.py:62 · validation/unit/commalg/test_kahler_differentials.py:131 · validation/unit/commalg/test_polynomial_ideal_facade.py:171 · validation/unit/commalg/test_quotient_facade.py:142

commalg.AffineSpace.dimension

Return the dimension recorded by this AffineSpace.

Detailed contract

Affine dimension.

(self) -> int

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

commalg.AffineSpace.from_json

Deserialize and revalidate a AffineSpace from typed JSON.

Detailed contract

Restore and validate this ambient context.

(cls, value: str) -> AffineSpace[SchemeBase]

noether::commalg::AffineSpace::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 attached / bounded
Semantic ID noether/commalg/AffineSpace@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.AffineSpace.to_json

Serialize this AffineSpace to its canonical typed JSON representation.

Detailed contract

Serialize this ambient context.

(self) -> str

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