Skip to content

commalg · Polynomial

49 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.Polynomial

A sparse polynomial carrying its complete coefficient and variable context.

class Polynomial

noether::commalg::Polynomial · Direct Rust declaration

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

Executable usage: validation/unit/combinatorics/test_matroid.py:12 · validation/unit/combinatorics/test_matroid.py:65 · validation/unit/commalg/test_context_tower_workload.py:7 · validation/unit/commalg/test_context_tower_workload.py:78 · validation/unit/commalg/test_kahler_differentials.py:171 · validation/unit/commalg/test_kahler_differentials.py:21

commalg.Polynomial.__add__

Add another compatible value to this value.

Detailed contract

Returns the argument unchanged.

(self, other: Polynomial[C] | Coefficient) -> Polynomial[C]

noether::commalg::Polynomial::add · Direct Rust declaration

fn add(self, rhs: &Polynomial<R>) -> Self::Output
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/Polynomial@1

Executable usage: validation/unit/infra/test_discovery.py:211 · validation/unit/infra/test_public_api_index.py:293

commalg.Polynomial.__divmod__

Compute divmod for this Polynomial.

(self: Polynomial[_PolynomialFieldContext], other: Polynomial[_PolynomialFieldContext] | Coefficient) -> tuple[Polynomial[_PolynomialFieldContext], Polynomial[_PolynomialFieldContext]]

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

commalg.Polynomial.__floordiv__

Compute floordiv for this Polynomial.

(self: Polynomial[_PolynomialFieldContext], other: Polynomial[_PolynomialFieldContext] | Coefficient) -> Polynomial[_PolynomialFieldContext]

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

commalg.Polynomial.__mod__

Compute mod for this Polynomial.

(self: Polynomial[_PolynomialFieldContext], other: Polynomial[_PolynomialFieldContext] | Coefficient) -> Polynomial[_PolynomialFieldContext]

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

commalg.Polynomial.__mul__

Multiply this value by another compatible value.

(self, other: Polynomial[C] | Coefficient) -> Polynomial[C]

noether::commalg::Polynomial::mul · Direct Rust declaration

fn mul(self, rhs: &Polynomial<R>) -> Self::Output
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/Polynomial@1

Executable usage: validation/unit/infra/test_public_api_index.py:214

commalg.Polynomial.__neg__

Return the additive inverse of this value.

(self) -> Polynomial[C]

noether::commalg::Polynomial::neg · Direct Rust declaration

fn neg(self) -> Self::Output
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/Polynomial@1

commalg.Polynomial.__pow__

Raise this value to the supplied power.

(self, exponent: int, modulus: None=None) -> Polynomial[C]

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

commalg.Polynomial.__radd__

Add this value to a compatible value on its left.

(self, other: Coefficient) -> Polynomial[C]

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

commalg.Polynomial.__rdivmod__

Compute rdivmod for this Polynomial.

(self: Polynomial[_PolynomialFieldContext], other: Coefficient) -> tuple[Polynomial[_PolynomialFieldContext], Polynomial[_PolynomialFieldContext]]

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

commalg.Polynomial.__rfloordiv__

Compute rfloordiv for this Polynomial.

(self: Polynomial[_PolynomialFieldContext], other: Coefficient) -> Polynomial[_PolynomialFieldContext]

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

commalg.Polynomial.__rmod__

Compute rmod for this Polynomial.

(self: Polynomial[_PolynomialFieldContext], other: Coefficient) -> Polynomial[_PolynomialFieldContext]

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

commalg.Polynomial.__rmul__

Multiply this value by a compatible value on its left.

(self, other: Coefficient) -> Polynomial[C]

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

commalg.Polynomial.__rsub__

Subtract this value from a compatible value on its left.

(self, other: Coefficient) -> Polynomial[C]

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

commalg.Polynomial.__sub__

Subtract another compatible value from this value.

(self, other: Polynomial[C] | Coefficient) -> Polynomial[C]

