How to use pymatgen.ext.matproj to query "has_phonons" or "has_bandstructure""

On the materialsproject website I can search with “has properties->”,
the “Elec. structure”, or “Vibrational” boxes checked.

How can I do this via pymatgen.ext.matproj?

So without has_bandstructure or has_phonons
the following works

a=MPRester("***")
print(a.query({“reduced_cell_formula”:“NiO”,“has_bandstructure”:“true”},[“material_id”,“pretty_formula”]))

But with has_bandstructure or has_phonons it does not

a=MPRester("***")
print(a.query({“reduced_cell_formula”:“NiO”,“has_bandstructure”:“true”},[“material_id”,“pretty_formula”]))

What’s the proper way to query via pymatgen.ext.matproj with the “has electronic structure” or “vibrational” criteria?

Thanks,
Fei

Hi Fei,

Try:

from pymatgen import MPRester
mpr = MPRester()
docs = mpr.query({"has": "bandstructure"}, ["e_above_hull"])

See the MAPI documentation for more info.

1 Like

Thanks Joseph. I appreciate it.

1 Like