- List of available colvar components
`distance`: center-of-mass distance between two groups.`distanceZ`: projection of a distance vector on an axis.`distanceXY`: modulus of the projection of a distance vector on a plane.`distanceVec`: distance vector between two groups.`distanceDir`: distance unit vector between two groups.`distanceInv`: mean distance between two groups of atoms.`angle`: angle between three groups.`dihedral`: torsional angle between four groups.`coordNum`: coordination number between two groups.`selfCoordNum`: coordination number between atoms within a group.`hBond`: hydrogen bond between two atoms.`rmsd`: root mean square displacement (RMSD) from reference positions.- Advanced usage of the
`rmsd`component. `eigenvector`: projection of the atomic coordinates on a vector.`gyration`: radius of gyration of a group of atoms.`inertia`: total moment of inertia of a group of atoms.`inertiaZ`: total moment of inertia of a group of atoms around a chosen axis.`orientation`: orientation from reference coordinates.`orientationAngle`: angle of rotation from reference coordinates.`spinAngle`: angle of rotation around a given axis.`tilt`: cosine of the rotation orthogonal to a given axis.`alpha`: -helix content of a protein segment.`dihedralPC`: protein dihedral pricipal component

- Advanced usage and special considerations

- Linear and polynomial combinations of components

Collective variable components (basis functions)

Each colvar is defined by one or more *components* (typically
only one). Each component consists of a keyword identifying a
functional form, and a definition block following that keyword,
specifying the atoms involved and any additional parameters (cutoffs,
``reference'' values, ...).

The types of the components used in a colvar determine the properties of that colvar, and which biasing or analysis methods can be applied. In most cases, the colvar returns a real number, which is computed by one or more instances of the following components:

`distance`: distance between two groups;`distanceZ`: projection of a distance vector on an axis;`distanceXY`: projection of a distance vector on a plane;`distanceVec`: distance vector between two groups;`distanceDir`: unit vector parallel to distanceVec;`distanceInv`: mean distance between two groups of atoms (e.g. NOE-based distance);`angle`: angle between three groups;`coordNum`: coordination number between two groups;`selfCoordNum`: coordination number of atoms within a group;`hBond`: hydrogen bond between two atoms;`rmsd`: root mean square deviation (RMSD) from a set of reference coordinates;`eigenvector`: projection of the atomic coordinates on a vector;`orientationAngle`: angle of the best-fit rotation from a set of reference coordinates;`spinAngle`: projection orthogonal to an axis of the best-fit rotation from a set of reference coordinates;`tilt`: projection on an axis of the best-fit rotation from a set of reference coordinates;`gyration`: radius of gyration of a group of atoms;`inertia`: moment of inertia of a group of atoms;`inertiaZ`: moment of inertia of a group of atoms around a chosen axis;`alpha`: -helix content of a protein segment.`dihedralPC`: projection of protein backbone dihedrals onto a dihedral principal component.

In the following, all the available component types are listed, along
with their physical units and the limiting values, if any. Such
limiting values can be used to define `lowerBoundary` and
`upperBoundary` in the parent colvar.

(`group1``distance`context) First group of atoms**Acceptable Values:**Block`group1 {...}`**Description:**First group of atoms.(`group2``distance`context) Second group of atoms**Acceptable Values:**Block`group2 {...}`**Description:**Second group of atoms.(`forceNoPBC``distance`context) Calculate absolute rather than minimum-image distance?**Acceptable Values:**boolean**Default Value:**`no`**Description:**By default, in calculations with periodic boundary conditions, the`distance`component returns the distance according to the minimum-image convention. If this parameter is set to`yes`, PBC will be ignored and the distance between the coordinates as maintained internally will be used. This is only useful in a limited number of special cases, e.g. to describe the distance between remote points of a single macromolecule, which cannot be split across periodic cell boundaries, and for which the minimum-image distance might give the wrong result because of a relatively small periodic cell.(`oneSiteSystemForce``distance`context) Measure system force on group 1 only?**Acceptable Values:**boolean**Default Value:**`no`**Description:**If this is set to`yes`, the system force is measured along a vector field (see equation (53) in section 10.5.1) that only involves atoms of`group1`. This option is only useful for ABF, or custom biases that compute system forces. See section 10.5.1 for details.

