core#

Core chemical potentials objects

Classes

Chempots(chempots_dict[, ndecimals])

Class to handle set of chemical potentials.

Functions

chempot_ideal_gas

Get chemical potential at a given temperature and partial pressure.

class Chempots(chempots_dict, ndecimals=None)[source]#

Bases: MSONable

Class to handle set of chemical potentials. Behaves like a python dictionary. The dictionary needs to be set with element symbols as keys and chemical potentials as values.

Parameters:
  • chempots_dict (dict) – Dictionary of chemical potentials in the format {el:value}.

  • ndecimals (int) – Round the chemical potentials to this number of decimals. If None the numbers are left untouched.

as_dict()[source]#

Json-serializable dict representation of a Chempots object.

Returns:

d – Json-serializable dict of a Chempots object.

Return type:

dict

copy()[source]#
static from_dict(d)[source]#

Constructor of Chempots object from dictionary representation.

Parameters:

d (dict)

Returns:

chempots – Chempots object.

Return type:

Chempots

static from_pmg_elements(d)[source]#

Construct a Chempots object from a dictionary in the format {Element:value}. Useful to interface with pymatgen which uses Element class to address elements instead of just their symbols.

Parameters:

d (dict) – Dictionary in the format {Element:value}.

Returns:

chempots – Chempots object.

Return type:

Chempots

get_absolute(mu_refs)[source]#

Get Chempots object with chemical potentials converted to absolute values (mu + mu_ref).

Parameters:

mu_refs (dict or Chempots) – Chempots object or just dictionary with elemental chemical potentials (mu0).

Returns:

chempots – Chempots values converted to absolute (mu + mu_ref).

Return type:

Chempots

get_referenced(mu_refs)[source]#

Get Chempots object with chemical potentials converted to referenced values (mu - mu_ref).

Parameters:

mu_refs (dict or Chempots) – Chempots object or just dictionary with elemental chemical potentials (mu0).

Returns:

chempots – Chempots values converted to referenced (mu - mu_ref).

Return type:

Chempots

items()[source]#
keys()[source]#
property mu#

Dictionary with chemical potentials

to_pmg_elements()[source]#

Convert the Chempots object to a dictionary in the format {Element:value}. Useful to interface with pymatgen which uses Element class to address elements instead of just their symbols.

Returns:

d – Dictionary in the format {Element:value}

Return type:

dict

update(other)[source]#
values()[source]#
chempot_ideal_gas(mu0, temperature, partial_pressure, coeff=2)[source]#

Get chemical potential at a given temperature and partial pressure. The chemical potential in standard conditions (mu0) has to be know.

Parameters:
  • mu0 (float) – Value of chemical potential in standard conditions.

  • temperature (float) – Temperature in Kelvin.

  • partial_pressure (float) – Partial pressure over standard pressure (p/p0).

  • coeff (int) – Stochiometric coefficient. Default is 2 for oxygen.

Returns:

chempot – Value of chemical potential at given T and p/p0.

Return type:

float