NonCommutativeCollect[expr,x,alg]
collects together terms involving the same powers of objects matching x over the noncommutative algebra alg.
NonCommutativeCollect[expr,{x1,x2,…},alg]
successively collects together terms that involve the same powers of objects matching x1 then x2, ….
NonCommutativeCollect[expr,{{x1,s1},{x2,s2},…},alg]
successively collects together terms that involve the same powers of objects matching xi on the side indicated by si, where si is Left, Right or All.


NonCommutativeCollect
NonCommutativeCollect[expr,x,alg]
collects together terms involving the same powers of objects matching x over the noncommutative algebra alg.
NonCommutativeCollect[expr,{x1,x2,…},alg]
successively collects together terms that involve the same powers of objects matching x1 then x2, ….
NonCommutativeCollect[expr,{{x1,s1},{x2,s2},…},alg]
successively collects together terms that involve the same powers of objects matching xi on the side indicated by si, where si is Left, Right or All.
Details

- NonCommutativeCollect is typically used to collect terms in a non-commutative polynomial.
- When collecting with respect to xi on both sides, first terms that involve the same powers of xi on the right are collected, and then terms that involve the same powers of xi on the left are collected. In other words, specifications {…,xi,…}, {…,{xi,All},…} and {…,{xi,Right},{xi,Left},…} are equivalent.
- alg can be a NonCommutativeAlgebra object, {Dot,n}, Composition, TensorProduct or NonCommutativeMultiply. If the algebra argument is omitted, NonCommutativeAlgebra with the default property values is used.
- NonCommutativeCollect automatically threads over lists in expr.
Examples
open all close allBasic Examples (2)
Scope (4)
Collect over the algebra of square matrices with Dot product:
Collect over the algebra of linear endomorphisms with Composition:
Collecting with respect to different variable specifications may yield different results:
NonCommutativeCollect is listable with respect to the first argument:
Properties & Relations (2)
NonCommutativeCollect collects terms in noncommutative polynomials:
Collect collects terms in commutative polynomials:
NonCommutativeExpand is effectively the inverse of NonCommutativeCollect:
Related Guides
History
Text
Wolfram Research (2025), NonCommutativeCollect, Wolfram Language function, https://reference.wolfram.com/language/ref/NonCommutativeCollect.html.
CMS
Wolfram Language. 2025. "NonCommutativeCollect." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NonCommutativeCollect.html.
APA
Wolfram Language. (2025). NonCommutativeCollect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NonCommutativeCollect.html
BibTeX
@misc{reference.wolfram_2025_noncommutativecollect, author="Wolfram Research", title="{NonCommutativeCollect}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/NonCommutativeCollect.html}", note=[Accessed: 04-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_noncommutativecollect, organization={Wolfram Research}, title={NonCommutativeCollect}, year={2025}, url={https://reference.wolfram.com/language/ref/NonCommutativeCollect.html}, note=[Accessed: 04-August-2025]}