The value returned is a positive number (in Å), ranging from 0
to the largest possible interatomic distance within the chosen
boundary conditions (with PBCs, the minimum image convention is used
unless the `forceNoPBC` option is set).

(`main``distanceZ,`context) Main group of atoms`distanceXY`**Acceptable Values:**Block`main {...}`**Description:**Group of atoms whose position is measured.(`ref``distanceZ,`context) Reference group of atoms`distanceXY`**Acceptable Values:**Block`ref {...}`**Description:**Reference group of atoms. The position of its center of mass is noted below.(`ref2``distanceZ,`context) Secondary reference group`distanceXY`**Acceptable Values:**Block`ref2 {...}`**Default Value:**none**Description:**Optional group of reference atoms, whose position can be used to define a dynamic projection axis: . In this case, the origin is , and the value of the component is .(`axis``distanceZ`,`distanceXY`context) Projection axis (Å)**Acceptable Values:**`(x, y, z)`triplet**Default Value:**`(0.0, 0.0, 1.0)`**Description:**The three components of this vector define (when normalized) a projection axis for the distance vector joining the centers of groups`ref`and`main`. The value of the component is then . The vector should be written as three components separated by commas and enclosed in parentheses.(`forceNoPBC``distanceZ, distanceXY`context) Calculate absolute rather than minimum-image distance?**Acceptable Values:**boolean**Default Value:**`no`**Description:**This parameter has the same meaning as that described above for the`distance`component.(`oneSiteSystemForce``distanceZ, distanceXY`context) Measure system force on group`main`only?**Acceptable Values:**boolean**Default Value:**`no`**Description:**If this is set to`yes`, the system force is measured along a vector field (see equation (53) in section 10.5.1) that only involves atoms of`main`. This option is only useful for ABF, or custom biases that compute system forces. See section 10.5.1 for details.

where is the distance between atoms and in groups 1 and 2 respectively, and is an even integer. This component accepts the same keywords as the component

(`exponent``distanceInv`context) Exponent in equation 36**Acceptable Values:**positive even integer**Default Value:**6**Description:**Defines the exponent to which the individual distances are elevated before averaging. The default value of 6 is useful for example to applying restraints based on NOE-measured distances.

(`oneSiteSystemForce``angle`,`dihedral`context) Measure system force on group 1 only?**Acceptable Values:**boolean**Default Value:**`no`**Description:**If this is set to`yes`, the system force is measured along a vector field (see equation (53) in section 10.5.1) that only involves atoms of`group1`. See section 10.5.1 for an example.

This colvar component accepts the same keywords as the component

(`cutoff``coordNum`context) ``Interaction'' distance (Å)**Acceptable Values:**positive decimal**Default Value:**4.0**Description:**This number defines the switching distance to define an interatomic contact: for , the switching function is close to 1, at it has a value of ( with the default and ), and at it goes to zero approximately like . Hence, for a proper behavior, must be larger than .(`cutoff3``coordNum`context) Reference distance vector (Å)**Acceptable Values:**```(x, y, z)`'' triplet of positive decimals**Default Value:**`(4.0, 4.0, 4.0)`**Description:**The three components of this vector define three different cutoffs for each direction. This option is mutually exclusive with`cutoff`.(`expNumer``coordNum`context) Numerator exponent**Acceptable Values:**positive even integer**Default Value:**6**Description:**This number defines the exponent for the switching function.(`expDenom``coordNum`context) Denominator exponent**Acceptable Values:**positive even integer**Default Value:**12**Description:**This number defines the exponent for the switching function.(`group2CenterOnly``coordNum`context) Use only`group2`'s center of mass**Acceptable Values:**boolean**Default Value:**`off`**Description:**If this option is`on`, only contacts between each atoms in`group1`and the center of mass of`group2`are calculated (by default, the sum extends over all pairs of atoms in`group1`and`group2`). If`group2`is a`dummyAtom`, this option is set to`yes`by default.

This component returns a dimensionless number, which ranges from
approximately 0 (all interatomic distances are much larger than the
cutoff) to
(all distances
are less than the cutoff), or
if
`group2CenterOnly` is used. For performance reasons, at least
one of `group1` and `group2` should be of limited size or `group2CenterOnly` should be used: the cost of the loop over all pairs grows as
.

