Commutator[x, y] = c defines the commutator between the
(non-commuting) objects x and y.
Overview, AntiCommutator, CommutatorExplicit, DeclareNonCommutative, DotSimplify.
DeclareNonCommutative[a, b, c, d]Commutator[a, b]
CommutatorExplicit[%][a,b]
a.b-b.a
DotSimplify[Commutator[a + b, c + d]]
UnDeclareNonCommutative[a, b, c, d]a.c-c.a+a.d-d.a+b.c-c.b+b.d-d.b
Verify the Jacobi identity.
\[Chi] = Commutator; DeclareNonCommutative[x, y, z];\[Chi][x, \[Chi][y, z]] + \[Chi][y, \[Chi][z, x]] + \[Chi][z, \[Chi][x, y]]
DotSimplify[%][x,[y,z]]+[y,[z,x]]+[z,[x,y]]
0
Clear[\[Chi]]
UnDeclareNonCommutative[x, y, z]