Is the non-commutative product in NCAlgebra also not distributive? From the documentation it seems it should be. But here is an expression, that it does not seem to be able to simplify:
SetNonCommutative[A, B];
SetCommutingOperators[C1];
Commutator[x_, y_] = x ** y - y ** x;
SetCommutators = {Commutator[A, B] :> 1};
G1 = Commutator[A, B + C1];
NCReplaceAll[G1, SetCommutators]
(* A ** (B + C1) - (B + C1) ** A *)
However this should be simplified to 1, since the commutator $[A,B]=1$ and $[A,C1]=[B,C1]=0$.
On the other hand the bare commutator can be simplified correctly:
SetNonCommutative[A, B];
SetCommutingOperators[C1];
Commutator[x_, y_] = x ** y - y ** x;
SetCommutators = {Commutator[A, B] :> 1};
G1 = Commutator[A, B];
NCReplaceAll[G1, SetCommutators]
(* 1 *)
The behaviour in the first case is also obtained with a number instead of C1:
SetNonCommutative[A, B];
SetCommutingOperators[C1];
Commutator[x_, y_] = x ** y - y ** x;
SetCommutators = {Commutator[A, B] :> 1};
G1 = Commutator[A, B + 1];
NCReplaceAll[G1, SetCommutators]
(* A ** (1 + B) - (1 + B) ** A *)
So either the operation **
is not distributive or I am really confused why NCAlgebra can not simplify this expression. Maybe I am doing something wrong?
Formulated as a simple question: how can I get NCAlgebra to simplify the expression in the first code snippet to 1?
Distribute
on**
or add anUpValue
toNonCommutativeMultiply
$\endgroup$