# md.dihedral

Overview

 Dihedral Constructs the dihedral bond potential. Harmonic Harmonic dihedral potential. OPLS OPLS dihedral force. Table Tabulated dihedral potential.

Details

Dihedral potentials.

By themselves, dihedrals that have been specified in an input file do nothing. Only when you specify an dihedral force (e.g. dihedral.Harmonic), are forces actually calculated between the listed particles.

Important: There are multiple conventions pertaining to the dihedral angle (phi) in the literature. HOOMD utilizes the convention shown in the following figure, where vectors are defined from the central particles to the outer particles. These vectors correspond to a stretched state ($$\phi = 180$$ degrees) when they are anti-parallel and a compact state ($$\phi = 0$$) when they are parallel.

class hoomd.md.dihedral.Dihedral

Bases: hoomd.md.force.Force

Constructs the dihedral bond potential.

Note

Dihedral is the base class for all dihedral potentials. Users should not instantiate this class directly.

class hoomd.md.dihedral.Harmonic

Harmonic dihedral potential.

Harmonic specifies a harmonic dihedral potential energy between every defined dihedral quadruplet of particles in the simulation:

$V(\phi) = \frac{1}{2}k \left( 1 + d \cos\left(n \phi - \phi_0 \right) \right)$

where $$\phi$$ is the angle between two sides of the dihedral.

params

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

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

• d (float, required) - sign factor $$d$$

• n (int, required) - angle multiplicity factor $$n$$

• phi0 (float, required) - phase shift $$\phi_0$$ $$[\mathrm{radians}]$$

Type

TypeParameter [dihedral type, dict]

Examples:

harmonic = dihedral.Harmonic()
harmonic.params['polymer'] = dict(k=3.0, d=-1, n=3, phi0=0)
harmonic.params['backbone'] = dict(k=100.0, d=1, n=4, phi0=math.pi/2)
class hoomd.md.dihedral.OPLS

OPLS dihedral force.

OPLS specifies an OPLS-style dihedral potential energy between every defined dihedral.

$V(\phi) = \frac{1}{2}k_1 \left( 1 + \cos\left(\phi \right) \right) + \frac{1}{2}k_2 \left( 1 - \cos\left(2 \phi \right) \right) + \frac{1}{2}k_3 \left( 1 + \cos\left(3 \phi \right) \right) + \frac{1}{2}k_4 \left( 1 - \cos\left(4 \phi \right) \right)$

where $$\phi$$ is the angle between two sides of the dihedral and $$k_n$$ are the force coefficients in the Fourier series (in energy units).

params

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

• k1 (float, required) - force constant of the first term $$[\mathrm{energy}]$$

• k2 (float, required) - force constant of the second term $$[\mathrm{energy}]$$

• k3 (float, required) - force constant of the third term $$[\mathrm{energy}]$$

• k4 (float, required) - force constant of the fourth term $$[\mathrm{energy}]$$

Type

TypeParameter [dihedral type, dict]

Examples:

opls = dihedral.OPLS()
opls.params['backbone'] = dict(k1=1.0, k2=1.0, k3=1.0, k4=1.0)
class hoomd.md.dihedral.Table(width)

Tabulated dihedral potential.

Parameters

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

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

The torque $$\tau$$ is:

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

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

$V(\phi) =V_\mathrm{table}(\phi)$

where $$\phi$$ is the dihedral angle for the particles A,B,C,D in the dihedral.

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

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 [dihedral type, dict]

width

Number of points in the table.

Type

int