Retrieving formation energies from MP database

Hello,

I am a beginner trying to utilise the MP database for my research. I think the formation energies shown in the MP-UI and also retrieved by MPRester are calculated after applying the mixing rules. Is there a way to retrieve the “raw” formation energies calculated with different XC functionals like PBE and R2SCAN ?

I thank you in advance for your time and suggestions.

Hi @Rajorshi_Chattopadhy,

You can use the thermo endpoint and specify the thermo types you want:

from mp_api.client import MPRester


with MPRester("YOUR_API_KEY") as mpr:
    docs = mpr.materials.thermo.search(thermo_types=["GGA_GGA+U", "R2SCAN"])

You can filter afterwards by thermo type once you get everything. Or just send one request for each thermo type if the post filtering is too cumbersome for you.

edit:
and if you are specifically only interested in just the formation energy you can speed up your query by limiting the returned fields. All fields here for thermo: Materials Project API - Swagger UI

with MPRester("YOUR_API_KEY") as mpr:
    docs = mpr.materials.thermo.search(thermo_types=["GGA_GGA+U", "R2SCAN"], fields=["thermo_type", "formation_energy_per_atom"])