Skip to content

commalg · PowerSeriesRing

15 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.PowerSeriesRing

A fixed-truncation power-series ring over one accepted coefficient context.

PowerSeriesRing(coefficient_ring: C, variables: Sequence[str], truncation: SeriesTruncation)

noether::commalg::PowerSeriesRing · Direct Rust declaration

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

Executable usage: examples/17_weighted_power_series.py:10 · examples/17_weighted_power_series.py:6 · validation/unit/commalg/test_acceptance_workload.py:15 · validation/unit/commalg/test_acceptance_workload.py:29 · validation/unit/commalg/test_context_tower_workload.py:10 · validation/unit/commalg/test_context_tower_workload.py:136

commalg.PowerSeriesRing.__call__

Coerce the supplied input through this context or mathematical map.

(self, value: Coefficient) -> PowerSeries[C]

noether::commalg::PowerSeriesRing · 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/PowerSeriesRing@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.PowerSeriesRing.coefficient_capacity_bound

Compute coefficient capacity bound for this PowerSeriesRing.

Detailed contract

A deterministic upper bound on the number of retained coefficient positions, without allocating those positions.

(self) -> int

noether::commalg::PowerSeriesRing::coefficient_capacity_bound · Direct Rust declaration

pub fn coefficient_capacity_bound(&self) -> Integer
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/PowerSeriesRing@1

Executable usage: examples/17_weighted_power_series.py:19 · validation/unit/commalg/test_acceptance_workload.py:49 · validation/unit/commalg/test_power_series_facade.py:127 · validation/unit/commalg/test_power_series_facade.py:97

commalg.PowerSeriesRing.coefficient_ring

Return the coefficient ring recorded by this PowerSeriesRing.

Detailed contract

Coefficient-ring context.

(self) -> C

noether::commalg::PowerSeriesRing::coefficient_ring · Direct Rust declaration

