HBOND_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 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 analysed using a number of other algorithms as is detailed in [66].

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 asymetric. 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.

Description of components

When the label of this action is used as the input for a second you are not referring to a scalar quantity as you are in regular collective variables. The label is used to reference the full set of quantities calculated by the action. This is usual when using MultiColvar functions. Generally when doing this the previously calculated multicolvar will be referenced using the DATA keyword rather than ARG.

This Action can be used to calculate the following scalar quantities directly. These quantities are calculated by employing the keywords listed below. These quantities can then be referenced elsewhere in the input file by using this Action's label followed by a dot and the name of the quantity. Some amongst them can be calculated multiple times with different parameters. In this case the quantities calculated can be referenced elsewhere in the input by using the name of the quantity followed by a numerical identifier e.g. label.lessthan-1, label.lessthan-2 etc. When doing this and, for clarity we have made the label of the components customizable. As such by using the LABEL keyword in the description of the keyword input you can customize the component name

 Quantity Keyword Description sum SUM the sum of values
The atoms involved can be specified using
 ATOMS The list of atoms which can be part of a hydrogen bond. When this command is used the set of atoms that can donate a hydrogen bond is assumed to be the same as the set of atoms that can form hydrogen bonds. The atoms involved must be specifiedas 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 HYDROGENS The list of hydrogen atoms that can form part of a hydrogen bond. The atoms must be specified using a comma separated list, an index range or by using a GROUP. A list of hydrogen atoms is always required even if you specify the other atoms using DONORS and ACCEPTORS as described below.. For more information on how to specify lists of atoms see Groups and Virtual Atoms
Or alternatively by using
 DONORS The list of atoms which can donate a hydrogen bond. 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 ACCEPTORS The list of atoms which can accept a hydrogen bond. 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
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 parallelize 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 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... SUM calculate the sum of all the quantities. The final value can be referenced using label.sum. You can use multiple instances of this keyword i.e. SUM1, SUM2, SUM3... The corresponding values are then referenced using label.sum-1, label.sum-2, label.sum-3...
Examples

The following input can be used to analyse 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 its hydrogens to the neighbouring 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.

mat: HBOND_MATRIX ATOMS=1-192:3 HYDROGENS=2-192:3,3-192:3 SWITCH={RATIONAL R_0=3.20} HSWITCH={RATIONAL R_0=2.30} ASWITCH={RATIONAL R_0=0.167pi} SUM
rsums: ROWSUMS MATRIX=mat MEAN
csums: COLUMNSUMS MATRIX=mat MEAN
DUMPMULTICOLVAR DATA=rsums FILE=donors.xyz
DUMPMULTICOLVAR DATA=csums FILE=acceptors.x