Trace of the Operator I want to ask a question about the fundamental knowledge of trace of the an operator. The operator $A$ is $$A = v (G_r-G_a)$$
where v is the velocity operator of the Hamiltonian ($v=dH/dk$); $G_r$ and $G_a$ are retarded and advanced green functions
 $$G_r=\frac{1}{E_f-H+i \gamma},\;\; G_a=\frac{1}{E_f-H-i \gamma}$$
$E_f$ is the Fermi energy of the system, $H$ is the Hamiltonian matrix, $i$ is the complex number $(0.0, 1.0)$ and $\gamma$ is a real number. I want to calculate the trace of operator A and I have the following equation
$$\rm{Tr}(A)=\sum_i \langle i|v(G_r-G_a)|i\rangle=
\sum_{i,i} \langle i|v|j\rangle \langle j|(G_r-G_a)|i\rangle =\;\;\sum_{i,j}\langle i|v|j\rangle \langle j|(G_{r_i}-G_{a_i})|i\rangle$$ where, $G_{r_i}=\frac{1}{E_f-e_i+i\gamma}$ and $G_a=\frac{1}{E_f-e_i-i\gamma}$. In other words, the Hamiltonian matrix in $G_r$ and $G_a$ is converted into eigenvalue.
I want to ask whether $|i\rangle$ and $j\rangle$ must be the eigenvectors of the operator $A$? Can $|i\rangle$ and $|j\rangle$ be the eigenvectors of $H$ matrix; not of the $A$ operator? 
My second question is that suppose $A$ is a 2 by 2 matrix and the eigen vector matrix $|i\rangle$ or $|j\rangle$ of $H$ is 2 by 1 matrix. In order to compute $$\sum_{i,j}\langle i|v|j\rangle \langle j|(G_{r_i}-G_{a_i})|i\rangle$$, I should use the following combination.
$$\sum_{i,j}\langle i|v|j\rangle \langle j|(G_{r_i}-G_{a_i})|i\rangle=\langle 1|v|1\rangle \langle 1|(G_{r_i}-G_{a_i})|1\rangle+\langle 1|v|2\rangle \langle 2|(G_{r_i}-G_{a_i})|1\rangle+\langle 2|v|1\rangle \langle 1|(G_{r_i}-G_{a_i})|2\rangle+\langle 2|v|2\rangle \langle 2|(G_{r_i}-G_{a_i})|2\rangle$$
Is my understanding correct or not? Thank you very much.
 A: In order for your formula to be valid, the states $|i\rangle$ must be eigenvectors of $H$ with the energy $e_i$. Otherwise you will not get $$\langle j | G_r | i \rangle = \langle j| \frac{1}{E_f-e_i+i\gamma} |i\rangle$$
as what you did was explicitly act with $H$ on the state to the right. While $|j\rangle$ might be any basis of states whatsoever, it will be convenient to also be the eigenstates of the Hamiltonian, as this will render the double-sum over $i$ and $j$ a single sum, since for such states 
$$\langle j | G_r | i \rangle = \langle j| \frac{1}{E_f-e_i+i\gamma} |i\rangle = \delta_{i,j} \frac{1}{E_f-e_i+i\gamma}$$
A: The trace of any matrix/operator will be same regardless of what basis you use, provided they are complete.
So it doesn't matter whether you choose eigenvectors of $A$ or $H$, but you must be consistent and use the complete basis.
If you decide to use the eigenbasis of $A$, then you can't simply substitute the scalar energy $E_i$ for $H$, you must keep $H$ an operator. The only exception is if you have a simultaneously diagonalizable basis for $A$ and $H$, which rarely happens.
