Angles as collective variables

Overview

pysages.colvars.angles.Angle(indices)

Angle between 3 points in space.

pysages.colvars.angles.DihedralAngle(indices)

Computes the dihedral angle spanned by four points in space (usually atom positions).

pysages.colvars.angles.RingPuckeringCoordinates(indices)

Computes the amplitude and the phase angle of a monocyclic ring by the Cremer-Pople method.

pysages.colvars.angles.RingPhaseAngle(indices)

Computes the phase angle of a monocyclic ring by the Cremer-Pople method.

pysages.colvars.angles.RingAmplitude(indices)

Computes the amplitude of a monocyclic ring by the Cremer-Pople method.

Details

Collective variable angles describe the angle spanning by 3 (or 4 for dihedral) particles in the simulation.

It is common to describe such angles inside a molecule or protein characteristic for a conformation change.

class pysages.colvars.angles.Angle(indices)

Angle between 3 points in space.

Angle collective variables calculated as the angle spanned by three points in space (usually atom positions). Take a look at the pysages.colvars.core.ThreePointCV for details on the constructor.

property function

Function generator

Returns:

  • Function that calculates the angle value from a simulation snapshot.

  • Look at pysages.colvars.angles.angle for details.

pysages.colvars.angles.angle(p1, p2, p3)

Calculates angle between 3 points in space.

Takes 3 positions in space and calculates the angle between them.

\(\vec{q} = \vec{p}_1 - \vec{p}_2\)

\(\vec{r} = \vec{p}_3 - \vec{p}_2\)

\(\theta = \arctan(|\vec{q} \times \vec{r}|, \vec{q} \cdot \vec{r})\)

Parameters:
  • p1 (jax.Array) – \(\vec{p}_1\) 3D vector in space

  • p2 (jax.Array) – \(\vec{p}_2\) 3D vector in space

  • p3 (jax.Array) – \(\vec{p}_3\) 3D vector in space

Returns:

\(\theta\)

Return type:

float

class pysages.colvars.angles.DihedralAngle(indices)

Computes the dihedral angle spanned by four points in space (usually atom positions). Take a look at the pysages.colvars.core.FourPointCV for details on the constructor.

property function

returns: * Function that calculates the dihedral angle value from a simulation snapshot. * Look at pysages.colvars.angles.dihedral_angle for details.

pysages.colvars.angles.dihedral_angle(p1, p2, p3, p4)

Calculate dihedral angle between 4 points in space.

Takes 4 positions in space and calculates the dihedral angle.

\(\vec{q} = \vec{p}_3 - \vec{p}_2\)

\(\vec{r} = (\vec{p}_2 - \vec{p}_1) \times \vec{q}\)

\(\vec{s} = \vec{q} \times (\vec{p}_4 - \vec{p}_3)\)

\(\theta=\arctan((\vec{r} \times \vec{s}) \cdot \vec{q}, |\vec{q}| \vec{r} \cdot \vec{s})\)

Parameters:
  • p1 (jax.Array) – \(\vec{p}_1\) 3D vector in space

  • p2 (jax.Array) – \(\vec{p}_2\) 3D vector in space

  • p3 (jax.Array) – \(\vec{p}_3\) 3D vector in space

  • p4 (jax.Array) – \(\vec{p}_4\) 3D vector in space

Returns:

\(\theta\)

Return type:

float

class pysages.colvars.angles.RingPuckeringCoordinates(indices, group_length=None)

Computes the amplitude and the phase angle of a monocyclic ring by the Cremer-Pople method. Mathematical definitions can be found in [D. Cremer and J. A. Pople, JACS, 1974](https://pubs.acs.org/doi/10.1021/ja00839a011) Equations 4-14. Notice that for rings with N atoms, there are int( ( N - 1 ) / 2 - 1 ) phase angles and int (N / 2 - 1) amplitudes. So if the ring contains more than six atoms, there is more than one phase angle; similarly, if the ring contains more than five atoms, there is more than one amplitude. This class (for now) only calculates the first amplitude and the phase angle (m = 2 in Equations 12 and 13, or see pysages.colvars.angles.ring_puckering_coordinates for math). Also, the phase angle obtained via the Cremer-Pople method can be converted to the Altona-Sundaralingam order parameter by adding pi / 2 to the result and then converting from radians to degrees. Similarly, the amplitude obtained via the Cremer-Pople method can be converted to the Altona-Sundaralingam order parameter (in degrees) by multiplying the result by 1025 degree/nanometer. Notice that the phase angle is dependent on the order of the indices. For example, the convention for sugar pucker of ribose in RNA/DNA is: O4’, C1’, C2’, C3’, C4’.

pysages.colvars.angles.ring_puckering_coordinates(rs)

calculate phase angle (first phase angle if N>5) based on Cremer-Pople method.

\(r_0 = \frac{1}{N} \sum\limits_i^N \vec{r}_i\)

\(\vec{R}_1 = \sum\limits_i^N (\vec{r}_i -r_c) \sin\Big(\frac{2\pi (i-1)}{N}\Big)\)

\(\vec{R}_2 = \sum\limits_i^N (\vec{r}_i -r_c) \cos\Big(\frac{2\pi (i-1)}{N}\Big)\)

\(\hat{n} = \frac{\vec{R}_1 \times \vec{R}_2}{ |\vec{R}_1\times\vec{R}_2|}\)

\(z_i = (\vec{r}_i-r_c) \cdot \hat{n}\)

\(a = \sqrt{\frac{2}{N}} \sum\limits_i^N z_i \cos(2\pi \frac{2(i-1)}{N})\)

\(b = -\sqrt{\frac{2}{N}} \sum\limits_i^N z_i \sin(2\pi \frac{2(i-1)}{N})\)

\(q = \sqrt{a^2 + b^2}\)

\(\phi = \arctan(b / a)\)

Parameters:

rs (jax.Array) – \(\vec{r}_i\) array of 3D vector in space

Returns:

jax.Array\(q\) in nanometer (if the default length unit for the MD engine is nanometer) \(\phi\) in radians, range -pi to pi.

Return type:

[q: float, phi: float]

class pysages.colvars.angles.RingPhaseAngle(indices, group_length=None)

Computes the phase angle of a monocyclic ring by the Cremer-Pople method. Mathematical definitions can be found in [D. Cremer and J. A. Pople, JACS, 1974](https://pubs.acs.org/doi/10.1021/ja00839a011) Equations 4-14.

property function

returns: * Function that calculates the dihedral angle value from a simulation snapshot. * Look at pysages.colvars.angles.ring_puckering_coordinates * and pysages.colvars.angles.ring_phase_angle for details.

pysages.colvars.angles.ring_phase_angle(rs)
Parameters:

rs (jax.Array) – \(\vec{r}_i\) array of 3D vector in space

Returns:

\(\phi\) in range -pi to pi.

Return type:

float

class pysages.colvars.angles.RingAmplitude(indices, group_length=None)

Computes the amplitude of a monocyclic ring by the Cremer-Pople method. Mathematical definitions can be found in [D. Cremer and J. A. Pople, JACS, 1974](https://pubs.acs.org/doi/10.1021/ja00839a011) Equations 4-14.

property function

returns: * Function that calculates the dihedral angle value from a simulation snapshot. * Look at pysages.colvars.angles.ring_puckering_coordinates * and pysages.colvars.angles.ring_amplitude for details.

pysages.colvars.angles.ring_amplitude(rs)
Parameters:

rs (jax.Array) – \(\vec{r}_i\) array of 3D vector in space

Returns:

\(q\), the same unit as the coordinates

Return type:

float