This is a rather simple question that I cannot quite figure out how to do. Basically, I have the result of some matrix multiplication in which my resultant matrix has a mixture of commutative and non-commutative symbols.
Is there a way to factor out the commutative symbols automatically? For example, one line in my matrix has non-commuting symbols e
and g
, and a constant $\Omega_1$ that commutes with everything.
I have used the following rules
SetCommutative[\[CapitalOmega]1, \[CapitalOmega]2, \[CapitalDelta]1, \[CapitalDelta]2]
SetNonCommutative[g, e, r]
DisplayRule = NonCommutativeMultiply[a__] :> Infix[NonCommutativeMultiply[a],"\InvisibleTimes]\[InvisibleTimes]"]
Which has allowed me to get NCAlgebra to output the following
$\Omega_1$ (e g) - $\Omega_1$ (g e)
and I would like it to factor to
$\Omega_1$ (e g - g e)
Is it possible to add another rule to get this sort of factorization I would like?