Action: COORDINATION

Module colvar
Description Usage
Calculate coordination numbers. used in 9 tutorialsused in 69 eggs
output value type
the value of the coordination scalar

Input

The atoms that serve as the input for this action are specified using one or more of the keywords in the following table.

Keyword Type Description
GROUPA atoms First list of atoms
GROUPB atoms Second list of atoms (if empty, N*(N-1)/2 pairs in GROUPA are counted)

Further details and examples

Calculate coordination numbers.

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

iAiBsij

where sij is 1 if the contact between atoms i and j is formed and zero otherwise. In actuality, sij is replaced with a switching function so as to ensure that the calculated CV has continuous derivatives.

The default switching function is:

sij=1(rijd0r0)n1(rijd0r0)m

but it can be changed using the optional SWITCH option. You can find more information about the various switching functions that you can use with this action in the documentation for LESS_THAN.

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, the coordination number will be calculated based on the N(N1)2 pairs in GROUPA. This avoids computing permuted indexes (e.g. pair (i,j) and (j,i)) twice and ensures that the calculation runs 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 on2.11
COORDINATIONCalculate coordination numbers. More details GROUPAFirst list of atoms=1-10 GROUPBSecond list of atoms (if empty, N*(N-1)/2 pairs in GROUPA are counted)=20-100 R_0The r_0 parameter of the switching function=0.3 NLIST Use a neighbor list to speed up the calculation NL_CUTOFFThe cutoff for the neighbor list=0.5 NL_STRIDEThe frequency with which we are updating the atoms in the neighbor list=100

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 on2.11
c: COORDINATIONCalculate coordination numbers. This action has hidden defaults. More details GROUPAFirst list of atoms=1 GROUPBSecond list of atoms (if empty, N*(N-1)/2 pairs in GROUPA are counted)=1 R_0The r_0 parameter of the switching function=0.3
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=c STRIDE the frequency with which the quantities of interest should be output=10

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

Click on the labels of the actions for more information on what each action computes
tested on2.11
# define some huge group:
group: GROUPDefine a group of atoms so that a particular list of atoms can be referenced with a single label in definitions of CVs or virtual atoms. More details ATOMSthe numerical indexes for the set of atoms in the group=1-1000
# Here's coordination of a group against itself:
c1: COORDINATIONCalculate coordination numbers. This action has hidden defaults. More details GROUPAFirst list of atoms=group GROUPBSecond list of atoms (if empty, N*(N-1)/2 pairs in GROUPA are counted)=group R_0The r_0 parameter of the switching function=0.3
# Here's coordination within a single group:
x: COORDINATIONCalculate coordination numbers. This action has hidden defaults. More details GROUPAFirst list of atoms=group R_0The r_0 parameter of the switching function=0.3
# This is just multiplying times 2 the variable x:
c2: COMBINECalculate a polynomial combination of a set of other variables. More details ARGthe values input to this function=x COEFFICIENTS the coefficients of the arguments in your function=2 PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO

# the two variables c1 and c2 should be identical, but the calculation of c2 is twice faster
# since it runs on half of the pairs.
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=c1,c2 STRIDE the frequency with which the quantities of interest should be output=10

Syntax

The following table describes the keywords and options that can be used with this action

Keyword Type Default Description
GROUPA input none First list of atoms
GROUPB input none Second list of atoms (if empty, N*(N-1)/2 pairs in GROUPA are counted)
NN compulsory 6 The n parameter of the switching function
MM compulsory 0 The m parameter of the switching function; 0 implies 2*NN
D_0 compulsory 0.0 The d_0 parameter of the switching function
R_0 compulsory none The r_0 parameter of the switching function
NUMERICAL_DERIVATIVES optional false calculate the derivatives for these quantities numerically
NOPBC optional false ignore the periodic boundary conditions when calculating distances
SERIAL optional false Perform the calculation in serial - for debug purpose
PAIR optional false Pair only 1st element of the 1st group with 1st element in the second, etc
NLIST optional false Use a neighbor list to speed up the calculation
NL_CUTOFF optional not used The cutoff for the neighbor list
NL_STRIDE optional not used The frequency with which we are updating the atoms in the neighbor list
SWITCH optional not used This keyword is used if you want to employ an alternative to the continuous switching function defined above. Options for this keyword are explained in the documentation for LESS_THAN.