Mathematica 10 recognizes the bilinearity of the trace and the Kronecker product, as well as Tr$\otimes$Tr$(A\otimes B)=$Tr($A$)Tr($B$). But I have issues trying to implement this in symbolic calculations:
- Kronecker Product:
As an example, consider
$$ [(A^3- 2 t A^2) \otimes 1_n ]\cdot[(A+3t 1_n)\otimes 4 t A^2] \qquad t\in \mathbb C, A \, n\times n\, \text{matrix}$$
The code should be consistent with distributing, e.g. the first round parenthesis, but it seems it is not. For
$Assumptions = (t) ∈ Complexes && (A) ∈
Matrices[{n, n}];
Id = IdentityMatrix[n];
(* I evaluate an expression implying KroneckerProduct, and extract the cubic coefficient *)
(KroneckerProduct[A.A.A, Id] +
KroneckerProduct[-2 t A.A, Id]).KroneckerProduct[A + 3 t Id, 4 t A.A] // TensorExpand;
Coefficient[%, t^3]
the result of this is 0.
However, if I do not distribute, the result of
KroneckerProduct[A.A.A - 2 t A.A, Id].KroneckerProduct[A + 3 t Id,
4 t A.A] // TensorExpand
Coefficient[%, t^3]
is
-24 KroneckerProduct[MatrixPower[A, 2], MatrixPower[A, 2]]
Trace: The trace (Tr $\otimes$ Tr) of the Kronecker Product is the product of the traces. A second issue is that Tr $\otimes$ Tr$[(1_n\otimes t A^2 -t A^2\otimes 1_n) (1_n \otimes 1_n)]$ should vanish. But I cannot see Mathematica knows it:
Tr[(KroneckerProduct[Id, t A.A] - KroneckerProduct[t A.A, Id]).(KroneckerProduct[Id, Id])//TensorExpand] === 0
yields False
, under the same hypothesis as above.
Tr[KroneckerProduct[A, B]]
where one of A and B has a rank higher than 2. What about tensor contractions of the first and third, if the KroneckerProduct has a rank higher than 2? $\endgroup$