Skip to content

commalg · PolynomialHomomorphism

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

Worked example

The complete checked program Apply and multiply canonical sparse exact operators uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Apply and multiply canonical sparse exact operators."""

from noether import Z
from noether.linalg import SparseMatrix, Vector


def main() -> None:
    operator = SparseMatrix.from_triplets(
        Z,
        (3, 3),
        [(0, 0, 2), (0, 2, -1), (1, 1, 3), (2, 0, 4)],
    )
    vector = Vector.from_values(Z, [5, 7, 11])
    image = operator.apply(vector)
    assert image.to_values() == [-1, 21, 20]
    assert (operator @ operator).nnz == 4
    print(f"A v = {image.to_values()}; nnz(A^2) = {(operator @ operator).nnz}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/05_sparse_exact_operators.py.

commalg.PolynomialHomomorphism

A checked polynomial-ring homomorphism with explicit endpoints and images.

class PolynomialHomomorphism

noether::commalg::PolynomialHomomorphism · Direct Rust declaration

pub struct PolynomialHomomorphism<S, T, M>where S: CommutativeRing, T: CommutativeRing, M: CoefficientMap<Source = S, Target = T>,{ /* 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/PolynomialHomomorphism@1

Executable usage: validation/unit/commalg/test_polynomial_homomorphism.py:34 · validation/unit/commalg/test_polynomial_homomorphism.py:9

commalg.PolynomialHomomorphism.__call__

Coerce the supplied input through this context or mathematical map.

(self, value: Polynomial[C]) -> T

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

Executable usage: validation/unit/infra/test_discovery.py:57 · validation/unit/infra/test_public_api_index.py:155 · validation/unit/infra/test_public_api_index.py:169

commalg.PolynomialHomomorphism.apply

Apply this PolynomialHomomorphism to the supplied value.

Detailed contract

Apply the homomorphism by a deterministic sparse term stream.

(self, value: Polynomial[C]) -> T

noether::commalg::PolynomialHomomorphism::apply · Direct Rust declaration

pub fn apply( &self, value: &Polynomial<S>, ) -> Result<T::Element, PolynomialHomomorphismError>
fn apply(&self, value: &Polynomial<S>) -> Result<T::Element, Self::Error>
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/PolynomialHomomorphism@1

Executable usage: examples/05_sparse_exact_operators.py:16 · validation/unit/commalg/test_local_algebra.py:94 · validation/unit/commalg/test_local_algebra.py:97 · validation/unit/commalg/test_polynomial_facade.py:199 · validation/unit/commalg/test_quotient_facade.py:186 · validation/unit/groups/test_weight_characters.py:39

commalg.PolynomialHomomorphism.coefficient_map

Return the coefficient map recorded by this PolynomialHomomorphism.

Detailed contract

Checked map used on source coefficients.

(self) -> _StandardCoefficientMap | None

noether::commalg::PolynomialHomomorphism::coefficient_map · Direct Rust declaration

pub fn coefficient_map(&self) -> &M
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/PolynomialHomomorphism@1

Executable usage: validation/unit/commalg/test_base_change.py:121 · validation/unit/commalg/test_base_change.py:123 · validation/unit/commalg/test_base_change.py:69 · validation/unit/commalg/test_polynomial_homomorphism.py:22 · validation/unit/commalg/test_polynomial_homomorphism.py:31 · validation/unit/commalg/test_polynomial_homomorphism.py:46

commalg.PolynomialHomomorphism.extend_ideal

Extend an ideal along this map and recanonicalize it in the target polynomial ring.

Detailed contract

Extend an ideal along this map and recanonicalize it in the target polynomial ring.

Extend an ideal along this homomorphism and recanonicalize its image in the target polynomial ring.

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

noether::commalg::PolynomialHomomorphism::extend_ideal · Direct Rust declaration

pub fn extend_ideal( &self, ideal: &Ideal<PolynomialRing<S>>, ) -> Result<Ideal<PolynomialRing<T>>, BaseChangeError>
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/PolynomialHomomorphism@1

Executable usage: validation/unit/commalg/test_base_change.py:125 · validation/unit/commalg/test_base_change.py:71 · validation/bench/macaulay2_normalization.py:415

commalg.PolynomialHomomorphism.from_json

Deserialize and revalidate a PolynomialHomomorphism from typed JSON.

Detailed contract

Deserialize and revalidate a complete homomorphism.

(cls, value: str) -> PolynomialHomomorphism[CoefficientRing, Coefficient | Polynomial[CoefficientRing]]

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

pub fn from_json(value: &str) -> Result<Self, NoetherError>where S: for<'de> Deserialize<'de>, T: for<'de> Deserialize<'de>, M: for<'de> Deserialize<'de>, T::Element: for<'de> Deserialize<'de>,
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/PolynomialHomomorphism@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.PolynomialHomomorphism.images

Return the images recorded by this PolynomialHomomorphism.

Detailed contract

Images of source variables in declared order.

(self) -> list[T]

noether::commalg::PolynomialHomomorphism::images · Direct Rust declaration

pub fn images(&self) -> &[T::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/PolynomialHomomorphism@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:198 · validation/unit/commalg/test_polynomial_homomorphism.py:30 · validation/unit/groups/test_acceptance_workload.py:90 · validation/unit/groups/test_acceptance_workload.py:95 · validation/unit/groups/test_permutation_group_facade.py:49 · validation/unit/groups/test_permutation_group_facade.py:54

commalg.PolynomialHomomorphism.source

Return the source recorded by this PolynomialHomomorphism.

Detailed contract

Exact source polynomial context.

(self) -> PolynomialRing[C]

noether::commalg::PolynomialHomomorphism::source · Direct Rust declaration

pub fn source(&self) -> &PolynomialRing<S>
fn source(&self) -> &Self::Source
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/PolynomialHomomorphism@1

Executable usage: examples/09_finite_field_isomorphisms.py:11 · examples/09_finite_field_isomorphisms.py:13 · examples/09_finite_field_isomorphisms.py:9 · examples/30_modules_and_resolutions.py:34 · examples/30_modules_and_resolutions.py:37 · validation/unit/category/test_acceptance_workload.py:25

commalg.PolynomialHomomorphism.target

Return the target recorded by this PolynomialHomomorphism.

Detailed contract

Exact target commutative-ring context.

(self) -> CoefficientRing | PolynomialRing[CoefficientRing]

noether::commalg::PolynomialHomomorphism::target · Direct Rust declaration

pub fn target(&self) -> &T
fn target(&self) -> &Self::Target
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/PolynomialHomomorphism@1

Executable usage: examples/09_finite_field_isomorphisms.py:10 · examples/09_finite_field_isomorphisms.py:11 · examples/30_modules_and_resolutions.py:33 · examples/30_modules_and_resolutions.py:38 · examples/31_local_fields_and_precision.py:27 · examples/36_affine_normalization.py:16

commalg.PolynomialHomomorphism.to_json

Serialize this PolynomialHomomorphism to its canonical typed JSON representation.

Detailed contract

Serialize all endpoint, coefficient-map, and image data.

(self) -> str

noether::commalg::PolynomialHomomorphism::to_json · Direct Rust declaration

pub fn to_json(&self) -> Result<String, NoetherError>where S: Serialize, T: Serialize, M: Serialize, T::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/PolynomialHomomorphism@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.PolynomialHomomorphism.verify

Replay and verify the mathematical evidence carried by this PolynomialHomomorphism.

Detailed contract

Verify exact endpoints and image membership.

(self) -> None

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