NonCommutativePolynomialQ[expr,vars,alg]
tests whether expr is a polynomial in vars over the non-commutative algebra alg.
NonCommutativePolynomialQ
NonCommutativePolynomialQ[expr,vars,alg]
tests whether expr is a polynomial in vars over the non-commutative algebra alg.
Details
- NonCommutativePolynomialQ is used to test whether an expression is a polynomial over a non-commutative algebra.
- NonCommutativePolynomialQ gives True if vars includes all variables in expr other than the commutative and scalar variables of the algebra 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.
- NonCommutativePolynomialQ threads over lists in the first argument.
Examples
open all close allBasic Examples (2)
Test whether an expression is a polynomial over a non-commutative algebra:
NonCommutativePolynomialQ[(x + 2y)**(3w**z + 4z**z), {x, y, z, w}]The variable list needs to contain all non-commutative variables:
NonCommutativePolynomialQ[(x + 2y)**(3w**z + 4z**z), {x, y, z}]The variable list does not need to contain the commutative or scalar variables of the algebra:
alg = NonCommutativeAlgebra[<|"CommutativeVariables" -> {x, w}, "ScalarVariables" -> {s, t}|>];NonCommutativePolynomialQ[(x + s y)**(t w**z + 2s ^ 2 z**z), {y, z}, alg]Scope (5)
Test whether an expression is a polynomial over an algebra with symbolic property names:
alg = NonCommutativeAlgebra[<|"Multiplication" -> mult, "Addition" -> add, "Unity" -> one, "Zero" -> zero|>];NonCommutativePolynomialQ[mult[add[x, y], add[2z, 3y, 4one]], {x, y, z}, alg]NonCommutativePolynomialQ[mult[add[x, y], add[a z, 3y, 4one]], {x, y, z}, alg]Test whether an expression is a polynomial over an algebra of square matrices with Dot product:
NonCommutativePolynomialQ[a.(b + c).(2a + 3d), {a, b, c, d}, {Dot, n}]NonCommutativePolynomialQ[a.(b + c).(2a + 3d ^ 2), {a, b, c, d}, {Dot, n}]Test whether an expression is a polynomial over an algebra of linear endomorphisms with Composition:
NonCommutativePolynomialQ[Composition[f + g, g + h, h + f], {f, g, h}, Composition]NonCommutativePolynomialQ[Composition[f g, g + h, h + f], {f, g, h}, Composition]NonCommutativePolynomialQ threads over lists in the first argument:
NonCommutativePolynomialQ[{a**(x + z), (x + y)**z}, {x, y, z}]Scalar arguments to algebra operations are interpreted as scalar multiples of the multiplicative unity:
alg = NonCommutativeAlgebra[<|"ScalarVariables" -> {a, b, y}|>];NonCommutativePolynomialQ[(a x)**Sin[y] + b ^ 2 + 1, {x}, alg]Properties & Relations (2)
Use NonCommutativeVariables to find variables in a non-commutative polynomial:
NonCommutativeVariables[(x + 2y)**(3z + 5x**y)]The input expression is a non-commutative polynomial in the retuned variables:
NonCommutativePolynomialQ[(x + 2y)**(3z + 5x**y), {x, y, z}]Unlike in the commutative case, the expression is not a polynomial in proper subsets of its variables:
NonCommutativePolynomialQ[(x + 2y)**(3z + 5x**y), {x, y}]Use PolynomialQ to test for commutative polynomials:
PolynomialQ[(x + 2y) * (3z + 5x * y), {x, y, z}]In the commutative case, the expression is a polynomial in proper subsets of its variables:
PolynomialQ[(x + 2y) * (3z + 5x * y), {x, y}]Possible Issues (1)
An expression may only be a polynomial in all non-commutative variables it involves:
NonCommutativePolynomialQ[(x + 2y)**(3z + 5x**y), {x, y, z}]Unlike in the commutative case, the expression is not a polynomial in proper subsets of its variables:
NonCommutativePolynomialQ[(x + 2y)**(3z + 5x**y), {x, y}]Related Guides
History
Text
Wolfram Research (2025), NonCommutativePolynomialQ, Wolfram Language function, https://reference.wolfram.com/language/ref/NonCommutativePolynomialQ.html.
CMS
Wolfram Language. 2025. "NonCommutativePolynomialQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NonCommutativePolynomialQ.html.
APA
Wolfram Language. (2025). NonCommutativePolynomialQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NonCommutativePolynomialQ.html
BibTeX
@misc{reference.wolfram_2026_noncommutativepolynomialq, author="Wolfram Research", title="{NonCommutativePolynomialQ}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/NonCommutativePolynomialQ.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_noncommutativepolynomialq, organization={Wolfram Research}, title={NonCommutativePolynomialQ}, year={2025}, url={https://reference.wolfram.com/language/ref/NonCommutativePolynomialQ.html}, note=[Accessed: 12-June-2026]}