If the diagonal of a positive operator is compact, is the operator itself compact?

Nope. For each $n$ let $T_n$ be the $n\times n$ matrix all of whose entries are $\frac{1}{n}$. This is a rank $1$ projection. So $T = \bigoplus T_n$ is a projection with infinite dimensional range, and hence is not compact. But its diagonal entries go to zero as $n \to \infty$, which means that $D_T$ is compact.


If T also is sparse, i.e. for some number N then for each i <Te_i, e_j> is non-zero for at most N values of j’s, (and for each j it is non-zero for at most N values of i’s) then the claim is true.

I have a proof, but I guess this is well known. My own literature search has been unsuccessful, so anyone having a reference will make me happy.