Let me try and do a simple non commutative expansion in NCAlgebra:
SetNonCommutative[xpt, rp, xq, s]
ExpandNonCommutativeMultiply[xpt*rp*rp*xpt*xq*xpt*rp*s*xq]
I get the surprising answer in which some of the symbols do in fact commute
s xq ** xq rp ** rp ** rp xpt ** xpt ** xpt
I can force these symbols to actually not commute by using **
:
ExpandNonCommutativeMultiply[
xpt ** rp ** rp ** xpt ** xq ** xpt ** rp ** s ** xq]
giving
xpt ** rp ** rp ** xpt ** xq ** xpt ** rp ** s ** xq
But then what did the SetNonCommutative
call even do for me? What is its function? I thought it would cause multiplication to be interpreted non-commutatively but perhaps I am missing something and everything happens via **
?
EDIT: @DanielHuber in a comment suggests, I think that my confusion here is thinking that *
is noncommutative multiplication rather than **
, whcih suggests perhaps that this question is insufficiently clearly stated. **
is AFAICT non-commutative, non-distributive multiplication even without mathematica. With NCAlgebra it become distributive, non-commutative multiplication. However the manual seems to suggest that one can also get non-commutative multiplication by defining symbols to be non-commutative, which does not work as far as I can see. so *What does SetNonCommmutative
do? Why do we have it?
*
, a single asterisk, and multiplication using an empty string. However my question only uses**
a double asterisk and*
, a single asterisk. $\endgroup$