Get phonon dos by material id api call

Hello all,

I am trying to understand the data that I am getting out of the api requests.

if I write the following:
let mat_id = mp-1000

from mp_api.client import MPRester
mpr = MPRester('api_key')
mat_id = str('mp-1000')
ph_dos =  mpr.get_phonon_dos_by_material_id(mat_id)

given this download, I grab the information given to me and convert it into a json file and read from that json file I have this part of the call that is called ‘pdos’

which i would get from

what is the pdos part of this? I assume it is the individual phonon dos contribution from each element in the material from the material_id correct? How can i tell which element is the one that is in each part of the list in pdos?

for example in this data I see pdos is a list with two elements and each one of those lists looks like it contains some pdos values. mp-1000 itself is composed of two atoms so because there are two atoms logically there would be two elements in the pdos list. afaik.

can anyone else confirm this? or perhaps point me to somewhere where I can get more information about these?

It sounds like you are only seeing the elemental projection. You can get all of projected data using the ph_dos.get_element_dos and ph_dos.get_site_dos methods in this case. The element projected data will be provided for every element present, while the site method requires you to provide a specific site you are interested in.

– Jason

Thank you for the reply munrojm. I checked out the ph_dos.get_element_dos and I got a dictionary that gives values for each element in the material-id in the keys, however, the values are only assigned into memory and I can’t view them when I call them using .get(' ') or .values()

here is what I get:

def simple_api_call(mp_id):
    '''
        A simple diagnostic tool for checking phdos api calls
    '''
    from core import Mat_Proj as mp
    mp_id=str(mp_id)
    mpr = mp.mpapi('api-key')
    ph_dos = mpr.get_phonon_dos_by_material_id(mp_id)
    return ph_dos
ph_dos = simple_api_call('mp-1000')
element_dos = ph_dos.get_element_dos()
element_dos

printout:

> {Element Ba: <pymatgen.phonon.dos.PhononDos at 0x7f1a6b599d30>,
 Element Te: <pymatgen.phonon.dos.PhononDos at 0x7f1a6b599cd0>}

The data in the dict values consists of nested DOS objects (equivalent to ph_dos) that only contain the projected data. You can access data from each of the objects in the same way you would for your ph_dos object.

– Jason