Shortcut: KERNEL

Module refdist
Description Usage
Transform a set of input coordinates using a kernel function used in 0 tutorialsused in 0 eggs
output value type
the value of the kernel evaluated at the argument values scalar/vector

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 the arguments that should be used as input to this method

Further details and examples

Transform a set of input coordinates using a kernel function

This action takes a vector of arguments in input, s, the square of the NORMALIZED_EUCLIDEAN_DISTANCE or MAHALANOBIS_DISTANCE between the instataneous values of these arguments and a set of reference values for them is then computed. If this squared distance is x then the final quantity that is returned by this function is:

f=wK(x)

where w is a scalar that the user specifies using the WEIGHT keyword and K can be a function of x that the user specifies using the FUNC keyword or one of the Kernel functions options from the following table that are available internally:

Instruction Function
FUNC=gaussian exp(x/2)
FUNC=von-misses exp(x/2)
FUNC=triangular 1xifx<1otherwise0

The von-misses options here is used if the input arguments have a periodic domain. This instruction changes the way the MAHALANOBIS_DISTANCE is computed so that the method that is appropriate for using with periodic variables is employed in place of the default method.

Examples

The following example demonstrates how this action can be used to evaluate a Kernel that is a function of one argument:

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
k: KERNELTransform a set of input coordinates using a kernel function This action is a shortcut and it has hidden defaults. More details ARGthe arguments that should be used as input to this method=d TYPE the type of kernel to use=gaussian CENTERthe position of the center of the kernel=1 SIGMAsquare root of variance of the cluster=0.1

The NORMALIZED_EUCLIDEAN_DISTANCE between the instantaneous distance and the point 1 is evaluated here. The metric vector that is used to evaluate this distance is taking the reciprocal of the square of the input SIGMA value. Lastly, the height of the Gaussian, w, in the expression above is set equal to one. If you would like the total volume of the Gaussian to be equal to one you use the NORMALIZED keyword 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 ATOMSthe pair of atom that we are calculating the distance between=1,2
k: KERNELTransform a set of input coordinates using a kernel function This action is a shortcut and it has hidden defaults. More details ARGthe arguments that should be used as input to this method=d TYPE the type of kernel to use=gaussian CENTERthe position of the center of the kernel=1 SIGMAsquare root of variance of the cluster=0.1 NORMALIZED would you like the kernel function to be normalized

If your Kernel is a function of two arguments you can use the NORMALIZED_EUCLIDEAN_DISTANCE to evaluate the distance as is done in the following example:

Click on the labels of the actions for more information on what each action computes
tested on2.11
d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,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
k: KERNELTransform a set of input coordinates using a kernel function This action is a shortcut and it has hidden defaults. More details ARGthe arguments that should be used as input to this method=d1,d2 TYPE the type of kernel to use=gaussian CENTERthe position of the center of the kernel=1,1 SIGMAsquare root of variance of the cluster=0.1,0.1

or you can use the MAHALANOBIS_DISTANCE as is done here:

Click on the labels of the actions for more information on what each action computes
tested on2.11
phi: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
psi: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=5,6,7,8
k: KERNELTransform a set of input coordinates using a kernel function This action is a shortcut and it has hidden defaults. More details ...
   ARGthe arguments that should be used as input to this method=phi,psi TYPE the type of kernel to use=von-misses
   CENTERthe position of the center of the kernel=-1.09648066E+0000,-7.17867907E-0001
   COVARthe covariance of the kernel=1.40523052E-0001,-1.05385552E-0001,-1.05385552E-0001,1.63290557E-0001
...

To switch to using the MAHALANOBIS_DISTANCE you use COVAR instead of SIGMA and specify the covariance matrix of the kernel. The metric that is used when evaluating the distance is the inverse of the input covariance matrix.

Notice that you specify the Kernel function in a separate PLUMED input file by using an input like the one shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
#SETTINGS INPUTFILES=regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp
phi: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
psi: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=5,6,7,8
k: KERNELTransform a set of input coordinates using a kernel function This action is a shortcut and it has hidden defaults. More details ARGthe arguments that should be used as input to this method=phi,psi REFERENCEthe file from which to read the kernel parameters=
regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp
Click here to see an extract from this file.
×

FILE: regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp

