pymatgen.entries.compatibility module¶
This module implements Compatibility corrections for mixing runs of different functionals.
-
class
AnionCorrection(*args, **kwargs)[source]¶ Bases:
pymatgen.entries.compatibility.AnionCorrectionCorrect anion energies to obtain the right formation energies. Note that this depends on calculations being run within the same input set.
Pass through… :param args: :param kwargs: :return:
-
class
AqueousCorrection(*args, **kwargs)[source]¶ Bases:
pymatgen.entries.compatibility.AqueousCorrectionThis class implements aqueous phase compound corrections for elements and H2O.
Pass through… :param args: :param kwargs: :return:
-
class
Compatibility(corrections: Sequence)[source]¶ Bases:
monty.json.MSONableThe Compatibility class combines a list of corrections to be applied to an entry or a set of entries. Note that some of the Corrections have interdependencies. For example, PotcarCorrection must always be used before any other compatibility. Also, GasCorrection(“MP”) must be used with PotcarCorrection(“MP”) (similarly with “MIT”). Typically, you should use the specific MaterialsProjectCompatibility and MITCompatibility subclasses instead.
- Parameters
corrections – List of corrections to apply.
-
explain(entry)[source]¶ Prints an explanation of the corrections that are being applied for a given compatibility scheme. Inspired by the “explain” methods in many database methodologies.
- Parameters
entry – A ComputedEntry.
-
get_corrections_dict(entry)[source]¶ Returns the corrections applied to a particular entry.
- Parameters
entry – A ComputedEntry object.
- Returns
value})
- Return type
({correction_name
-
get_explanation_dict(entry)[source]¶ Provides an explanation dict of the corrections that are being applied for a given compatibility scheme. Inspired by the “explain” methods in many database methodologies.
- Parameters
entry – A ComputedEntry.
- Returns
(dict) of the form {“Compatibility”: “string”, “Uncorrected_energy”: float, “Corrected_energy”: float, “Corrections”: [{“Name of Correction”: { “Value”: float, “Explanation”: “string”}]}
-
exception
CompatibilityError[source]¶ Bases:
ExceptionException class for Compatibility. Raised by attempting correction on incompatible calculation
-
class
Correction[source]¶ Bases:
objectA Correction class is a pre-defined scheme for correction a computed entry based on the type and chemistry of the structure and the calculation parameters. All Correction classes must implement a correct_entry method.
-
class
GasCorrection(*args, **kwargs)[source]¶ Bases:
pymatgen.entries.compatibility.GasCorrectionCorrect gas energies to obtain the right formation energies. Note that this depends on calculations being run within the same input set.
Pass through… :param args: :param kwargs: :return:
-
class
MITAqueousCompatibility(compat_type='Advanced', correct_peroxide=True, check_potcar_hash=False)[source]¶ Bases:
pymatgen.entries.compatibility.CompatibilityThis class implements the GGA/GGA+U mixing scheme, which allows mixing of entries. Note that this should only be used for VASP calculations using the MIT parameters (see pymatgen.io.vaspio_set MITVaspInputSet). Using this compatibility scheme on runs with different parameters is not valid.
- Parameters
compat_type – Two options, GGA or Advanced. GGA means all GGA+U entries are excluded. Advanced means mixing scheme is implemented to make entries compatible with each other, but entries which are supposed to be done in GGA+U will have the equivalent GGA entries excluded. For example, Fe oxides should have a U value under the Advanced scheme. A GGA Fe oxide run will therefore be excluded under the scheme.
correct_peroxide – Specify whether peroxide/superoxide/ozonide corrections are to be applied or not.
check_potcar_hash (bool) – Use potcar hash to verify potcars are correct.
-
class
MITCompatibility(compat_type='Advanced', correct_peroxide=True, check_potcar_hash=False)[source]¶ Bases:
pymatgen.entries.compatibility.CompatibilityThis class implements the GGA/GGA+U mixing scheme, which allows mixing of entries. Note that this should only be used for VASP calculations using the MIT parameters (see pymatgen.io.vaspio_set MITVaspInputSet). Using this compatibility scheme on runs with different parameters is not valid.
- Parameters
compat_type – Two options, GGA or Advanced. GGA means all GGA+U entries are excluded. Advanced means mixing scheme is implemented to make entries compatible with each other, but entries which are supposed to be done in GGA+U will have the equivalent GGA entries excluded. For example, Fe oxides should have a U value under the Advanced scheme. A GGA Fe oxide run will therefore be excluded under the scheme.
correct_peroxide – Specify whether peroxide/superoxide/ozonide corrections are to be applied or not.
check_potcar_hash (bool) – Use potcar hash to verify potcars are correct.
-
class
MaterialsProjectAqueousCompatibility(compat_type='Advanced', correct_peroxide=True, check_potcar_hash=False)[source]¶ Bases:
pymatgen.entries.compatibility.CompatibilityThis class implements the GGA/GGA+U mixing scheme, which allows mixing of entries. Note that this should only be used for VASP calculations using the MaterialsProject parameters (see pymatgen.io.vaspio_set.MPVaspInputSet). Using this compatibility scheme on runs with different parameters is not valid.
- Parameters
compat_type – Two options, GGA or Advanced. GGA means all GGA+U entries are excluded. Advanced means mixing scheme is implemented to make entries compatible with each other, but entries which are supposed to be done in GGA+U will have the equivalent GGA entries excluded. For example, Fe oxides should have a U value under the Advanced scheme. A GGA Fe oxide run will therefore be excluded under the scheme.
correct_peroxide – Specify whether peroxide/superoxide/ozonide corrections are to be applied or not.
check_potcar_hash (bool) – Use potcar hash to verify potcars are correct.
-
class
MaterialsProjectCompatibility(compat_type='Advanced', correct_peroxide=True, check_potcar_hash=False)[source]¶ Bases:
pymatgen.entries.compatibility.CompatibilityThis class implements the GGA/GGA+U mixing scheme, which allows mixing of entries. Note that this should only be used for VASP calculations using the MaterialsProject parameters (see pymatgen.io.vaspio_set.MPVaspInputSet). Using this compatibility scheme on runs with different parameters is not valid.
- Parameters
compat_type – Two options, GGA or Advanced. GGA means all GGA+U entries are excluded. Advanced means mixing scheme is implemented to make entries compatible with each other, but entries which are supposed to be done in GGA+U will have the equivalent GGA entries excluded. For example, Fe oxides should have a U value under the Advanced scheme. A GGA Fe oxide run will therefore be excluded under the scheme.
correct_peroxide – Specify whether peroxide/superoxide/ozonide corrections are to be applied or not.
check_potcar_hash (bool) – Use potcar hash to verify potcars are correct.
-
class
PotcarCorrection(input_set, check_hash=False)[source]¶ Bases:
pymatgen.entries.compatibility.CorrectionChecks 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’].
- Parameters
input_set – InputSet object used to generate the runs (used to check for correct potcar symbols)
check_hash (bool) – If true, uses the potcar hash to check for valid potcars. If false, uses the potcar symbol (Less reliable). Defaults to True
- Raises
ValueError if entry do not contain "potcar_symbols" key. –
CombatibilityError if wrong potcar symbols –
-
class
UCorrection(*args, **kwargs)[source]¶ Bases:
pymatgen.entries.compatibility.UCorrectionThis 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.
Pass through… :param args: :param kwargs: :return: