# md.special_pair

Overview

 SpecialPair Base class special pair forces. LJ LJ special pair force. Coulomb Coulomb special pair force.

Details

Special pair forces.

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

$U_\mathrm{special~pairs} = \sum_{(j,k) \in \mathrm{special~pairs}} U_{jk}(r)$

Special pairs are used to implement interactions between designated pairs of particles. They act much like bonds, except that the interaction potential is typically a pair potential, such as LJ.

Each special pair is defined by an ordered pair of particle tags in the hoomd.State member pair_group. HOOMD-blue does not compute special pair groups, users must explicitly define special pairs in the initial condition.

In the special pair group (j,k), $$r$$ is the length of the vector between the particle positions $$r= |\mathrm{minimum\_image}(\vec{r}_k - \vec{r}_j)|$$.

Special pair force classes assign 1/2 of the potential energy to each of the particles in the bond group:

$U_i = \frac{1}{2} \sum_{(j,k) \in \mathrm{special~pairs}} U_{jk}(r) [i=j \lor i=k]$

and similarly for virials.

class hoomd.md.special_pair.Coulomb

Bases: SpecialPair

Coulomb special pair force.

Coulomb computes forces, virials, and energies on all special pairs in the simulation state with:

$\begin{split}U(r) = \begin{cases} \alpha \cdot \left[ \frac{q_{a}q_{b}}{r} \right] & r < r_{\mathrm{cut}} \\ 0 & r \ge r_{\mathrm{cut}} \\ \end{cases}\end{split}$

Note

Use Coulomb to implement special 1-4 interactions in atomistic force fields, such as the scaled 1-4 interactions in OPLS where both the 1-4 LJ and Coulomb interactions are scaled by 0.5.

params

The parameter of the Coulomb forces for each particle type. The dictionary has the following keys:

• alpha (float, required) - Coulomb scaling factor $$[\mathrm{energy}]$$

Type

TypeParameter[special pair type, dict]

r_cut

The cut-off distance for special pair potential $$[\mathrm{length}]$$

Type

TypeParameter[special pair type, float]

Examples:

coulomb = special_pair.Coulomb()
coulomb.params['cluster'] = dict(alpha=1.0)
coulomb.r_cut['cluster'] = 2

class hoomd.md.special_pair.LJ

Bases: SpecialPair

LJ special pair force.

LJ computes forces, virials, and energies on all special pairs in the simulation state with:

$\begin{split}U(r) = \begin{cases} 4 \varepsilon \left[ \left( \frac{\sigma}{r} \right)^{12} - \left( \frac{\sigma}{r} \right)^{6} \right] & r < r_{\mathrm{cut}} \\ 0 & r \ge r_{\mathrm{cut}} \\ \end{cases}\end{split}$

Note

Use LJ to implement special 1-4 interactions in atomistic force fields, such as the scaled 1-4 interactions in OPLS where both the 1-4 LJ and Coulomb interactions are scaled by 0.5.

params

The parameter of the lj forces for each particle type. The dictionary has the following keys:

Type

TypeParameter[special pair type, dict]

r_cut

The cut-off distance for special pair potential $$[\mathrm{length}]$$

Type

TypeParameter[special pair type, float]

Examples:

lj = special_pair.LJ()
lj.params['cluster'] = dict(epsilon=3, sigma=0.5)
lj.r_cut['cluster'] = 5

class hoomd.md.special_pair.SpecialPair

Bases: Force

Base class special pair forces.

Note

SpecialPair is the base class for all special pair forces. Users should not instantiate this class directly.