Extracting phases within a Ehull cutofff from MaterialsProject

Hi, I was trying to retrieve all the phases which are lying under a Ehull cutoff of say 0.5 eV/atom for a composition. I used something like this;

def get_phase_entries(oxide):
    exl_list = ['O2', oxide]
    comp = Composition(oxide)
    elements = [str(el) for el in comp.elements]
    entries = mpr.get_entries_in_chemsys(elements)
    pd = PhaseDiagram(entries)
    stable_entries = pd.stable_entries
    phase_list = [entry.composition.reduced_formula for entry in stable_entries if entry.composition.reduced_formula not in exl_list]
    return (stable_entries, phase_list)

But this is extracting only the entries lying on the convex hull ( as I am using stable entries). Is there a way you could provide a Ehull cutoff range (taking account of the updated r2SCAN data) and extract all the unique phases (I would like to avoid the same structure getting extracted because it has a different experimental report (ICSD ID) behind).

Hi @Akhil_S, you can query using an energy above hull range in mpr.thermo.search and mpr.summary.search. You should be able to filter for what you need using either your list of elements, or a list of chemical systems from the elements.

– Jason

Dear Mr.munrojm,
Thank for recommend, I can use that function,
I use this code to search information of "ZnCr2O4’':

from mp_api.client import MPRester

with MPRester('API-Key') as mpr:
Material_inf = mpr.summary.search(formula="ZnCrO2", fields=['material_id',"energy_above_hull",'builder_meta', 'nsites', 'elements', 'nelements', 'composition', 'composition_reduced', 'formula_pretty', 'formula_anonymous', 'chemsys', 'volume', 'density', 'density_atomic', 'symmetry', 'property_name', 'deprecated', 'deprecation_reasons', 'last_updated', 'origins', 'warnings', 'structure', 'task_ids', 'uncorrected_energy_per_atom', 'energy_per_atom', 'formation_energy_per_atom', 'is_stable', 'equilibrium_reaction_energy_per_atom', 'decomposes_to', 'xas', 'grain_boundaries', 'band_gap', 'cbm', 'vbm', 'efermi', 'is_gap_direct', 'is_metal', 'es_source_calc_id', 'bandstructure', 'dos', 'dos_energy_up', 'dos_energy_down', 'is_magnetic', 'ordering', 'total_magnetization', 'total_magnetization_normalized_vol', 'total_magnetization_normalized_formula_units', 'num_magnetic_sites', 'num_unique_magnetic_sites', 'types_of_magnetic_species', 'k_voigt', 'k_reuss', 'k_vrh', 'g_voigt', 'g_reuss', 'g_vrh', 'universal_anisotropy', 'homogeneous_poisson', 'e_total', 'e_ionic', 'e_electronic', 'n', 'e_ij_max', 'weighted_surface_energy_EV_PER_ANG2', 'weighted_surface_energy', 'weighted_work_function', 'surface_anisotropy', 'shape_factor', 'has_reconstructed', 'possible_species', 'has_props', 'theoretical', 'database_IDs'])

After that process, how can I selecting the materials have energy_above_hull (Ehull) bellow than 0.025 ev/atom by pymatgen code?
Thank for helping!

Dear @buithitham.
I used something like this following the suggestion from @munrojm

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

hull_data={}
with MPRester(API_KEY) as mpr:
    
    stable_entries=mpr.thermo.search(chemsys='Cr-Al-O',energy_above_hull=(0,0.05),thermo_types=['GGA_GGA+U'])
    for entry in stable_entries:
        formula=entry.composition_reduced.formula
        hull_energy=round(entry.energy_above_hull,3)
        hull_data[formula]=hull_energy
    print([entry.composition_reduced.formula for entry in stable_entries])

and this will give you {'Al3 Cr1 O6': 0.014, 'Al19 Cr1 O30': 0.004} . Hope this is what you are looking for.

@munrojm I just noticed that in the turorial given Examples - Materials Project Documentation , thermo_type=ThermoType.GGA_GGA_U_R2SCAN needs to be replaced by just GGA_GGA+U_R2SCAN in order to return the results (same for GGA_GGA+U as well). Could you please suggest is this so?

2 Likes

@Akhil_S, good catch. I will update that now.

Dear Akhil_S,
I sloved the problem,
Thank you for helping!