matrix notation used when computing trace

1.2k Views Asked by At

A linear algebra text I'm reading defines Matrix multiplication as $(AB)_{ij}=\sum_{k=1}^nA_{ik}B_{ki}$

Later on in the text they define the trace formula as $tr(AB)=\sum_{i}^n(AB)_{ii}$

What confuses me is that is that since the first formula simply describes a matrix, then based on their notation, doesn't the second describe the sum of all elements? I don't see how it says anything specific about the diagonal. What I get from $(AB)_{ii}$ is that $AB$ is a square matrix, which makes sense since we want the trace. but I still don't see how the second summation formula describes summing the diagonals.

2

There are 2 best solutions below

1
On BEST ANSWER

By definition

$tr(AB)=\sum_{i}^n(AB)_{ii}$ = sum of all elements along the diagonal

infact $(AB)_{ii}$ indicates the element on row i and column i $\equiv $ the i-th element on the diagonal

7
On

Note that $(A)_{ij}$ is the number which is in row $i$ column $j$. Thus $(AB)_{ij}$ as you write above is not the whole matrix, but rather $AB$ is the matrix such that on position $(i,j)$ we have the number $(AB)_{ij}$.

When defining the trace as the sum $\sum _{i}^n (AB)_{ii}$ we only use the fact that $(AB)_{ii}$ is a number, and sum together all these numbers. This will clearly be a new number, and without putting it into a matrix (as we did implicitly for matrix multiplication) it will just be a number, which we here call the trace. The diagonal of a matrix is defined as the umbers who is on the same row as column, i.e. the numbers on position $(AB)_{ii}$.