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.