We need a symbolic algebra system that can handle two multiplication operations. One possibility is to use Sympy's TensorProduct.