NLINKS
This is part of the multicolvar module

Calculate number of pairs of atoms/molecules that are "linked"

In its simplest guise this coordinate calculates a coordination number. Each pair of atoms is assumed "linked" if they are within some cutoff of each other. In more complex applications each entity is a vector and this quantity measures whether pairs of vectors are (a) within a certain cutoff and (b) if the two vectors have similar orientations. The vectors on individual atoms could be Steinhardt parameters (see Q3, Q4 and Q6) or they could describe some internal vector in a molecule.

The atoms involved can be specified using
GROUP . For more information on how to specify lists of atoms see Groups and Virtual Atoms
Or alternatively by using
GROUPA
GROUPB
Compulsory keywords
NN ( default=6 ) The n parameter of the switching function
MM ( default=0 ) The m parameter of the switching function; 0 implies 2*NN
D_0 ( default=0.0 ) The d_0 parameter of the switching function
R_0 The r_0 parameter of the switching function
Options
NUMERICAL_DERIVATIVES ( default=off ) calculate the derivatives for these quantities numerically
NOPBC ( default=off ) ignore the periodic boundary conditions when calculating distances
SERIAL ( default=off ) do the calculation in serial. Do not use MPI
TIMINGS ( default=off ) output information on the timings of the various parts of the calculation
LOWMEM

( default=off ) lower the memory requirements

SWITCH This keyword is used if you want to employ an alternative to the continuous switching function defined above. The following provides information on the switchingfunction that are available. When this keyword is present you no longer need the NN, MM, D_0 and R_0 keywords.
Examples

The following calculates how many bonds there are in a system containing 64 atoms and outputs this quantity to a file.

DENSITY SPECIES=1-64 LABEL=d1
NLINKS GROUP=d1 SWITCH={RATIONAL D_0=1.3 R_0=0.2} LABEL=dd
PRINT ARG=dd FILE=colvar

The following calculates how many pairs of neighboring atoms in a system containing 64 atoms have similar dispositions for the atoms in their coordination sphere. This calculation uses the dot product of the Q6 vectors on adjacent atoms to measure whether or not two atoms have the same ``orientation"

Q6 SPECIES=1-64 SWITCH={RATIONAL D_0=1.3 R_0=0.2} LABEL=q6
NLINKS GROUP=q6 SWITCH={RATIONAL D_0=1.3 R_0=0.2} LABEL=dd
PRINT ARG=dd FILE=colvar