COORDINATION
This is part of the colvar module

Calculate coordination numbers.

This keyword can be used to calculate the number of contacts between two groups of atoms and is defined as

\[ \sum_{i\in A} \sum_{i\in B} s_{ij} \]

where \(s_{ij}\) is 1 if the contact between atoms \(i\) and \(j\) is formed, zero otherwise. In actuality, \(s_{ij}\) is replaced with a switching function so as to ensure that the calculated CV has continuous derivatives. The default switching function is:

\[ s_{ij} = \frac{ 1 - \left(\frac{{\bf r}_{ij}-d_0}{r_0}\right)^n } { 1 - \left(\frac{{\bf r}_{ij}-d_0}{r_0}\right)^m } \]

but it can be changed using the optional SWITCH option.

To make your calculation faster you can use a neighbor list, which makes it that only a relevant subset of the pairwise distance are calculated at every step.

If GROUPB is empty, it will sum the \(\frac{N(N-1)}{2}\) pairs in GROUPA. This avoids computing twice permuted indexes (e.g. pair (i,j) and (j,i)) thus running at twice the speed.

Notice that if there are common atoms between GROUPA and GROUPB the switching function should be equal to one. These "self contacts" are discarded by plumed (since version 2.1), so that they actually count as "zero".

Examples

The following example instructs plumed to calculate the total coordination number of the atoms in group 1-10 with the atoms in group 20-100. For atoms 1-10 coordination numbers are calculated that count the number of atoms from the second group that are within 0.3 nm of the central atom. A neighbor list is used to make this calculation faster, this neighbor list is updated every 100 steps.

Click on the labels of the actions for more information on what each action computes
tested on master

The following is a dummy example which should compute the value 0 because the self interaction of atom 1 is skipped. Notice that in plumed 2.0 "self interactions" were not skipped, and the same calculation should return 1.

Click on the labels of the actions for more information on what each action computes
tested on master
c: COORDINATION 
GROUPA
First list of atoms.
=1
GROUPB
Second list of atoms (if empty, N*(N-1)/2 pairs in GROUPA are counted).
=1
R_0
could not find this keyword
=0.3

Here's an example that shows what happens when providing COORDINATION with a single group:

Click on the labels of the actions for more information on what each action computes
tested on master