noether::commalg::Polynomial::sub · Direct Rust declaration

fn sub(self, rhs: &Polynomial<R>) -> Self::Output
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/Polynomial@1

Executable usage: validation/unit/infra/test_discovery.py:212

commalg.Polynomial.base_change

Extend coefficients along one checked standard map while preserving the complete polynomial presentation.

Detailed contract

Extend coefficients along one checked standard map while preserving the complete polynomial presentation.

Extend every coefficient while preserving the complete polynomial-ring presentation.

(self: Polynomial[IntegerRing], map: IntegerRationalEmbedding) -> Polynomial[RationalField]
(self: Polynomial[IntegerRing], map: IntegerReduction) -> Polynomial[ResidueRing]
(self: Polynomial[IntegerRing], map: IntegerFiniteFieldMap) -> Polynomial[FiniteField]
(self: Polynomial[FiniteField], map: PrimeSubfieldEmbedding) -> Polynomial[FiniteField]
(self: Polynomial[FiniteField], map: FiniteFieldEmbedding) -> Polynomial[FiniteField]
(self: Polynomial[RationalFunctionField[FiniteField]], map: RationalFunctionFieldMap) -> Polynomial[RationalFunctionField[FiniteField]]

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

pub fn base_change<M>( &self, map: &M, ) -> Result<Polynomial<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/Polynomial@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.Polynomial.coefficient

Compute coefficient for this Polynomial.

Detailed contract

Coefficient of one exact exponent vector.

(self, exponent: Sequence[int]) -> Coefficient

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

pub fn coefficient( &self, exponent: &[Integer], ) -> Result<R::Element, PolynomialError>
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/Polynomial@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.Polynomial.coefficient_polynomial

Coefficient of one selected-variable power in the remaining variables.

Detailed contract

Coefficient of one power of variable, as a polynomial in all other variables. The remaining variables retain their order, grading weights, and the induced monomial order. A one-variable source has no polynomial ring of remaining variables in the current context model and is rejected.

(self, variable: int | str, exponent: int) -> Polynomial[C]

noether::commalg::Polynomial::coefficient_polynomial · Direct Rust declaration

pub fn coefficient_polynomial( &self, variable: usize, exponent: &Integer, ) -> Result<Polynomial<R>, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:287

commalg.Polynomial.coefficient_polynomials

Dense selected-variable coefficients through its degree.

Detailed contract

Dense coefficients in variable, from exponent zero through its degree, as polynomials in all other variables. max_count is checked against the selected-variable degree before the dense result is allocated. The zero polynomial returns an empty list.

(self, variable: int | str, *, max_count: int) -> list[Polynomial[C]]

noether::commalg::Polynomial::coefficient_polynomials · Direct Rust declaration

pub fn coefficient_polynomials( &self, variable: usize, max_count: usize, ) -> Result<Vec<Polynomial<R>>, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:280 · validation/unit/commalg/test_polynomial_facade.py:289

commalg.Polynomial.constant_coefficient

Compute constant coefficient for this Polynomial.

Detailed contract

Constant coefficient.

(self) -> Coefficient

noether::commalg::Polynomial::constant_coefficient · Direct Rust declaration

pub fn constant_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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:364 · validation/unit/commalg/test_polynomial_facade.py:371 · validation/unit/commalg/test_polynomial_ideal_facade.py:413 · validation/unit/commalg/test_power_series_facade.py:129 · validation/unit/commalg/test_power_series_facade.py:152 · validation/unit/commalg/test_power_series_facade.py:196

commalg.Polynomial.degree

Compute degree for this Polynomial.

Detailed contract

Degree in one variable, or weighted total degree when variable is None. Zero has no degree.

(self, variable: int | str | None=None) -> int | None

noether::commalg::Polynomial::degree · Direct Rust declaration

pub fn degree( &self, variable: Option<usize>, ) -> Result<Option<Integer>, PolynomialError>
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/Polynomial@1

