Exploiting contact matrices

A contact 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. There are various ways of defining whether a pair of atoms/molecules are adjacent or not. For example we can say two atoms are adjacent if the distance between them is less than some cutoff. Alternatively, if we have a have a pair of molecules, we might state they are adjacent if their centers of mass are within a certain cutoff and if the two molecules have the same orientation. Two electronegative atoms might be said to be adjacent if there is a hydrogen bond between them. For these reasons then PLUMED contains all of the following methods for calculating an adjacency matrix

ALIGNED_MATRIX Adjacency matrix in which two molecule are adjacent if they are within a certain cutoff and if they have the same orientation.
CONTACT_MATRIX Adjacency matrix in which two atoms are adjacent if they are within a certain cutoff.
HBOND_MATRIX Adjacency matrix in which two atoms are adjacent if there is a hydrogen bond between them.
HBPAMM_MATRIX Adjacency matrix in which two electronegative atoms are adjacent if they are hydrogen bonded
SMAC_MATRIX Adjacency matrix in which two molecules are adjacent if they are within a certain cutoff and if the angle between them is within certain ranges.
TOPOLOGY_MATRIX Adjacency matrix in which two atoms are adjacent if they are connected topologically

Once you have calculated an adjacency matrix you can then perform any one of the following operations on this object in order to reduce it to a scalar number or a set of connected components.

CLUSTER_WITHSURFACE Take a connected component that was found using a clustering algorithm and create a new cluster that contains those atoms that are in the cluster together with those atoms that are within a certain cutoff of the cluster.
COLUMNSUMS Sum the columns of a contact matrix
DFSCLUSTERING Find the connected components of the matrix using the depth first search clustering algorithm.
ROWSUMS Sum the rows of a adjacency matrix.
SPRINT Calculate SPRINT topological variables from an adjacency matrix.

If the function you have chosen reduces your contact matrix to a set of connected components you then need a method to convert these connected components into a scalar number or to output this information to a file. The various things that you can do with a set of connected components are listed below:

CLUSTER_DIAMETER Print out the diameter of one of the connected components
CLUSTER_DISTRIBUTION Calculate functions of the distribution of properties in your connected components.
CLUSTER_NATOMS Gives the number of atoms in the connected component
CLUSTER_PROPERTIES Calculate properties of the distribution of some quantities that are part of a connected component
DUMPGRAPH Write out the connectivity of the nodes in the graph in dot format.
OUTPUT_CLUSTER Output the indices of the atoms in one of the clusters identified by a clustering object