calculate_coordination_numbers

mdhelper.analysis.structure.calculate_coordination_numbers(bins: ndarray[float], rdf: ndarray[float], rho: float, *, n_coord_nums: int = 2, n_dims: int = 3, threshold: float = 0.1) ndarray[float][source]

Calculates coordination numbers \(n_k\) from a radial distribution function \(g_{ij}(r)\).

It is defined as

\[n_k=4\pi\rho_j\int_{r_{k-1}}^{r_k}r^2g_{ij}(r)\,dr\]

for three-dimensional systems and

\[n_k=2\pi\rho_j\int_{r_{k-1}}^{r_k}rg_{ij}(r)\,dr\]

for two-dimensional systems, where \(k\) is the index, \(\rho_j\) is the bulk number density of species \(j\) and \(r_k\) is the \((k + 1)\)-th local minimum of \(g_{ij}(r)\).

If the radial distribution function \(g_{ij}(r)\) does not contain as many local minima as n_coord_nums, this method will return numpy.nan for the coordination numbers that could not be calculated.

Parameters:
binsnumpy.ndarray

Centers of the histogram bins.

Shape: \((N_\mathrm{bins},)\).

Reference unit: \(\mathrm{Å}\).

rdfnumpy.ndarray

Radial distribution function \(g_{ij}(r)\).

Shape: \((N_\mathrm{bins},)\).

rhofloat

Number density \(\rho_j\) of species \(j\).

Reference unit: \(\mathrm{Å}^D\), where \(D\) is the number of dimensions.

n_coord_numsint, keyword-only, default: 2

Number of coordination numbers to calculate.

n_dimsint, keyword-only, default: 3

Number of dimensions \(D\).

thresholdfloat, keyword-only, default: 0.1

Minimum \(g_{ij}(r)\) value that must be reached before local minima are found.

Returns:
coord_numsnumpy.ndarray

Coordination numbers \(n_k\).