Density of states at the Fermi level


Hello all,

I am somewhat new to the MAPI. If I am only interested in the DOS at the Fermi level for a material, is the following workflow correct/reasonable?

  1. Use MPRester to get the full DOS with get_dos_by_material_id()
  2. Convert this to a dictionary.
  3. Get the energy at the Fermi level using key ‘efermi’
  4. Find the index of the element in the ‘energies’ array that is closest to efermi
  5. Find the density at the same index of the array associated with the key ‘1’ under the ‘densities’ key.

Thank you in advance for your help!


Yep, this should work. Note that you don’t necessarily need to convert to dict, but could use the attributes of the DOS object, e. g.

import numpy as np
from pymatgen.ext.matproj import MPRester
mpr = MPRester()
dos = mpr.get_dos_by_material_id("mp-134")
total_density = sum(dos.densities.values()) # Sum over both spins, if present
min_index = np.argmin(abs(dos.energies - dos.efermi))