Module |
adjmat |
Description |
Usage |
Build a matrix with ones in for the N nearest neighbours of an atom |
  |
output value |
type |
a matrix in which the ij element is one if the ij-element of the input matrix is one of the NLOWEST/NHIGHEST elements on that row of the input matrix and zero otherwise |
matrix |
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 |
matrix |
the label of an adjacency/distance matrix that will be used to find the nearest neighbors |
Further details and examples
Build a matrix with ones in for the N nearest neighbours of an atom
The following input illustrates how to use this action in tandem with DISTANCE_MATRIX to find the six
nearest atoms to each of the first 100 atoms in the input file:
Click on the labels of the actions for more information on what each action computes
d1The DISTANCE_MATRIX action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | matrix | a matrix containing the weights for the bonds between each pair of atoms |
: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action has hidden defaults. More details GROUPthe atoms for which you would like to calculate the adjacency matrix=1-100
d1: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action uses the defaults shown here. More details GROUPthe atoms for which you would like to calculate the adjacency matrix=1-100 NL_CUTOFF The cutoff for the neighbor list=0.0 NL_STRIDE The frequency with which we are updating the atoms in the neighbor list=1 CUTOFF ignore distances that have a value larger than this cutoff=-1
nThe NEIGHBORS action with label n calculates the following quantities: Quantity | Type | Description |
n | matrix | a matrix in which the ij element is one if the ij-element of the input matrix is one of the NLOWEST/NHIGHEST elements on that row of the input matrix and zero otherwise |
: 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=d1 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=6
n: NEIGHBORSBuild a matrix with ones in for the N nearest neighbours of an atom This action uses the defaults shown here. More details ARGthe label of an adjacency/distance matrix that will be used to find the nearest neighbors=d1 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=6 NHIGHEST in each row of the output matrix set the elements that correspond to the n highest elements in each row of the input matrix equal to one=0
Alternatively, if you would like to use a CONTACT_MATRIX to do something similar you would do the following:
Click on the labels of the actions for more information on what each action computes
c1The CONTACT_MATRIX action with label c1 calculates the following quantities: Quantity | Type | Description |
c1 | matrix | a matrix containing the weights for the bonds between each pair of atoms |
: 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.={RATIONAL R_0=0.5}
nThe NEIGHBORS action with label n calculates the following quantities: Quantity | Type | Description |
n | matrix | a matrix in which the ij element is one if the ij-element of the input matrix is one of the NLOWEST/NHIGHEST elements on that row of the input matrix and zero otherwise |
: 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=c1 NHIGHEST in each row of the output matrix set the elements that correspond to the n highest elements in each row of the input matrix equal to one=6
n: NEIGHBORSBuild a matrix with ones in for the N nearest neighbours of an atom This action uses the defaults shown here. More details ARGthe label of an adjacency/distance matrix that will be used to find the nearest neighbors=c1 NHIGHEST in each row of the output matrix set the elements that correspond to the n highest elements in each row of the input matrix equal to one=6 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=0
This command is useful for implementing alternatives to the symmatry functions that are defined by the shortcuts
in the module symfunc. For example, suppose that you want to calculate a variant on the TETRAHEDRAL symmetry function.
In this variant on the CV the coordination sphere around each central atom is not defined using a switching function. Instad
this coordination sphere contains only the four nearest atoms. You can implement this CV by using the following input:
Click on the labels of the actions for more information on what each action computes
d1The DISTANCE_MATRIX action with label d1 calculates the following quantities: Quantity | Type | Description |
d1.w | matrix | a matrix containing the weights for the bonds between each pair of atoms |
d1.x | matrix | the projection of the bond on the x axis |
d1.y | matrix | the projection of the bond on the y axis |
d1.z | matrix | the projection of the bond on the z axis |
: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action has hidden defaults. More details GROUPthe atoms for which you would like to calculate the adjacency matrix=1-100 COMPONENTS also calculate the components of the vectors connecting the atoms in the contact matrix
d1: DISTANCE_MATRIXCalculate a matrix of distances between atoms. This action uses the defaults shown here. More details GROUPthe atoms for which you would like to calculate the adjacency matrix=1-100 COMPONENTS also calculate the components of the vectors connecting the atoms in the contact matrix NL_CUTOFF The cutoff for the neighbor list=0.0 NL_STRIDE The frequency with which we are updating the atoms in the neighbor list=1 CUTOFF ignore distances that have a value larger than this cutoff=-1
nThe NEIGHBORS action with label n calculates the following quantities: Quantity | Type | Description |
n | matrix | a matrix in which the ij element is one if the ij-element of the input matrix is one of the NLOWEST/NHIGHEST elements on that row of the input matrix and zero otherwise |
: 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=d1.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
n: NEIGHBORSBuild a matrix with ones in for the N nearest neighbours of an atom This action uses the defaults shown here. More details ARGthe label of an adjacency/distance matrix that will be used to find the nearest neighbors=d1.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 NHIGHEST in each row of the output matrix set the elements that correspond to the n highest elements in each row of the input matrix equal to one=0
fThe CUSTOM action with label f calculates the following quantities: Quantity | Type | Description |
f | matrix | the matrix obtained by doing an element-wise application of an arbitrary function to the input matrix |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=n,d1.x,d1.y,d1.z,d1.w VARthe names to give each of the arguments in the function=w,x,y,z,r PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO FUNCthe function you wish to evaluate=w*(((x+y+z)/r)^3+((x-y-z)/r)^3+((-x+y-z)/r)^3+((-x-y+z)/r)^3)
onesThe ONES action with label ones calculates the following quantities: Quantity | Type | Description |
ones | vector | a vector of ones with the required number of elements |
: ONESCreate a constant vector with all elements equal to one This action is a shortcut. More details SIZEthe number of ones that you would like to create=100
# ones: ONES SIZE=100
onesThe CONSTANT action with label ones calculates the following quantities: Quantity | Type | Description |
ones | vector | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details NOLOG do not report all the read in scalars in the log VALUESthe numbers that are in your constant value=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
# --- End of included input --- ucvThe MATRIX_VECTOR_PRODUCT action with label ucv calculates the following quantities: Quantity | Type | Description |
ucv | vector | the vector that is obtained by taking the product between the matrix and the vector that were input |
: MATRIX_VECTOR_PRODUCTCalculate the product of the matrix and the vector More details ARGthe label for the matrix and the vector/scalar that are being multiplied=f,ones
cvThe CUSTOM action with label cv calculates the following quantities: Quantity | Type | Description |
cv | vector | the vector obtained by doing an element-wise application of an arbitrary function to the input vectors |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ucv PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO FUNCthe function you wish to evaluate=x/4
Syntax
The following table describes the keywords and options that can be used with this action
Keyword |
Type |
Default |
Description |
ARG |
input |
none |
the label of an adjacency/distance matrix that will be used to find the nearest neighbors |
NLOWEST |
compulsory |
0 |
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 |
NHIGHEST |
compulsory |
0 |
in each row of the output matrix set the elements that correspond to the n highest elements in each row of the input matrix equal to one |
SERIAL |
optional |
false |
do the calculation in serial |