Why this definition of the trace? It is common in quantum mechanics textbooks (e.g. Ballentine page 15) to define the trace of an operator as the sum of its diagonal elements in an orthonormal basis in particular. Why is this definition given when the trace of an operator can be shown to equal the sum of its diagonal elements in any basis? This definition is sufficiently common (it appears in Shankar, Sakurai, Nielsen and Chuang, etc.) that its always made me wonder. Is it perhaps because the aforementioned definition translates to infinite-dimensional spaces better?
I tried to follow this answer but don't understand it in light of what I know from linear algebra -- that the trace of an operator equals the trace of its matrix in any basis representation.
Edit: I think I may see the issue with my reasoning. The definition given in physics textbooks is, for an orthonormal basis $|\phi_n\rangle$,
$$\textrm{Tr}(A) := \sum_n \langle \phi_n | A |\phi_n\rangle $$
which equals the sum of the diagonal matrix elements in that basis. On the other hand, if $|\psi_n\rangle$ in not orthonormal, then while
$$\textrm{Tr}(A) := \sum_n A_{nn}$$
is true in that basis, $A_{nn} \neq \langle \psi_n | A |\psi_n\rangle$ in general (because the $A_{nn}$, which are expansion coefficients in the given basis of particular transformed vectors, are only guaranteed to equal the inner product $(|\psi_n \rangle, A |\psi_n\rangle$) in an orthonormal basis. Is this correct?
 A: The problem here is really the usage of the adjoint $\langle \psi\rvert$ instead of a dual basis.
The matrix representation of a linear operator $T : V\to V$ in terms of any basis $b_i\in V$ is $T=\sum_{i,j} T_{ij} b_i\otimes b_j^\ast$ where $b_i\otimes b_j^\ast$ is a basis of $V\otimes V^\ast$, $V^\ast$ is the dual space and the dual basis $b_i^\ast$ is defined by $b_i^\ast(b_j) = \delta_{ij}$. The $T_{ij}$ are the matrix components of $T$ in the basis $b_i$ and the trace $\sum_i T_{ii}$ is an invariant for any basis.
Now, when $V$ is an inner product space with inner product $\langle -,-\rangle$ - such as the Hilbert spaces of quantum mechanics - then there is a general way to associate a dual vector with a vector $v$, namely the conjugate/adjoint $v^\dagger : V\to \mathbb{C}, w\mapsto \langle v,w\rangle$, and clearly $v^\dagger\in V^\ast$ since this is a linear map on $V$. When physicists write $\langle \psi\rvert$, they mean this adjoint to a vector $\lvert \psi\rangle$.
Given a basis $b_i$ of this inner product space, you can expand the operator $T$ also as $T = \sum_{ij}T'_{ij}b_i \otimes b_j^\dagger$. These $T'_{ij}$ are not in general the matrix components of $T$, but this is what $\langle b_j\vert T\vert b_i\rangle$ means in Dirac notation.
Finally, note that when $b_i$ is orthonormal, then $b_j^\dagger(b_i) = \delta_{ij}$ (this is, after all, the definition of orthonormality!), i.e. the dual and the adjoint basis coincide, and so $T'_{ij} = T_{ij}$, i.e. $\langle b_i\vert T\vert b_j\rangle$ really are what we usually call the matrix elements in linear algebra.
So when you want to define the trace via the "adjoint components" you need to restrict $b_i$ to be an orthonormal basis.
A: Let's take a random basis $\mathscr{B} = \{|\phi_n\rangle\}_n$, which is not necessarily orthonormal. In this basis, the operator $A$ can be written as $A = \displaystyle\sum_{n,m}A_{nm}|\phi_n\rangle\langle \phi_m|$. In consequence, we have :
$$
\begin{array}{rclll}
\displaystyle\sum_k\langle \phi_k|A|\phi_k\rangle 
   &=& \displaystyle
   \sum_{k,n,m}A_{nm}\langle \phi_k|\phi_n\rangle\langle \phi_m|\phi_k\rangle \\
   &=& \displaystyle
   \sum_kA_{kk}\langle \phi_k|\phi_k\rangle^2 \quad\mathrm{only\,if\,} \{|\phi_k\rangle\}_k \mathrm{\,are\,orthogonal} \\
   &=& \displaystyle
   \sum_kA_{kk}\color{white}{\langle \phi_k|\phi_k\rangle^2} \quad\mathrm{only\,if\,} \{|\phi_k\rangle\}_k \mathrm{\,are\,normalized} \\
   &=& \displaystyle
   \mathrm{Tr}(A) \quad .
\end{array}
$$
In other words, the definition $\mathrm{Tr}(A) = \sum_k\langle \phi_k|A|\phi_k\rangle $ is true when the components $A_{kk}$ can be isolated by the scalar product, which necessitates the relation $\langle\phi_n|\phi_m\rangle = \delta_{nm}$, that is orthonormality.

Addendum.
The quantities $A_{nm}$ are not the (matrix) components of $A$ in the basis $\{|\phi_n\rangle\}_n$, but only a "representation" with respect to the "projectors" $|\phi_n\rangle\langle\phi_m|$, because the a non-orthonormal basis doesn't admit a closure/completeness relation and that's why such bases fail to generate a trace formula through scalar product (hence the "mess" in the first line).
The coefficients $A_{nm}$ would be related to the true components $a_{\mu\nu}$ of $A$ with respect to an orthonormal basis $\{|e_\mu\rangle\}_n$, such that $|\phi_n\rangle = \displaystyle\sum_\mu c_{n\mu}|e_\mu\rangle$, by
$$
A = \sum_{n,m}A_{nm}|\phi_n\rangle\langle \phi_m| = \sum_{n,m}\sum_{\mu,\nu}A_{nm}c_{n\mu}c_{m\nu}^*|e_\mu\rangle\langle e_\nu| = \sum_{\mu,\nu}a_{\mu\nu}|e_\mu\rangle\langle e_\nu|
$$
with $a_{\mu\nu} := \displaystyle\sum_{n,m}A_{nm}c_{n\mu}c_{m\nu}^*$.
