It is only available if you configure PLUMED with ./configure –enable-modules=envsim . Furthermore, this feature is still being developed so take care when using it and report any problems on the mailing list.
Measure how similar the environment around atoms is to that found in some reference crystal structure.
This CV was introduced in this article [87]. The starting point for the definition of the CV is the local atomic density around an atom. We consider an environment \(\chi\) around this atom and we define the density by
where \(i\) runs over the neighbors in the environment \(\chi\), \(\sigma\) is a broadening parameter, and \(\mathbf{r}_i\) are the coordinates of the neighbors relative to the central atom. We now define a reference environment or template \(\chi_0\) that contains \(n\) reference positions \(\{\mathbf{r}^0_1,...,\mathbf{r}^0_n\}\) that describe, for instance, the nearest neighbors in a given lattice. \(\sigma\) is set using the SIGMA keyword and \(\chi_0\) is chosen with the CRYSTAL_STRUCTURE keyword. If only the SPECIES keyword is given then the atoms defined there will be the central and neighboring atoms. If instead the SPECIESA and SPECIESB keywords are given then SPECIESA determines the central atoms and SPECIESB the neighbors.
The environments \(\chi\) and \(\chi_0\) are compared using the kernel,
such that \(\tilde{k}_{\chi_0}(\chi_0) = 1\). The above kernel is computed for each atom in the SPECIES or SPECIESA keywords. This quantity is a multicolvar so you can compute it for multiple atoms using a single PLUMED action and then compute the average value for the atoms in your system, the number of atoms that have an \(\tilde{k}_{\chi_0}\) value that is more that some target and so on.
The kernel can be generalized to crystal structures described as a lattice with a basis of more than one atom. In this case there is more than one type of environment. We consider the case of \(M\) environments \(X = \chi_1,\chi_2,...,\chi_M\) and we define the kernel through a best match strategy:
For a large enough \(\lambda\) this expression will select the largest \(\tilde{k}_{\chi_l}(\chi)\) with \(\chi_l \in X\). This approach can be used, for instance, to target the hexagonal closed packed (HCP keyword) or the diamond structure (DIAMOND keyword).
The CRYSTAL_STRUCTURE keyword can take the values SC (simple cubic), BCC (body centered cubic), FCC (face centered cubic), HCP (hexagonal closed pack), DIAMOND (cubic diamond), and CUSTOM (user defined). All options follow the same conventions as in the lattice command of LAMMPS. If a CRYSTAL_STRUCTURE other than CUSTOM is used, then the lattice constants have to be specified using the keyword LATTICE_CONSTANTS. One value has to be specified for SC, BCC, FCC, and DIAMOND and two values have to be set for HCP (a and c lattice constants in that order).
If the CUSTOM option is used then the reference environments have to be specified by the user. The reference environments are specified in pdb files containing the distance vectors from the central atom to the neighbors. Make sure your PDB file is correctly formatted as explained in this page If only one reference environment is specified then the filename should be given as argument of the keyword REFERENCE. If instead several reference environments are given, then they have to be provided in separate pdb files and given as arguments of the keywords REFERENCE_1, REFERENCE_2, etc. If you have a reference crystal structure configuration you can use the Environment Finder app to determine the reference environments that you should use.
If multiple chemical species are involved in the calculation, it is possible to provide the atom types (names) both for atoms in the reference environments and in the simulation box. This information is provided in pdb files using the atom name field. The comparison between environments is performed taking into account whether the atom names match.
Examples
The following input calculates the ENVIRONMENTSIMILARITY kernel for 250 atoms in the system using the BCC atomic environment as target, and then calculates and prints the average value for this quantity.
Click on the labels of the actions for more information on what each action computes
( default=off ) calculate the mean of all the quantities.
The ENVIRONMENTSIMILARITY action with label es calculates a single scalar value
The next example compares the environments of the 96 selected atoms with a user specified reference environment. The reference environment is contained in the env1.pdb file. Once the kernel is computed the average and the number of atoms with a kernel larger than 0.5 are computed.
Click on the labels of the actions for more information on what each action computes
PDB files with relative distances from central atom.
=env1.pdb
MEAN
( default=off ) calculate the mean of all the quantities.
MORE_THAN
calculate the number of variables that are more than a certain target value.
={RATIONAL R_0=0.5 NN=12 MM=24}
...The ENVIRONMENTSIMILARITY action with label es calculates a single scalar value
The next example is similar to the one above but in this case 4 reference environments are specified. Each reference environment is given in a separate pdb file.
Click on the labels of the actions for more information on what each action computes
PDB files with relative distances from central atom.
=env.pdb
MEAN
( default=off ) calculate the mean of all the quantities.
MORE_THAN
calculate the number of variables that are more than a certain target value.
={RATIONAL R_0=0.5 NN=12 MM=24}
ATOM_NAMES_FILE
PDB file with atom names for all atoms in SPECIES.
=atom-names.pdb
... You cannot view the components that are calculated by each action for this input file. Sorry
Here the file env.pdb is:
ATOM 1 O MOL 1 -2.239 -1.296 -0.917 1.00 0.00 O
ATOM 2 O MOL 1 0.000 0.000 2.751 1.00 0.00 O
where atoms are of type O, and the atom-names.pdb file is:
ATOM 1 O X 1 0.000 2.593 4.126 0.00 0.00 O
ATOM 2 H X 1 0.000 3.509 3.847 0.00 0.00 H
ATOM 3 H X 1 0.000 2.635 5.083 0.00 0.00 H
ATOM 4 O X 1 0.000 2.593 11.462 0.00 0.00 O
ATOM 5 H X 1 0.000 3.509 11.183 0.00 0.00 H
ATOM 6 H X 1 0.000 2.635 12.419 0.00 0.00 H
where atoms are of type O and H. In this case, all atoms are used as centers, but only neighbors of type O are taken into account.
Glossary of keywords and components
Description of components
Quantity
Keyword
Description
lessthan
LESS_THAN
the number of colvars that have a value less than a threshold
morethan
MORE_THAN
the number of colvars that have a value more than a threshold
altmin
ALT_MIN
the minimum value of the cv
min
MIN
the minimum colvar
max
MAX
the maximum colvar
between
BETWEEN
the number of colvars that have a value that lies in a particular interval
highest
HIGHEST
the largest of the colvars
lowest
LOWEST
the smallest of the colvars
sum
SUM
the sum of the colvars
mean
MEAN
the mean of the colvars
The atoms involved can be specified using
SPECIES
this keyword is used for colvars such as coordination number. In that context it specifies that plumed should calculate one coordination number for each of the atoms specified. Each of these coordination numbers specifies how many of the other specified atoms are within a certain cutoff of the central atom. You can specify the atoms here as another multicolvar action or using a MultiColvarFilter or ActionVolume action. When you do so the quantity is calculated for those atoms specified in the previous multicolvar. This is useful if you would like to calculate the Steinhardt parameter for those atoms that have a coordination number more than four for example
Or alternatively by using
SPECIESA
this keyword is used for colvars such as the coordination number. In that context it species that plumed should calculate one coordination number for each of the atoms specified in SPECIESA. Each of these cooordination numbers specifies how many of the atoms specifies using SPECIESB is within the specified cutoff. As with the species keyword the input can also be specified using the label of another multicolvar
SPECIESB
this keyword is used for colvars such as the coordination number. It must appear with SPECIESA. For a full explanation see the documentation for that keyword
Compulsory keywords
CRYSTAL_STRUCTURE
( default=FCC ) Targeted crystal structure. Options are: SC: simple cubic, BCC: body center cubic, FCC: face centered cubic, HCP: hexagonal closed pack, DIAMOND: cubic diamond, CUSTOM: user defined
LATTICE_CONSTANTS
Lattice constants. Two comma separated values for HCP, one value for all other CRYSTAL_STRUCTURES.
SIGMA
( default=0.1 ) the width to use for the gaussian kernels
LAMBDA
( default=100 ) Lambda parameter. This is only used if you have more than one reference environment
CUTOFF
( default=3 ) how many multiples of sigma would you like to consider beyond the maximum distance in the environment
Options
HIGHEST
( default=off ) this flag allows you to recover the highest of these variables.
LOWEST
( default=off ) this flag allows you to recover the lowest of these variables.
SUM
( default=off ) calculate the sum of all the quantities.
MEAN
( default=off ) calculate the mean of all the quantities.
REFERENCE
PDB files with relative distances from central atom. Use this keyword if you are targeting a single reference environment.
REFERENCE_
PDB files with relative distances from central atom. Each file corresponds to one template. Use these keywords if you are targeting more than one reference environment.. You can use multiple instances of this keyword i.e. REFERENCE_1, REFERENCE_2, REFERENCE_3...
ATOM_NAMES_FILE
PDB file with atom names for all atoms in SPECIES. Atoms in reference environments will be compared only if atom names match.
LESS_THAN
calculate the number of variables that are less than a certain target value. This quantity is calculated using \(\sum_i \sigma(s_i)\), where \(\sigma(s)\) is a switchingfunction.. You can use multiple instances of this keyword i.e. LESS_THAN1, LESS_THAN2, LESS_THAN3...
MORE_THAN
calculate the number of variables that are more than a certain target value. This quantity is calculated using \(\sum_i 1 - \sigma(s_i)\), where \(\sigma(s)\) is a switchingfunction.. You can use multiple instances of this keyword i.e. MORE_THAN1, MORE_THAN2, MORE_THAN3...
ALT_MIN
calculate the minimum value. To make this quantity continuous the minimum is calculated using \( \textrm{min} = -\frac{1}{\beta} \log \sum_i \exp\left( -\beta s_i \right) \) The value of \(\beta\) in this function is specified using (BETA= \(\beta\)).
MIN
calculate the minimum value. To make this quantity continuous the minimum is calculated using \( \textrm{min} = \frac{\beta}{ \log \sum_i \exp\left( \frac{\beta}{s_i} \right) } \) The value of \(\beta\) in this function is specified using (BETA= \(\beta\))
MAX
calculate the maximum value. To make this quantity continuous the maximum is calculated using \( \textrm{max} = \beta \log \sum_i \exp\left( \frac{s_i}{\beta}\right) \) The value of \(\beta\) in this function is specified using (BETA= \(\beta\))
BETWEEN
calculate the number of values that are within a certain range. These quantities are calculated using kernel density estimation as described on histogrambead.. You can use multiple instances of this keyword i.e. BETWEEN1, BETWEEN2, BETWEEN3...
HISTOGRAM
calculate a discretized histogram of the distribution of values. This shortcut allows you to calculates NBIN quantites like BETWEEN.