get_mole_frac

Contents

get_mole_frac#

autoplex.fitting.common.regularization.get_mole_frac(atoms, element_order=None)[source]#

Calculate the mole-fraction of a structure.

Parameters:
  • atoms ((Atoms)) – structure to calculate mole-fraction of

  • element_order ((list)) – list of atomic numbers in order of choice (e.g. [42, 16] for MoS2)

Returns:

(x2, x3…) – reduced mole-fraction of structure - first element n = 1-sum(others)

Return type:

(array of float)