md.angle

Overview

Angle

Constructs the angular bond potential.

Harmonic

Harmonic angle potential.

CosineSquared

Cosine squared angle potential.

Table

Tabulated bond potential.

Details

Angle potentials.

class hoomd.md.angle.Angle

Bases: hoomd.md.force.Force

Constructs the angular bond potential.

Note

Angle is the base class for all angular potentials. Users should not instantiate this class directly.

class hoomd.md.angle.CosineSquared

Bases: hoomd.md.angle.Angle

Cosine squared angle potential.

CosineSquared specifies a cosine squared potential energy between every triplet of particles with an angle specified between them.

\[V(\theta) = \frac{1}{2} k \left( \cos\theta - \cos\theta_0 \right)^2\]

where \(\theta\) is the angle between the triplet of particles. This angle style is also known as g96, since they were used in the gromos96 force field. These are also the types of angles used with the coarse-grained MARTINI force field.

params

The parameter of the harmonic bonds for each particle type. The dictionary has the following keys:

  • k (float, required) - potential constant \(k\) \([\mathrm{energy}]\)

  • t0 (float, required) - rest angle \(\theta_0\) \([\mathrm{radians}]\)

Type

TypeParameter[angle type, dict]

Parameters \(k\) and \(\theta_0\) must be set for each type of angle in the simulation. Note that the value of \(k\) for this angle potential is not comparable to the value of \(k\) for harmonic angles, as they have different units.

Examples:

cosinesq = angle.CosineSquared()
cosinesq.params['polymer'] = dict(k=3.0, t0=0.7851)
cosinesq.params['backbone'] = dict(k=100.0, t0=1.0)
class hoomd.md.angle.Harmonic

Bases: hoomd.md.angle.Angle

Harmonic angle potential.

Harmonic specifies a harmonic potential energy between every triplet of particles with an angle specified between them.

\[V(\theta) = \frac{1}{2} k \left( \theta - \theta_0 \right)^2\]

where \(\theta\) is the angle between the triplet of particles.

params

The parameter of the harmonic bonds for each particle type. The dictionary has the following keys:

  • k (float, required) - potential constant \(k\) \([\mathrm{energy} \cdot \mathrm{radians}^{-2}]\)

  • t0 (float, required) - rest angle \(\theta_0\) \([\mathrm{radians}]\)

Type

TypeParameter[angle type, dict]

Examples:

harmonic = angle.Harmonic()
harmonic.params['polymer'] = dict(k=3.0, t0=0.7851)
harmonic.params['backbone'] = dict(k=100.0, t0=1.0)
class hoomd.md.angle.Table(width)

Bases: hoomd.md.angle.Angle

Tabulated bond potential.

Parameters

width (int) – Number of points in the table.

Table computes a user-defined potential and force applied to each angle.

The torque \(\tau\) is:

\[\tau(\theta) = \tau_\mathrm{table}(\theta)\]

and the potential \(V(\theta)\) is:

\[V(\theta) =V_\mathrm{table}(\theta)\]

where \(\theta\) is the angle between the vectors \(\vec{r}_A - \vec{r}_B\) and \(\vec{r}_C - \vec{r}_B\) for particles A,B,C in the angle.

Provide \(\tau_\mathrm{table}(\theta)\) and \(V_\mathrm{table}(\theta)\) on evenly spaced grid points points in the range \(\theta \in [0,\pi]\). Table linearly interpolates values when \(\theta\) lies between grid points. The torque must be specificed commensurate with the potential: \(\tau = -\frac{\partial V}{\partial \theta}\).

params

The potential parameters. The dictionary has the following keys:

  • V ((width,) numpy.ndarray of float, required) - the tabulated energy values \([\mathrm{energy}]\). Must have a size equal to width.

  • tau ((width,) numpy.ndarray of float, required) - the tabulated torque values \([\mathrm{force} \cdot \mathrm{length}]\). Must have a size equal to width.

Type

TypeParameter [angle type, dict]

width

Number of points in the table.

Type

int