Shortcut: GYRATION_TENSOR
| Module | colvar |
|---|---|
| Description | Usage |
| Calculate the gyration tensor using a user specified vector of weights | |
| output value | type |
| the gyration tensor that was computed from the weights | matrix |
Details and examples
Calculate the gyration tensor using a user specified vector of weights
The elements of the gyration tensor are defined as:
where and can be the , or coordinates of atom and and can be the , or components of the center, which is calculated using:
The following example shows how you can calculate and print the gyration tensor from the positions of the fist 10 atoms using PLUMED
g: GYRATION_TENSORCalculate the gyration tensor using a user specified vector of weights This action is a shortcut. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-10 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=g FILEthe name of the file on which to output these quantities=colvar
In this example input the weights of all the atoms are set equal to one. The 9 elements of the resulting gyration matrix will
be output to the file colvar here. If you want the weights of the atoms to be set equal to the masses you can use either of the following
equivalent commands:
g: GYRATION_TENSORCalculate the gyration tensor using a user specified vector of weights This action is a shortcut. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-10 MASS calculate the center of mass g2: GYRATION_TENSORCalculate the gyration tensor using a user specified vector of weights This action is a shortcut. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-10 WEIGHTSwhat weights should be used when calculating the center=@Masses g3: GYRATION_TENSORCalculate the gyration tensor using a user specified vector of weights This action is a shortcut. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-10 MASS_WEIGHTED set the masses of all the atoms equal to one PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=g,g2,g3 FILEthe name of the file on which to output these quantities=colvar
This input above should output three identical matrices.
If you want to use an arbitrary set of weights for the atoms you can use the following syntax.
c: CONSTANTCreate 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,3,2,4 g: GYRATION_TENSORCalculate the gyration tensor using a user specified vector of weights This action is a shortcut. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-4 WEIGHTSwhat weights should be used when calculating the center=c UNORMALIZED do not divide by the sum of the weights PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=g FILEthe name of the file on which to output these quantities=colvar
Although the input weights are CONSTANT here that is not a requirement. You can use a vector of weights from any action that outputs a vector in the input for the WEIGHTS keyword here. Notice, also that the denominator in the expression for is set equal to one rather than the sum of the weights as we used the UNORMALIZED flag.
Similar functionality to the functionality in the examples above is used in the GYRATION shortcut. There is, however, no fast version of the GYRATION_TENSOR command in the way that there is a fast version of the GYRATION command that is used when the weights are all one or when the masses are used as the weights.
A note on periodic boundary conditions
Calculating the gyration tensor is normally used to determine the shape of a molecule so all the specified atoms would normally be part of the same molecule. When computing gyration tensors it is important to ensure that the periodic boundaries are calculated correctly. There are two ways that you can manage periodic boundary conditions when using this action. The first and simplest is to reconstruct the molecule similarly to the way that WHOLEMOLECULES operates. This reconstruction of molecules has been done automatically since PLUMED 2.2. If for some reason you want to turn it off you can use the NOPBC flag as shown below:
g: GYRATION_TENSORCalculate the gyration tensor using a user specified vector of weights This action is a shortcut. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-5 NOPBC ignore the periodic boundary conditions when calculating distances PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=g FILEthe name of the file on which to output these quantities=colvar
An alternative approach to handling PBC is to use the PHASES keyword. This keyword instructs PLUMED to use the PHASES option when computing the position of the center using the CENTER command. Distances of atoms from this center are then computed using PBC as usual. The example shown below shows you how to use this option
g: GYRATION_TENSORCalculate the gyration tensor using a user specified vector of weights This action is a shortcut. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1-5 PHASES use trigonometric phases when computing position of center of mass PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=g FILEthe name of the file on which to output these quantities=colvar
Input
The atoms that serve as the input for this action are specified using one or more of the keywords in the following table.
| Keyword | Type | Description |
|---|---|---|
| ATOMS | atoms | the group of atoms that you are calculating the Gyration Tensor for |
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| ATOMS | input | none | the group of atoms that you are calculating the Gyration Tensor for |
| NOPBC | optional | false | ignore the periodic boundary conditions when calculating distances |
| WEIGHTS | optional | not used | what weights should be used when calculating the center |
| PHASES | optional | false | use trigonometric phases when computing position of center of mass |
| MASS | optional | false | calculate the center of mass |
| MASS_WEIGHTED | optional | false | set the masses of all the atoms equal to one |
| UNORMALIZED | optional | false | do not divide by the sum of the weights |
References
More information about how this action can be used is available in the following articles: