Hi Zhan,

SpectralDensity indeed doesn't support translationally invariant
systems. You have two options instead. If you want to obtain the DOS
at a specific energy, you should use the output of
syst.modes—specifically the wave functions of the propagating modes.
If you need the DOS of the full spectrum, you should diagonalize the
Hamitlonian and perform a summation over all momenta on your own.

Best,
Anton

On Sat, 21 Dec 2019 at 13:51, Cao Zhan <caoz...@baqis.ac.cn> wrote:
>
> Dear Kwant users,
>
> In Kwant manual there is a section entitled "Calculating spectral density 
> with the kernel polynomial method". I find that examples in this section are 
> all talking about finite-size systems. I wonder whether Kwant can calculate 
> density of states of a quasi one-dimensional system that is finite along 
> y-direction but is translationally invariant along x-direction. For a minimal 
> test, I have run the following codes but errors occurred.
> #--------------------------------------------------------------------------------------
> import kwant
> import numpy
>
> a=1
> W=30
> t=1
> lat = kwant.lattice.square(a)
> syst = kwant.Builder(kwant.TranslationalSymmetry((-a, 0)))
> syst[(lat(0, j) for j in range(W))] = 4 * t
> syst[lat.neighbors()] = -t
> fsyst = syst.finalized()
> energies = numpy.linspace(-0.1,0.1, 10)
>
> spectrum = kwant.kpm.SpectralDensity(fsyst)
> spectrum.add_moments(10)
> spectrum.add_vectors(5)
> densities = spectrum(energies)
> #--------------------------------------------------------------------------------------
> What's wrong in above codes? Currently, are we able to employ Kwant to 
> calculate density of states of 3D systems being translationally invariant 
> along one or two directions?
>
> Regards,
> Zhan
>
>
>
>
>
>
>
>
>
>

Reply via email to