The keywords accepted by

This component returns a dimensionless number, which ranges from
approximately 0 (all interatomic distances much larger than the
cutoff) to
(all
distances within the cutoff). For performance reasons,
`group1` should be of limited size, because the cost of the
loop over all pairs grows as
.

The optimal rotation is calculated within the formalism developed in reference [18], which guarantees a continuous dependence of with respect to . The options for

(`atoms``rmsd`context) Atom group**Acceptable Values:**`atoms {...}`block**Description:**Defines the group of atoms of which the RMSD should be calculated. Optimal fit options (such as`refPositions`and`rotateReference`) should typically NOT be set within this block. Exceptions to this rule are the special cases discussed in the*Advanced usage*paragraph below.(`refPositions``rmsd`context) Reference coordinates**Acceptable Values:**space-separated list of`(x, y, z)`triplets**Description:**This option (mutually exclusive with`refPositionsFile`) sets the reference coordinates. If only`centerReference`is`on`, the list can be a single (x, y, z) triplet; if also`rotateReference`is`on`, the list should be as long as the atom group. This option is independent from that with the same keyword within the`atoms {...}`block (see 10.3). The latter (and related fitting options for the atom group) are normally not needed, and should be omitted altogether except for advanced usage cases.(`refPositionsFile``rmsd`context) Reference coordinates file**Acceptable Values:**UNIX filename**Description:**This option (mutually exclusive with`refPositions`) sets the PDB file name for the reference coordinates to be compared with. The format is the same as that provided by`refPositionsFile`within an atom group definition.(`refPositionsCol``rmsd`context) PDB column containing atom flags**Acceptable Values:**`O`,`B`,`X`,`Y`, or`Z`**Description:**If`refPositionsFile`is defined, and the file contains all the atoms in the topology, this option may be povided to set which PDB field is used to flag the reference coordinates for`atoms`.(`refPositionsColValue``rmsd`context) Atom selection flag in the PDB column**Acceptable Values:**positive decimal**Description:**If defined, this value identifies in the PDB column`refPositionsCol`of the file`refPositionsFile`which atom positions are to be read. Otherwise, all positions with a non-zero value are read.

- applying the optimal translation, but no rotation
(
`rotateReference off`), to bias or restrain the shape and orientation, but not the position of the atom group; - applying the optimal rotation, but no translation
(
`translateReference off`), to bias or restrain the shape and position, but not the orientation of the atom group; - disabling the application of optimal roto-translations, which lets the RMSD component decribe the deviation of atoms from fixed positions in the laboratory frame: this allows for custom positional restraints within the colvars module;
- fitting the atomic positions to different reference coordinates than those used in the RMSD calculation itself;
- applying the optimal rotation and/or translation from a separate
atom group, defined through
`refPositionsGroup`: the RMSD then reflects the deviation from reference coordinates in a separate, moving reference frame.

where, as in the

As for the component `rmsd`, the available options are `atoms`, `refPositionsFile`, `refPositionsCol` and `refPositionsColValue`, and `refPositions`.
In addition, the following are recognized:

(`vector``eigenvector`context) Vector components**Acceptable Values:**space-separated list of`(x, y, z)`triplets**Description:**This option (mutually exclusive with`vectorFile`) sets the values of the vector components.(`vectorFile``eigenvector`context) PDB file containing vector components**Acceptable Values:**UNIX filename**Description:**This option (mutually exclusive with`vector`) sets the name of a PDB file where the vector components will be read from the X, Y, and Z fields.**Note:***The PDB file has limited precision and fixed point numbers: in some cases, the vector may not be accurately represented, and*`vector`*should be used instead.*(`vectorCol``eigenvector`context) PDB column used to flag participating atoms**Acceptable Values:**`O`or`B`**Description:**Analogous to`atomsCol`.(`vectorColValue``eigenvector`context) Value used to flag participating atoms in the PDB file**Acceptable Values:**positive decimal**Description:**Analogous to`atomsColValue`.(`differenceVector``eigenvector`context) The -dimensional vector is the difference between`vector`and`refPositions`**Acceptable Values:**boolean**Default Value:**`off`**Description:**If this option is`on`, the numbers provided by`vector`or`vectorFile`are interpreted as another set of positions, : the vector is then defined as . This allows to conveniently define a colvar as a projection on the linear transformation between two sets of positions, ``A'' and ``B''. For convenience, the vector is also normalized so that when the atoms are at the set of positions ``A'' and at the set of positions ``B''.

