This is part of the clusters module | |
It is only available if you configure PLUMED with ./configure –enable-modules=clusters . Furthermore, this feature is still being developed so take care when using it and report any problems on the mailing list. |
Find the connected components of the matrix using the depth first search clustering algorithm.
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. As detailed in [107] these matrices provide a representation of a graph and can thus can be analyzed using tools from graph theory. This particular action performs a depth first search clustering to find the connected components of this graph. You can read more about depth first search here:
https://en.wikipedia.org/wiki/Depth-first_search
This action is useful if you are looking at a phenomenon such as nucleation where the aim is to detect the sizes of the crystalline nuclei that have formed in your simulation cell.
The input below calculates the coordination numbers of atoms 1-100 and then computes the an adjacency matrix whose elements measures whether atoms \(i\) and \(j\) are within 0.55 nm of each other. The action labelled dfs then treats the elements of this matrix as zero or ones and thus thinks of the matrix as defining a graph. This dfs action then finds the largest connected component in this graph. The sum of the coordination numbers for the atoms in this largest connected component are then computed and this quantity is output to a colvar file. The way this input can be used is described in detail in [107].
lq: COORDINATIONNUMBERSPECIES=1-100this keyword is used for colvars such as coordination number.SWITCH={CUBIC D_0=0.45 D_MAX=0.55}the switching function that it used in the construction of the contact matrixLOWMEMcm: CONTACT_MATRIX( default=off ) this flag does nothing and is present only to ensure back-compatibilityATOMS=lqthe atoms for which you would like to calculate the adjacency matrix.SWITCH={CUBIC D_0=0.45 D_MAX=0.55} dfs: DFSCLUSTERINGspecify the switching function to use between two sets of indistinguishable atoms.MATRIX=cm clust1: CLUSTER_PROPERTIESthe input matrix (can use ARG instead)CLUSTERS=dfscompulsory keyword the label of the action that does the clusteringCLUSTER=1compulsory keyword ( default=1 ) which cluster would you like to look at 1 is the largest cluster, 2 is the second largest, 3 is the the third largest and so on.SUMPRINT( default=off ) calculate the sum of all the quantities.ARG=clust1.*compulsory keyword the labels of the values that you would like to print to the fileFILE=colvarthe name of the file on which to output these quantities
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 | Description |
.#!value | vector with length that is equal to the number of rows in the input matrix. Elements of this vector are equal to the cluster that each node is a part of |
ARG | the input matrix |
LOWMEM | ( default=off ) this flag does nothing and is present only to ensure back-compatibility |
MATRIX | the input matrix (can use ARG instead) |