Executable usage: examples/14_weighted_polynomials.py:16 · examples/14_weighted_polynomials.py:18 · examples/15_groebner_twisted_cubic.py:15 · examples/15_groebner_twisted_cubic.py:28 · examples/31_local_fields_and_precision.py:37 · examples/33_simplicial_cohomology_operations.py:26

commalg.Polynomial.derivative

Compute derivative for this Polynomial.

Detailed contract

Formal derivative with respect to one variable.

(self, variable: int | str) -> Polynomial[C]

noether::commalg::Polynomial::derivative · Direct Rust declaration

pub fn derivative(&self, variable: usize) -> Result<Self, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:216 · validation/unit/commalg/test_power_series_facade.py:134 · validation/unit/commalg/test_power_series_facade.py:135 · validation/unit/commalg/test_power_series_facade.py:136 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:636 · validation/unit/numthy/test_padic_ring_facade.py:176

commalg.Polynomial.div_rem

Compute div rem for this Polynomial.

Detailed contract

Divide two univariate polynomials over a field. Returns (quotient, remainder) with self = quotient * divisor + remainder and either zero remainder or remainder degree strictly smaller than divisor degree.

(self: Polynomial[_PolynomialFieldContext], divisor: Polynomial[_PolynomialFieldContext] | Coefficient) -> tuple[Polynomial[_PolynomialFieldContext], Polynomial[_PolynomialFieldContext]]

noether::commalg::Polynomial::div_rem · Direct Rust declaration

pub fn div_rem(&self, divisor: &Self) -> Result<(Self, Self), PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:383 · validation/unit/commalg/test_polynomial_facade.py:447 · validation/unit/commalg/test_polynomial_facade.py:462

commalg.Polynomial.evaluate

Compute evaluate for this Polynomial.

Detailed contract

Evaluate at one coefficient-ring value per variable.

(self, values: Sequence[Coefficient] | Mapping[str, Coefficient]) -> Coefficient

noether::commalg::Polynomial::evaluate · Direct Rust declaration

pub fn evaluate( &self, values: &[R::Element], ) -> Result<R::Element, PolynomialError>
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/Polynomial@1

Executable usage: examples/10_padic_hensel_lifting.py:15 · validation/unit/commalg/test_context_tower_workload.py:108 · validation/unit/commalg/test_polynomial_facade.py:216 · validation/unit/commalg/test_polynomial_facade.py:217 · validation/unit/commalg/test_polynomial_facade.py:365 · validation/unit/commalg/test_polynomial_facade.py:424

commalg.Polynomial.exact_div

Compute exact div for this Polynomial.

Detailed contract

Divide exactly by one polynomial over a field. Native coefficient contexts use their multivariate divisibility kernels. The exact sparse floor performs single-divisor leading-term reduction in the ring’s declared global monomial order. Divide exactly by one univariate polynomial over the integers. The operation returns PolynomialError::NonExactDivision when the quotient does not have integer coefficients.

(self: Polynomial[_PolynomialExactGcdContext], divisor: Polynomial[_PolynomialExactGcdContext] | Coefficient) -> Polynomial[_PolynomialExactGcdContext]

noether::commalg::Polynomial::exact_div · Direct Rust declaration

pub fn exact_div(&self, divisor: &Self) -> Result<Self, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:451 · validation/unit/commalg/test_polynomial_facade.py:464 · validation/unit/commalg/test_polynomial_facade.py:483 · validation/unit/commalg/test_polynomial_facade.py:485 · validation/unit/commalg/test_polynomial_facade.py:497 · validation/unit/commalg/test_polynomial_facade.py:502

commalg.Polynomial.factor

Canonical complete factorization over Z, Q, or a finite field.

Detailed contract

Return signed content and canonical primitive irreducible factors over Z. Return the canonical monic irreducible factorization over Q. Return the canonical monic irreducible factorization over this finite field.

(self) -> PolynomialFactorization[C]

