1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| import json from pymatgen.apps.borg.hive import VaspToComputedEntryDrone from pymatgen.apps.borg.queen import BorgQueen from pymatgen.io.vasp.outputs import Outcar from pymatgen.analysis.phase_diagram import PhaseDiagram from pymatgen.analysis.phase_diagram import PDPlotter from pymatgen.entries.compatibility import MaterialsProjectCompatibility from pymatgen.ext.matproj import MPRester
para = ["is_hubbard", "hubbards","potcar_symbols", "run_type","structures","efermi","is_spin","potcar_spec","atomic_symbols"] dat = ["final_energy"] etry = VaspToComputedEntryDrone(parameters = para,data = dat)
path = "/lustre/home/acct-umjzhh/umjzhh-2/zhenming/e-hull/" queen = BorgQueen(etry,rootpath=path,number_of_drones=1)
entries = queen.get_data()
a=MPRester("mqzy3IaxSNegF941") compat = MaterialsProjectCompatibility() computed_entries = compat.process_entries(entries) print("len_computed_entries:",len(computed_entries)) elements = [ ] for entry in computed_entries: element = list(set(entry.as_dict()[u'parameters'][u'atomic_symbols'])) s = [ ] for i in range(len(element)): s.append(str(element[i])) elements.append(s)
ss=[] for element in elements: for i in range(len(element)): ss.append(element[i]) ss = list(set(ss)) mp_entries = a.get_entries_in_chemsys(ss) total_entries = computed_entries+mp_entries pd = PhaseDiagram(total_entries) for i in range(len(computed_entries)): decomp,e_above_hull = pd.get_decomp_and_e_above_hull(computed_entries[i]) print("name and ebh:",(computed_entries[i].name,e_above_hull))
|