Patchy¶
- class hoomd.md.pair.aniso.Patchy(nlist, default_r_cut=None, mode='none')¶
Bases:
AnisotropicPair
Patchy pair potentials.
Patchy
combines an isotropicPair
potential with an orientation dependent modulation function \(f\). UsePatchy
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\). UsePatchy
along with a repulsive isotropicPair
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}\]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}\).\(\alpha\) and \(\omega\) control the shape of the patch:
See also
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
orissubclass
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)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'] = []