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?