md.dihedral¶
Overview
Base class dihedral force. |
|
Periodic dihedral force. |
|
OPLS dihedral force. |
|
Tabulated dihedral force. |
Details
Dihedral forces.
Dihedral force classes apply a force and virial on every particle in the simulation state commensurate with the potential energy:
Each dihedral is defined by an ordered quadruplet of particle tags in the
hoomd.State
member dihedral_group
. HOOMD-blue does not construct dihedral
groups, users must explicitly define dihedrals in the initial condition.
In the dihedral group (i,j,k,l), \(\phi\) is the signed dihedral angle between the planes passing through (\(\vec{r}_i, \vec{r}_j, \vec{r}_k\)) and (\(\vec{r}_j, \vec{r}_k, \vec{r}_l\)).
Dihedral force classes assign 1/4 of the potential energy to each of the particles in the dihedral group:
and similarly for virials.
Important
There are multiple conventions pertaining to the dihedral angle in the literature. HOOMD-blue utilizes the convention where \(\phi = \pm \pi\) in the anti-parallel stretched state ( /\/ ) and \(\phi = 0\) in the parallel compact state ( |_| ).
- class hoomd.md.dihedral.Dihedral¶
Bases:
Force
Base class dihedral force.
Dihedral
is the base class for all dihedral forces.Warning
This class should not be instantiated by users. The class can be used for
isinstance
orissubclass
checks.
- class hoomd.md.dihedral.OPLS¶
Bases:
Dihedral
OPLS dihedral force.
OPLS
computes forces, virials, and energies on all dihedrals in the simulation state with:\[U(\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)\]\(k_n\) are the force coefficients in the Fourier series.
- 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['A-A-A-A'] = dict(k1=1.0, k2=1.0, k3=1.0, k4=1.0)
- class hoomd.md.dihedral.Periodic¶
Bases:
Dihedral
Periodic dihedral force.
Periodic
computes forces, virials, and energies on all dihedrals in the simulation state with:\[U(\phi) = \frac{1}{2}k \left( 1 + d \cos\left(n \phi - \phi_0 \right) \right)\]- 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.Periodic() harmonic.params['A-A-A-A'] = dict(k=3.0, d=-1, n=3, phi0=0) harmonic.params['A-B-C-D'] = dict(k=100.0, d=1, n=4, phi0=math.pi/2)
- class hoomd.md.dihedral.Table(width)¶
Bases:
Dihedral
Tabulated dihedral force.
- Parameters:
width (int) – Number of points in the table.
Table
computes computes forces, virials, and energies on all dihedrals in the simulation given the user defined tables \(U\) and \(\tau\).The torque \(\tau\) is:
\[\tau(\phi) = \tau_\mathrm{table}(\phi)\]and the potential \(U(\phi)\) is:
\[U(\phi) = U_\mathrm{table}(\phi)\]Provide \(\tau_\mathrm{table}(\phi)\) and \(U_\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 U}{\partial \phi}\).- params¶
The potential parameters. The dictionary has the following keys:
U
((width,)numpy.ndarray
offloat
, required) - the tabulated energy values \([\mathrm{energy}]\). Must have a size equal towidth
.tau
((width,)numpy.ndarray
offloat
, required) - the tabulated torque values \([\mathrm{force} \cdot \mathrm{length}]\). Must have a size equal towidth
.
- Type:
TypeParameter
[dihedral type
,dict
]