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!

1 Like

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))
total_density[min_index]
3 Likes

Thank you for this piece for code, it has been very helpful!

I am trying to teak this for getting the numeric values of each projected Dos contribution (for s, for d, for d, and for f) at the Fermi level, but without any luck. Any ideas?