noether::commalg::Polynomial::factor · Direct Rust declaration

pub fn factor( &self, ) -> Result<PolynomialFactorization<IntegerRing>, PolynomialFactorizationError>
pub fn factor( &self, ) -> Result<PolynomialFactorization<RationalField>, PolynomialFactorizationError>
pub fn factor( &self, ) -> Result<PolynomialFactorization<FiniteField>, 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 released
Semantic ID noether/commalg/Polynomial@1

Executable usage: examples/07_integer_factorization.py:10 · examples/07_integer_factorization.py:5 · examples/12_number_field_ideals.py:3 · validation/unit/commalg/test_context_tower_workload.py:87 · validation/unit/commalg/test_polynomial_facade.py:120 · validation/unit/commalg/test_polynomial_facade.py:134

commalg.Polynomial.frobenius_lift

Compute frobenius lift for this Polynomial.

Detailed contract

Apply coefficient Frobenius and x_i -> x_i^(p^exponent) in one pass.

(self, exponent: int) -> Polynomial[C]

noether::commalg::Polynomial::frobenius_lift · Direct Rust declaration

pub fn frobenius_lift( &self, exponent: u64, ) -> Result<Self, SemilinearSubstitutionError>where R: CoefficientFrobeniusContext,
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:244 · validation/unit/commalg/test_power_series_facade.py:271 · validation/unit/commalg/test_power_series_facade.py:298 · validation/bench/sage_power_series.py:127

commalg.Polynomial.from_json

Deserialize and revalidate a polynomial over one supported coefficient ring.

Detailed contract

Deserialize and revalidate the ring, exponents, coefficients, and term order.

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

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

pub fn from_json(value: &str) -> Result<Self, NoetherError>where R: for<'de> Deserialize<'de>, R::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/Polynomial@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.Polynomial.gcd

Compute gcd for this Polynomial.

Detailed contract

Monic greatest common divisor of two univariate polynomials over a field, with gcd(0, 0) = 0. Native multivariate coefficient contexts also use their exact multivariate gcd kernel. The coefficient-generic sparse fallback is currently univariate and fails closed otherwise. Greatest common divisor of two univariate integer polynomials. The result has positive leading coefficient and includes the gcd of the coefficient contents, with gcd(0, 0) = 0.

(self: Polynomial[_PolynomialExactGcdContext], other: Polynomial[_PolynomialExactGcdContext] | Coefficient) -> Polynomial[_PolynomialExactGcdContext]

noether::commalg::Polynomial::gcd · Direct Rust declaration

pub fn gcd(&self, other: &Self) -> Result<Self, PolynomialError>
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/Polynomial@1

Executable usage: examples/01_bezout_certificates.py:12 · validation/unit/commalg/test_polynomial_facade.py:385 · validation/unit/commalg/test_polynomial_facade.py:452 · validation/unit/commalg/test_polynomial_facade.py:469 · validation/unit/commalg/test_polynomial_facade.py:474 · validation/unit/commalg/test_polynomial_facade.py:498

commalg.Polynomial.homogeneous_components

Decompose a polynomial into components for its ring's positive grading.

Detailed contract

Split into nonzero homogeneous components in increasing degree.

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

noether::commalg::Polynomial::homogeneous_components · Direct Rust declaration

pub fn homogeneous_components( &self, ) -> Result<Vec<(Integer, Polynomial<R>)>, PolynomialError>
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/Polynomial@1

Executable usage: examples/14_weighted_polynomials.py:15 · validation/unit/commalg/test_polynomial_facade.py:263 · validation/unit/infra/test_public_api_index.py:167

commalg.Polynomial.homogeneous_degree

Compute homogeneous degree for this Polynomial.

Detailed contract

Degree shared by every nonzero monomial, or None when this polynomial is zero or inhomogeneous.

(self) -> int | None

noether::commalg::Polynomial::homogeneous_degree · Direct Rust declaration

