Generalized Coordination Number
This module allows for the computation of the Generalized Coordination Number (GCN) for an atomic system.
The GCN is a descriptor expanding on the better known Coordination Number (CN, the number of neighbours for each atom)
Functions
apply_pbc(coords, box_size)
Apply periodic boundary conditions to atom coordinates. Maps coordinates to be within the simulation box.
Parameters
coords : np.ndarray Atom coordinates array, shape (n_atoms, 3). box_size : np.ndarray Box size array (3,) or (3,2) depending on box format.
Returns
np.ndarray Coordinates after applying PBC.
Source code in snow/lodispp/utils.py
bounding_box(points)
Calculate an axis-aligned bounding box from a set of points.
Source code in snow/lodispp/utils.py
kl_div(func1, func2)
Calculate the Kullback-Leibler divergence between two functions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func1
|
np.array)
|
values taken by the first function for a given set of inputs |
required |
func2
|
np.array)
|
values taken by the second function for the same set of inputs |
required |
Returns:
| Type | Description |
|---|---|
float
|
kldiv (float) : KL Divergency between function 1 and function 2 |
Source code in snow/lodispp/utils.py
second_neighbours(index_frame, coords, cutoff)
Generates a list of lists of atomic indeces for each atom corresponding to aotoms that are neighbours of first neighbours excluding those which are already first neighbours.
Parameters
index_frame : int Index of the frame if a movie (not used in the current version but can be useful for dynamic systems). coords : np.ndarray Array with the XYZ coordinates of the atoms, shape (n_atoms, 3). cutoff : float Cutoff distance for finding pairs in angstroms. If None, an adaptive cutoff is used per atom.
Returns
list List of lists containing indeces of second neighbours for each atom