entries Package

entries Package

This module contains entry related tools. Essentially, entries are containers for calculated information, which is used in many analyses.

compatibility Module

This module implements Compatibility corrections for mixing runs of different functionals.

class Compatibility(input_set_name, compat_type)[source]

Bases: pymatgen.entries.post_processors_abc.EntryPostProcessor

This class implements the GGA/GGA+U mixing scheme, which allows mixing of entries. This is a base class from which other specific compatibility schemes are implemented.

For compatibility to be checked, the entry supplied have two additional restrictions in terms of its parameters key:

  1. 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.
  2. 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’].

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.

Args:
input_set_name:
The name of the input set to use. Can be either MaterialsProject or MITMatgen.
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.
corrected_compound_formulas[source]
process_entries(entries)[source]

Process a sequence of entries with the chosen Compatibility scheme.

Args:
entries - A sequence of entries.
Returns:
An list of adjusted entries. Entries in the original list which are not compatible are excluded.
process_entry(entry)[source]

Process a single entry with the chosen Compatibility scheme.

Args:
entry:
A ComputedEntry object.
Returns:
An adjusted entry if entry is compatible, otherwise None is returned.
Raises:
ValueError if entry do not contain “potcar_symbols” key.
requires_hubbard(comp)[source]

Check if a particular composition requies U parameters to be set.

Args:
comp:
Composition
Returns:
True if hubbard U parameter required. False otherwise.
class MITCompatibility(compat_type='Advanced')[source]

Bases: pymatgen.entries.compatibility.MaterialsProjectCompatibility

This 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.

Args:
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.
class MaterialsProjectCompatibility(compat_type='Advanced')[source]

Bases: pymatgen.entries.compatibility.Compatibility

This 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.

Args:
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.

computed_entries Module

This module implements equivalents of the basic ComputedEntry objects, which is the basic entity that can be used to perform many analyses. ComputedEntries contain calculated information, typically from VASP or other electronic structure codes. For example, ComputedEntries can be used as inputs for phase diagram analysis.

class ComputedEntry(composition, energy, correction=0.0, parameters=None, data=None, entry_id=None)[source]

Bases: pymatgen.phasediagram.entries.PDEntry, pymatgen.serializers.json_coders.MSONable

An lightweight ComputedEntry object containing key computed data for many purposes. Extends a PDEntry so that it can be used for phase diagram generation. The difference between a ComputedEntry and a standard PDEntry is that it includes additional parameters like a correction and run_parameters.

Args:
composition:
Composition of the entry. For flexibility, this can take the form of all the typical input taken by a Composition, including a {symbol: amt} dict, a string formula, and others.
energy:
Energy of the entry. Usually the final calculated energy from VASP or other electronic structure codes.
correction:
A correction to be applied to the energy. This is used to modify the energy for certain analyses. Defaults to 0.0.
parameters:
An optional dict of parameters associated with the entry. Defaults to None.
data:
An optional dict of any additional data associated with the entry. Defaults to None.
entry_id:
An optional id to uniquely identify the entry.
energy[source]

Returns the corrected energy of the entry.

classmethod from_dict(d)[source]
to_dict[source]
uncorrected_energy[source]

Returns the uncorrected energy of the entry.

class ComputedStructureEntry(structure, energy, correction=0.0, parameters=None, data=None, entry_id=None)[source]

Bases: pymatgen.entries.computed_entries.ComputedEntry

A heavier version of ComputedEntry which contains a structure as well. The structure is needed for some analyses.

Args:
structure:
The actual structure of an entry.
energy:
Energy of the entry. Usually the final calculated energy from VASP or other electronic structure codes.
correction:
A correction to be applied to the energy. This is used to modify the energy for certain analyses. Defaults to 0.0.
parameters:
An optional dict of parameters associated with the entry. Defaults to None.
data:
An optional dict of any additional data associated with the entry. Defaults to None.
entry_id:
An optional id to uniquely identify the entry.
classmethod from_dict(d)[source]
to_dict[source]

entry_tools Module

This module implements functions to perform various useful operations on entries, such as grouping entries by structure.

group_entries_by_structure(entries, species_to_remove=None, ltol=0.2, stol=0.4, angle_tol=5, primitive_cell=True, scale=True, comparator=<pymatgen.analysis.structure_matcher.SpeciesComparator object at 0x1070fc350>, ncpus=None)[source]

Given a sequence of ComputedStructureEntries, use structure fitter to group them by structural similarity.

Args:
entries:
Sequence of ComputedStructureEntries.
species_to_remove:
Sometimes you want to compare a host framework (e.g., in Li-ion battery analysis). This allows you to specify species to remove before structural comparison.
ltol:
Fractional length tolerance. Default is 0.2
stol:
Site tolerance in Angstrom. Default is 0.4 Angstrom
angle_tol:
Angle tolerance in degrees. Default is 5 degrees.
primitive_cell:
If true: input structures will be reduced to primitive cells prior to matching. Defaults to True.
scale:
Input structures are scaled to equivalent volume if true; For exact matching, set to False.
comparator:
A comparator object implementing an equals method that declares declaring equivalency of sites. Default is SpeciesComparator, which implies rigid species mapping.
ncpus:
Number of cpus to use. Use of multiple cpus can greatly improve fitting speed. Default of None means serial processing.
Returns:
Sequence of sequence of entries by structural similarity. e.g, [[ entry1, entry2], [entry3, entry4, entry5]]

exp_entries Module

This module defines Entry classes for containing experimental data.

class ExpEntry(composition, thermodata, temperature=298)[source]

Bases: pymatgen.phasediagram.entries.PDEntry, pymatgen.serializers.json_coders.MSONable

An lightweight ExpEntry object containing experimental data for a composition for many purposes. Extends a PDEntry so that it can be used for phase diagram generation and reaction calculation.

Current version works only with solid phases and at 298K. Further extensions for temperature dependence are planned.

Args:
composition:
Composition of the entry. For flexibility, this can take the form of all the typical input taken by a Composition, including a {symbol: amt} dict, a string formula, and others.
thermodata:
A sequence of ThermoData associated with the entry.
temperature:
A temperature for the entry in Kelvin. Defaults to 298K.
classmethod from_dict(d)[source]
to_dict[source]

post_processors_abc Module

This module implements abstract base classes for post-processing entries. Any class which modifies entries should inherit these classes.

class EntryPostProcessor[source]

Bases: object

corrected_compound_formulas[source]

List of compound formulas that are corrected.

process_entries(entries)[source]

Process a sequence of entries.

Args:
entries - A sequence of ComputedEntries.
Returns:
An list of processed entries. ComputedEntries in the original list which are not compatible with the processing scheme are excluded.
process_entry(entry)[source]

Process a single entry.

Args:
entry - An ComputedEntry object.
Returns:
An processed entry. None if entry is not compatible within the processing scheme.

Table Of Contents

This Page