Retrieving GGA energy_above_hull, rather than r2scan with mpr

I’m part of a team working with a material that is stable. In the legacy Materials Project it is on the convex hull and this works for what we see, but in the new version it is more that 90 meV above the hull. Now I’m looking for compatible systems but we would rather stick to the old data. Here is the code I am using right now to search for other stable systems (below). Could someone please help me modify for it to work with the old GGA data?

Many thanks, Lee

with MPRester(API_KEY) as mpr:
docs = mpr.summary.search(crystal_system=“Hexagonal”, fields=[“material_id”, “energy_above_hull”])

@Lee1 currently we by default serve up the mixed GGA/GGA+U/r2SCAN hull. If you would like the previous GGA/GGA+U only hull you can query for it with the thermo endpoint as such:

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

– Jason

Dear Munrojm, thank you for your reply. I’m sorry I’m getting the error “AttributeError: ‘MaterialsRester’ object has no attribute ‘thermo’” when I run this code. Do you have another suggestion?

You may have to update mp-api (pip install mp-api --upgrade). Do you know which version you are running?

– Jason

thank you its working now!
Best
Lee

1 Like

I’m sorry @munrojm, I’m still not getting the result I expected.

If you look on the legacy materials project here you see an energy above hull of zero:

if you look at the new materials project here you see an energy above hull of 0.09 eV

When I run the code you suggested for this MPID, I get a returned “energy_above_hull=0.09071444863636202”. which is from the dataset I’m trying to avoid. Do you have any other suggestions?

Best,
Lee

@Lee1 you will have to access that data with the legacy rester in pymatgen. See pymatgen/src/pymatgen/ext/matproj_legacy.py at 27d90b777cedc80593d93b6e8b66dee04c167460 · materialsproject/pymatgen · GitHub.

– Jason

Thank you for your reply and the information- I’ll try it this way. Just for my own information, when you run the code for this material do you get the energy above hull as 0.0? No matter which option I use for “thermo_types” I get the exact same answer. Is this a bug or is it something wrong with my local set up?

Either way thanks again for your continued support.
Lee