Shortcut: COVARIANCE_MATRIX
Module |
matrixtools |
Description |
Usage |
Calculate a covariance matix |
  |
output value |
type |
the covariance matrix |
matrix |
Further details and examples
Calculate a covariance matix
This shortcut takes multiple vectors in input as well as a vector of weights. A
covariance matrix is then computed from this input
data. The example below shows how this action can be used to calculate a gyration tensor that describes
the shape for a cluster of atoms.
Click on the labels of the actions for more information on what each action computes
comThe CENTER_FAST action with label com calculates the following quantities: Quantity | Type | Description |
com | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-100
dThe DISTANCE action with label d calculates the following quantities: Quantity | Type | Description |
d.x | vector | the x-component of the vector connecting the two atoms |
d.y | vector | the y-component of the vector connecting the two atoms |
d.z | vector | the z-component of the vector connecting the two atoms |
: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details ATOMSthe pairs of atoms that you would like to calculate the angles for=1-100 ORIGINcalculate the distance of all the atoms specified using the ATOMS keyword from this point=com COMPONENTS calculate the x, y and z components of the distance separately and store them as label
# d: DISTANCES ATOMS=1-100 ORIGIN=com COMPONENTS
d: DISTANCECalculate the distance/s between pairs of atoms. More details COMPONENTS calculate the x, y and z components of the distance separately and store them as label ATOMS1the pair of atom that we are calculating the distance between=com,1 ATOMS2the pair of atom that we are calculating the distance between=com,2 ATOMS3the pair of atom that we are calculating the distance between=com,3 ATOMS4the pair of atom that we are calculating the distance between=com,4 ATOMS5the pair of atom that we are calculating the distance between=com,5
# --- End of included input ---
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 --- covarThe COVARIANCE_MATRIX action with label covar calculates the following quantities: Quantity | Type | Description |
covar | matrix | the covariance matrix |
: COVARIANCE_MATRIXCalculate a covariance matix This action is a shortcut. More details ARGthe vectors of data from which we are calculating the covariance=d.x,d.y,d.z WEIGHTSthis keyword takes the label of an action that calculates a vector of values=ones
# covar: COVARIANCE_MATRIX ARG=d.x,d.y,d.z WEIGHTS=ones
covar_wsumThe SUM action with label covar_wsum calculates the following quantities: Quantity | Type | Description |
covar_wsum | scalar | the sum of all the elements in the input vector |
: SUMCalculate the sum of the arguments More details ARGthe values input to this function=ones PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO
covar_weightsThe CUSTOM action with label covar_weights calculates the following quantities: Quantity | Type | Description |
covar_weights | 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=ones,covar_wsum 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
covar_stackThe VSTACK action with label covar_stack calculates the following quantities: Quantity | Type | Description |
covar_stack | matrix | a matrix that contains the input vectors in its columns |
: VSTACKCreate a matrix by stacking vectors together More details ARGthe values that you would like to stack together to construct the output matrix=d.x,d.y,d.z
covar_stackTThe TRANSPOSE action with label covar_stackT calculates the following quantities: Quantity | Type | Description |
covar_stackT | matrix | the transpose of the input matrix |
: TRANSPOSECalculate the transpose of a matrix More details ARGthe label of the vector or matrix that should be transposed=covar_stack
covar_onesThe CONSTANT action with label covar_ones calculates the following quantities: Quantity | Type | Description |
covar_ones | vector | the constant value that was read from the plumed input |
: ONESCreate a constant vector with all elements equal to one More details SIZEthe number of ones that you would like to create=3
covar_matweightsThe OUTER_PRODUCT action with label covar_matweights calculates the following quantities: Quantity | Type | Description |
covar_matweights | matrix | a matrix containing the outer product of the two input vectors that was obtained using the function that was input |
: OUTER_PRODUCTCalculate the outer product matrix of two vectors More details ARGthe labels of the two vectors from which the outer product is being computed=covar_ones,covar_weights
covar_wTThe CUSTOM action with label covar_wT calculates the following quantities: Quantity | Type | Description |
covar_wT | 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=covar_matweights,covar_stackT 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
covarThe MATRIX_PRODUCT action with label covar calculates the following quantities: Quantity | Type | Description |
covar | matrix | the product of the two input matrices |
: MATRIX_PRODUCTCalculate the product of two matrices More details ARGthe label of the two matrices from which the product is calculated=covar_wT,covar_stack
# --- End of included input ---
Syntax
The following table describes the keywords and options that can be used with this action
Keyword |
Type |
Default |
Description |
WEIGHTS |
compulsory |
none |
this keyword takes the label of an action that calculates a vector of values |
ARG |
optional |
not used |
the vectors of data from which we are calculating the covariance |
UNORMALIZED |
optional |
false |
do not divide by the sum of the weights |