The trace formula of a linear map $T: V \to V$, $\operatorname{tr}(T) = \sum_k (Te_k,e_k)$ Can someone explain how this formula came about?
I tried doing an example on a 2x2 matrix to recover the usual trace, but I am not getting anywhere.
How does $\sum_k (Te_k,e_k) = \sum_i T_{ii}$ where $T: V \to V$ is a linear map and $T_{ij}s$ are the matrix representation of the linear map $T$ and $(e_k)$ are an orthonormal basis.
I learned trace in the matrix language, but I don't get the abstract definition for linear maps.
 A: If you express $T$ as a matrix with respect to the basis $e_k$, then $\sum_k(Te_k,e_k)=\sum_kT_{kk}$ by definition of the matrix of the operator.
The nice thing is that
$$
\sum_k(TSe_k,e_k)=\sum_k\Big(T\Big(\sum_j(Se_k,e_j)\,e_j\Big),e_k\Big)
=\sum_k\sum_j(Se_k,e_j)(Te_j,e_k)=\sum_k(STe_k,e_k),
$$
where the last equality is obtained by exchanging the sums. This means that $$\operatorname{tr}(ST)=\operatorname{tr}(TS)$$ for all $S,T$. In particular,
$$
\operatorname{tr}(STS^{-1})=\operatorname{tr}(T),
$$
which you can use to show that the trace does not depend on the choice of the basis. So you get that
$$
\operatorname{tr}(T)=\sum_{k}T_{kk}
$$
for $T$ expressed as a matrix in any basis. This can also be used to show that $$\operatorname{tr}(T)=\sum_k\lambda_k,$$ where $\lambda_1,\ldots,\lambda_n$ are the eigenvalues of $T$.
A: In your notation, $$Te_k = \sum_i T_{ik}e_i.$$ Using the bilinearity of the inner product and the fact that the $e_i$ are orthonormal, we see that
\begin{align*}
(Te_k, e_k) = \Big(\sum_i T_{ik}e_i, e_k\Big) = \sum_i T_{ik}(e_i, e_k) = T_{kk}.
\end{align*}
Now summing over $k$ gives your result.
