Skip to content

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

Source code in snow/descriptors/gcn.py
def agcn_calculator(index_frame, coords, cut_off, dbulk : list[float], thr_cn: int, gcn_max = 12.0, strained: bool = False):
    """
    """
    neigh_list, coord_numbers = coordination_number(index_frame, coords, cut_off, neigh_list=True)
    n_atoms = len(coord_numbers)
    agcn = np.zeros(n_atoms)
    sites=[]

    for i, atom_neighbors in enumerate(neigh_list):
        if coord_numbers[i] >= thr_cn:
            continue
        sites.append(coords[i])
        if strained:
            sgcn=0
            for nb in neigh_list[i]:
                for nnb in neigh_list[nb]:
                    d_nb_nnb= np.linalg.norm(coords[nb] - coords[nnb])
                    sgcn += dbulk/d_nb_nnb
            self_sgcn=0
            for nb in neigh_list[i]:
                break
                d_nb_nnb= np.linalg.norm(coords[nb] - coords[i])
                self_sgcn += dbulk/d_nb_nnb
            agcn[i]=((sgcn-self_sgcn)/gcn_max)
        else:
            agcn_i = sum(coord_numbers[neigh] for neigh in atom_neighbors)# - coord_numbers[i]
            agcn[i]=(agcn_i / gcn_max)
    return sites,agcn