Action: MATRIX_VECTOR_PRODUCT
Module | matrixtools |
---|---|
Description | Usage |
Calculate the product of the matrix and the vector | |
output value | type |
the vector that is obtained by taking the product between the matrix and the vector that were input | vector |
Output components
This action calculates the values in the following table. These values can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the value required from the list below.
Name | Type | Description |
---|---|---|
.#!custom | scalar | the names of the output components for this action depend on the actions input file see the example inputs below for details |
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/matrix | the label for the matrix and the vector/scalar that are being multiplied |
Further details and examples
Calculate the product of the matrix and the vector
Thiis action allows you to multiply a matrix and a vector together. This action is primarily used to calculate coordination numbers and symmetry functions, which is what is done by the example below:
c1CONTACT_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-7 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=2.6 NN=6 MM=12} onesONESCreate 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=7 : cc : 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=c1,ones PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=cc FILEthe name of the file on which to output these quantities=colvar:
Notice that you can use this action to multiply multiple matrices by a single vector as shown below:
c1CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details COMPONENTS also calculate the components of the vectors connecting the atoms in the contact matrix GROUPspecifies the list of atoms that should be assumed indistinguishable=1-7 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=2.6 NN=6 MM=12 D_MAX=10.0} onesONESCreate 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=7 : cc : 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=c1.x,c1.y,c1.z,ones PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=cc.x,cc.y,cc.z FILEthe name of the file on which to output these quantities=colvar:
Notice that if you use this options all the input matrices must have the same sparsity pattern. This feature was implemented in order to making caluclating Steinhardt parameters such as Q6 straightforward.
You can also multiply a single matrix by multiple vectors:
c1CONTACT_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-7 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=2.6 NN=6 MM=12 D_MAX=10.0} onesONESCreate 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=7 : twosCONSTANTCreate 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,4,5,6,7 : cc : 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=c1,ones,twos PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=cc.ones,cc.twos FILEthe name of the file on which to output these quantities=colvar:
This feature was implemented to make calculating local averages of the Steinhard parameters straightforward.
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 for the matrix and the vector/scalar that are being multiplied |
SERIAL | optional | false | do the calculation in serial |