Harmonic

class hoomd.hpmc.external.Harmonic(reference_positions, reference_orientations, k_translational, k_rotational, symmetries)

Bases: External

Restrain particle positions and orientations with harmonic springs.

Parameters:
  • reference_positions ((N_particles, 3) numpy.ndarray of float) – the reference positions to which particles are restrained [length][\mathrm{length}].

  • reference_orientations ((N_particles, 4) numpy.ndarray of float) – the reference orientations to which particles are restrained [dimensionless][\mathrm{dimensionless}].

  • k_translational (hoomd.variant.variant_like) – translational spring constant [energylength2][\mathrm{energy} \cdot \mathrm{length}^{-2}].

  • k_rotational (hoomd.variant.variant_like) – rotational spring constant [energy][\mathrm{energy}].

  • symmetries ((N_symmetries, 4) numpy.ndarray of float) – the orientations that are equivalent through symmetry, i.e., the rotation quaternions that leave the particles unchanged. At a minimum, the identity quaternion ([1, 0, 0, 0]) must be included here [dimensionless][\mathrm{dimensionless}].

Harmonic computes harmonic spring energies between the particle positions/orientations and given reference positions/orientations:

Uexternal,i=Utranslational,i+Urotational,iUtranslational,i=12ktranslational(rir0,i)2Urotational,i=12krotationalminj[(qiq0,iqsymmetry,j)2]\begin{split} U_{\mathrm{external},i} & = U_{\mathrm{translational},i} + U_{\mathrm{rotational},i} \\ U_{\mathrm{translational},i} & = \frac{1}{2} k_{translational} \cdot (\vec{r}_i-\vec{r}_{0,i})^2 \\ U_{\mathrm{rotational},i} & = \frac{1}{2} k_{rotational} \cdot \min_j \left[ (\mathbf{q}_i-\mathbf{q}_{0,i} \cdot \mathbf{q}_{\mathrm{symmetry},j})^2 \right] \end{split}

where ktranslationalk_{translational} and krotationalk_{rotational} correspond to the parameters k_translational and k_rotational, respectively, ri\vec{r}_i and qi\mathbf{q}_i are the position and orientation of particle ii, the 00 subscripts denote the given reference quantities, and qsymmetry\mathbf{q}_{\mathrm{symmetry}} is the given set of symmetric orientations from the symmetries parameter.

Note

Harmonic does not support execution on GPUs.


Members inherited from External:

property energy

Potential energy contributed by this potential [energy][\mathrm{energy}]. Read more...


Members defined in Harmonic:

k_translational

The translational spring constant [energylength2][\mathrm{energy} \cdot \mathrm{length}^{-2}].

Type:

hoomd.variant.Variant

k_rotational

The rotational spring constant [energy][\mathrm{energy}].

Type:

hoomd.variant.Variant

reference_positions

The reference positions to which particles are restrained [length][\mathrm{length}].

Type:

(N_particles, 3) numpy.ndarray of float

reference_orientations

The reference orientations to which particles are restrained [dimensionless][\mathrm{dimensionless}].

Type:

(N_particles, 4) numpy.ndarray of float

symmetries

The orientations that are equivalent through symmetry, i.e., the rotation quaternions that leave the particles unchanged [dimensionless][\mathrm{dimensionless}].

Type:

(N_symmetries, 4) numpy.ndarray of float