Expand description
Sparse multivariate polynomials over ℚ. Sparse multivariate polynomials over ℚ.
MultiPoly represents polynomials in multiple variables with
exact rational coefficients. Monomials are stored sparsely
as (exponent_vector, coefficient) pairs.
This module provides:
- Polynomial arithmetic (+, -, ×)
- Degree computation
- Evaluation
- Partial derivatives
- Variable substitution
- Multivariate polynomial division
- S-polynomials for Gröbner basis computation
The monomial ordering is parameterized via the MonomialOrd trait,
enabling graded reverse lex (default), lex, and graded lex orderings.
Structs§
- GrLex
- Graded lexicographic ordering.
- GrevLex
- Graded reverse lexicographic ordering (default for Gröbner computation).
- Lex
- Pure lexicographic ordering (for elimination/back-substitution).
- MonoKey
- A monomial exponent vector with ordering determined by type parameter O.
- Multi
Poly - A sparse multivariate polynomial over ℚ.
Enums§
- Monomial
Order - A monomial order chosen at run time — the value-level counterpart of
the zero-sized order types
LexandGrevLex, for APIs that take the order as an argument (Ex::groebner,Ex::reduce_modulo).
Traits§
- Monomial
Ord - Trait for monomial orderings. Implemented by zero-sized types.
Functions§
- monomial_
coprime - Check if two monomials are coprime (no shared variable).
- monomial_
div - Divide monomial b by a (component-wise subtraction). Returns None if a doesn’t divide b.
- monomial_
divides - Check if monomial a divides monomial b (component-wise ≤).
- monomial_
lcm - Component-wise maximum of two exponent vectors (LCM of monomials).
- monomial_
mul - Multiply two monomials (component-wise addition).
- multipoly_
vars - Create variable polynomials for a ring with the given number of variables.
- s_
polynomial - Compute the S-polynomial of f and g.
Type Aliases§
- Exponent
- An exponent vector representing a monomial x₀^a · x₁^b · x₂^c · … as [a, b, c, …]. The length equals the number of variables.