nanoCAT.recipes.coordination_number

A recipe for calculating atomic coordination numbers.

Index

get_coordination_number(mol[, shell, d_outer])

Take a molecule and identify the coordination number of each atom.

coordination_outer(dist, d_outer, length)

Calculate the coordination number relative to the outer shell.

API

nanoCAT.recipes.get_coordination_number(mol, shell='inner', d_outer=None)[source]

Take a molecule and identify the coordination number of each atom.

The function first compute the pair distance between all reference atoms in mol. The number of first neighbors, defined as all atoms within a threshold radius d_inner is then count for each atom. The threshold radius can be changed to a desired value d_outer (in angstrom) to obtain higher coordination numbers associated to outer coordination shells. The function finally groups the (1-based) indices of all atoms in mol according to their atomic symbols and coordination numbers.

Parameters:
  • mol (array-like [float], shape \((n, 3)\)) – An array-like object with the Cartesian coordinates of the molecule.

  • shell (str) – The coordination shell to be considered. Only 'inner' or 'outer' values are accepted. The default, 'inner', refers to the first coordination shell.

  • d_outer (float, optional) – The threshold radius for defining which atoms are considered as neighbors. The default, None, is accepted only if shell is 'inner'

Returns:

A nested dictionary {'Cd': {8: [0, 1, 2, 3, 4, ...], ...}, ...} containing lists of (1-based) indices refered to the atoms in mol having a given atomic symbol (e.g. 'Cd') and coordination number (e.g. 8).

Return type:

dict

Raises:
  • TypeError – Raised if no threshold radius is defined for the outer coordination shell.

  • ValueError – Raised if a wrong value is attributed to shell.

See also

guess_core_core_dist()

Estimate a value for d_inner based on the radial distribution function of mol. Can also be used to estimate d_outer as the distance between the atom pairs (‘A’, ‘B’).

nanoCAT.recipes.coordination_outer(dist, d_outer, length)[source]

Calculate the coordination number relative to the outer shell.