For 1D systems, the bulk DOS script is a bit of an overkill (plus it doesn't work
). You can just use a simple histogram approach instead.
I have attached a script that computes the 1D DOS. It requires a few parameters, like how many k-points to use for the band structure, how many energy points to sample in the histogram, etc.
There is also an option to compute a Gaussian or Lorentzian broadened DOS, which sometimes gives nicer pictures.
I hope it's relatively self-explanatory, but here is a concrete example, which assumes that I have a converged carbon nanotube (4,4) checkpoint file called
cnt44.nc. (By the way, the DOS script assumes the systems is 1D in the Z direction; it's trivial to modify for other directions, however.)
from ATK.KohnSham import *
import dos1d
# =====================================================
scf_filename = 'cnt44.nc'
num_k_points = 200 # Number of k-points from 0 to pi/a along z
num_E_points = 100 # Number of energy points in the histogram
Emin = -10*eV # Energy interval
Emax = 10*eV # Can also be None, for automatic interval
broadening = 0.025*eV # Energy broadening
# =====================================================
scf = restoreSelfConsistentCalculation(scf_filename)
kpoints,bandstructure = dos1d.calculate_bandstructure(scf,num_k_points)
DOS,energies = dos1d.calculateDOS1D(bandstructure,num_E_points,Emin,Emax)
# Or, compute the corresponding broadened DOS
#DOS_bG = dos1d.DOS1DGaussianBroadening(DOS,energies,broadening)
#DOS_bL = dos1d.DOS1DLorentzianBroadening(DOS,energies,broadening)
dos1d.plot_DOS(DOS,energies,'dos.png')
I have also attached a picture of the computed DOS for my nanotube!
Have fun with it! One probably needs to play around with the k-point sampling and number of energy points, and the broadening, to get really nice pictures. 100 energy-points was fine for the nanotube, 1000 too many (you get noise), although I didn't try if more broadening would remove it...