pub fn homogeneous_degree(&self) -> Result<Option<Integer>, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:260 · validation/unit/commalg/test_polynomial_facade.py:261 · validation/unit/commalg/test_polynomial_facade.py:262 · validation/unit/commalg/test_polynomial_facade.py:305 · validation/unit/homalg/test_exterior_algebra.py:90 · validation/unit/homalg/test_finite_group_cohomology.py:163

commalg.Polynomial.is_nth_power

Whether this supported univariate polynomial is an exact power.

Detailed contract

Whether this polynomial is an exact exponent-th power over Z. Whether this polynomial is an exact exponent-th power over Q. Whether this polynomial is an exact exponent-th power in its finite field.

(self, exponent: int) -> bool

noether::commalg::Polynomial::is_nth_power · Direct Rust declaration

pub fn is_nth_power(&self, exponent: u64) -> Result<bool, PerfectPowerError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:179 · validation/unit/commalg/test_rational_function_facade.py:58 · validation/corpus/commalg/k3-univariate-certificates.py:63

commalg.Polynomial.is_one

Test whether this Polynomial is one.

Detailed contract

Whether this polynomial is one.

(self) -> bool

noether::commalg::Polynomial::is_one · Direct Rust declaration

pub fn is_one(&self) -> bool
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/Polynomial@1

Executable usage: validation/unit/commalg/test_rational_function_facade.py:31 · validation/unit/commalg/test_residue_ring_facade.py:25 · validation/unit/numthy/test_number_field_facade.py:29 · validation/corpus/commalg/evolution-algebra-isomorphism.py:34 · validation/corpus/numthy/diagonal-quadric-local-density-sums.py:36

commalg.Polynomial.is_zero

Test whether this Polynomial is zero.

Detailed contract

Whether this polynomial is zero.

(self) -> bool

noether::commalg::Polynomial::is_zero · Direct Rust declaration

pub fn is_zero(&self) -> bool
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/Polynomial@1

Executable usage: examples/17_weighted_power_series.py:16 · examples/17_weighted_power_series.py:17 · examples/39_kahler_differentials.py:20 · validation/unit/commalg/test_graded_commutative_facade.py:26 · validation/unit/commalg/test_kahler_differentials.py:113 · validation/unit/commalg/test_kahler_differentials.py:38

commalg.Polynomial.leading_coefficient

Compute leading coefficient for this Polynomial.

Detailed contract

Leading coefficient in the context’s monomial order, or None for zero.

(self) -> Coefficient | None

noether::commalg::Polynomial::leading_coefficient · Direct Rust declaration

pub fn leading_coefficient(&self) -> Option<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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:225 · validation/unit/commalg/test_polynomial_facade.py:454 · validation/unit/commalg/test_polynomial_facade.py:455 · validation/bench/macaulay2_core.py:1962 · validation/bench/macaulay2_core.py:1967 · validation/bench/macaulay2_core.py:1978

commalg.Polynomial.monic

Compute monic for this Polynomial.

Detailed contract

Normalize a nonzero polynomial to leading coefficient one. The zero polynomial is returned unchanged.

(self: Polynomial[_PolynomialFieldContext]) -> Polynomial[_PolynomialFieldContext]

noether::commalg::Polynomial::monic · Direct Rust declaration

pub fn monic(&self) -> Result<Self, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:387 · validation/unit/commalg/test_polynomial_facade.py:453 · validation/unit/commalg/test_polynomial_ideal_facade.py:715 · validation/unit/numthy/test_finite_field_facade.py:126 · validation/unit/numthy/test_number_field_facade.py:271 · validation/bench/magma_release.py:1415

commalg.Polynomial.monomial_substitution

Compute monomial substitution for this Polynomial.

Detailed contract

Substitute monomials while leaving coefficients unchanged.

(self, monomial_map: MonomialMap) -> Polynomial[C]

noether::commalg::Polynomial::monomial_substitution · Direct Rust declaration

