This is a follow-up on / clarification of this thread.
I have the following in a notebook:
$Assumptions = A ∈ Matrices[{3,3},Reals] && B ∈ Matrices[{3,3},Reals]
TensorExpand[(A+B).(A+B)]
(* MatrixPower[A + B, 2] *)
Apparently, TensorExpand
does not expand the dot product if the two arguments of the dot product are equal. Is there any way I can expand these kinds of dot products of tensors in Mathematica, i.e. to get A.A + A.B + B.A + B.B
in the above example?
Distribute
. $\endgroup$Dot
in terms ofTensorProduct
andTensorContract
as shown here in section Properties&Relations (search for: "TensorProduct, in combination with TensorContract, can be used to implement Dot:") $\endgroup$