Shortcut: DISPLACEMENT

Module refdist
Description Usage
Calculate the displacement vector between the pair of input vectors used in 1 tutorialsused in 0 eggs
output value type
the differences between the input arguments vector/matrix

Further details and examples

Calculate the displacement vector between the pair of input vectors

This shortcut can be used to calculate the vector of displacements between two input vectors as shown below.

Click on the labels of the actions for more information on what each action computes
tested on2.11
c: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=1,2,3
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
dd: DISPLACEMENTCalculate the displacement vector between the pair of input vectors This action is a shortcut. More details ARG1The point that we are calculating the distance from=c ARG2The point that we are calculating the distance to=d
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=dd FILEthe name of the file on which to output these quantities=colvar

The output here, dd, is a 1×3 matrix for reasons that will become clear later in this documentation. Notice that we can obtain the same result by specifying the input vectors here as two sets of three scalars as shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
c1: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUEthe single number that you would like to store=1
d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
c2: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUEthe single number that you would like to store=2
d2: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4
c3: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUEthe single number that you would like to store=3
d3: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=5,6
dd: DISPLACEMENTCalculate the displacement vector between the pair of input vectors This action is a shortcut. More details ARG1The point that we are calculating the distance from=c1,c2,c3 ARG2The point that we are calculating the distance to=d1,d2,d3
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=dd FILEthe name of the file on which to output these quantities=colvar

The DISPLACEMENT command that has been introduced in the above inputs is primarily used within the EUCLIDEAN_DISTANCE, NORMALIZED_EUCLIDEAN_DISTANCE and MAHALANOBIS_DISTANCE shortcuts. If the 1×N matrix of displacements that that we obtainfrom these commands is, D, these three actions calculate

d=DMDT

The N×N matrix M here is the identity if you are using EUCLIDEAN_DISTANCE, a diagonal matrix if you are using NORMALIZED_EUCLIDEAN_DISTANCE and a full matrix if you are computing the MAHALANOBIS_DISTANCE.

Calculating multiple displacement vectors

The reason the output of DISPLACEMENT is a 1×3 matrix here becomes clearer once we consider the following input:

Click on the labels of the actions for more information on what each action computes
tested on2.11
ref_psi: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=2.25
ref_phi: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=-1.91

psi: TORSIONCalculate one or multiple torsional angles. More details ATOMS1the four atoms involved in the torsional angle=1,2,3,4 ATOMS2the four atoms involved in the torsional angle=5,6,7,8 ATOMS3the four atoms involved in the torsional angle=9,10,11,12 phi: TORSIONCalculate one or multiple torsional angles. More details ATOMS1the four atoms involved in the torsional angle=13,14,15,16 ATOMS2the four atoms involved in the torsional angle=17,18,19,20 ATOMS3the four atoms involved in the torsional angle=21,22,23,24 dd: DISPLACEMENTCalculate the displacement vector between the pair of input vectors This action is a shortcut. More details ARG1The point that we are calculating the distance from=psi,phi ARG2The point that we are calculating the distance to=ref_psi,ref_phi PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=dd FILEthe name of the file on which to output these quantities=colvar

The output from the input above is a 3×2 matrix. The rows of this matrix run over the 3 different torsion values that have been specified in the psi and phi commands. The first column of the matrix contains the differences between each of the instantaneous psi aingles and the reference value for this angle, while the second columns contains the differences between the phi angles and the reference.

In other words, we can calculate multiple displacement vectors at once as each row of the final output matrix will contain a vector of displacements between two vectors. Notice that we can use a similar input to calculate the differences between the instantaneous value of a pair of torsions and 3 reference values as shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
ref_psi: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=2.25,1.3,-1.5
ref_phi: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=-1.91,-0.6,2.4

psi: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4 phi: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=13,14,15,16 dd: DISPLACEMENTCalculate the displacement vector between the pair of input vectors This action is a shortcut. More details ARG1The point that we are calculating the distance from=psi,phi ARG2The point that we are calculating the distance to=ref_psi,ref_phi PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=dd FILEthe name of the file on which to output these quantities=colvar

The output here will again be a 3×2 matrix with each of the three rows holding a vector of displacements between the 2 instananeous values and one of the three sets of reference values.

Lastly, we can use two sets of vectors in the input to DISPLACEMENT as shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
ref_psi: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=2.25,1.3,-1.5
ref_phi: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=-1.91,-0.6,2.4

psi: TORSIONCalculate one or multiple torsional angles. More details ATOMS1the four atoms involved in the torsional angle=1,2,3,4 ATOMS2the four atoms involved in the torsional angle=5,6,7,8 ATOMS3the four atoms involved in the torsional angle=9,10,11,12 phi: TORSIONCalculate one or multiple torsional angles. More details ATOMS1the four atoms involved in the torsional angle=13,14,15,16 ATOMS2the four atoms involved in the torsional angle=17,18,19,20 ATOMS3the four atoms involved in the torsional angle=21,22,23,24 dd: DISPLACEMENTCalculate the displacement vector between the pair of input vectors This action is a shortcut. More details ARG1The point that we are calculating the distance from=psi,phi ARG2The point that we are calculating the distance to=ref_psi,ref_phi PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=dd FILEthe name of the file on which to output these quantities=colvar

The output here is still a 3×2 matrix. Now, however, each of the three instantaneous angles we have calculated has its own set of reference values. A different pair of instaneous and reference values is used to calculate each element of the resulting matrix.

DISPLACEMENT actions that compute M×N matrices, D, are used within the EUCLIDEAN_DISTANCE, NORMALIZED_EUCLIDEAN_DISTANCE and MAHALANOBIS_DISTANCE shortcuts. Doing so is useful as if you take the diagonal elements of a product of matrices that is similar to the product of vectors and matrices that we introduced earlier:

d=DMDT

you can calculate M values for the EUCLIDEAN_DISTANCE, NORMALIZED_EUCLIDEAN_DISTANCE and MAHALANOBIS_DISTANCE.

Syntax

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

Keyword Type Default Description
ARG1 compulsory none The point that we are calculating the distance from
ARG2 compulsory none The point that we are calculating the distance to