It always strikes me as odd, that Mathematica seems to have a hard time with non-communative multiplications.

I can use the horrible TensorExpand (or more performant Distribute) to get

In: a.(b.c+c.b) // TensorExpand  
Out: a.b.c+a.c.b

How can I do the reverse?

In: a.b.c+a.c.b // TensorFactorise
Out: a.(b.c+c.b)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.