CONTACT_MATRIX
 This is part of the adjmat module It is only available if you configure PLUMED with ./configure –enable-modules=adjmat . Furthermore, this feature is still being developed so take care when using it and report any problems on the mailing list.

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 [131].

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
mat: CONTACT_MATRIX ATOMSThe list of atoms for which you would like to calculate the contact matrix. =1-6 SWITCHThis keyword is used if you want to employ an alternative to the continuous switching
function defined above. ={EXP D_0=0.2 R_0=0.1 D_MAX=0.66}
csums: COLUMNSUMS MATRIXcompulsory keyword
the action that calculates the adjacency matrix vessel we would like to analyze =mat MEANtake the mean of these variables.
PRINT ARGthe input for this action is the scalar output from one or more other actions. =csums.* FILEthe name of the file on which to output these quantities =colvar

Glossary of keywords and components
The atoms involved can be specified using
 ATOMS The list of atoms for which you would like to calculate the contact matrix. The atoms involved must be specified as a list of labels of MultiColvar or labels of a MultiColvar functions actions. If you would just like to use the atomic positions you can use a DENSITY command to specify a group of atoms. Specifying your atomic positions using labels of other MultiColvar or MultiColvar functions commands is useful, however, as you can then exploit a much wider variety of functions of the contact matrix as described in Exploiting contact matrices. For more information on how to specify lists of atoms see Groups and Virtual Atoms
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 HIGHMEM ( default=off ) use a more memory intensive version of this collective variable 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. You can use multiple instances of this keyword i.e. SWITCH1, SWITCH2, SWITCH3...