NonCommutativePolynomialReduction[poly,{poly1,poly2,…},vars,alg]
yields a reduction r of the polynomial poly modulo the polynomials polyi in variables vars over the non-commutative algebra alg.
NonCommutativePolynomialReduction[poly,{poly1,poly2,…},alg]
yields a reduction r of the polynomial poly modulo the polynomials polyi in the generators of the non-commutative algebra alg.
NonCommutativePolynomialReduction
NonCommutativePolynomialReduction[poly,{poly1,poly2,…},vars,alg]
yields a reduction r of the polynomial poly modulo the polynomials polyi in variables vars over the non-commutative algebra alg.
NonCommutativePolynomialReduction[poly,{poly1,poly2,…},alg]
yields a reduction r of the polynomial poly modulo the polynomials polyi in the generators of the non-commutative algebra alg.
Details
- NonCommutativePolynomialReduction is used to reduce a polynomial modulo a list of polynomials over a non-commutative algebra.
- vars needs to be specified when alg does not have generators specified ("Generators"Automatic).
- When alg has generators specified ("Generators"gens), {poly1,poly2,…} need to be polynomials in gens, and gens determines the monomial order.
- poly-r belongs to the ideal generated by {poly1,poly2,…}, and no monomial in r is divisible by any of the leading monomials of polyi. If the polyi form a Gröbner basis with respect to the monomial order determined by vars, then this property uniquely determines the reduction r.
- If the algebra alg has commutation relations specified, then poly-r belongs to the left ideal generated by {poly1,poly2,…}.
- NonCommutativePolynomialReduce gives {{f1,f2,…},r}, such that poly=f1[poly1]+f2[poly2]+…+r, where {f1,f2,…} are univariate linear pure functions with coefficients that are polynomials in vars over alg. If the algebra alg has commutation relations specified, then fi=gi⋄#1&, where gi is a polynomial in the algebra generators and ⋄ is the multiplication in alg.
- alg can be a NonCommutativeAlgebra object or any valid NonCommutativeAlgebra specification. If the algebra argument is omitted, NonCommutativeAlgebra with the default property values is used.
- vars should be {vs1,…,vsk}, where vsi are disjoint lists of variables that include all non-commutative variables that appear in {poly1,poly2,…}. vsi=x, where x is a variable, is equivalent to vsi={x}.
- vars, together with "VariableOrder" and "WordOrder" specifications in alg, determines a multi-graded monomial order.
- "VariableOrder" can be either "Increasing" or "Decreasing". With the default "Increasing" setting, variables that appear earlier in variable lists are considered to be smaller. The elements of "CommutativeVariables" of the algebra alg are always considered smaller than all vars.
- The monomials are ordered first on the number of occurrences of variables from variable lists vsi, starting with the list that contains the largest variables, then on the number of occurrences of "CommutativeVariables". If all numbers of occurrences are the same, monomials are ordered using "WordOrder", which can be one of "Lexicographic" (default), "ReverseLexicographic", "NegativeLexicographic" and "NegativeReverseLexicographic".
- The result of reducing a polynomial in general depends on the ordering assigned to monomials.
Examples
open all close allBasic Examples (1)
Scope (5)
Reduce a polynomial over an algebra with commutative and scalar variables:
alg = NonCommutativeAlgebra[<|"ScalarVariables" -> {a, b}, "CommutativeVariables" -> {z, t}|>];
p = 7 x**x**y**z**t**x + a z**x**t**x;
qq = {a t**x + b ^ 2 z**x**y + x**y + 5, 3 x**z + 5 x**x**t + a b};NonCommutativePolynomialReduction[p, qq, {x, y}, alg]Reduce a polynomial over an algebra with symbolic property names:
alg = NonCommutativeAlgebra[<|"Multiplication" -> mult, "Addition" -> add, "Unity" -> one, "Zero" -> zero|>];
p = add[mult[x, y, x, z, y], 2mult[z, x, x]];
qq = {add[mult[x, y, x], z], add[mult[z, y], 3]};NonCommutativePolynomialReduction[p, qq, {{x, y}, {z}}, alg]The result of reduction depends on the monomial order:
p = y**x**y**y**x + 2x**y**x;
qq = {3 y**x**y + 4 x + 5, 3 x**y**x + 4 x**y - 5 y**y + 6};NonCommutativePolynomialReduction[p, qq, {x, y}]NonCommutativePolynomialReduction[p, qq, {{x, y}}]Reduce a polynomial modulo a list of polynomials that is not a Gröbner basis:
p = 2x**x**x + y**y**y + 3y;
qq = {x**x + y**y - 1, x**y - 2};
gb = NonCommutativeGroebnerBasis[qq, {{x, y}}]The remainder is not zero, even though p belongs to the ideal generated by qq:
NonCommutativePolynomialReduction[p, qq, {{x, y}}]When p belongs to the ideal generated by qq, the remainder modulo gb must be zero:
NonCommutativePolynomialReduction[p, gb, {{x, y}}]Reduce a polynomial over a Weyl algebra:
alg = WeylAlgebra[{{x, y}, {dx, dy}}]NonCommutativePolynomialReduction[dx**dy**x**y, {x**dx - y**dy}, alg]Applications (4)
Simplify an expression involving
matrices
and
:
expr = (Inverse[a] + Inverse[b]).a.Inverse[a + b].bFind the inverses in the expression:
inv = Union[Cases[expr, _Inverse, Infinity]]Generate the relations satisfied by the inverses:
rel = Join@@({#1.First[#1] - SymbolicIdentityArray[{n}], First[#1].#1 - SymbolicIdentityArray[{n}]}& /@ inv)Pick a variable order that makes the most complicated variables largest:
vars = Join[{a, b}, inv]Compute the Gröbner basis of the ideal generated by the relations over the algebra of
matrices:
alg = NonCommutativeAlgebra[{Dot, n}];gb = NonCommutativeGroebnerBasis[rel, vars, alg]Reducing the expression modulo the Gröbner basis shows that it is equal to the identity matrix:
NonCommutativePolynomialReduction[expr, gb, vars, alg]Use ArraySimplify to do the above simplification steps automatically:
ArraySimplify[expr, Element[a | b, Matrices[{n, n}]]]Prove the Woodbury matrix identity:
In the standard formulation,
is an
matrix,
is a
matrix with
,
is an
matrix, and
is a
matrix. However, by replacing
,
and
with the block matrices
,
and
, one may assume that all matrices belong to the algebra of
matrices. It will be shown that the difference of the sides of the identity reduces to zero modulo the Gröbner basis of the ideal generated by relations implied by the properties of the matrix inverse.
Compute the difference
of the sides of the Woodbury matrix identity:
d = Subtract@@(Inverse[(a + u.c.v)] == Inverse[a] - Inverse[a].u.Inverse[(v.Inverse[a].u + Inverse[c])].v.Inverse[a])inv = Union[Cases[d, _Inverse, Infinity]]Generate the relations satisfied by the inverses:
rel = Join@@({#1.First[#1] - SymbolicIdentityArray[{n}], First[#1].#1 - SymbolicIdentityArray[{n}]}& /@ inv)Pick a variable order that makes the most complicated variables largest:
vars = Join[{a, c, u, v}, inv]Compute the Gröbner basis of the ideal generated by the relations over the algebra of
matrices:
alg = NonCommutativeAlgebra[{Dot, n}];gb = NonCommutativeGroebnerBasis[rel, vars, alg]Reduce
modulo the Gröbner basis. The result is a zero matrix, which proves the identity:
NonCommutativePolynomialReduction[d, gb, vars, alg]Use ArraySimplify to do the above simplification steps automatically:
ArraySimplify[d, Element[a | c | u | v, Matrices[{n, n}]]]Construct a finitely presented group. The dicyclic group
is given by generators
and relations
. The group algebra of
is given by four generators:
gens = {a, x, inv[a], inv[x]};The generators satisfy the following relations:
rel = {GeneralizedPower[NonCommutativeMultiply, a, 6] - 1, GeneralizedPower[NonCommutativeMultiply, x, 2] - GeneralizedPower[NonCommutativeMultiply, a, 3], inv[x]**a**x - inv[a], a**inv[a] - 1, inv[a]**a - 1, x**inv[x] - 1, inv[x]**x - 1};Compute the Gröbner basis of the ideal generated by the relations:
vars = {{a, x}, {inv[a], inv[x]}};gb = NonCommutativeGroebnerBasis[rel, vars]Note that reducing an arbitrary monomial modulo the Gröbner basis gives a monomial that does not contain
and
. This shows that reducing an arbitrary monomial in
and
of total degree
yields a monomial of a total degree at most
:
NonCommutativePolynomialReduction[#, gb, vars]& /@ NonCommutativeMultiply@@@Tuples[{a, x}, 5]Hence, all elements of the group can be represented as reduced monomials of degree at most
:
gg = Union[NonCommutativePolynomialReduction[#, gb, vars]& /@ Join@@Table[NonCommutativeMultiply@@@Tuples[{a, x}, i], {i, 0, 4}]]It has been proven that
is a finite group of order
:
Length[gg]Test left ideal membership in a Clifford algebra:
alg = CliffordAlgebra[{{x, y}, {u, v}}]Compute the Gröbner basis of the left ideal
:
gb = NonCommutativeGroebnerBasis[{x**y - u**v}, alg, Left]A polynomial belongs to the ideal
if it reduces to
:
NonCommutativePolynomialReduction[x**u**v, gb, alg]NonCommutativePolynomialReduction[x**u**v**y + 1, gb, alg]Properties & Relations (4)
NonCommutativePolynomialReduce gives both the reduced polynomial and the linear cofactors:
p = z**y**x**y**z + 2x**y**z;
qq = {z**y - 3x, y**z + 5x**x};{fs, r} = NonCommutativePolynomialReduce[p, qq, {x, y, z}]p is a linear combination of polynomials qq and the reduced polynomial r:
NonCommutativeExpand[p - Plus@@MapThread[Construct, {fs, qq}] - r]A polynomial belongs to the ideal generated by a Gröbner basis iff it reduces to zero:
{p, q} = {y**y - 2y**x**y, y**x - 2 x**x};gb = NonCommutativeGroebnerBasis[{p, q}, {x, y}]This shows that p is in the ideal generated by gb:
NonCommutativePolynomialReduction[p, gb, {x, y}]Over an algebra with commutation relations specified, a polynomial belongs to the left ideal generated by a left Gröbner basis iff it reduces to zero:
alg = WeylAlgebra[{{x, y, z}, {dx, dy, dz}}]{p, q} = {x**x - z**dz, y**y - 2 dz**dz};lgb = NonCommutativeGroebnerBasis[{p, q}, alg, Left]This shows that
is in the left ideal generated by
:
NonCommutativePolynomialReduction[p + dx**q, lgb, alg]Use PolynomialReduction to reduce a commutative polynomial with respect to a list of polynomials:
p = x * y * z * y * x + 2z * y * x;
qq = {x * y - 3z, y * x + 5z * z};PolynomialReduction[p, qq, {x, y, z}]Use PolynomialReduce to represent p as a linear combination of qq plus the reduced polynomial r:
{cfs, r} = PolynomialReduce[p, qq, {x, y, z}]Expand[p - cfs.qq - r]Tech Notes
Related Guides
History
Text
Wolfram Research (2026), NonCommutativePolynomialReduction, Wolfram Language function, https://reference.wolfram.com/language/ref/NonCommutativePolynomialReduction.html.
CMS
Wolfram Language. 2026. "NonCommutativePolynomialReduction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NonCommutativePolynomialReduction.html.
APA
Wolfram Language. (2026). NonCommutativePolynomialReduction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NonCommutativePolynomialReduction.html
BibTeX
@misc{reference.wolfram_2026_noncommutativepolynomialreduction, author="Wolfram Research", title="{NonCommutativePolynomialReduction}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/NonCommutativePolynomialReduction.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_noncommutativepolynomialreduction, organization={Wolfram Research}, title={NonCommutativePolynomialReduction}, year={2026}, url={https://reference.wolfram.com/language/ref/NonCommutativePolynomialReduction.html}, note=[Accessed: 12-June-2026]}