Patchy

class hoomd.md.pair.aniso.Patchy(nlist, default_r_cut=None, mode='none')

Bases: AnisotropicPair

Patchy pair potentials.

Patchy combines an isotropic Pair potential with an orientation dependent modulation function \(f\). Use Patchy with an attractive potential to create localized sticky patches on the surface of a particle. Use it with a repulsive potential to create localized bumps. Patchy computes both forces and torques on particles.

Note

Patchy provides no interaction when there are no patches or particles are oriented such that \(f = 0\). Use Patchy along with a repulsive isotropic Pair potential to prevent particles from passing through each other.

The specific form of the patchy pair potential between particles \(i\) and \(j\) is:

\[U(r_{ij}, \mathbf{q}_i, \mathbf{q}_j) = \sum_{m=1}^{N_{\mathrm{patches},i}} \sum_{n=1}^{N_{\mathrm{patches},j}} f(\theta_{m,i}, \alpha, \omega) f(\theta_{n,j}, \alpha, \omega) U_{\mathrm{pair}}(r_{ij})\]

where \(U_{\mathrm{pair}}(r_{ij})\) is the isotropic pair potential and \(f\) is an orientation-dependent factor of the patchy spherical cap half-angle \(\alpha\) and patch steepness \(\omega\):

\[\begin{split}\begin{align} f(\theta, \alpha, \omega) &= \frac{\big(1+e^{-\omega (\cos{\theta} - \cos{\alpha}) }\big)^{-1} - f_{min}}{f_{max} - f_{min}}\\ f_{max} &= \big( 1 + e^{-\omega (1 - \cos{\alpha}) } \big)^{-1} \\ f_{min} &= \big( 1 + e^{-\omega (-1 - \cos{\alpha}) } \big)^{-1} \\ \end{align}\end{split}\]
Two dashed circles not quite touching. Circle i on the left has a faded shaded slice pointing up and to the right at a 35 degree angle. Circle j on the right has its shaded region pointing left and slightly up at a 25 degree angle. A vector labeled r i j points from particle i to j.

directors sets the locations of the patches in the local reference frame of the particle. Patchy rotates the local director \(\vec{d}\) by the particle’s orientation and computes the \(cos(\theta)\) in \(f\) as the cosine of the angle between the director and \(\vec{r}_{ij}\): \(cos(\theta_i) = \mathbf{q} \hat{d} \mathbf{q}^* \cdot \hat{r}_{ij}\) and \(cos(\theta_j) = \mathbf{q} \hat{d} \mathbf{q}^* \cdot -\hat{r}_{ij}\).

A single dashed circle centered at the origin of Cartesian x y axes. Vector p points from the center of the circle at a 35 degree angle from the right towards the center of the shaded region but does not reach the circle boundary. Alpha is indicated as half of the arc of the shaded region.

\(\alpha\) and \(\omega\) control the shape of the patch:

Plots of modulator f with alpha equals pi over 3 for omegas of 2, 5, 10, 20 and 50. For omega of 50, the plot is a barely rounded step from 0 to 1 at negative pi over 3 and back down to 0 at pi over 3. The omega 2 line is so rounded that there are no noticeable elbows, but f still reaches 1 at theta of 0. The other lines appear between these.

See also

Beltran-Villegas et. al.

hoomd.hpmc.pair.AngularStep provides a similar functional form for HPMC, except that \(f\) is a step function.

Warning

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


Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...


Members inherited from Force:

additional_energy

Additional energy term. Read more...

additional_virial

Additional virial tensor term \(W_\mathrm{additional}\). Read more...

cpu_local_force_arrays

Local force arrays on the CPU. Read more...

energies

Energy contribution \(U_i\) from each particle. Read more...

energy

The potential energy \(U\) of the system from this force. Read more...

forces

The force \(\vec{F}_i\) applied to each particle. Read more...

gpu_local_force_arrays

Local force arrays on the GPU. Read more...

torques

The torque \(\vec{\tau}_i\) applied to each particle. Read more...

virials

Virial tensor contribution \(W_i\) from each particle. Read more...


Members inherited from Pair:

nlist

Neighbor list used to compute the pair force. Read more...

mode

Energy smoothing/cutoff mode. Read more...

r_cut

Cuttoff radius beyond which the energy and force are 0. Read more...

r_on

Radius at which the XPLOR smoothing function starts. Read more...

compute_energy()

Compute the energy between two sets of particles. Read more...


Members defined in Patchy:

params

The Patchy potential parameters unique to each pair of particle types. The dictionary has the following keys:

  • envelope_params (dict, required)

    • alpha (float) - patch half-angle \(\alpha\) \([\mathrm{rad}]\)

    • omega (float) - patch steepness \(\omega\)

  • pair_params (dict, required) - passed to isotropic potential (see subclasses).

Example:

envelope_params = {'alpha': math.pi/4, 'omega': 30}
patchy.params[('A', 'A')] = dict(pair_params=pair_params,
                                 envelope_params=envelope_params)

Type: TypeParameter [tuple [particle_type, particle_type], dict]

directors

List of vectors pointing to patch centers, by particle type (normalized when set). When a particle type does not have patches, set an empty list.

Type: TypeParameter [particle_type, list [tuple [float, float, float]]

Examples:

patchy.directors['A'] = [(1,0,0), (1,1,1)]
patchy.directors['A'] = []