I would like to apply a linear transformation to a tensor. My linear transformation is encoded by a matrix, for example
M = Table[m[i, j], {i, 4}, {j, 4}]
Take some vectors
V = Table[v[i], {i, 4}]
W = Table[w[i], {i, 4}]
I apply the linear transformation to vectors with the dot operator
M . V
M . W
Now I would like to apply the same linear transformation to tensors, in a compatible ways. For a tensor of order two, the linear transformation is encoded by the tensor product matrix
TensorProduct[M,M]
But how do I apply it to a tensor? The dot operator doesn't give the right result. For example, imagine I want to apply my linear transformation to the following tensor
TensorProduct[V,W]
I would like to have that
TensorProduct[M,M] . TensorProduct[V,W] === TensorProduct[M . V, M . W]
But this is False. The dot operator is not the correct way. What is the right way? I would like to apply this linear transformation also to other tensors, not just tensors of the form TensorProduct[V,W]
Moreover, I would like to apply the linear transformation also to tensors of higher order, not just tensors of order 2.
Thank you for any help!