Correcting R2SCAN data to find Ehull with respect to GGA_GGA_U_R2SCAN phase diagram

If I have R2SCAN total energy on a material, how do I apply corrections/adjustments so that I can get the Ehull for this material with respect to a combined GGA/GGA+U/R2SCAN phase diagram? I obtain the phase diagram with the following code:

from mp_api.client import MPRester as mp_MPRester
from emmet.core.thermo import ThermoType

with mp_MPRester(API_KEY) as mp_mpr:
pd_mixed = mp_mpr.materials.thermo.get_phase_diagram_from_chemsys(
chemsys=“F-Fe”, thermo_type=ThermoType.GGA_GGA_U_R2SCAN # mixed (site default)
)

Is there example code for correcting R2SCAN formation energy so it aligns woth GGA/GGA+U?

This discussion was the closest to my question, but it doesn’t address the question of how to corect a fresh DFT R2SCAN data point to check for stability.

Thanks.

Hi @Suresh, just to clarify, we don’t apply corrections to r2SCAN calculations, but we do shift its energies to align with the GGA / GGA+U mixed/corrected hull

There are some caveats while using the full correction scheme:

  • You’ll need to provide a pymatgen ComputedStructureEntry representing your calculation. To ensure it’s seen as r2SCAN, the parameters['run_type'] field should be set to r2SCAN
  • If there’s no GGA/GGA+U structure at this composition in our databse, or in your calculations the fully mixed hull will exclude your r2SCAN calc

mp_api has a get_stability function to get the energies above hull for user submitted ComputedStructureEntry and handles the corrections

Thank you Aaron. Let me try this and get back to you with the results.

@Aaron_Kaplan, I am trying to understand the process step by step. So I thought I would create a fake R2SCAN entry using data from a real R2SCAN entry from MP and try to shift its energy using MaterialsProjectDFTMixingScheme and confirm everything was working correctly. While trying this, the first question I have is:

from mp_api.client import MPRester as mp_MPRester
mp_mpr = mp_MPRester(API_KEY)
mp_mpr.get_entry_by_material_id(material_id=‘mp-1030309’) returns

