# md.angle#

Overview

 Angle Base class angle force. Harmonic Harmonic angle force. CosineSquared Cosine squared angle force. Table Tabulated bond force.

Details

Angle forces.

Angle force classes apply a force and virial on every particle in the simulation state commensurate with the potential energy:

$U_\mathrm{angle} = \sum_{(i,j,k) \in \mathrm{angles}} U_{ijk}(\theta)$

Each angle is defined by an ordered triplet of particle tags in the hoomd.State member angle_group. HOOMD-blue does not construct angle groups, users must explicitly define angles in the initial condition. In the angle group (i,j,k), $$\theta$$ is the angle between the vectors $$\vec{r}_{ij}$$ and $$\vec{r}_{kj}$$.

Angle force classes assign 1/3 of the potential energy to each of the particles in the angle group:

$U_l = \frac{1}{3} \sum_{(i,j,k) \in \mathrm{angles}} U_{ijk}(\theta) [l=i \lor l=j \lor l=k]$

and similarly for virials.

class hoomd.md.angle.Angle#

Bases: Force

Base class angle force.

Angle is the base class for all angle forces.

Warning

This class should not be instantiated by users. The class can be used for isinstance or issubclass checks.

class hoomd.md.angle.CosineSquared#

Bases: Angle

Cosine squared angle force.

CosineSquared computes forces, virials, and energies on all angles in the simulation state with:

$U(\theta) = \frac{1}{2} k \left( \cos\theta - \cos\theta_0 \right)^2$

CosineSquared is used in the gromos96 and MARTINI force fields.

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]

Examples:

cosinesq = angle.CosineSquared()
cosinesq.params['A-A-A'] = dict(k=3.0, t0=0.7851)
cosinesq.params['A-B-A'] = dict(k=100.0, t0=1.0)

class hoomd.md.angle.Harmonic#

Bases: Angle

Harmonic angle force.

Harmonic computes forces, virials, and energies on all angles in the simulation state with:

$U(\theta) = \frac{1}{2} k \left( \theta - \theta_0 \right)^2$
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['A-A-A'] = dict(k=3.0, t0=0.7851)
harmonic.params['A-B-A'] = dict(k=100.0, t0=1.0)

class hoomd.md.angle.Table(width)#

Bases: Angle

Tabulated bond force.

Parameters:

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

Table computes computes forces, virials, and energies on all angles in the simulation given the user defined tables $$U$$ and $$\tau$$.

The torque $$\tau$$ is:

$\tau(\theta) = \tau_\mathrm{table}(\theta)$

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

$U(\theta) =U_\mathrm{table}(\theta)$

Provide $$\tau_\mathrm{table}(\theta)$$ and $$U_\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 U}{\partial \theta}$$.

params#

The potential parameters. The dictionary has the following keys:

Type:

TypeParameter [angle type, dict]

width#

Number of points in the table.

Type:

int