I tested the Green's function G(r,r',k,w) against the sum-over-state expression. The diagonal element on psinc(1) and k=0 gives EXACTLY the same result as for the sum over states (I compared the imaginary parts to avoid calculating many empty states). This is great, now I need to do the off-diagonal matrix elements and the case k/=0.