Why can $\mathrm{Tr}(A B)$ be expressed with this double sum?

67 Views Asked by At

In a textbook I'm reading, the author uses the relation $\mathrm{Tr}(A B) = \sum\limits_{i j}A_{ij} B_{ji}$ without further explanation. How can this be the same as the usual definition, $\mathrm{Tr}(A B) = \sum\limits_{i}(A B)_{ii}$? It seems like the author's definition would include additional off-diagonal elements from the matrices.


(It is assumed that $A$ and $B$ are both $N$x$N$ matrices and the sums go from 1 to $N$.)

3

There are 3 best solutions below

0
On BEST ANSWER

How are the diagonal entries of $AB $ calculated? $(AB)_{ii}=\sum_j A_{ij}B_{ji} $.

0
On

It's because, for each $i\in\{1,2,\ldots,n\}$,$$(AB)_{ii}=\sum_{j=1}^nA_{ij}B_{ji}.$$

0
On

Here is another way of looking at it. Fix $B$. Then $L_1(A) = \operatorname{tr} (AB)$ and $L_2(A) = \sum_i [AB]_{ii}$ are linear, so to check that the equations result in the same value we just need to show equality on a basis. $E_{ij} = e_i e_j^T$ is suitable here.

A quick computation shows that $L_1(E_{ij}) = A_{ji}$ and $L_2(E_{ij}) = A_{ij}$. Hence they are equal.