#! FIELDS height phi psi sigma_phi_phi sigma_phi_psi sigma_psi_phi sigma_psi_psi 
#! SET kerneltype von-misses
      2.97197455E-0001     -1.91983118E+0000      2.25029540E+0000      2.45960237E-0001     -1.30615381E-0001     -1.30615381E-0001      2.40239117E-0001  
      2.29131448E-0002      1.39809354E+0000      9.54585380E-0002      9.61755708E-0002     -3.55657919E-0002     -3.55657919E-0002      1.06147253E-0001  
      5.06676398E-0001     -1.09648066E+0000     -7.17867907E-0001      1.40523052E-0001     -1.05385552E-0001     -1.05385552E-0001      1.63290557E-0001  
      8.38235835E-0003      1.34746362E+0000     -2.92912242E+0000      1.50601708E-0001     -1.16056708E-0001     -1.16056708E-0001      2.58187042E-0001  
      1.34976025E-0001     -1.12488647E+0000      2.46856186E+0000      6.47837871E-0002     -5.48993853E-0002     -5.48993853E-0002      1.28240303E-0001  
      2.62404899E-0002      9.93277439E-0001      6.63990207E-0001      3.77594608E-0002     -2.13908228E-0002     -2.13908228E-0002      7.02294006E-0002  
      3.61412967E-0003      9.92586372E-0001     -2.28743740E+0000      6.13474371E-0002      9.32283874E-0003      9.32283874E-0003      4.90062255E-0002  
NUMBER if there are multiple sets of kernel parameters in the input file which set of kernel parameters would you like to read in here=3

This command computes the same Kernel that was computed in the previous input. The keyword REFERENCE specifies that the parameters are to be read from the file and the keyword NUMBER indicates that the parameters are found on the third line of that file.

Lastly, note that you can use vectors in the input to this shortcut as shown here:

Click on the labels of the actions for more information on what each action computes
tested on2.11
#SETTINGS INPUTFILES=regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp
phi: 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=9,10,11,12 ATOMS3the four atoms involved in the torsional angle=17,18,19,20
psi: TORSIONCalculate one or multiple torsional angles. More details ATOMS1the four atoms involved in the torsional angle=5,6,7,8 ATOMS2the four atoms involved in the torsional angle=13,14,15,16 ATOMS3the four atoms involved in the torsional angle=21,22,23,24
k: KERNELTransform a set of input coordinates using a kernel function This action is a shortcut and it has hidden defaults. More details ARGthe arguments that should be used as input to this method=phi,psi REFERENCEthe file from which to read the kernel parameters=
regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp
Click here to see an extract from this file.
×

FILE: regtest/pamm/rt-pamm-periodic/2D-testc-0.75.pammp

#! FIELDS height phi psi sigma_phi_phi sigma_phi_psi sigma_psi_phi sigma_psi_psi 
#! SET kerneltype von-misses
      2.97197455E-0001     -1.91983118E+0000      2.25029540E+0000      2.45960237E-0001     -1.30615381E-0001     -1.30615381E-0001      2.40239117E-0001  
      2.29131448E-0002      1.39809354E+0000      9.54585380E-0002      9.61755708E-0002     -3.55657919E-0002     -3.55657919E-0002      1.06147253E-0001  
      5.06676398E-0001     -1.09648066E+0000     -7.17867907E-0001      1.40523052E-0001     -1.05385552E-0001     -1.05385552E-0001      1.63290557E-0001  
      8.38235835E-0003      1.34746362E+0000     -2.92912242E+0000      1.50601708E-0001     -1.16056708E-0001     -1.16056708E-0001      2.58187042E-0001  
      1.34976025E-0001     -1.12488647E+0000      2.46856186E+0000      6.47837871E-0002     -5.48993853E-0002     -5.48993853E-0002      1.28240303E-0001  
      2.62404899E-0002      9.93277439E-0001      6.63990207E-0001      3.77594608E-0002     -2.13908228E-0002     -2.13908228E-0002      7.02294006E-0002  
      3.61412967E-0003      9.92586372E-0001     -2.28743740E+0000      6.13474371E-0002      9.32283874E-0003      9.32283874E-0003      4.90062255E-0002  
NUMBER if there are multiple sets of kernel parameters in the input file which set of kernel parameters would you like to read in here=3

The output k here is a vector with three components. The first component is the kernel evaluated with the torsion involving atoms 1, 2, 3 and 4 and the torsion involving atoms 5, 6, 7 and 8. The second component is the kernel evaluated with the torsion involving atoms 9, 10, 11 and 12 and the torsion involving atoms 13, 14, 15 and 16. The third component is the kernel evaluated with the torsion involving atoms 17, 18, 19 and 20 and the torsion involving atoms 21, 22, 23 and 24.

Syntax

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

Keyword Type Default Description
ARG input none the arguments that should be used as input to this method
TYPE compulsory gaussian the type of kernel to use
CENTER compulsory none the position of the center of the kernel
COVAR compulsory none the covariance of the kernel
WEIGHT compulsory 1.0 the weight to multiply this kernel function by
NUMBER compulsory 1 if there are multiple sets of kernel parameters in the input file which set of kernel parameters would you like to read in here
SIGMA optional not used square root of variance of the cluster
REFERENCE optional not used the file from which to read the kernel parameters
NORMALIZED optional false would you like the kernel function to be normalized