Hi Alex, all,
Firstly, if you have the resulting density of states and you want it to look smoother: convolve it with a Lorentzian :) The result is the same, and you aren't losing on efficiency as far as I know.
For a reference I'll also comment along the lines of the prior discussion.
I am not sure whether computing LDOS in this above way makes much physical sense, but it should be possible.
At complex energies one would need to compute the imaginary part of the Green's function diagonal directly (the summation over modes only matches the Im G_ii with a Hermitian Hamiltonian at real energies). To do so efficiently one would need to do two things:
1. Take the linear system for solving the problem (kwant's solvers expose this via solver._make_linear_sys I believe). 2. Feed that matrix to a sparse linear algebra library capable of computing selected elements of the inverse of a sparse matrix.
MUMPS library (wrapped by Kwant) supports computing diagonal of an inverse, although it would probably take longer computation time than solving the original linear system and we didn't benchmark it.
Let me know if you want to go further down that path.