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, method=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 (sequence (size 3) of int | MonkhorstPackGrid | KpointDensity | RegularKpointGrid) – The k-points for which to calculate the density of states.
    Default: The Monkhorst-Pack grid 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 and GWCalculator, 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

  • method (None | Full | KDotPExpansion3D) –

    The method used for the eigenvalue computation.

    The default is to perform an exact diagonalization to determine the eigenvalues at each requested k-point.

    Alternatively, the k.p expansion method can be used to interpolate the eigenvalues at the requested k-points using the exact eigenvalues and eigenfunctions calculated in the SCF calculation.

    NOTE: Only the PlaneWaveCalculator supports the k.p method at the moment.

calculateCarrierConcentration(contribution=None, fermi_shift=None, temperature=None)

Calculate the carrier concentration of the specified contribution.

Parameters:
  • contribution (Electron | Hole) – The contribution to the carrier contribution.
    Default: Electron

  • fermi_shift (PhysicalQuantity of type energy.) – The shift in Fermi level.
    Default: 0.0 * eV

  • temperature (PhysicalQuantity of type temperature.) – The temperature to use for the distribution.
    Default: 300 * Kelvin

Returns:

The carrier concentration.

Return type:

PhysicalQuantity of type inverse volume.

elements()

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

Returns:

A list of the elements.

Return type:

list of PeriodicTableElement

energies()
Returns:

The energies used for generating the last spectrum.

Return type:

PhysicalQuantity of type energy.

energyMax()
Returns:

The maximum energy eigenvalue.

Return type:

PhysicalQuantity of type energy.

energyMin()
Returns:

The minimum energy eigenvalue.

Return type:

PhysicalQuantity of type energy.

energyZero()
Returns:

The energy zero.

Return type:

PhysicalQuantity of type energy.

evaluate(spin=None, projection_list=None, normalization=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.

  • normalization (False | NormalizeByVolume() | NormalizeByNumberOfAtoms()) – Normalization scheme to use for the DOS.
    Default: False

Returns:

The density of states spectrum.

Return type:

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

Returns:

The Fermi level in absolute energy.

Return type:

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.

Returns:

The density of states spectrum.

Return type:

PhysicalQuantity of type inverse energy

metatext()
Returns:

The metatext of the object or None if no metatext is present.

Return type:

str | None

method()
Returns:

The eigenvalue generation method.

Return type:

None | Full | KDotPExpansion3D

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: from v2019

Returns:

The number of processes per k-point used in the calculation.

Return type:

int > 0

setMetatext(metatext)

Set a given metatext string on the object.

Parameters:

metatext (str | 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.

Return type:

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.

Returns:

The density of states spectrum.

Return type:

PhysicalQuantity of type inverse energy

uniqueString()

Return a unique string representing the state of the object.

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. [1].

  • 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.