pub fn coefficient_ring(&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/PowerSeriesRing@1

Executable usage: validation/unit/commalg/test_affine_normalization_facade.py:115 · validation/unit/commalg/test_affine_normalization_facade.py:117 · validation/unit/commalg/test_affine_normalization_facade.py:119 · validation/unit/commalg/test_base_change.py:31 · validation/unit/commalg/test_base_change.py:53 · validation/unit/commalg/test_construction_algebras.py:19

commalg.PowerSeriesRing.constant

Compute constant for this PowerSeriesRing.

Detailed contract

Embed a coefficient as a constant series.

(self, value: Coefficient) -> PowerSeries[C]

noether::commalg::PowerSeriesRing::constant · Direct Rust declaration

pub fn constant( &self, coefficient: R::Element, ) -> Result<PowerSeries<R>, PowerSeriesError>
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/PowerSeriesRing@1

Executable usage: validation/unit/commalg/test_curve_facade.py:150 · validation/unit/commalg/test_normalization_facade.py:71 · validation/unit/commalg/test_polynomial_ideal_facade.py:304 · validation/unit/commalg/test_polynomial_ideal_facade.py:409 · validation/unit/commalg/test_polynomial_ideal_facade.py:413 · validation/unit/commalg/test_polynomial_ideal_facade.py:62

commalg.PowerSeriesRing.from_json

Deserialize and revalidate a complete fixed-precision context.

Detailed contract

Deserialize and revalidate a complete fixed-truncation series context.

(cls, value: str) -> PowerSeriesRing[C]

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

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

Construct a PowerSeriesRing using terms.

Detailed contract

Construct a sparse series from exponent/coefficient pairs. Duplicate exponents are summed. Coefficients outside their context and terms outside the fixed truncation are rejected rather than coerced or silently discarded.

(self, terms: Iterable[tuple[Sequence[int], Coefficient]]) -> PowerSeries[C]

noether::commalg::PowerSeriesRing::from_terms · Direct Rust declaration

pub fn from_terms<I>( &self, terms: I, ) -> Result<PowerSeries<R>, PowerSeriesError>where I: IntoIterator<Item = (Vec<u64>, 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/PowerSeriesRing@1

Executable usage: examples/14_weighted_polynomials.py:12 · validation/unit/commalg/test_groebner_verification_budget.py:48 · validation/unit/commalg/test_intersection_theory.py:34 · validation/unit/commalg/test_kahler_differentials.py:172 · validation/unit/commalg/test_polynomial_facade.py:226 · validation/unit/commalg/test_polynomial_facade.py:233

commalg.PowerSeriesRing.generator

Compute generator for this PowerSeriesRing.

Detailed contract

Return the variable-th indeterminate.

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

noether::commalg::PowerSeriesRing::generator · Direct Rust declaration

pub fn generator( &self, variable: usize, ) -> Result<PowerSeries<R>, PowerSeriesError>
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/PowerSeriesRing@1

Executable usage: examples/08_finite_field_extensions.py:10 · examples/08_finite_field_extensions.py:11 · examples/08_finite_field_extensions.py:12 · examples/08_finite_field_extensions.py:13 · examples/08_finite_field_extensions.py:14 · examples/10_padic_hensel_lifting.py:12

commalg.PowerSeriesRing.generators

Compute generators for this PowerSeriesRing.

Detailed contract

All indeterminates in the context’s declared order.

(self) -> list[PowerSeries[C]]

noether::commalg::PowerSeriesRing::generators · Direct Rust declaration

pub fn generators(&self) -> Result<Vec<PowerSeries<R>>, PowerSeriesError>
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/PowerSeriesRing@1

Executable usage: examples/14_weighted_polynomials.py:11 · examples/15_groebner_twisted_cubic.py:11 · examples/15_groebner_twisted_cubic.py:19 · examples/17_weighted_power_series.py:15 · examples/18_finite_field_schemes.py:12 · examples/30_modules_and_resolutions.py:20

commalg.PowerSeriesRing.grading

Return the grading recorded by this PowerSeriesRing.

Detailed contract

Positive grading used by a degree truncation. Box truncations have no single grading and return None.

(self) -> WeightedGrading | None

noether::commalg::PowerSeriesRing::grading · Direct Rust declaration

pub fn grading(&self) -> Option<WeightedGrading>
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/PowerSeriesRing@1

Executable usage: examples/14_weighted_polynomials.py:10 · examples/14_weighted_polynomials.py:3 · validation/unit/commalg/test_base_change.py:23 · validation/unit/commalg/test_base_change.py:34 · validation/unit/commalg/test_construction_algebras.py:44 · validation/unit/commalg/test_context_tower_workload.py:42

commalg.PowerSeriesRing.one

Compute one for this PowerSeriesRing.

(self) -> PowerSeries[C]

noether::commalg::PowerSeriesRing::one · Direct Rust declaration

fn one(&self) -> Self::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/PowerSeriesRing@1

Executable usage: examples/02_ball_arithmetic.py:13 · examples/11_qadic_witt_vectors.py:11 · examples/24_homology_and_persistence.py:3 · examples/31_local_fields_and_precision.py:27 · validation/unit/combinatorics/test_poset.py:3 · validation/unit/commalg/test_acceptance_workload.py:37

commalg.PowerSeriesRing.to_json

Serialize the complete coefficient and fixed-precision context.

Detailed contract

Serialize the complete coefficient, variable, and finite-precision context.

(self) -> str

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

pub fn to_json(&self) -> Result<String, NoetherError>where R: 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/PowerSeriesRing@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.PowerSeriesRing.truncation

Return the truncation recorded by this PowerSeriesRing.

Detailed contract

Immutable finite truncation policy.

(self) -> SeriesTruncation

noether::commalg::PowerSeriesRing::truncation · Direct Rust declaration

pub fn truncation(&self) -> &SeriesTruncation
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/PowerSeriesRing@1

Executable usage: examples/34_finite_group_cohomology.py:11 · examples/34_finite_group_cohomology.py:12 · examples/34_finite_group_cohomology.py:13 · examples/34_finite_group_cohomology.py:15 · examples/34_finite_group_cohomology.py:20 · validation/unit/commalg/test_acceptance_workload.py:28

commalg.PowerSeriesRing.variables

Return the variables recorded by this PowerSeriesRing.

Detailed contract

Ordered indeterminate names.

(self) -> list[str]

noether::commalg::PowerSeriesRing::variables · Direct Rust declaration

pub fn variables(&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/PowerSeriesRing@1

Executable usage: validation/unit/combinatorics/test_matroid.py:66 · validation/unit/commalg/test_affine_normalization_facade.py:100 · validation/unit/commalg/test_affine_normalization_facade.py:107 · validation/unit/commalg/test_base_change.py:32 · validation/unit/commalg/test_normalization_facade.py:60 · validation/unit/commalg/test_normalization_facade.py:69

commalg.PowerSeriesRing.zero

Compute zero for this PowerSeriesRing.

(self) -> PowerSeries[C]

noether::commalg::PowerSeriesRing::zero · Direct Rust declaration

fn zero(&self) -> Self::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/PowerSeriesRing@1

Executable usage: examples/08_finite_field_extensions.py:11 · examples/10_padic_hensel_lifting.py:15 · examples/40_exterior_algebra.py:26 · examples/distributed/f2_linear_algebra.py:28 · examples/distributed/f2_linear_algebra.py:29 · examples/distributed/f2_linear_algebra.py:30