#对于每个组分,获得计算的band_gap从mp为了最稳定的成分结构
from pymatgen.ext.matproj import MPRester
from pymatgen.core.composition import Composition
mpr = MPRester(api_key='')
def get_MP_bandgap(formula):
reduced_formula = Composition(formula).get_integer_formula_and_factor()[0]
struct_lst = mpr.get_data(reduced_formula)
# If there is a structure at this composition, return the band gap energy
if struct_lst:
return sorted(struct_lst, key=lambda e: e['energy_per_atom'])['band_gap']
df['Computed band gap'] = df['formula'].apply(get_MP_bandgap)
查询数据库带隙
于 2022-09-21 10:05:24 首次发布