Action: GSYMFUNC_THREEBODY
| Module | symfunc |
|---|---|
| Description | Usage |
| Calculate functions of the coordinates of the coordinates of all pairs of bonds in the first coordination sphere of an atom |
Details and examples
Calculate functions of the coordinates of the coordinates of all pairs of bonds in the first coordination sphere of an atom
This shortcut can be used to calculate symmetry function that are like those defined by Behler in the paper that is cited in the bibliography below. The particular symmetry functions that are computed by this shortcut are the angular ones that are functions of the set pairs of atoms in the coordination sphere of the central atom. One of the angular symmetry functions that Behler introduces is:
In this expression , and are all parameters. is a switching function which acts upon , the distance between atom and atom , and , the distance between atom and atom . is then the angle between the vector that points from atom to atom and the vector that points from atom to atom . THe input below can be used to get PLUMED to calculate the 100 values for this symmetry function for the 100 atoms in a system.
# Calculate the contact matrix and the x,y and z components of the bond vectors # This action calculates 4 100x100 matrices cmat: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-100 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={CUSTOM R_0=4.5 D_MAX=4.5 FUNC=0.5*(cos(pi*x)+1)} COMPONENTS also calculate the components of the vector connecting the atoms in the contact matrix
# Compute the symmetry function for the 100 atoms from the 4 100x100 matrices output # by cmat. The output from this action is a vector with 100 elements beh3: GSYMFUNC_THREEBODYCalculate functions of the coordinates of the coordinates of all pairs of bonds in the first coordination sphere of an atom More details ... WEIGHTthe matrix that contains the weights that should be used for each connection=cmat.w ARGthree matrices containing the bond vectors of interest=cmat.x,cmat.y,cmat.z FUNCTION1the parameters of the function you would like to compute={FUNC=0.25*exp(-0.1*(rij+rik))*(1+3*cos(ajik))^3 LABEL=g5} ...
# Print the 100 symmetry function values to a file PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=beh3.g5 FILEthe name of the file on which to output these quantities=colvar
The GSYMFUNC_THREEBODY action sums over all the distinct triples of atoms that are identified in the contact matrix. This action uses the same functionality as CUSTOM and can thus compute any function of the following four quantities:
rij- the distance between atom and atomrik- the distance between atom and atomrjk- the distance between atom and atomajik- the angle between the vector connecting atom to atom and the vector connecting atom to atom .
Furthermore we can calculate more than one function of these four quantities at a time as illustrated by the input below:
# Calculate the contact matrix and the x,y and z components of the bond vectors # This action calculates 4 100x100 matrices cmat: CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-100 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={CUSTOM R_0=4.5 D_MAX=4.5 FUNC=0.5*(cos(pi*x)+1)} COMPONENTS also calculate the components of the vector connecting the atoms in the contact matrix
# Compute the 4 symmetry function below for the 100 atoms from the 4 100x100 matrices output # by cmat. The output from this action is a vector with 100 elements beh3: GSYMFUNC_THREEBODYCalculate functions of the coordinates of the coordinates of all pairs of bonds in the first coordination sphere of an atom More details ... WEIGHTthe matrix that contains the weights that should be used for each connection=cmat.w ARGthree matrices containing the bond vectors of interest=cmat.x,cmat.y,cmat.z FUNCTION1the parameters of the function you would like to compute={FUNC=0.25*(cos(pi*sqrt(rjk)/4.5)+1)*exp(-0.1*(rij+rik+rjk))*(1+2*cos(ajik))^2 LABEL=g4} FUNCTION2the parameters of the function you would like to compute={FUNC=0.25*exp(-0.1*(rij+rik))*(1+3.5*cos(ajik))^3 LABEL=g5} FUNCTION3the parameters of the function you would like to compute={FUNC=0.125*(1+6.6*cos(ajik))^4 LABEL=g6} FUNCTION4the parameters of the function you would like to compute={FUNC=sin(3.0*(ajik-1)) LABEL=g7} ...
# Print the 4 sets of 100 symmetry function values to a file PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=beh3.g4,beh3.g5,beh3.g6,beh3.g7 FILEthe name of the file on which to output these quantities=colvar
You can even use this action in tandem with the features that are in the volumes module as shown below:
# The atoms that are of interest ow: 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=1-16500 # Fixed virtual atom which serves as the probe volume's center (pos. in nm) center: FIXEDATOMAdd a virtual atom in a fixed position. This action has hidden defaults. More details ATcoordinates of the virtual atom=2.5,2.5,2.5 # Vector in which element i is one if atom i is in sphere of interest and zero otherwise sphere: INSPHEREThis quantity can be used to calculate functions of the distribution of collective variables for the atoms that lie in a particular, user-specified part of of the cell. More details ATOMSthe group of atoms that you would like to investigate=ow CENTERthe atom whose vicinity we are interested in examining=center RADIUSthe switching function that tells us the extent of the sphereical region of interest. Options for this keyword are explained in the documentation for LESS_THAN.={GAUSSIAN D_0=0.5 R_0=0.01 D_MAX=0.52} # The distance matrix dmap: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action has hidden defaults. More details COMPONENTS also calculate the components of the vector connecting the atoms in the contact matrix GROUPthe atoms for which you would like to calculate the adjacency matrix=ow CUTOFF ignore distances that have a value larger than this cutoff=1.0 MASKa vector that is used to used to determine which rows of the adjancency matrix to compute=sphere # Find the four nearest neighbors acv_neigh: NEIGHBORSBuild a matrix with ones in for the N nearest neighbours of an atom This action has hidden defaults. More details ARGthe label of an adjacency/distance matrix that will be used to find the nearest neighbors=dmap.w NLOWEST in each row of the output matrix set the elements that correspond to the n lowest elements in each row of the input matrix equal to one=4 MASKa vector that is used to used to determine which rows of the neighbors matrix to compute=sphere # Compute a function for the atoms that are in the first coordination sphere acv_g8: GSYMFUNC_THREEBODYCalculate functions of the coordinates of the coordinates of all pairs of bonds in the first coordination sphere of an atom More details ... WEIGHTthe matrix that contains the weights that should be used for each connection=acv_neigh ARGthree matrices containing the bond vectors of interest=dmap.x,dmap.y,dmap.z FUNCTION1the parameters of the function you would like to compute={FUNC=(cos(ajik)+1/3)^2 LABEL=g8} MASKa vector that is used to used to determine which symmetry functions should be calculated=sphere ... # Now compute the value of the function above for those atoms that are in the # sphere of interest acv: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=acv_g8.g8,sphere FUNCthe function you wish to evaluate=y*(1-(3*x/8)) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # And now compute the final average acv_sum: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=acv PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO acv_norm: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=sphere PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO mean: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=acv_sum,acv_norm FUNCthe function you wish to evaluate=x/y 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=mean FILEthe name of the file on which to output these quantities=colvar
You can read more about how to calculate more Behler-type symmetry functions here.
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 |
|---|---|---|
| MASK | vector | a vector that is used to used to determine which symmetry functions should be calculated |
| ARG | matrix | three matrices containing the bond vectors of interest |
| WEIGHT | matrix | the matrix that contains the weights that should be used for each connection |
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| MASK | input | none | a vector that is used to used to determine which symmetry functions should be calculated |
| ARG | input | none | three matrices containing the bond vectors of interest |
| WEIGHT | input | none | the matrix that contains the weights that should be used for each connection |
| FUNCTION | optional | not used | the parameters of the function you would like to compute |
| SERIAL | optional | false | do the calculation in serial. Further information about this flag can be found here. |
| USEGPU | optional | false | run this calculation on the GPU. Further information about this flag can be found here. |
References
More information about how this action can be used is available in the following articles: