DOS and LDOS using Quantica

Hello @pablosanjose , looking through the Quantica documentation, I could only see how to find the LDOS at a fixed energy at all sites in the lattice.

Is there a way to get the LDOS at a fixed position for a range of energies?

And is there a way to calculate the total DOS of the lattice for different energies?


Hello Alex,

yes, you need to pass a GreenSlice to ldos, like this:

First build your Hamiltonian and GreenFunction. I’ll use the one in the ldos documentation

h = LP.square() |> onsite(4) - hopping(1) |> supercell(region = r -> norm(r) < 40*(1+0.2*cos(5*atan(r[2],r[1]))));

g = h|> greenfunction;

Then you select the sites you want (see siteselector), creating a GreenSlice

julia> gs = g[region = r->norm(r) < 2]
GreenSlice{Float64,2,0}: Green function at arbitrary energy, but at a fixed lattice positions

Then you pass that to ldos

julia> ρ = ldos(gs)
LocalSpectralDensitySlice{Float64} : local density of states at a fixed location and arbitrary energy
  kernel   : LinearAlgebra.UniformScaling{Bool}(true)

Finally, you choose your energies

julia> ρ(0.2)
9-element Vector{Float64}:

One value for each orbital (unless you use kernel, see the ldos docstring).

In the near future (very soon), you will be able to use siteselectors also on this result.

If your GreenSolver allows for cheap evaluation of different energies (like GS.KPM) the latter should be fast. Here, we have used the default GS.SparseLU, which needs to do an ldiv! for each energy, but it is exact.