Trace in Terms of Orthonormal Basis

Theorem
Let $\mathbb K\subset\C$ be a field.

Let $(V,\langle\cdot\rangle)$ be an inner product space over $\mathbb K$ of dimension $n$.

Let $(e_1,\ldots, e_n)$ be an orthonormal basis of $V$.

Let $f:V\to V$ be a linear operator.

Then its trace equals:
 * $\operatorname{tr}(f) = \displaystyle \sum_{i\mathop =1}^n\langle f(e_i), e_i\rangle$

Also see

 * Trace in Terms of Dual Basis