Shortcut: MORE_THAN

Module function
Description Usage
Use a switching function to determine how many of the input variables are more than a certain cutoff. used in 4 tutorialsused in 21 eggs
output value type
a function that is one if the if the input is more than a threshold scalar/vector/matrix

Input

The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.

Keyword Type Description
ARG scalar/vector/matrix the values input to this function

Further details and examples

Use a switching function to determine how many of the input variables are more than a certain cutoff.

This action takes one argument, r and evaluates the following function:

w(s)=1s(r)

In this equation s(r) is one of the switching functions described in the documentation for the action LESS_THAN. The output value w is thus a number between 0 and 1 that tells you if the input value is greater than some cutoff. Furthermore, the value of w smoothly from zero to one as the input value r crosses the threshold of interest so any function of this value is differentiable.

The following example, shows how we can apply the function above on the instantaneous value of the distance between atom 1 and 2. The MORE_THAN action here is used to determine whether the input distance is greater than 0.2 nm.

Click on the labels of the actions for more information on what each action computes
tested on2.11
d: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
b: 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=d SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=0.2}

You can use all the switching function options described in the documentation for LESS_THAN here in place of RATIONAL.

Non rank zero arguments

Instead of passing a single scalar in the input to the MORE_THAN action you can pass a single vector as shown here:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d: 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=3,4 ATOMS3the pair of atom that we are calculating the distance between=5,6 ATOMS4the pair of atom that we are calculating the distance between=7,8
b: 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=d SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=0.2}

The input to the MORE_THAN action here is a vector with four elements. The output from the action b is similarly a vector with four elements. In calculating the elements of this vector PLUMED applies the function described in the previous section on each of the distances in turn. The first element of b thus tells you if the distance between atoms 1 and 2 is between greater than 0.2 nm, the second element tells you if the distance between atoms 3 and 4 is greater than 0.2 nm and so on.

You can use the commands in the above example input to evaluate the number of distances that greater than a threshold as follows:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d: 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=3,4 ATOMS3the pair of atom that we are calculating the distance between=5,6 ATOMS4the pair of atom that we are calculating the distance between=7,8
b: 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=d SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=0.2}
s: SUMCalculate the sum of the arguments More details ARGthe values input to this function=b PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=s FILEthe name of the file on which to output these quantities=colvar

The final scalar that is output here is evaluated using the following summation:

s=i1s(di)

where the sum over i here runs over the four distances in the above expression. This scalar tells you the number of distances that are more than 0.2 nm.

Notice that you can do something similar with a matrix as input as shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action has hidden defaults. More details GROUPAwhen you are calculating the adjacency matrix between two sets of atoms this keyword is used to specify the atoms along with the keyword GROUPB=1-10 GROUPBwhen you are calculating the adjacency matrix between two sets of atoms this keyword is used to specify the atoms along with the keyword GROUPA=11-20
b: 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=d SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={RATIONAL R_0=0.2}
s: SUMCalculate the sum of the arguments More details ARGthe values input to this function=b PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=s FILEthe name of the file on which to output these quantities=colvar

This input tells PLUMED to calculate the 100 distances between the atoms in the two input groups. The final value that is printed to the colvar file then tells you how many of these distances are greater than 0.2 nm.

Syntax

The following table describes the keywords and options that can be used with this action

Keyword Type Default Description
ARG input none the values input to this function
NN compulsory 6 The n parameter of the switching function
MM compulsory 0 The m parameter of the switching function; 0 implies 2*NN
D_0 compulsory 0.0 The d_0 parameter of the switching function
R_0 compulsory none The r_0 parameter of the switching function
SWITCH optional not used This keyword is used if you want to employ an alternative to the continuous swiching function defined above
SQUARED optional false is the input quantity the square of the value that you would like to apply the switching function to