Name

DensityOfStates — Class for calculating the density of states for a BulkConfiguration.

Synopsis

Namespace: NanoLanguage
DensityOfStates(
configuration,
kpoints,
energy_zero_parameter,
bands_above_fermi_level,
save_partial
)

Description

Constructor for the density of states object.

DensityOfStates Arguments

configuration

The BulkConfiguration or MoleculeConfiguration for which the density of states should be calculated.

Type: BulkConfiguration, MoleculeConfiguration

kpoints

The k-points for which the density of states should be calculated.

Type: MonkhorstPackGrid

Default: MonkhorstPackGrid(nx,ny,nz), where nx, ny, nz is the sampling used for the self consistent calculation
energy_zero_parameter

Specifies the choice for the energy zero.

Type: FermiLevel | AbsoluteEnergy

Default: FermiLevel
bands_above_fermi_level

The number of bands above the Fermi level.

Type: A positive integer

Default: All bands are included
save_partial

Save the partial contributions to the density of states.

Type: True | False

Default: True

DensityOfStates Methods

A DensityOfStates object provides the following methods:

  • elements(): Query for the elements in the configuration used for generating the dos

  • energies(): Return the energies used for generating the last spectrum

  • energyMax(): Return the maximum eigenenergy

  • energyMin(): Return the minimum eigenenergy

  • energyZero(): Return the energy zero

  • evaluate(spin, projection_list): Return the default density of states spectrum

    spin

    The spin of the DOS

    Type: Spin.Sum | Spin.Up | Spin.down

    Default: Spin.Sum
    projection_list

    ProjectionList with projections to include in the density of states.

    Type: ProjectionList

    Default: total density of states
  • fermiLevel(): Return the Fermi level in absolute energy

  • gaussianSpectrum(energies, spin, broadening, projection_list): Return the Density of States Spectrum using Gaussian broadening.

    energies

    List of energies for which the spectrum should be calculated.

    Type: list of PhysicalQuantity with unit energy

    Default: spectrum from emin to emax
    spin

    The spin of the DOS

    Type: Spin.Up | Spin.down

    Default: Spin.Up
    broadening

    Broadening of the Gaussian.

    Type: PhysicalQuantity with unit energy

    Default: 0.1*eV
    projection_list

    ProjectionList with projections to include in the density of states.

    Type: ProjectionList

    Default: total density of states
  • nlprint(stream): Print a string containing an ASCII table useful for plotting the density of states.

    stream

    The stream the density of states should be written to.

    Type: A stream that supports strings being written to using 'write'.

    Default: sys.stdout
  • spins(): Return the spins associated to this analysis object

  • tetrahedronSpectrum(energies, spin, projection_list): Return the Density of States Spectrum using the tetrahedron method.

    energies

    List of energies for which the spectrum should be calculated

    Type: list of PhysicalQuantity with unit energy

    Default: list of energies from emin to emax
    spin

    The spin of the DOS

    Type: Spin.Up | Spin.down

    Default: Spin.Up
    projection_list

    ProjectionList with projections to include in the density of states.

    Type: ProjectionList

    Default: total density of states

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] Note
The spectrum can be shown by selecting the file si_dos.nc in the result browser of VNL

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 molecules, and a tetrahedron spectrum for BulkConfigurations with more than 10 k-points.

The implementation of the tetrahedron method follows Ref. [25]