I want to compute a partial trace using formula
$\rho_A=\sum\langle B|\rho_{AB}|B\rangle$ .
Example,
$\rho_{AB}= $$ \begin{pmatrix} a & b & c & d\\ e & f & g & h\\ i & j & k & l\\ m & n & o & p \end{pmatrix} $
I try to evaluate
MatrixForm[
Sum[
TensorProduct[{{a, b, c, d}, {e, f, g, h}, {i, j, k, l}, {m, n, o, p}}, (q*r)],
{1, 2}]]
but Mathematica returns the expression unevaluated.
The output is wrong. I am not sure whether the operator should be TensorProduct or Cross.
I expected to get
$\rho_{A}= $$ \begin{pmatrix} a +f & c+h\\ i+n & k+p\\ \end{pmatrix} $
Sumis ill-formed. – m_goldberg Jun 23 '16 at 13:46