This component must contain one

(`axis``inertiaZ`context) Projection axis (Å)**Acceptable Values:**`(x, y, z)`triplet**Default Value:**`(0.0, 0.0, 1.0)`**Description:**The three components of this vector define (when normalized) the projection axis .

As for the component `rmsd`, the available options are `atoms`, `refPositionsFile`, `refPositionsCol` and `refPositionsColValue`, and `refPositions`.

**Note:** `refPositions` and `refPositionsFile` define the set of positions *from which* the optimal rotation is calculated, but this rotation is not applied to the coordinates of the atoms involved: it is used instead to define the variable itself.

(`closestToQuaternion``orientation`context) Reference rotation**Acceptable Values:**```(q0, q1, q2, q3)`'' quadruplet**Default Value:**`(1.0, 0.0, 0.0, 0.0)`(``null'' rotation)**Description:**Between the two equivalent quaternions and , the closer to`(1.0, 0.0, 0.0, 0.0)`is chosen. This simplifies the visualization of the colvar trajectory when samples values are a smaller subset of all possible rotations.**Note:***this only affects the output, never the dynamics*.

**Hint: stopping the rotation of a protein.** To stop the
rotation of an elongated macromolecule in solution (and use an
anisotropic box to save water molecules), it is possible to define a
colvar with an `orientation` component, and restrain it throuh
the `harmonic` bias around the identity rotation, `(1.0,
0.0, 0.0, 0.0)`. Only the overall orientation of the macromolecule
is affected, and *not* its internal degrees of freedom. The user
should also take care that the macromolecule is composed by a single
chain, or disable `wrapAll` otherwise.

(`axis``tilt, spinAngle`context) Special rotation axis (Å)**Acceptable Values:**`(x, y, z)`triplet**Default Value:**`(0.0, 0.0, 1.0)`**Description:**The three components of this vector define (when normalized) the special rotation axis used to calculate the`tilt`and`spinAngle`components.

**Note:** the value of `spinAngle` is a continuous function almost everywhere, with the exception of configurations with the corresponding ``tilt'' angle equal to 180
(i.e. the `tilt` component is equal to
): in those cases, `spinAngle` is undefined. If such configurations are expected, consider defining a `tilt` colvar using the same axis **e**, and restraining it with a lower wall away from
.

where the score function for the angle is defined as:

and the score function for the hydrogen bond is defined through a

((`residueRange``alpha`) Potential -helical residues context) `` Initial residue number - Final residue number ''**Acceptable Values:**This option specifies the range of residues on which this component should be defined. The colvar module looks for the atoms within these residues named ```CA`'', ```N`'' and ```O`'', and raises an error if any of those atoms is not found.**Description:**(`psfSegID``alpha`context) PSF segment identifier**Acceptable Values:**string (max 4 characters)**Description:**This option sets the PSF segment identifier for the residues specified in`residueRange`. This option is only required when PSF topologies are used.(`hBondCoeff``alpha`context) Coefficient for the hydrogen bond term**Acceptable Values:**positive between 0 and 1**Default Value:**0.5**Description:**This number specifies the contribution to the total value from the hydrogen bond terms. 0 disables the hydrogen bond terms, 1 disables the angle terms.(`angleRef``alpha`context) Reference angle**Acceptable Values:**positive decimal**Default Value:**88**Description:**This option sets the reference angle used in the score function (46).(`angleTol``alpha`context) Tolerance in the angle**Acceptable Values:**positive decimal**Default Value:**15**Description:**This option sets the angle tolerance used in the score function (46).(`hBondCutoff``alpha`context) Hydrogen bond cutoff**Acceptable Values:**positive decimal**Default Value:**3.3 Å**Description:**Equivalent to the`cutoff`option in the`hBond`component.(`hBondExpNumer``alpha`context) Hydrogen bond numerator exponent**Acceptable Values:**positive integer**Default Value:**6**Description:**Equivalent to the`expNumer`option in the`hBond`component.(`hBondExpDenom``alpha`context) Hydrogen bond denominator exponent**Acceptable Values:**positive integer**Default Value:**8**Description:**Equivalent to the`expDenom`option in the`hBond`component.

