Shortcut: COVARIANCE_MATRIX

Module matrixtools
Description Usage
Calculate a covariance matix used in 0 tutorialsused in 0 eggs
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
tested on2.11
# Calculate the geometric center for 100 atoms
com: 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
# Calculate the vector connecting each of the 100 atoms to the geometric center
d: 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
# Now compute the covariance matrix
ones: 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
covar: 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

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