This notebook illustrates how to obtain an explaination of the different corrections being applied in the Materials Project.

In [1]:
import re
from pymatgen.entries.computed_entries import ComputedEntry
from pymatgen.entries.compatibility import MaterialsProjectCompatibility
In [2]:
from pymatgen import MPRester

#To do our testing, let's use the MPRester to get a sample computed entry from the Materials Project.
m = MPRester()
entries = m.get_entries("LiFePO4")
entry = entries[0]
In [3]:
compat = MaterialsProjectCompatibility()
In [4]:
compat.explain(entry)
The uncorrected value of the energy of P4 Fe4 O16 Li4 is -191.338121 eV
The following corrections / screening are applied for MaterialsProjectCompatibility:

MP Potcar Correction correction: Checks that POTCARs are valid within a pre-defined input set. This
    ensures that calculations performed using different InputSets are not
    compared against each other.

    Entry.parameters must contain a "potcar_symbols" key that is a list of
    all POTCARs used in the run. Again, using the example of an Fe2O3 run
    using Materials Project parameters, this would look like
    entry.parameters["potcar_symbols"] = ['PAW_PBE Fe_pv 06Sep2000',
    'PAW_PBE O 08Apr2002'].

This correction does not make any changes to the energy.
------------------------------
MP Gas Correction correction: Correct gas energies to obtain the right formation energies. Note that
    this depends on calculations being run within the same input set.

For the entry, this correction has the value -11.236640 eV.
------------------------------
MP Advanced Correction correction: This class implements the GGA/GGA+U mixing scheme, which allows mixing of
    entries. Entry.parameters must contain a "hubbards" key which is a dict
    of all non-zero Hubbard U values used in the calculation. For example,
    if you ran a Fe2O3 calculation with Materials Project parameters,
    this would look like entry.parameters["hubbards"] = {"Fe": 5.3}
    If the "hubbards" key is missing, a GGA run is assumed.

    It should be noted that ComputedEntries assimilated using the
    pymatgen.apps.borg package and obtained via the MaterialsProject REST
    interface using the pymatgen.matproj.rest package will automatically have
    these fields populated.

For the entry, this correction has the value -10.932000 eV.
------------------------------
The final energy after corrections is -213.506761