# Symbolic multiplication of tensors

I am trying to do symbolic calculations on Pauli Matrix Algebra. I want to find some way of making CircleTimes[a,b] ** CircleTimes[c,d] map to CircleTimes[a.c,b.d] for every a,b,c,d. I would also like to be able to impose polynomial relationships, such as a.a=$${1}$$

Many Thanks

This does what you have asked for:

Unprotect[NonCommutativeMultiply];

(a_ \[CircleTimes] b_) ** (c_ \[CircleTimes] d_) :=  a.c \[CircleTimes] b.d

Protect[NonCommutativeMultiply];


You can also Unprotect[Dot] to define a_ . a_ = 1 (keeping in mind that this will break its normal usage). However, Clifford algebra only has one non-commutative multiplication operator (I use \[CircleTimes], but ** is probably just as good). But your code has 3, including Dot.

Your question about how to do this is useful to others, even if it turns out to be not to be quite what you want :)

If this is for fun, go for it. But there exist Clifford algebra packages (and similar) that already do this and more.