Shortcut: KERNEL
| Module | refdist |
|---|---|
| Description | Usage |
| Transform a set of input coordinates using a kernel function | |
| output value | type |
| the value of the kernel evaluated at the argument values | scalar/vector |
Details and examples
Transform a set of input coordinates using a kernel function
This action takes a vector of arguments in input, , 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 then the final quantity that is returned by this function is:
where is a scalar that the user specifies using the WEIGHT keyword and can be a function of 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 | |
| FUNC=von-misses | |
| FUNC=triangular |
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:
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, ,
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:
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:
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:
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:
#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.pammpClick here to see an extract from this file.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:
#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.pammpClick here to see an extract from this file.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.
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 |
Full list of keywords
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 |