calculate_coordination_numbers

mdcraft.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_{\alpha\beta}(r)\).

It is defined as

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

for three-dimensional systems and

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

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

If the radial distribution function \(g_{\alpha\beta}(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_{\alpha\beta}(r)\).

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

rhofloat

Number density \(\rho_\beta\) of species \(\beta\).

Reference unit: \(\mathrm{Å}^{n_\mathrm{dims}}\).

n_coord_numsint, keyword-only, default: 2

Number of coordination numbers \(n_\mathrm{coord}\) to calculate.

n_dimsint, keyword-only, default: 3

Number of dimensions \(n_\mathrm{dims}\).

thresholdfloat, keyword-only, default: 0.1

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

Returns:
coord_numsnumpy.ndarray

Coordination numbers \(n_k\).