This component returns positive values, always comprised between 0 (lowest -helical score) and 1 (highest -helical score).

For a given principal component (eigenvector) of coefficients , the projection of the current backbone conformation is:

(46) |

`dihedralPC` expects the same parameters as the `alpha`
component for defining the relevant residues (`residueRange`
and `psfSegID`) in addition to the following:

(`vectorFile``dihedralPC`context) File containing dihedral PCA eigenvector(s)**Acceptable Values:**file name**Description:**A text file containing the coefficients of dihedral PCA eigenvectors on the cosine and sine coordinates. The vectors should be arranged in columns, as in the files output by Carma.[25](`vectorNumber``dihedralPC`context) File containing dihedralPCA eigenvector(s)**Acceptable Values:**positive integer**Description:**Number of the eigenvector to be used for this component.

`dihedral`: torsional angle between four groups;`spinAngle`: angle of rotation around a predefined axis in the best-fit from a set of reference coordinates.

The following keywords can be used within periodic components (and are illegal elsewhere):

(`period``distanceZ`context) Period of the component**Acceptable Values:**positive decimal**Default Value:**0.0**Description:**Setting this number enables the treatment of`distanceZ`as a periodic component: by default,`distanceZ`is not considered periodic. The keyword is supported, but irrelevant within`dihedral`or`spinAngle`, because their period is always 360 degrees.(`wrapAround``distanceZ`,`dihedral`or`spinAngle`context) Center of the wrapping interval for periodic variables**Acceptable Values:**decimal**Default Value:**0.0**Description:**By default, values of the periodic components are centered around zero, ranging from to , where is the period. Setting this number centers the interval around this value. This can be useful for convenience of output, or to set`lowerWall`and`upperWall`in an order that would not otherwise be allowed.

*Note: linear or polynomial combinations of periodic components
may become meaningless when components cross the periodic boundary.
Use such combinations carefully: estimate the range of possible values
of each component in a given simulation, and make use of
wrapAround to limit this problem whenever possible.*

`distanceVec`: 3-dimensional vector of the distance between two groups;`distanceDir`: 3-dimensional unit vector of the distance between two groups;`orientation`: 4-dimensional unit quaternion representing the best-fit rotation from a set of reference coordinates.

Non-scalar components carry the following restrictions:

- Calculation of system forces (
`outputSystemForce`option) is currently not implemented. - Each colvar can only contain one non-scalar component.
- Binning on a grid (
`abf`,`histogram`and`metadynamics`with`useGrids`enabled) is currently not implemented for colvars based on such components.

*Note: while these restrictions apply to individual colvars based
on non-scalar components, no limit is set to the number of scalar
colvars. To compute multi-dimensional histograms and PMFs, use sets
of scalar colvars of arbitrary size.*

Linear and polynomial combinations of components

To extend the set of possible definitions of colvars , multiple components can be summed with the formula:

where each component appears with a unique coefficient (1.0 by default) the positive integer exponent (1 by default).

Any set of components can be combined within a colvar, provided that they return the same type of values (scalar, unit vector, vector, or quaternion). By default, the colvar is the sum of its components. Linear or polynomial combinations (following equation (48)) can be obtained by setting the following parameters, which are common to all components:

(any component context) Coefficient of this component in the colvar`componentCoeff`**Acceptable Values:**decimal**Default Value:**`1.0`**Description:**Defines the coefficient by which this component is multiplied (after being raised to`componentExp`) before being added to the sum.(any component context) Exponent of this component in the colvar`componentExp`**Acceptable Values:**integer**Default Value:**`1`**Description:**Defines the power at which the value of this component is raised before being added to the sum. When this exponent is different than 1 (non-linear sum), system forces and the Jacobian force are not available, making the colvar unsuitable for ABF calculations.

**Example:** To define the *average* of a colvar across
different parts of the system, simply define within the same colvar
block a series of components of the same type (applied to different
atom groups), and assign to each component a `componentCoeff`
of
.