DensityOfStates¶

class DensityOfStates(configuration, kpoints=None, energy_zero_parameter=None, bands_above_fermi_level=None, save_partial=None, enable_symmetry=None, processes_per_kpoint=None)

Class for calculating the density of states for a configuration.

Parameters: configuration (BulkConfiguration | MoleculeConfiguration) – The configuration with an attached calculator for which to calculate the density of states. kpoints – The k-points for which to calculate the density of states. Default: MonkhorstPackGrid(nx,ny,nz), where nx, ny, nz is the sampling used for the self-consistent calculation. energy_zero_parameter (FermiLevel | AbsoluteEnergy) – Specifies the choice for the energy zero. Default: FermiLevel bands_above_fermi_level (int | All) – The number of bands above the Fermi level per principal spin channel. Must be a non-negative integer. Default: All (All bands are included), except for calculators of type PlaneWaveCalculator; in this case the default is equal to the number of bands above the Fermi level set by the calculator. save_partial (bool) – Save the partial contributions to the density of states. The PlaneWaveCalculator does not support calculation of partial contributions. Default: False for PlaneWaveCalculator True otherwise enable_symmetry (bool) – Enable or disable the use of symmetry Default: True processes_per_kpoint (int | None) – The number of processes to use per kpoint. If None the same number of processes per k-point as used in the SCF calculation will be used. The parameter is only used by the PlaneWaveCalculator. Default: None
elements()

Query method for the elements in the configuration used for calculating the density of states.

Returns: A list of the elements. list of PeriodicTableElement
energies()
Returns: The energies used for generating the last spectrum. PhysicalQuantity of type energy.
energyMax()
Returns: The maximum energy eigenvalue. PhysicalQuantity of type energy.
energyMin()
Returns: The minimum energy eigenvalue. PhysicalQuantity of type energy.
energyZero()
Returns: The energy zero. PhysicalQuantity of type energy.
evaluate(spin=None, projection_list=None)

Return the default density of states spectrum

Parameters: spin (Spin.All | Spin.Sum | Spin.X | Spin.Y | Spin.Z | Spin.Up | Spin.Down | Spin.RealUpDown | Spin.ImagUpDown) – The spin of the DOS. Default: Spin.All projection_list (ProjectionList) – ProjectionList with projections to include in the density of states. Default: Total density of states. The density of states spectrum. PhysicalQuantity of type reciprocal energy
fermiLevel(spin=None)
Parameters: spin (Spin.Up | Spin.Down | Spin.All) – The spin the Fermi level should be returned for. Must be either Spin.Up, Spin.Down, or Spin.All. Only when the band structure is calculated with a fixed spin moment will the Fermi level depend on spin. Default: Spin.All The Fermi level in absolute energy. PhysicalQuantity of type energy
gaussianSpectrum(energies=None, spin=None, broadening=None, projection_list=None)

Return the Density of States Spectrum using Gaussian broadening.

Parameters: energies (PhysicalQuantity of type energy) – List of energies for which the spectrum should be calculated. Default: Spectrum from energyMin() to energyMax(). spin (Spin.All | Spin.Sum | Spin.X | Spin.Y | Spin.Z | Spin.Up | Spin.Down | Spin.RealUpDown | Spin.ImagUpDown) – The spin of the DOS. Must be Spin.All for non-collinear and spin-orbit calculations. |DEFAULT| Spin.Up for unpolarized and polarized calculations. broadening (PhysicalQuantity of type energy) – Broadening of the Gaussian. Default: The default value is automatically determined based on the energy spectrum and k-point sampling. If the spectrum is calculated for a single k-point, the default value is 0.1 * eV. projection_list (ProjectionList) – ProjectionList with projections to include in the density of states. Default: Total density of states. The density of states spectrum. PhysicalQuantity of type inverse energy
metatext()
Returns: The metatext of the object or None if no metatext is present. str | unicode | None
nlprint(stream=None)

