CONTACT_MATRIX
This is part of the adjmat module

Adjacency matrix in which two atoms are adjacent if they are within a certain cutoff.

As discussed in the section of the manual on Exploiting contact matrices a useful tool for developing complex collective variables is the notion of the so called adjacency matrix. An adjacency matrix is an \(N \times N\) matrix in which the \(i\)th, \(j\)th element tells you whether or not the \(i\)th and \(j\)th atoms/molecules from a set of \(N\) atoms/molecules are adjacent or not. These matrices can then be further analyzed using a number of other algorithms as is detailed in [107].

For this action the elements of the contact matrix are calculated using:

\[ a_{ij} = \sigma( |\mathbf{r}_{ij}| ) \]

where \(|\mathbf{r}_{ij}|\) is the magnitude of the vector connecting atoms \(i\) and \(j\) and where \(\sigma\) is a switchingfunction.

Examples

The input shown below calculates a \(6 \times 6\) matrix whose elements are equal to one if atom \(i\) and atom \(j\) are within 0.3 nm of each other and which is zero otherwise. The columns in this matrix are then summed so as to give the coordination number for each atom. The final quantity output in the colvar file is thus the average coordination number.

Click on the labels of the actions for more information on what each action computes
tested on master
mat: CONTACT_MATRIX 
ATOMS
the atoms for which you would like to calculate the adjacency matrix (basically equivalent to GROUP)
=1-6
SWITCH
specify the switching function to use between two sets of indistinguishable atoms.
={EXP D_0=0.2 R_0=0.1 D_MAX=0.66} csums: COLUMNSUMS
MATRIX
could not find this keyword
=mat
MEAN
could not find this keyword
PRINT
ARG
the input for this action is the scalar output from one or more other actions.
=csums.*
FILE
the name of the file on which to output these quantities
=colvar
Glossary of keywords and components
The atoms involved can be specified using
GROUPA . For more information on how to specify lists of atoms see Groups and Virtual Atoms
GROUPB . For more information on how to specify lists of atoms see Groups and Virtual Atoms
Or alternatively by using
ATOMS the atoms for which you would like to calculate the adjacency matrix (basically equivalent to GROUP)
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
NL_CUTOFF ( default=0.0 ) The cutoff for the neighbor list. A value of 0 means we are not using a neighbor list
NL_STRIDE ( default=1 ) The frequency with which we are updating the atoms in the neighbor list
Options
COMPONENTS ( default=off ) also calculate the components of the vector connecting the atoms in the contact matrix
NOPBC

( default=off ) don't use pbc

GROUP specifies the list of atoms that should be assumed indistinguishable. You can use multiple instances of this keyword i.e. GROUP1, GROUP2, GROUP3...
SWITCH specify the switching function to use between two sets of indistinguishable atoms. You can use multiple instances of this keyword i.e. SWITCH1, SWITCH2, SWITCH3...