Open
Description
Python version
Python 3.11.11
Pymatgen version
2025.1.23
Operating system version
No response
Current behavior
Hello, I recently tried using the MaterialsProjectDFTMixingScheme() to construct a GGA/GGA+U/R2SCAN phase diagram for Fe-O by following the code on the materials project documentation. However, I noticed that the constructed phase diagram used the mp-13-GGA entry even though mp-13-r2SCAN exists. It seems that the mixing function did not attempt to combine entries for mp-13 because its GGA and R2SCAN calculations employ different numbers of atoms in the cell:
Full Formula (Fe1)
Reduced Formula: Fe
abc : 2.459206 2.459352 2.459570
angles: 109.469122 109.467063 109.459583
pbc : True True True
Sites (1)
# SP a b c
--- ---- --- --- ---
0 Fe 0 0 0
Full Formula (Fe2)
Reduced Formula: Fe
abc : 2.477813 2.477809 4.054295
angles: 90.000038 90.000320 109.469837
pbc : True True True
Sites (2)
# SP a b c
--- ---- --- --- ---
0 Fe 0.5 0.5 0.5
1 Fe 1 1 0
Expected Behavior
The ground state at composition Fe (mp-13) has both GGA/GGA+U and R2SCAN entries, so I expected the R2SCAN entry to replace the GGA one. I have also checked that their structures matched using StructureMatcher().fit()
.
Minimal example
from mp_api.client import MPRester
from pymatgen.analysis.phase_diagram import PhaseDiagram, PDPlotter
from pymatgen.entries.mixing_scheme import MaterialsProjectDFTMixingScheme
with MPRester(my_key) as mpr:
# Obtain GGA, GGA+U, and r2SCAN ComputedStructureEntry objects
entries = mpr.get_entries_in_chemsys(elements=["Fe", "O"],
additional_criteria={"thermo_types": ["GGA_GGA+U", "R2SCAN"]})
# Apply corrections locally with the mixing scheme
scheme = MaterialsProjectDFTMixingScheme()
corrected_entries = scheme.process_entries(entries, verbose=True)
# Construct phase diagram
pd = PhaseDiagram(corrected_entries)
# Plot phase diagram
PDPlotter(pd).get_plot()
Relevant files to reproduce this bug
No response
Activity