Print a string containing an ASCII table useful for plotting the AnalysisSpin object.

Parameters: stream (python stream) – The stream the table should be written to. Default: NLPrintLogger()
processesPerKPoint()

..deprecated:: 2019 :returns: The number of processes per k-point used in the calculation. :rtype: int > 0

setMetatext(metatext)

Set a given metatext string on the object.

Parameters: metatext (str | unicode | None) – The metatext string that should be set. A value of “None” can be given to remove the current metatext.
spins()
Returns: The spins associated to this analysis object. list of spin flags.
tetrahedronSpectrum(energies=None, spin=None, projection_list=None)

Return the Density of States Spectrum using the tetrahedron method.

Parameters: energies (PhysicalQuantity of type energy) – List of energies for which the spectrum should be calculated. Default: Spectrum from energyMin() to energyMax(). spin (Spin.All | Spin.Sum | Spin.X | Spin.Y | Spin.Z | Spin.Up | Spin.Down | Spin.RealUpDown | Spin.ImagUpDown) – The spin of the DOS. Must be Spin.All for non-collinear and spin-orbit calculations. |DEFAULT| UNPOLARIZED/POLARIZED: Spin.Up projection_list (ProjectionList) – ProjectionList with projections to include in the density of states. Default: Total density of states. The density of states spectrum. PhysicalQuantity of type inverse energy

Usage Examples¶

Calculate the Density of states of a silicon crystal:

# Set up Si in the diamond structure
si_crystal = BulkConfiguration(
bravais_lattice=FaceCenteredCubic(5.4306*Angstrom),
elements=[Silicon, Silicon],
cartesian_coordinates=[[ 0.     ,  0.     ,  0.     ],
[ 1.35765,  1.35765,  1.35765]]*Angstrom
)

calculator = LCAOCalculator(
numerical_accuracy_parameters=
NumericalAccuracyParameters(k_point_sampling=(4, 4, 4))
)

si_crystal.setCalculator(calculator)

# Calculate the density of states
dos = DensityOfStates(si_crystal, kpoints = MonkhorstPackGrid(16,16,16))
# save the DOS to a file
nlsave('si_dos.nc', dos)


si_dos.py

Note

The spectrum can be shown by selecting the file si_dos.nc in the LabFloor of QuantumATK and using the 2D Plot... plugin.

Plot the Gaussian and tetrahedron spectrum within pylab:

# read DOS object from file
dos = nlread('si_dos.nc', DensityOfStates)[0]

# make list of energies
energies = numpy.arange(-14,5,0.01)*eV

# calculate the DOS spectrum with two different methods
dos_t = dos.tetrahedronSpectrum(energies)
dos_g = dos.gaussianSpectrum(energies, broadening = 0.2*eV)

#plot the spectra using pylab
import pylab
pylab.figure()
pylab.plot(energies.inUnitsOf(eV), dos_t.inUnitsOf(eV**-1))
pylab.plot(energies.inUnitsOf(eV), dos_g.inUnitsOf(eV**-1))
pylab.xlabel("Energy (eV)")
pylab.ylabel("DOS (1/eV)")
pylab.show()


si_dos_plot.py

Notes¶

• The routine utilizes the symmetries of the crystal to reduce the computational load.
• The default spectrum is a Gaussian spectrum for a MoleculeConfiguration and a BulkConfiguration with less than 10 k-points. For a BulkConfiguration with more than 10 k-points, the tetrahedron method is used.
• The implementation of the tetrahedron method follows Ref. [BJA94].
• The behavior of bands_above_fermi_level with regard to the spin types unpolarized, polarized, and noncollinear is described in Notes of the Bandstructure analysis object.

 [BJA94] P. E. Blöchl, O. Jepsen, and O. K. Andersen. Improved tetrahedron method for brillouin-zone integrations. Phys. Rev. B, 49:16223–16233, Jun 1994. doi:10.1103/PhysRevB.49.16223.