Helper Functions

This page contains various helper functions useful when working with pMuTT

get_molecular_weight

pmutt.get_molecular_weight(elements)

Molecular mass (in g/mol) given the elemental composition. Data taken from: https://en.wikipedia.org/wiki/Standard_atomic_weight

Parameters:

elements (dict or str) –

Elemental composition of species.

If a dictionary is passed, the keys are the element symbol, atomic number, or element name and the value is the stoichiometric coefficient. If a string is passed, the formula will be guessed using pmutt.parse_formula

Returns:

molecular_weight – Molecular weight as float in kg/mol

Return type:

float

pmutt_list_to_dict

pmutt.pmutt_list_to_dict(pmutt_list, key='name')

Converts a pmutt list to a dictionary using a specified attribute. This allows for quicker searching.

Parameters:
  • pmutt_list (list of objects) – List of pmutt objects to convert

  • key (str, optional) – Name of attribute used as the keys for the dictionary. Default is ‘name’

Returns:

pmutt_dict – Dictionary of pmutt objects

Return type:

dict

Raises:

KeyError – Raised if key is not an attribute of the pmutt objects

get_geometry_from_atoms

pmutt.statmech.rot.get_geometry_from_atoms(atoms, degree_tol=5.0)

Estimate the geometry using the ase.Atoms object

Parameters:
  • atoms (ase.Atoms object) – Atoms object

  • degree_tol (float, optional) – Degree tolerance in degrees. Default is 5 degrees

Returns:

geometry – Geometry

Return type:

str