Kpm method is applied for a finite system as mentioned in the documentation:
*hamiltonian* : FiniteSystem https://kwant-project.org/doc/1/reference/generated/kwant.system.FiniteSystem.html#kwant.system.FiniteSystem or matrix Hamiltonian
If a system is passed, it should contain no leads.
On Tue, May 14, 2019 at 6:00 AM X.F.Yan firstname.lastname@example.org wrote:
Dear Anton and other Kwant users,
Recently, I attempt to use Kwant to calculate the density of states in transport system. I successfully calculated the dos of a large closed system according to the manual. Unfortunately, I use the method to compute the dos of an open system(i.e. a system composed of a scattering region and leads):
fsyst = make_syst().finalized()
spectrum = kwant.kpm.SpectralDensity(fsyst)
energies, densities = spectrum()
But, the system generates a complexwarning :
\Anaconda3\lib\site-packages\numpy\core\numeric.py:501: ComplexWarning: Casting complex values to real discards the imaginary part
return array(a, dtype, copy=False, order=order)
Hence, there’s something wrong with the calculation. I don’t know how to solve the warning.
Please help me solve my bewilderment , Thanks!