The tensor product satisfies far commutativity:
$(f \circ g) \otimes (h \circ k) =(f \otimes h) \circ (g \otimes k)$.
I have some replacement rules I'd like to apply to an expression containing tensor products and compositions. For example, whenever $(a \otimes b) \circ (c \otimes d)$ appears, I might like to replace it with $l$. The problem is that applying far commutativity in an a prespecified way (for example,
lhs -> rhs) cannot guarantee that $(a \otimes b) \circ (c \otimes d)$ appears as a subexpression of the result, even if it is implicitly present.
I therefore need to search the space of far-commutativity-transformed expressions and apply certain replacement rules when I can. I know that the space of expressions far-commutativity-equivalent to a given one is finite, after all possible replacements are performed the process terminates, and the result does not depend on the order of the replacements.
This seems like the sort of term-rewriting problem for which Mathematica might have an automatic capability. Is there a short, readable, and relatively efficient way to do it?