NonCommutativeVariables[poly,alg]
gives a list of all noncommutative variables in a polynomial poly over an algebra alg.
NonCommutativeVariables
NonCommutativeVariables[poly,alg]
gives a list of all noncommutative variables in a polynomial poly over an algebra alg.
Details
- NonCommutativeVariables gives a list of variables in a polynomial over a non-commutative algebra.
- The returned list does not include commutative or 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.
- NonCommutativeVariables goes inside lists in the first argument.
Examples
open all close allBasic Examples (2)
Find non-commutative variables in a polynomial:
NonCommutativeVariables[(x + 2y)**(3w**z + 4z**z)]The returned list does not include commutative or scalar variables of the algebra:
alg = NonCommutativeAlgebra[<|"CommutativeVariables" -> {x, w}, "ScalarVariables" -> {s, t}|>];NonCommutativeVariables[(x + s y)**(t w**z + 2s ^ 2 z**z), alg]Scope (5)
Variables of a polynomial over an algebra with symbolic property names:
alg = NonCommutativeAlgebra[<|"Multiplication" -> mult, "Addition" -> add, "Unity" -> one, "Zero" -> zero|>];NonCommutativeVariables[mult[add[x, y], add[2z, 3y], add[4y, 5one]], alg]Variables of a polynomial over an algebra of square matrices with Dot product:
NonCommutativeVariables[a.(b + c).(2a + 3d), {Dot, n}]Variables of a polynomial over an algebra of linear endomorphisms with Composition:
NonCommutativeVariables[Composition[f + g, g + h, h + f], Composition]NonCommutativeVariables goes inside lists in the first argument:
NonCommutativeVariables[{a**(b + c), (x + y)**z}]Variables are any expressions found inside algebra operations that are not specified to be scalars:
NonCommutativeVariables[(a x)**Sin[y] + b ^ 2]Scalar arguments to algebra operations are interpreted as scalar multiples of the multiplicative unity:
alg = NonCommutativeAlgebra[<|"ScalarVariables" -> {a, b, y}|>];NonCommutativeVariables[(a x)**Sin[y] + b ^ 2, alg]Properties & Relations (2)
Find variables in a non-commutative polynomial:
NonCommutativeVariables[(x + 2y)**(3z + 5x**y)]The input expression is a non-commutative polynomial in the returned 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 Variables to find variables in commutative polynomials:
Variables[(x + 2y) * (3z + 5x * y)]Related Guides
History
Text
Wolfram Research (2025), NonCommutativeVariables, Wolfram Language function, https://reference.wolfram.com/language/ref/NonCommutativeVariables.html.
CMS
Wolfram Language. 2025. "NonCommutativeVariables." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NonCommutativeVariables.html.
APA
Wolfram Language. (2025). NonCommutativeVariables. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NonCommutativeVariables.html
BibTeX
@misc{reference.wolfram_2026_noncommutativevariables, author="Wolfram Research", title="{NonCommutativeVariables}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/NonCommutativeVariables.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_noncommutativevariables, organization={Wolfram Research}, title={NonCommutativeVariables}, year={2025}, url={https://reference.wolfram.com/language/ref/NonCommutativeVariables.html}, note=[Accessed: 13-June-2026]}