Skip to content

commalg · PolynomialFactorization

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

Worked example

The complete checked program Calculate in a fixed-cap multivariate weighted power-series ring uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Calculate in a fixed-cap multivariate weighted power-series ring."""

from noether import Z
from noether.commalg import PowerSeriesRing, SeriesTruncation


def main() -> None:
    ring = PowerSeriesRing(
        Z,
        ["x", "y", "z"],
        SeriesTruncation.weighted_degree([1, 2, 3], 6),
    )
    x, y, z = ring.generators()
    assert (x**6).is_zero()
    assert not (x**2 * z + y * z).is_zero()
    value = (1 + x + y).pow(4)
    print(f"{value}; coefficient capacity <= {ring.coefficient_capacity_bound()}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/17_weighted_power_series.py.

commalg.PolynomialFactorization

Canonical complete factorization of one supported polynomial.

class PolynomialFactorization

noether::commalg::PolynomialFactorization · Direct Rust declaration

pub struct PolynomialFactorization<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/PolynomialFactorization@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:122 · validation/unit/commalg/test_polynomial_facade.py:123 · validation/unit/commalg/test_polynomial_facade.py:129 · validation/unit/commalg/test_polynomial_facade.py:15 · validation/unit/commalg/test_polynomial_facade.py:161

commalg.PolynomialFactorization.coefficient

Return the coefficient recorded by this PolynomialFactorization.

Detailed contract

Signed content over Z, or normalized leading scalar over a field.

(self) -> Coefficient

noether::commalg::PolynomialFactorization::coefficient · Direct Rust declaration

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

Executable usage: examples/17_weighted_power_series.py:19 · examples/22_matroids_and_tutte.py:11 · examples/22_matroids_and_tutte.py:12 · examples/22_matroids_and_tutte.py:13 · examples/33_simplicial_cohomology_operations.py:31 · validation/unit/combin/test_acceptance_workload.py:45

commalg.PolynomialFactorization.factors

Return the factors recorded by this PolynomialFactorization.

Detailed contract

Deterministically ordered irreducible factors and positive multiplicities.

(self) -> list[tuple[Polynomial[C], int]]

noether::commalg::PolynomialFactorization::factors · Direct Rust declaration

pub fn factors(&self) -> &[(Polynomial<R>, u64)]
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/PolynomialFactorization@1

Executable usage: examples/04_smith_normal_form.py:17 · examples/07_integer_factorization.py:12 · validation/unit/commalg/test_context_tower_workload.py:87 · validation/unit/commalg/test_polynomial_facade.py:126 · validation/unit/commalg/test_polynomial_facade.py:147 · validation/unit/commalg/test_polynomial_facade.py:158

commalg.PolynomialFactorization.from_json

Deserialize and revalidate a PolynomialFactorization from typed JSON.

Detailed contract

Deserialize and recompute the canonical integer-polynomial factorization. Deserialize and recompute the canonical rational-polynomial factorization. Deserialize and recompute the canonical finite-field factorization.

(cls, value: str) -> PolynomialFactorization[CoefficientRing]

noether::commalg::PolynomialFactorization::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/PolynomialFactorization@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.PolynomialFactorization.source

Return the source recorded by this PolynomialFactorization.

Detailed contract

Polynomial whose canonical factorization is recorded.

(self) -> Polynomial[C]

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

pub fn source(&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/PolynomialFactorization@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.PolynomialFactorization.to_json

Serialize this PolynomialFactorization to its canonical typed JSON representation.

Detailed contract

Serialize the source and its canonical exact factors as typed JSON.

(self) -> str

noether::commalg::PolynomialFactorization::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/PolynomialFactorization@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.PolynomialFactorization.value

Return the value recorded by this PolynomialFactorization.

Detailed contract

Reconstruct the exact represented polynomial.

(self) -> Polynomial[C]

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

pub fn value(&self) -> Result<Polynomial<R>, PolynomialFactorizationError>
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/PolynomialFactorization@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.PolynomialFactorization.verify

Replay and verify the mathematical evidence carried by this PolynomialFactorization.

Detailed contract

Verify exact reconstruction of the source polynomial.

(self) -> None

noether::commalg::PolynomialFactorization::verify · Direct Rust declaration

pub fn verify(&self) -> Result<(), PolynomialFactorizationError>
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/PolynomialFactorization@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