HBOND_MATRIX
This is part of the adjmat module

Adjacency matrix in which two atoms are adjacent if there is a hydrogen bond between them.

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 adjacency matrix are calculated using:

\[ a_{ij} = \sigma_{oo}( |\mathbf{r}_{ij}| ) \sum_{k=1}^N \sigma_{oh}( |\mathbf{r}_{ik}| ) \sigma_{\theta}( \theta_{kij} ) \]

This expression was derived by thinking about how to detect if there is a hydrogen bond between atoms \(i\) and \(j\). The notion is that if the hydrogen bond is present atoms \(i\) and \(j\) should be within a certain cutoff distance. In addition, there should be a hydrogen within a certain cutoff distance of atom \(i\) and this hydrogen should lie on or close to the vector connecting atoms \(i\) and \(j\). As such \(\sigma_{oo}( |\mathbf{r}_{ij}| )\) is a switchingfunction that acts on the modulus of the vector connecting atom \(i\) to atom \(j\). The sum over \(k\) then runs over all the hydrogen atoms that are specified using using HYDROGEN keyword. \(\sigma_{oh}(|\mathbf{r}_{ik}|)\) is a switchingfunction that acts on the modulus of the vector connecting atom \(i\) to atom \(k\) and \(\sigma_{\theta}(\theta_{kij})\) is a switchingfunction that acts on the angle between the vector connecting atoms \(i\) and \(j\) and the vector connecting atoms \(i\) and \(k\).

It is important to note that hydrogen bonds, unlike regular bonds, are asymmetric. In other words, the hydrogen atom does not sit at the mid point between the two other atoms in this three-center bond. As a result of this adjacency matrices calculated using HBOND_MATRIX are not symmetric like those calculated by CONTACT_MATRIX. One consequence of this fact is that the quantities found by performing ROWSUMS and COLUMNSUMS on a square HBOND_MATRIX are not the same as they would be if you performed ROWSUMS and COLUMNSUMS on a square CONTACT_MATRIX.

Examples

The following input can be used to analyze the number of hydrogen bonds each of the oxygen atoms in a box of water participates in. Each water molecule can participate in a hydrogen bond in one of two ways. It can either donate one of its hydrogen atom to the neighboring oxygen or it can accept a bond between the hydrogen of a neighboring water molecule and its own oxygen. The input below allows you to output information on the number of hydrogen bonds each of the water molecules donates and accepts. This information is output in two xyz files which each contain five columns of data. The first four of these columns are a label for the atom and the x, y and z position of the oxygen. The last column is then the number of accepted/donated hydrogen bonds.

Click on the labels of the actions for more information on what each action computes
tested on master
mat: HBOND_MATRIX 
ATOMS
the atoms for which you would like to calculate the adjacency matrix.
=1-192:3
HYDROGENS
The list of atoms that can form the bridge between the two interesting parts of the structure..
=2-192:3,3-192:3
SWITCH
The \ref switchingfunction that specifies how close a pair of atoms must be together for there to be a hydrogen bond between them.
={RATIONAL R_0=3.20}
HSWITCH
The \ref switchingfunction that specifies how close the hydrogen must be to the donor atom of the hydrogen bond for it to be considered a hydrogen bond.
={RATIONAL R_0=2.30}
ASWITCH
A \ref switchingfunction that is used to specify what the angle between the vector connecting the donor atom to the acceptor atom and the vector connecting the donor atom to the hydrogen must be in order for it considered to be a hydrogen bond.
={RATIONAL R_0=0.167pi}
SUM
could not find this keyword
rsums: ROWSUMS
MATRIX
could not find this keyword
=mat
MEAN
could not find this keyword
csums: COLUMNSUMS
MATRIX
could not find this keyword
=mat
MEAN
could not find this keyword
DUMPMULTICOLVAR
DATA
compulsory keyword the vector you wish to transform
=rsums
FILE
compulsory keyword the file that you would like to output the data to
=donors.xyz DUMPMULTICOLVAR
DATA
compulsory keyword the vector you wish to transform
=csums
FILE
compulsory keyword the file that you would like to output the data to
=acceptors.xyz
Glossary of keywords and components
Description of components

By default the value of the calculated quantity can be referenced elsewhere in the input file by using the label of the action. Alternatively this Action can be used to calculate the following quantities by employing the keywords listed below. These quantities can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the quantity required from the list below.

Quantity Keyword Description
w COMPONENTS the weight of the connection
x COMPONENTS the projection of the bond on the x axis
y COMPONENTS the projection of the bond on the y axis
z COMPONENTS the projection of the bond on the z axis
The atoms involved can be specified using
GROUP the atoms for which you would like to calculate the adjacency matrix. For more information on how to specify lists of atoms see Groups and Virtual Atoms
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. This is a depracated syntax that is equivalent to GROUP. You are strongly recommened to use GROUP instead of ATOMS.
Or alternatively by using
HYDROGENS The list of atoms that can form the bridge between the two interesting parts of the structure.. For more information on how to specify lists of atoms see Groups and Virtual Atoms
Compulsory keywords
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
SERIAL ( default=off ) do the calculation in serial. Do not parallelize
COMPONENTS ( default=off ) also calculate the components of the vector connecting the atoms in the contact matrix
NOPBC

( default=off ) don't use pbc

SWITCH The switchingfunction that specifies how close a pair of atoms must be together for there to be a hydrogen bond between them. You can use multiple instances of this keyword i.e. SWITCH1, SWITCH2, SWITCH3...
HSWITCH The switchingfunction that specifies how close the hydrogen must be to the donor atom of the hydrogen bond for it to be considered a hydrogen bond. You can use multiple instances of this keyword i.e. HSWITCH1, HSWITCH2, HSWITCH3...
ASWITCH A switchingfunction that is used to specify what the angle between the vector connecting the donor atom to the acceptor atom and the vector connecting the donor atom to the hydrogen must be in order for it considered to be a hydrogen bond. You can use multiple instances of this keyword i.e. ASWITCH1, ASWITCH2, ASWITCH3...