commalg · FreeAbelianGrading¶
11 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.
Worked example¶
The complete checked program Decompose a polynomial by a nonstandard positive grading uses this API directly.
# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Decompose a polynomial by a nonstandard positive grading."""
from noether import Z
from noether.commalg import PolynomialRing, WeightedGrading
def main() -> None:
ring = PolynomialRing(Z, ["x", "y", "z"], grading=WeightedGrading([1, 2, 3]))
x, y, z = ring.generators()
sparse = ring.from_terms([([0, 0, 0], 1), ([2, 0, 0], 1), ([0, 1, 0], 1)])
polynomial = sparse + z
assert sparse * (x + y) == (1 + x**2 + y) * (x + y)
components = polynomial.homogeneous_components()
assert [degree for degree, _ in components] == [0, 2, 3]
assert x**2 + y == components[1][1]
print(f"weighted homogeneous degrees: {[degree for degree, _ in components]}")
if __name__ == "__main__":
main()
Run it with .venv/bin/python examples/14_weighted_polynomials.py.
commalg.FreeAbelianGrading¶
Degrees of ordered variables in one free abelian group Z^r.
noether::commalg::FreeAbelianGrading · Direct Rust declaration
| 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/FreeAbelianGrading@1 |
Executable usage: validation/unit/commalg/test_monomial_ideal_facade.py:12 · validation/unit/commalg/test_monomial_ideal_facade.py:76 · validation/unit/commalg/test_polynomial_facade.py:11 · validation/unit/commalg/test_polynomial_facade.py:318 · validation/unit/homalg/test_module_facade.py:14 · validation/unit/homalg/test_module_facade.py:198
commalg.FreeAbelianGrading.arity¶
Return the arity recorded by this FreeAbelianGrading.
Detailed contract
Number of ordered variables receiving degrees.
noether::commalg::FreeAbelianGrading::arity · Direct Rust declaration
| 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/FreeAbelianGrading@1 |
Executable usage: validation/unit/commalg/test_polynomial_facade.py:197 · validation/unit/commalg/test_polynomial_facade.py:205 · validation/unit/commalg/test_polynomial_ideal_facade.py:259 · validation/unit/commalg/test_power_series_facade.py:65 · validation/bench/groebner_compare.py:120 · validation/bench/groebner_compare.py:121
commalg.FreeAbelianGrading.certify_positive¶
Compute certify positive for this FreeAbelianGrading.
Detailed contract
Certify finite graded pieces using an exact integral functional. The functional must have the grading rank and pair positively with the degree of every variable. This is independently rechecked when the certificate is deserialized.
noether::commalg::FreeAbelianGrading::certify_positive · Direct Rust declaration
| 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/FreeAbelianGrading@1 |
commalg.FreeAbelianGrading.degree¶
Compute degree for this FreeAbelianGrading.
Detailed contract
Degree of a monomial with arbitrary-precision nonnegative exponents.
noether::commalg::FreeAbelianGrading::degree · Direct Rust declaration
| 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/FreeAbelianGrading@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.FreeAbelianGrading.from_json¶
Deserialize and revalidate a FreeAbelianGrading from typed JSON.
Detailed contract
Deserialize and revalidate a free abelian grading.
noether::commalg::FreeAbelianGrading::from_json · Direct Rust declaration
| 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/FreeAbelianGrading@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.FreeAbelianGrading.rank¶
Return the rank recorded by this FreeAbelianGrading.
Detailed contract
Rank of the free abelian grading group.
noether::commalg::FreeAbelianGrading::rank · Direct Rust declaration
| 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/FreeAbelianGrading@1 |
Executable usage: examples/38_exact_linear_systems.py:78 · examples/distributed/f2_linear_algebra.py:34 · examples/distributed/f2_linear_algebra.py:54 · examples/distributed/f2_linear_algebra.py:55 · examples/distributed/f2_linear_algebra.py:60 · validation/unit/combin/test_acceptance_workload.py:74
commalg.FreeAbelianGrading.standard¶
Construct a FreeAbelianGrading using standard.
Detailed contract
Standard rank-one grading on the requested number of variables.
noether::commalg::FreeAbelianGrading::standard · Direct Rust declaration
| 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/FreeAbelianGrading@1 |
Executable usage: validation/unit/commalg/test_monomial_ideal_facade.py:57 · validation/unit/commalg/test_polynomial_facade.py:34 · validation/unit/commalg/test_polynomial_facade.py:42 · validation/unit/commalg/test_polynomial_facade.py:43 · validation/unit/commalg/test_polynomial_facade.py:44 · validation/unit/commalg/test_polynomial_facade.py:45
commalg.FreeAbelianGrading.to_json¶
Serialize this FreeAbelianGrading to its canonical typed JSON representation.
Detailed contract
Serialize the complete grading context as typed JSON.
noether::commalg::FreeAbelianGrading::to_json · Direct Rust declaration
| 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/FreeAbelianGrading@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.FreeAbelianGrading.trivial¶
Construct a FreeAbelianGrading using trivial.
Detailed contract
Trivial rank-zero grading on the requested number of variables.
noether::commalg::FreeAbelianGrading::trivial · Direct Rust declaration
| 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/FreeAbelianGrading@1 |
Executable usage: examples/26_elliptic_descent_functions.py:40 · validation/unit/groups/test_acceptance_workload.py:140 · validation/unit/groups/test_acceptance_workload.py:141 · validation/unit/groups/test_acceptance_workload.py:149 · validation/unit/groups/test_acceptance_workload.py:151
commalg.FreeAbelianGrading.variable_degrees¶
Return the variable degrees recorded by this FreeAbelianGrading.
Detailed contract
Degree of every variable, in variable order.
noether::commalg::FreeAbelianGrading::variable_degrees · Direct Rust declaration
| 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/FreeAbelianGrading@1 |
Executable usage: validation/unit/commalg/test_construction_algebras.py:44 · validation/bench/macaulay2_quotient.py:191 · validation/bench/macaulay2_quotient.py:229 · validation/bench/macaulay2_quotient.py:271 · validation/bench/macaulay2_quotient.py:276 · validation/bench/macaulay2_quotient.py:362
commalg.FreeAbelianGrading.weighted_view¶
Compute weighted view for this FreeAbelianGrading.
Detailed contract
Return the positive rank-one weighted view when it exists.
noether::commalg::FreeAbelianGrading::weighted_view · Direct Rust declaration
| 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/FreeAbelianGrading@1 |
Executable usage: validation/unit/homalg/test_module_facade.py:200 · validation/unit/homalg/test_module_facade.py:204