pub fn monomial_substitution( &self, monomial_map: &MonomialMap, ) -> Result<Self, SemilinearSubstitutionError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:247

commalg.Polynomial.multihomogeneous_components

Split into components in the full free-abelian grading.

Detailed contract

Split into nonzero components in the full free-abelian grading.

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

noether::commalg::Polynomial::multihomogeneous_components · Direct Rust declaration

pub fn multihomogeneous_components( &self, ) -> Result<Vec<(Degree, Polynomial<R>)>, PolynomialError>
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/Polynomial@1

commalg.Polynomial.multihomogeneous_degree

Degree shared by every term in the full free-abelian grading.

Detailed contract

Degree shared by every nonzero monomial in the full free-abelian grading, or None when this polynomial is zero or inhomogeneous.

(self) -> Degree | None

noether::commalg::Polynomial::multihomogeneous_degree · Direct Rust declaration

pub fn multihomogeneous_degree(&self) -> Result<Option<Degree>, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:333 · validation/unit/commalg/test_quotient_facade.py:141 · validation/unit/commalg/test_quotient_facade.py:148 · validation/unit/commalg/test_quotient_facade.py:39

commalg.Polynomial.nonzero_term_count

Return the nonzero term count recorded by this Polynomial.

Detailed contract

Number of nonzero terms.

(self) -> int

noether::commalg::Polynomial::nonzero_term_count · Direct Rust declaration