[mp-1030309-GGA ComputedStructureEntry - Te4 Mo2 W2 S4 (Te2MoWS2)
Energy (Uncorrected) = -81.8747 eV (-6.8229 eV/atom)
Correction = -3.7000 eV (-0.3083 eV/atom)
Energy (Final) = -85.5747 eV (-7.1312 eV/atom)
Energy Adjustments:
MP2020 anion correction (S): -2.0120 eV (-0.1677 eV/atom)
MP2020 anion correction (Te): -1.6880 eV (-0.1407 eV/atom)
Parameters:
potcar_spec = [{‘titel’: ‘PAW_PBE Te 08Apr2002’, ‘hash’: ‘72719856e22fb1d3032df6f96d98a0f2’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE Mo_pv 08Apr2002’, ‘hash’: ‘84e18fd84a98e3d7fa8f055952410df0’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE W_pv 06Sep2000’, ‘hash’: ‘2a33e0d5c700640535f60ac0a12177ab’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE S 17Jan2003’, ‘hash’: ‘d368db6899d8839859bbee4811a42a88’, ‘summary_stats’: None}]
run_type = GGA
is_hubbard = False
hubbards = None
Data:
oxide_type = None
aspherical = True
last_updated = 2024-11-21 22:53:38.549166+00:00
task_id = mp-1333121
material_id = mp-1030309
oxidation_states = {‘Te’: -2.0, ‘Mo’: 6.0, ‘W’: 2.0, ‘S’: -2.0}
license = BY-C
run_type = GGA,
mp-1030309-r2SCAN ComputedStructureEntry - Te4 Mo2 W2 S4 (Te2MoWS2)
Energy (Uncorrected) = -294.2673 eV (-24.5223 eV/atom)
Correction = 0.0000 eV (0.0000 eV/atom)
Energy (Final) = -294.2673 eV (-24.5223 eV/atom)
Energy Adjustments:
None
Parameters:
potcar_spec = [{‘titel’: ‘PAW_PBE Te 08Apr2002’, ‘hash’: ‘11ac22d05d08fb6be6beb8cf78b0127c’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE Mo_pv 04Feb2005’, ‘hash’: ‘7e3938837b3a62c07c50f33dda12a02c’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE W_sv 04Sep2015’, ‘hash’: ‘50a52a9b0eb3b676ba9e5e5568c8fcb2’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE S 06Sep2000’, ‘hash’: ‘a627a17058051408d471730e77821d4e’, ‘summary_stats’: None}]
run_type = r2SCAN
is_hubbard = False
hubbards = None
Data:
oxide_type = None
aspherical = True
last_updated = 2024-11-21 22:53:38.560046+00:00
task_id = mp-2899017
material_id = mp-1030309
oxidation_states = {‘Te’: -2.0, ‘Mo’: 6.0, ‘W’: 2.0, ‘S’: -2.0}
license = BY-C
run_type = R2SCAN,
mp-1030309-r2SCAN ComputedStructureEntry - Te4 Mo2 W2 S4 (Te2MoWS2)
Energy (Uncorrected) = -294.2673 eV (-24.5223 eV/atom)
Correction = 0.0000 eV (0.0000 eV/atom)
Energy (Final) = -294.2673 eV (-24.5223 eV/atom)
Energy Adjustments:
None
Parameters:
potcar_spec = [{‘titel’: ‘PAW_PBE Te 08Apr2002’, ‘hash’: ‘11ac22d05d08fb6be6beb8cf78b0127c’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE Mo_pv 04Feb2005’, ‘hash’: ‘7e3938837b3a62c07c50f33dda12a02c’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE W_sv 04Sep2015’, ‘hash’: ‘50a52a9b0eb3b676ba9e5e5568c8fcb2’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE S 06Sep2000’, ‘hash’: ‘a627a17058051408d471730e77821d4e’, ‘summary_stats’: None}]
run_type = r2SCAN
is_hubbard = False
hubbards = None
Data:
oxide_type = None
aspherical = True
last_updated = 2024-11-21 22:53:38.560046+00:00
task_id = mp-2899017
material_id = mp-1030309
oxidation_states = {‘Te’: -2.0, ‘Mo’: 6.0, ‘W’: 2.0, ‘S’: -2.0}
license = BY-C
run_type = R2SCAN]

This is a list with 3 items, items 2 and 3 are identical.
The uncorrected energies for items 1 and 2 are very different. The run_types are also different.

If I do:

pd_mixed = mp_mpr.materials.thermo.get_phase_diagram_from_chemsys(
chemsys=chemsys, thermo_type=ThermoType.GGA_GGA_U_R2SCAN)
entries_1030309 = [e for e in entries if ‘1030309’ in e.entry_id]

I get a single entry:
[mp-1030309-r2SCAN ComputedStructureEntry - Te4 Mo2 W2 S4 (Te2MoWS2)
Energy (Uncorrected) = -294.2673 eV (-24.5223 eV/atom)
Correction = 0.0000 eV (0.0000 eV/atom)
Energy (Final) = -294.2673 eV (-24.5223 eV/atom)
Energy Adjustments:
None
Parameters:
potcar_spec = [{‘titel’: ‘PAW_PBE Te 08Apr2002’, ‘hash’: ‘11ac22d05d08fb6be6beb8cf78b0127c’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE Mo_pv 04Feb2005’, ‘hash’: ‘7e3938837b3a62c07c50f33dda12a02c’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE W_sv 04Sep2015’, ‘hash’: ‘50a52a9b0eb3b676ba9e5e5568c8fcb2’, ‘summary_stats’: None}, {‘titel’: ‘PAW_PBE S 06Sep2000’, ‘hash’: ‘a627a17058051408d471730e77821d4e’, ‘summary_stats’: None}]
run_type = r2SCAN
is_hubbard = False
hubbards = None
Data:
oxide_type = None
aspherical = True
last_updated = 2024-11-21 22:53:38.560046+00:00
task_id = mp-2899017
material_id = mp-1030309
oxidation_states = {‘Te’: -2.0, ‘Mo’: 6.0, ‘W’: 2.0, ‘S’: -2.0}
license = BY-C
run_type = R2SCAN]

You can see from the potcar_spec list that the first item is also present in the 3 item list from before. The other items are different.

I am quite confused as to what is going on. Perhaps you could explain or point to an explanation on the web. Thank you.