Greetings!
I have been having a lot of trouble trying to obtain the same answer I get from https://materialsproject.org/#apps/reactioncalculator/ while using pymatgen. The example is simple: I type H2O + H2O as reactants and H2O + H2O as products on the website and it naturally yields 0 eV as the enthalpy of the reaction. However, if I try to do the same with pymatgen (the api_key is the api key):
from pymatgen.analysis.reaction_calculator import Reaction
def get_most_stable_entry(entries, formula):
entries = api_key.get_entries_in_chemsys(entries)
relevant_entries = [entry for entry in entries if entry.composition.reduced_formula == Composition(formula).reduced_formula]
relevant_entries = sorted(relevant_entries, key=lambda e: e.energy_per_atom)
return relevant_entries[0]
H2O = get_most_stable_entry(["H", "O"], "H2O")
Reaction.elements([H2O, H2O], [H2O, H2O])
I get:
TypeError: 'property' object is not callable
What am I doing wrong? Is there a function that gives the calculated or the experimental enthalpy values such that it could be used with the material ID like:
In: Reaction([mp-###, mp-###], [mp-###, mp-###])
Out: #.###