pub fn nonzero_term_count(&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/Polynomial@1

Executable usage: examples/27_weight_characters.py:26 · validation/unit/commalg/test_acceptance_workload.py:50 · validation/unit/commalg/test_acceptance_workload.py:52 · validation/unit/commalg/test_context_tower_workload.py:139 · validation/unit/commalg/test_context_tower_workload.py:142 · validation/unit/commalg/test_polynomial_facade.py:436

commalg.Polynomial.nth_root

Extract a deterministic exact root, or return None when none exists.

Detailed contract

Return an exact exponent-th root over Z, when one exists. Return an exact exponent-th root over Q, when one exists. Return a deterministic exact exponent-th root in its finite field. Coefficient roots are found by exact finite-field factorization of X^exponent-a, so this also handles inseparable exponents divisible by the characteristic.

(self, exponent: int) -> Polynomial[C] | None

noether::commalg::Polynomial::nth_root · Direct Rust declaration

pub fn nth_root(&self, exponent: u64) -> Result<Option<Self>, PerfectPowerError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:180 · validation/unit/commalg/test_polynomial_facade.py:181 · validation/unit/commalg/test_polynomial_facade.py:183 · validation/unit/commalg/test_polynomial_facade.py:189 · validation/unit/commalg/test_rational_function_facade.py:59 · validation/unit/commalg/test_rational_function_facade.py:60

commalg.Polynomial.pow

Compute pow for this Polynomial.

Detailed contract

Raise to a machine-word nonnegative power.

(self, exponent: int) -> Polynomial[C]

noether::commalg::Polynomial::pow · Direct Rust declaration

pub fn pow(&self, exponent: u64) -> Result<Self, PolynomialError>
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/Polynomial@1

Executable usage: examples/17_weighted_power_series.py:18 · validation/unit/commalg/test_polynomial_ideal_facade.py:368 · validation/unit/commalg/test_polynomial_ideal_facade.py:369 · validation/unit/commalg/test_polynomial_ideal_facade.py:370 · validation/unit/commalg/test_polynomial_ideal_facade.py:373 · validation/unit/commalg/test_polynomial_ideal_facade.py:381

commalg.Polynomial.real_roots

Isolate every distinct real root of an exact integer/rational polynomial.

Detailed contract

Isolate every distinct real root, including exact multiplicities. Isolate every distinct real root after the canonical embedding into Q.

(self) -> list[RealRootIsolation]

noether::commalg::Polynomial::real_roots · Direct Rust declaration

pub fn real_roots(&self) -> Result<Vec<RealRootIsolation>, RealRootError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:113 · validation/unit/commalg/test_polynomial_facade.py:92 · validation/unit/infra/test_discovery.py:94 · validation/corpus/commalg/k3-univariate-certificates.py:103

commalg.Polynomial.ring

Return the ring recorded by this Polynomial.

Detailed contract

Polynomial-ring context.

(self) -> PolynomialRing[C]

noether::commalg::Polynomial::ring · Direct Rust declaration

pub fn 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/Polynomial@1

Executable usage: examples/11_qadic_witt_vectors.py:3 · examples/13_chinese_remainder_theorem.py:10 · examples/13_chinese_remainder_theorem.py:12 · examples/13_chinese_remainder_theorem.py:9 · examples/14_weighted_polynomials.py:10 · examples/14_weighted_polynomials.py:11

commalg.Polynomial.semilinear_substitution

Compute semilinear substitution for this Polynomial.

Detailed contract

Fuse a checked coefficient map and monomial substitution in one term stream.

(self, coefficient_map: CoefficientFrobenius, monomial_map: MonomialMap) -> Polynomial[C]

noether::commalg::Polynomial::semilinear_substitution · Direct Rust declaration

pub fn semilinear_substitution<M>( &self, coefficient_map: &M, monomial_map: &MonomialMap, ) -> Result<Polynomial<M::Target>, SemilinearSubstitutionError>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/Polynomial@1

Executable usage: validation/unit/commalg/test_power_series_facade.py:278 · validation/unit/commalg/test_power_series_facade.py:285 · validation/unit/numthy/test_padic_local_field_facade.py:163 · validation/unit/numthy/test_padic_local_field_facade.py:166

commalg.Polynomial.substitute

Compute substitute for this Polynomial.

Detailed contract

Substitute one polynomial from the same context for each variable.

(self, images: Sequence[Polynomial[C]] | Mapping[str, Polynomial[C]]) -> Polynomial[C]

noether::commalg::Polynomial::substitute · Direct Rust declaration

pub fn substitute(&self, images: &[Self]) -> Result<Self, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:218 · validation/bench/macaulay2_core.py:1227 · validation/corpus/commalg/multivariate-faa-di-bruno.py:20 · validation/corpus/commalg/multivariate-faa-di-bruno.py:24 · validation/corpus/commalg/multivariate-faa-di-bruno.py:30

commalg.Polynomial.terms

Compute terms for this Polynomial.

Detailed contract

Nonzero terms from greatest to least in the context’s term order.

(self) -> list[tuple[list[int], Coefficient]]

noether::commalg::Polynomial::terms · Direct Rust declaration

pub fn terms(&self) -> impl Iterator<Item = (&[Integer], &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/Polynomial@1

Executable usage: examples/07_integer_factorization.py:14 · examples/40_exterior_algebra.py:43 · validation/unit/combin/test_acceptance_workload.py:45 · validation/unit/combin/test_acceptance_workload.py:81 · validation/unit/combinatorics/test_boundary.py:31 · validation/unit/combinatorics/test_boundary.py:44

commalg.Polynomial.to_json

Serialize this polynomial with its complete ring and ordered terms.

Detailed contract

Serialize this polynomial with its complete ring and ordered nonzero terms.

(self) -> str

noether::commalg::Polynomial::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/Polynomial@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.Polynomial.univariate_view

Checked one-variable view retaining only the selected indeterminate.

Detailed contract

Checked univariate view in one selected variable. Every exponent outside variable must vanish. The returned polynomial has a one-variable context with the selected name, grading weight, and induced monomial order.

(self, variable: int | str) -> Polynomial[C]

noether::commalg::Polynomial::univariate_view · Direct Rust declaration

pub fn univariate_view( &self, variable: usize, ) -> Result<Polynomial<R>, PolynomialError>
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/Polynomial@1

Executable usage: validation/unit/commalg/test_polynomial_facade.py:292 · validation/unit/commalg/test_polynomial_facade.py:297