7. Non-bonded interactions¶
In ESPResSo, interactions are set up and investigated by the espressomd.interactions
module. There are
mainly two types of interactions: non-bonded and bonded interactions.
Non-bonded interactions only depend on the type of the two particles involved. This also applies to the electrostatic interaction; however, due to its long-ranged nature, it requires special care and ESPResSo handles it separately with a number of state-of-the-art algorithms. To specify particle type and charge see Setting up particles.
A bonded interaction defines an interaction between a number of specific particles; it only applies to the set of particles for which it has been explicitly set. A bonded interaction between a set of particles has to be specified explicitly by the command, while the command is used to define the interaction parameters.
Non-bonded interaction are configured via the
espressomd.interactions.NonBondedInteraction
class,
which is a member of espressomd.system.System
:
system.non_bonded_inter[type1, type2]
This command defines an interaction between all particles of type type1
and type2
. All available interaction potentials and their parameters are
listed below. For example, the following adds a WCA potential between
particles of type 0:
system.non_bonded_inter[0, 0].wca.set_params(epsilon=1., sigma=2.)
Each type pair can have multiple potentials active at the same time. To deactivate a specific potential for a given type pair, do:
system.non_bonded_inter[0, 0].wca.deactivate()
To deactivate all potentials for a given type pair, do:
system.non_bonded_inter[0, 0].reset()
To deactivate all potentials between all type pairs, do:
system.non_bonded_inter.reset()
For many non-bonded interactions, it is possible to artificially cap the forces, which often allows to equilibrate the system much faster. See the subsection Capping the force during warmup for more details.
It is possible to exclude particle pairs from the non-bonded interaction calculation. For example:
system.part.by_id(0).exclusions = [1, 2]
excludes short-range interactions of the particle pairs 0 <-> 1
and 0 <-> 2
.
It is possible to automatically exclude particle pairs that are involved in
bonded interactions, for example to prevent virtual sites from interacting
with the real particles they are tracking, or to facilitate the use of custom
potentials in polymers. This is achieved via the
espressomd.particle_data.ParticleList.auto_exclusions()
method.
7.1. Isotropic non-bonded interactions¶
7.1.1. Tabulated interaction¶
Note
Feature TABULATED
required.
The interface for tabulated interactions are implemented in the
TabulatedNonBonded
class. They can be configured
via the following syntax:
import numpy as np
r = np.linspace(0., 8., 100)
energy = 4 * eps * ((sig / r)**12 - (sig / r)**6)
force = -4 * eps * (-12 / r * (sig / r)**12 + 6 / r * (sig / r)**6)
system.non_bonded_inter[type1, type2].tabulated.set_params(
min=0., max=8., energy=energy, force=force)
This defines an interaction between particles of the types type1
and
type2
according to an arbitrary tabulated pair potential by linear interpolation.
force
specifies the tabulated forces and energy
the energies as a function of the
separation distance. force
and energy
have to have the same length
The values of
Alternatively, one can generate the tabulated interaction from an analytical
expression of the potential. The expression of the force is automatically
determined through symbolic differentiation, via method
set_analytical()
:
system.non_bonded_inter[type1, type2].tabulated.set_analytical(
min=0., max=8., steps=100, sigma=1., epsilon=4.,
energy_expr="4*epsilon*((sigma/r)**12-(sigma/r)**6)")
# optional: plot tabulated values
import matplotlib.pyplot as plt
plt.plot(system.non_bonded_inter[type1, type2].tabulated.force, label="force")
plt.plot(system.non_bonded_inter[type1, type2].tabulated.energy, label="energy")
plt.legend()
plt.show()
7.1.2. Lennard-Jones interaction¶
Note
Feature LENNARD_JONES
required.
The interface for the Lennard-Jones interaction is implemented in
LennardJonesInteraction
. The Lennard-Jones parameters
can be set via:
system.non_bonded_inter[type1, type2].lennard_jones.set_params(**kwargs)
This command defines the traditional (12-6)-Lennard-Jones interaction
between particles of the types type1
and type2
. For a description of the input arguments
see LennardJonesInteraction
. The potential is defined by
The traditional Lennard-Jones potential is the “work-horse” potential of
particle–particle interactions in coarse-grained simulations. It is a
simple model for the van-der-Waals interaction, and is attractive at
large distance, but strongly repulsive at short distances.
If 'auto'
, the shift will be
automatically computed such that the potential is continuous at the
cutoff radius.
The net force on a particle can be capped by using force capping, see section Capping the force during warmup
An optional additional parameter can be used to restrict the interaction
from a minimal distance
A special case of the Lennard-Jones potential is the
Weeks–Chandler–Andersen (WCA) potential, which one obtains by putting
the cutoff into the minimum and shifting the potential to be continuous, choosing
'auto'
. The WCA
potential is purely repulsive, and is often used to mimic hard sphere repulsion.
7.1.3. Generic Lennard-Jones interaction¶
Note
Feature LENNARD_JONES_GENERIC
required.
The interface for the generic Lennard-Jones interactions is implemented in
espressomd.interactions.GenericLennardJonesInteraction
. They
are configured via the syntax:
system.non_bonded_inter[type1, type2].generic_lennard_jones.set_params(**kwargs)
This command defines a generalized version of the Lennard-Jones
interaction (see Lennard-Jones interaction) between particles of the
types type1
and type2
. The potential is defined by
Note that the prefactor 4 of the standard LJ potential is missing, so
the normal LJ potential is recovered for
The optional LJGEN_SOFTCORE
feature activates a softcore version of
the potential, where the following transformations apply:
7.1.4. Weeks–Chandler–Andersen interaction¶
Note
Feature WCA
required.
The interface for the Weeks–Chandler–Andersen interactions is implemented in
espressomd.interactions.WCAInteraction
. They
are configured via the syntax:
system.non_bonded_inter[type1, type2].wca.set_params(**kwargs)
This command defines a Weeks-Chandler-Andersen interaction between particles of the
types type1
and type2
. The potential is defined by
7.1.5. Lennard-Jones cosine interaction¶
Note
Feature LJCOS
and/or LJCOS2
required.
espressomd.interactions.LennardJonesCosInteraction
and
espressomd.interactions.LennardJonesCos2Interaction
specify
a Lennard-Jones interaction with cosine tail [Soddemann et al., 2001]
between particles of the types type1
and type2
. They
are configured via the syntax:
system.non_bonded_inter[type1, type2].lennard_jones_cos.set_params(**kwargs)
system.non_bonded_inter[type1, type2].lennard_jones_cos2.set_params(**kwargs)
The first variant behaves as follows: until the minimum of the Lennard-Jones
potential at
where
In the second variant, the cutoff radius is
For
The net force on a particle can be capped by using force capping, see section Capping the force during warmup
7.1.6. Smooth step interaction¶
Note
Feature SMOOTH_STEP
required.
The interface for the smooth-step interaction is implemented in
espressomd.interactions.SmoothStepInteraction
. The smooth-step parameters
can be set via:
system.non_bonded_inter[type1, type2].smooth_step.set_params(**kwargs)
This defines a smooth step interaction between particles of the types type1
and type2
, for which the potential is
for
7.1.7. BMHTF potential¶
Note
Feature BMHTF_NACL
required.
The interface for the smooth-step interaction is implemented in
espressomd.interactions.BMHTFInteraction
. The parameters of the BMHTF potential
can be set via:
system.non_bonded_inter[type1, type2].bmhtf.set_params(**kwargs)
This defines an interaction with the short-ranged part of the
Born–Meyer–Huggins–Tosi–Fumi potential between particles of the types type1
and type2
, which is often used to simulate NaCl crystals. The potential is
defined by:
where
For NaCl, the parameters should be chosen as follows:
types |
|||||
---|---|---|---|---|---|
Na-Na |
25.4435 |
3.1546 |
101.1719 |
48.1771 |
2.34 |
Na-Cl |
20.3548 |
3.1546 |
674.4793 |
837.0770 |
2.755 |
Cl-Cl |
15.2661 |
3.1546 |
6985.6786 |
14031.5785 |
3.170 |
The cutoff can be chosen relatively freely because the potential decays fast; a value around 10 seems reasonable.
In addition to this short ranged interaction, one needs to add a
Coulombic, long-ranged part. If one uses elementary charges, a charge of
7.1.8. Morse interaction¶
Note
Feature MORSE
required.
The interface for the Morse interaction is implemented in
espressomd.interactions.MorseInteraction
. The Morse interaction parameters
can be set via:
system.non_bonded_inter[type1, type2].morse.set_params(**kwargs)
This defines an interaction using the Morse potential between particles
of the types type1
and type2
. It serves similar purposes as the Lennard-Jones
potential, but has a deeper minimum, around which it is harmonic. This
models the potential energy in a diatomic molecule.
For
where is again chosen such that
7.1.9. Buckingham interaction¶
Note
Feature BUCKINGHAM
required.
The interface for the Buckingham interaction is implemented in
espressomd.interactions.BuckinghamInteraction
. The Buckingham interaction parameters
can be set via:
system.non_bonded_inter[type1, type2].morse.set_params(**kwargs)
This defines a Buckingham interaction between particles of the types type1 and type2, for which the potential is given by
for
7.1.10. Soft-sphere interaction¶
Note
Feature SOFT_SPHERE
required.
The interface for the soft-sphere interaction is implemented in
espressomd.interactions.SoftSphereInteraction
. The Soft-sphere parameters
can be set via:
system.non_bonded_inter[type1, type2].soft_sphere.set_params(**kwargs)
This defines a soft-sphere interaction between particles of the types type1
and type2
, which is defined by a single power law:
for
7.1.11. Hat interaction¶
Note
Feature HAT
required.
The interface for the hat interaction is implemented in
espressomd.interactions.HatInteraction
. The hat parameters
can be set via:
system.non_bonded_inter[type1, type2].hat.set_params(**kwargs)
This defines a simple force ramp between particles of two types.
The maximal force acts at zero distance and zero force is applied at
distances
for distances exceeding
The potential energy is given by
which is zero for distances bigger than
This is the standard conservative DPD potential and can be used in combination with Dissipative Particle Dynamics (DPD).
7.1.12. Hertzian interaction¶
Note
Feature HERTZIAN
required.
The interface for the Hertzian interaction is implemented in
espressomd.interactions.HertzianInteraction
. The Hertzian interaction parameters
can be set via:
system.non_bonded_inter[type1, type2].hertzian.set_params(**kwargs)
This defines an interaction according to the Hertzian potential between
particles of the types type1
and type2
. The Hertzian potential is defined by
The potential has no singularity and is defined everywhere; the
potential has a non-differentiable maximum at
7.1.13. Gaussian interaction¶
Note
Feature GAUSSIAN
required.
The interface for the Gaussian interaction is implemented in
espressomd.interactions.GaussianInteraction
. The Gaussian interaction parameters
can be set via:
system.non_bonded_inter[type1, type2].gaussian.set_params(**kwargs)
This defines an interaction according to the Gaussian potential between
particles of the types type1
and type2
. The Gaussian potential is defined by
The Gaussian potential is smooth except at the cutoff, and has a finite
overlap energy of
Currently, there is no shift implemented, which means that the potential
is discontinuous at
7.1.14. DPD interaction¶
Note
Feature DPD
required.
This is a special interaction that is to be used in conjunction with the Dissipative Particle Dynamics (DPD) thermostat. The parameters can be set via:
system.non_bonded_inter[type1, type2].dpd.set_params(**kwargs)
This command defines an interaction between particles of the types type1
and type2
that contains velocity-dependent friction and noise according
to a temperature set by espressomd.thermostat.Thermostat.set_dpd()
.
The parameters for the interaction are
gamma
weight_function
k
r_cut
trans_gamma
trans_weight_function
trans_r_cut
which will be explained below. The interaction only has an effect if the DPD thermostat is activated.
The interaction consists of a friction force
for the dissipative force and
for the random force. This introduces the friction coefficient gamma
) and the weight function
espressomd.thermostat.Thermostat.set_dpd()
)
to be equal for all particles. The weight function can be specified via the weight_function
switch.
The possible values for weight_function
are 0 and 1, corresponding to the
order of
Both weight functions are set to zero for r_cut
).
In case the weight_function
1 is selected the parameter k
can be chosen.
The random force has the properties
and is numerically discretized to a random number
For the perpendicular part, the dissipative and random force are calculated analogously
and introduce the second set of parameters prefixed with trans_
.
For trans_weight_function
)
the same options are available as for
Note: This interaction does not conserve angular momentum.
A more detailed description of the interaction can be found in [Soddemann et al., 2003].
7.1.15. Thole correction¶
Note
Requires features THOLE
and ELECTROSTATICS
.
Note
THOLE
is only implemented for the P3M electrostatics solver.
The Thole correction is closely related to simulations involving
Particle polarizability with thermalized cold Drude oscillators.
In this context, it is used to correct for overestimation of
induced dipoles at short distances. Ultimately, it alters the short-range
electrostatics of P3M to result in a damped Coulomb interaction potential
system = espressomd.System(box_l=[1, 1, 1])
system.non_bonded_inter[type_1,type_2].thole.set_params(scaling_coeff=<float>, q1q2=<float>)
- with parameters:
scaling_coeff
: The scaling coefficient .q1q2
: The charge factor of the involved charges.
Because the scaling coefficient depends on the mixed polarizabilities and the
nonbonded interaction is controlled by particle types, each Drude charge with a
unique polarizability has to have a unique type. Each Drude charge type has
a Thole correction interaction with all other Drude charges and all Drude
cores, except the one it’s connected to. This exception is handled internally
by disabling Thole interaction between particles connected via Drude bonds.
Also, each Drude core has a Thole correction interaction with all other Drude
cores and Drude charges. To assist with the bookkeeping of mixed scaling
coefficients, the helper method add_drude_particle_to_core()
(see
Particle polarizability with thermalized cold Drude oscillators)
collects all core types, Drude types and relevant parameters when a Drude
particle is created. The user already provided all the information when
setting up the Drude particles, so the simple call:
add_all_thole(<system>, <verbose>)
given the espressomd.System()
object, uses this information to create all
necessary Thole interactions. The method calculates the mixed scaling
coefficient s
and creates the non-bonded Thole interactions between the
collected types to cover all the Drude-Drude, Drude-core and core-core
combinations. No further calls of add_drude_particle_to_core()
should
follow. Set verbose
to True
to print out the coefficients, charge factors
and involved types.
The samples folder contains the script /samples/drude_bmimpf6.py
with a
fully polarizable, coarse grained ionic liquid where this approach is applied.
7.2. Anisotropic non-bonded interactions¶
7.2.1. Gay–Berne interaction¶
Note
Feature GAY_BERNE
required.
The interface for a Gay–Berne interaction is provided by the
espressomd.interactions.GayBerneInteraction
class. Interaction
parameters can be set via:
system.non_bonded_inter[type1, type2].gay_berne.set_params(**kwargs)
This defines a Gay–Berne potential for prolate and oblate particles
between particles types type1
and type2
. The Gay–Berne potential is an
anisotropic version of the classic Lennard-Jones potential, with
orientational dependence of the range
Assume two particles with orientations given by the unit vectors
otherwise
where
and
Note that contrary to the original paper [Gay and Berne, 1981], here
The parameters