Module |
multicolvar |
Description |
Usage |
Calculate the distances between multiple piars of atoms |
  |
output value |
type |
the DISTANCES between the each pair of atoms that were specified |
vector |
Output components
This action can calculate the values in the following table when the associated keyword is included in the input for the action. These values can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the value required from the list below.
Name |
Type |
Keyword |
Description |
lessthan |
scalar |
LESS_THAN |
the number of colvars that have a value less than a threshold |
morethan |
scalar |
MORE_THAN |
the number of colvars that have a value more than a threshold |
altmin |
scalar |
ALT_MIN |
the minimum value of the cv |
min |
scalar |
MIN |
the minimum colvar |
max |
scalar |
MAX |
the maximum colvar |
between |
scalar |
BETWEEN |
the number of colvars that have a value that lies in a particular interval |
highest |
scalar |
HIGHEST |
the largest of the colvars |
lowest |
scalar |
LOWEST |
the smallest of the colvars |
sum |
scalar |
SUM |
the sum of the colvars |
mean |
scalar |
MEAN |
the mean of the colvars |
x |
vector |
COMPONENTS |
the x-components of the distance vectors |
y |
vector |
COMPONENTS |
the y-components of the distance vectors |
z |
vector |
COMPONENTS |
the z-components of the distance vectors |
The atoms that serve as the input for this action are specified using one or more of the keywords in the following table.
Keyword |
Type |
Description |
GROUP |
atoms |
Calculate the distance between each distinct pair of atoms in the group |
GROUPA |
atoms |
Calculate the distances between all the atoms in GROUPA and all the atoms in GROUPB |
GROUPB |
atoms |
Calculate the distances between all the atoms in GROUPA and all the atoms in GROUPB |
ATOMS |
atoms |
the pairs of atoms that you would like to calculate the angles for |
ORIGIN |
atoms |
calculate the distance of all the atoms specified using the ATOMS keyword from this point |
LOCATION |
atoms |
the location at which the CV is assumed to be in space |
Further details and examples
Calculate the distances between multiple piars of atoms
This shortcut action allows you to calculate function of the distribution of distatnces and reproduces the syntax in older PLUMED versions.
If you look at the example inputs below you can
see how the new syntax operates. We would strongly encourage you to use the newer syntax as it offers greater flexibility.
The following input tells plumed to calculate the distances between atoms 3 and 5 and
between atoms 1 and 2 and to print the minimum for these two distances.
Click on the labels of the actions for more information on what each action computes
d1The DISTANCES action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCES between the each pair of atoms that were specified |
d1_min | scalar | the minimum colvar |
: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details ATOMS1the pairs of atoms that you would like to calculate the angles for=3,5 ATOMS2the pairs of atoms that you would like to calculate the angles for=1,2 MINcalculate the minimum value={BETA=0.1}
# d1: DISTANCES ATOMS1=3,5 ATOMS2=1,2 MIN={BETA=0.1}
d1_vatom1The CENTER_FAST action with label d1_vatom1 calculates the following quantities: Quantity | Type | Description |
d1_vatom1 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=3,5
d1_vatom2The CENTER_FAST action with label d1_vatom2 calculates the following quantities: Quantity | Type | Description |
d1_vatom2 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1,2
d1_grpThe GROUP action with label d1_grp calculates the following quantities: Quantity | Type | Description |
d1_grp | atoms | indices of atoms specified in GROUP |
: GROUPDefine a group of atoms so that a particular list of atoms can be referenced with a single label in definitions of CVs or virtual atoms. More details ATOMSthe numerical indexes for the set of atoms in the group=d1_vatom1,d1_vatom2
d1The DISTANCE action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCE for each set of specified atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=3,5 ATOMS2the pair of atom that we are calculating the distance between=1,2
d1_me_minThe CUSTOM action with label d1_me_min calculates the following quantities: Quantity | Type | Description |
d1_me_min | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=d1 FUNCthe function you wish to evaluate=exp(0.1/x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_mec_minThe SUM action with label d1_mec_min calculates the following quantities: Quantity | Type | Description |
d1_mec_min | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=d1_me_min PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_minThe CUSTOM action with label d1_min calculates the following quantities: Quantity | Type | Description |
d1_min | scalar | an arbitrary function |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=d1_mec_min FUNCthe function you wish to evaluate=0.1/log(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input --- PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1.min
The following input tells plumed to calculate the distances between atoms 3 and 5 and between atoms 1 and 2
and then to calculate the number of these distances that are less than 0.1 nm. The number of distances
less than 0.1nm is then printed to a file.
Click on the labels of the actions for more information on what each action computes
d1The DISTANCES action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCES between the each pair of atoms that were specified |
d1_lessthan | scalar | the number of colvars that have a value less than a threshold |
: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details ATOMS1the pairs of atoms that you would like to calculate the angles for=3,5 ATOMS2the pairs of atoms that you would like to calculate the angles for=1,2 LESS_THANcalculate the number of variables that are less than a certain target value. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL R_0=0.1}
# d1: DISTANCES ATOMS1=3,5 ATOMS2=1,2 LESS_THAN={RATIONAL R_0=0.1}
d1_vatom1The CENTER_FAST action with label d1_vatom1 calculates the following quantities: Quantity | Type | Description |
d1_vatom1 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=3,5
d1_vatom2The CENTER_FAST action with label d1_vatom2 calculates the following quantities: Quantity | Type | Description |
d1_vatom2 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1,2
d1_grpThe GROUP action with label d1_grp calculates the following quantities: Quantity | Type | Description |
d1_grp | atoms | indices of atoms specified in GROUP |
: GROUPDefine a group of atoms so that a particular list of atoms can be referenced with a single label in definitions of CVs or virtual atoms. More details ATOMSthe numerical indexes for the set of atoms in the group=d1_vatom1,d1_vatom2
d1The DISTANCE action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCE for each set of specified atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=3,5 ATOMS2the pair of atom that we are calculating the distance between=1,2
d1_ltThe LESS_THAN action with label d1_lt calculates the following quantities: Quantity | Type | Description |
d1_lt | vector | the vector obtained by doing an element-wise application of a function that is one if the input is less than a threshold to the input vectors |
: LESS_THANUse a switching function to determine how many of the input variables are less than a certain cutoff. More details ARGthe values input to this function=d1 SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=0.1}
d1_lessthanThe SUM action with label d1_lessthan calculates the following quantities: Quantity | Type | Description |
d1_lessthan | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=d1_lt PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input --- PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1.lessthan
The following input tells plumed to calculate all the distances between atoms 1, 2 and 3 (i.e. the distances between atoms
1 and 2, atoms 1 and 3 and atoms 2 and 3). The average of these distances is then calculated.
Click on the labels of the actions for more information on what each action computes
d1The DISTANCES action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCES between the each pair of atoms that were specified |
d1_mean | scalar | the mean of the colvars |
: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details GROUPCalculate the distance between each distinct pair of atoms in the group=1-3 MEAN calculate the mean of all the quantities
# d1: DISTANCES GROUP=1-3 MEAN
d1The DISTANCE action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCE for each set of specified atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=2,1 ATOMS2the pair of atom that we are calculating the distance between=3,1 ATOMS3the pair of atom that we are calculating the distance between=3,2
d1_meanThe MEAN action with label d1_mean calculates the following quantities: Quantity | Type | Description |
d1_mean | scalar | the mean of all the elements in the input vector |
: MEANCalculate the arithmetic mean of the elements in a vector More details ARGthe values input to this function=d1 PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input --- PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1.mean
The following input tells plumed to calculate all the distances between the atoms in GROUPA and the atoms in GROUPB.
In other words the distances between atoms 1 and 2 and the distance between atoms 1 and 3. The number of distances
more than 0.1 is then printed to a file.
Click on the labels of the actions for more information on what each action computes
d1The DISTANCES action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCES between the each pair of atoms that were specified |
d1_morethan | scalar | the number of colvars that have a value more than a threshold |
: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details GROUPACalculate the distances between all the atoms in GROUPA and all the atoms in GROUPB=1 GROUPBCalculate the distances between all the atoms in GROUPA and all the atoms in GROUPB=2,3 MORE_THANcalculate the number of variables that are more than a certain target value. Options for this keyword are explained in the documentation for MORE_THAN.={RATIONAL R_0=0.1}
# d1: DISTANCES GROUPA=1 GROUPB=2,3 MORE_THAN={RATIONAL R_0=0.1}
d1The DISTANCE action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCE for each set of specified atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=1,2 ATOMS2the pair of atom that we are calculating the distance between=1,3
d1_mtThe MORE_THAN action with label d1_mt calculates the following quantities: Quantity | Type | Description |
d1_mt | vector | the vector obtained by doing an element-wise application of a function that is one if the if the input is more than a threshold to the input vectors |
: MORE_THANUse a switching function to determine how many of the input variables are more than a certain cutoff. More details ARGthe values input to this function=d1 SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=0.1}
d1_morethanThe SUM action with label d1_morethan calculates the following quantities: Quantity | Type | Description |
d1_morethan | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=d1_mt PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input --- PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1.morethan
Calculating minimum distances
To calculate and print the minimum distance between two groups of atoms you use the following commands
Click on the labels of the actions for more information on what each action computes
d1The DISTANCES action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCES between the each pair of atoms that were specified |
d1_min | scalar | the minimum colvar |
: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details GROUPACalculate the distances between all the atoms in GROUPA and all the atoms in GROUPB=1-10 GROUPBCalculate the distances between all the atoms in GROUPA and all the atoms in GROUPB=11-20 MINcalculate the minimum value={BETA=500.}
# d1: DISTANCES GROUPA=1-10 GROUPB=11-20 MIN={BETA=500.}
d1The DISTANCE action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCE for each set of specified atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=1,11 ATOMS2the pair of atom that we are calculating the distance between=1,12 ATOMS3the pair of atom that we are calculating the distance between=1,13 ATOMS4the pair of atom that we are calculating the distance between=1,14 ATOMS5the pair of atom that we are calculating the distance between=1,15
d1_me_minThe CUSTOM action with label d1_me_min calculates the following quantities: Quantity | Type | Description |
d1_me_min | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=d1 FUNCthe function you wish to evaluate=exp(500./x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_mec_minThe SUM action with label d1_mec_min calculates the following quantities: Quantity | Type | Description |
d1_mec_min | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=d1_me_min PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_minThe CUSTOM action with label d1_min calculates the following quantities: Quantity | Type | Description |
d1_min | scalar | an arbitrary function |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=d1_mec_min FUNCthe function you wish to evaluate=500./log(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input --- PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1.min FILEthe name of the file on which to output these quantities=colvar STRIDE the frequency with which the quantities of interest should be output=10
In order to ensure that the minimum value has continuous derivatives we use the following function:
s=βlog∑iexp(βsi)
where β is a user specified parameter.
This input is used rather than a separate MINDIST colvar so that the same routine and the same input style can be
used to calculate minimum coordination numbers (see COORDINATIONNUMBER), minimum
angles (see ANGLES) and many other variables.
This new way of calculating mindist is part of plumed 2's multicolvar functionality. These special actions
allow you to calculate multiple functions of a distribution of simple collective variables. As an example you
can calculate the number of distances less than 1.0, the minimum distance, the number of distances more than
2.0 and the number of distances between 1.0 and 2.0 by using the following command:
Click on the labels of the actions for more information on what each action computes
d1The DISTANCES action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCES between the each pair of atoms that were specified |
d1_lessthan | scalar | the number of colvars that have a value less than a threshold |
d1_morethan | scalar | the number of colvars that have a value more than a threshold |
d1_min | scalar | the minimum colvar |
d1_between | scalar | the number of colvars that have a value that lies in a particular interval |
: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details ...
GROUPACalculate the distances between all the atoms in GROUPA and all the atoms in GROUPB=1-10 GROUPBCalculate the distances between all the atoms in GROUPA and all the atoms in GROUPB=11-20
LESS_THANcalculate the number of variables that are less than a certain target value. Options for this keyword are explained in the documentation for LESS_THAN.={RATIONAL R_0=1.0}
MORE_THANcalculate the number of variables that are more than a certain target value. Options for this keyword are explained in the documentation for MORE_THAN.={RATIONAL R_0=2.0}
BETWEENcalculate the number of values that are within a certain range. Options for this keyword are explained in the documentation for BETWEEN.={GAUSSIAN LOWER=1.0 UPPER=2.0}
MINcalculate the minimum value={BETA=500.}
...
# d1: DISTANCES ...
d1The DISTANCE action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | vector | the DISTANCE for each set of specified atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=1,11 ATOMS2the pair of atom that we are calculating the distance between=1,12 ATOMS3the pair of atom that we are calculating the distance between=1,13 ATOMS4the pair of atom that we are calculating the distance between=1,14 ATOMS5the pair of atom that we are calculating the distance between=1,15
d1_ltThe LESS_THAN action with label d1_lt calculates the following quantities: Quantity | Type | Description |
d1_lt | vector | the vector obtained by doing an element-wise application of a function that is one if the input is less than a threshold to the input vectors |
: LESS_THANUse a switching function to determine how many of the input variables are less than a certain cutoff. More details ARGthe values input to this function=d1 SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=1.0}
d1_lessthanThe SUM action with label d1_lessthan calculates the following quantities: Quantity | Type | Description |
d1_lessthan | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=d1_lt PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_mtThe MORE_THAN action with label d1_mt calculates the following quantities: Quantity | Type | Description |
d1_mt | vector | the vector obtained by doing an element-wise application of a function that is one if the if the input is more than a threshold to the input vectors |
: MORE_THANUse a switching function to determine how many of the input variables are more than a certain cutoff. More details ARGthe values input to this function=d1 SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=2.0}
d1_morethanThe SUM action with label d1_morethan calculates the following quantities: Quantity | Type | Description |
d1_morethan | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=d1_mt PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_me_minThe CUSTOM action with label d1_me_min calculates the following quantities: Quantity | Type | Description |
d1_me_min | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=d1 FUNCthe function you wish to evaluate=exp(500./x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_mec_minThe SUM action with label d1_mec_min calculates the following quantities: Quantity | Type | Description |
d1_mec_min | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=d1_me_min PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_minThe CUSTOM action with label d1_min calculates the following quantities: Quantity | Type | Description |
d1_min | scalar | an arbitrary function |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=d1_mec_min FUNCthe function you wish to evaluate=500./log(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
d1_btThe BETWEEN action with label d1_bt calculates the following quantities: Quantity | Type | Description |
d1_bt | vector | the vector obtained by doing an element-wise application of a function that is one if the input falls within a particular range and zero otherwise to the input vectors |
: BETWEENUse a switching function to determine how many of the input variables are within a certain range. More details ARGthe values input to this function=d1 SWITCHThis keyword is used if you want to employ an alternative to the continuous function defined above={GAUSSIAN LOWER=1.0 UPPER=2.0}
d1_betweenThe SUM action with label d1_between calculates the following quantities: Quantity | Type | Description |
d1_between | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=d1_bt PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
# --- End of included input --- PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1.lessthan,d1.morethan,d1.between,d1.min FILEthe name of the file on which to output these quantities=colvar STRIDE the frequency with which the quantities of interest should be output=10
A calculation performed this way is fast because the expensive part of the calculation - the calculation of all the distances - is only done once per step.
Syntax
The following table describes the keywords and options that can be used with this action
Keyword |
Type |
Default |
Description |
GROUP |
input |
none |
Calculate the distance between each distinct pair of atoms in the group |
GROUPA |
input |
none |
Calculate the distances between all the atoms in GROUPA and all the atoms in GROUPB |
GROUPB |
input |
none |
Calculate the distances between all the atoms in GROUPA and all the atoms in GROUPB |
ATOMS |
input |
none |
the pairs of atoms that you would like to calculate the angles for |
ORIGIN |
input |
none |
calculate the distance of all the atoms specified using the ATOMS keyword from this point |
LOCATION |
input |
none |
the location at which the CV is assumed to be in space |
NOPBC |
optional |
false |
ignore the periodic boundary conditions when calculating distances |
COMPONENTS |
optional |
false |
calculate the x, y and z components of the distance separately and store them as label |
SCALED_COMPONENTS |
optional |
false |
calculate the a, b and c scaled components of the distance separately and store them as label |
LOWMEM |
optional |
false |
this flag does nothing and is present only to ensure back-compatibility |
LESS_THAN |
optional |
not used |
calculate the number of variables that are less than a certain target value. Options for this keyword are explained in the documentation for LESS_THAN. |
MORE_THAN |
optional |
not used |
calculate the number of variables that are more than a certain target value. Options for this keyword are explained in the documentation for MORE_THAN. |
ALT_MIN |
optional |
not used |
calculate the minimum value |
MIN |
optional |
not used |
calculate the minimum value |
MAX |
optional |
not used |
calculate the maximum value |
BETWEEN |
optional |
not used |
calculate the number of values that are within a certain range. Options for this keyword are explained in the documentation for BETWEEN. |
HIGHEST |
optional |
false |
this flag allows you to recover the highest of these variables |
HISTOGRAM |
optional |
not used |
calculate a discretized histogram of the distribution of values |
LOWEST |
optional |
false |
this flag allows you to recover the lowest of these variables |
SUM |
optional |
false |
calculate the sum of all the quantities |
MEAN |
optional |
false |
calculate the mean of all the quantities |