generator#
Generate sets of chemical potentials
Functions
Generate Chempots dictionary using the data from the Materials Project. |
|
Generate Chempots dictionary using the data from the Materials Project. |
|
Generate chemical potentials for reference elemental phases using the data from the Materials Project database. |
|
Generate reservoirs dependent on oxygen partial pressure (PressureReservoirs) starting from precursors compostitions. |
- generate_chempots_from_condition(composition, condition, phase_diagram=None, API_KEY=None, thermo_type='GGA_GGA+U', **kwargs)[source]#
Generate Chempots dictionary using the data from the Materials Project. Condition must be specified as “<el>-rich” or “<el>-poor”. The phase diagram with the elements contained in the target composition is build and used to create the chemical potentials range for the target element.
- Parameters:
composition (str or Composition) – Composition of the target material.
condition (str) – Condition for the choice of chemical potential. “<el>-poor” or “<el>-rich>”.
phase_diagram (PhaseDiagram) – Pymatgen PhaseDiagram object. If not provided it is pulled from the Materials Project database.
API_KEY (str) – API KEY for the Materials Project database. If not provided, pymatgen looks in the configuration file.
thermo_type (str) – The thermo type to pass to MP database.
kwargs (dict) – Kwargs to pass to get_phase_diagram_from_chemsys.
- Return type:
Chempots object
- generate_chempots_from_mp(composition, element=None, phase_diagram=None, API_KEY=None, thermo_type='GGA_GGA+U', **kwargs)[source]#
Generate Chempots dictionary using the data from the Materials Project. element can be a periodic table element, or a condition “<el>-poor/rich” (see docs in generate_chempots_from_condition). If not provided, oxygen is chosen as target element if present, otherwise the last element in the composition formula is picked.
If element is provided as condition (“<el>-poor/rich”), a Chempots object is returned, otherwise all conditions are pulled from the database and a Reservoirs object is returned (a Chempots object for every condition).
- Parameters:
composition (str or Composition) – Composition of the target material.
element (str) – Periodic table element or condition (“<el>-poor/rich”) for the choice of chemical potential. if a condition is provided, a Chempots object is returned, otherwise all conditions are pulled from the database and a Reservoirs object is returned (a Chempots object for every condition).
phase_diagram (PhaseDiagram) – Pymatgen PhaseDiagram object. If not provided it is pulled from the Materials Project database.
API_KEY (str) – API KEY for the Materials Project database. If not provided, pymatgen looks in the configuration file.
thermo_type (str) – The thermo type to pass to MP database.
kwargs (dict) – Kwargs to pass to get_phase_diagram_from_chemsys.
- Returns:
chemical_potentials – Chemical potentials for the target composition and condition. If element is provided as condition (“<el>-poor/rich”), a Chempots object is returned, otherwise all conditions are pulled from the database and a Reservoirs object is returned (a Chempots object for every condition).
- Return type:
- generate_elemental_chempots(elements, API_KEY=None, thermo_type='GGA_GGA+U', **kwargs)[source]#
Generate chemical potentials for reference elemental phases using the data from the Materials Project database.
- Parameters:
elements (list) – List of strings with element symbols.
API_KEY (str) – API KEY for the Materials Project database. If not provided, pymatgen looks in the configuration file.
thermo_type (str) – The thermo type to pass to MP database.
kwargs (dict) – Kwargs to pass to get_phase_diagram_from_chemsys.
- Return type:
Chempots object
- generate_pressure_reservoirs_from_precursors(precursors, temperature, oxygen_ref=None, pressure_range=(1e-20, 10000000000.0), npoints=50, get_pressures_as_strings=False, thermo_type='GGA_GGA+U', **kwargs)[source]#
Generate reservoirs dependent on oxygen partial pressure (PressureReservoirs) starting from precursors compostitions. A dictionary with precursor composition and energy per formula unit in eV is generated with data from the Materials Project database. If not provided, the reference for the oxygen chempot at 0 K is also pulled from the DB. Chemical potentials are found from the energies of the precursors and the oxygen chempot value (uses the np.linalg.lstsq function). If the system is underdetermined the minimum-norm solution is found.
- Parameters:
precursors (str or list) – Compositions of precursors.
oxygen_ref (float) – Absolute chempot of oxygen at 0K. If not provided it is pulled from the MP database.
temperature (float) – Temperature in K.
pressure_range (tuple) – Range in which to evaluate the partial pressure . The default is from 1e-20 to 1e10.
npoints (int) – Number of data points to interpolate the partial pressure with. The default is 50.
get_pressures_as_strings (bool) – Get pressure values (keys in the Reservoirs dict) as strings. The default is set to floats.
- Returns:
pressure_reservoirs – PressureReservoirs object.
- Return type: