# LennardJonesSplinePotential¶

class LennardJonesSplinePotential(particleType1, particleType2, r_cut=None, r_i=None, sigma=None, epsilon=None, sigmaSpecial=None, epsilonSpecial=None, bonded_mode=None)

Constructor of the potential.

Parameters: particleType1 (ParticleType or ParticleIdentifier) – Identifier of the first particle type. particleType2 (ParticleType or ParticleIdentifier) – Identifier of the second particle type. r_cut (PhysicalQuantity of type length) – The cutoff radius of this potential. r_i (PhysicalQuantity of type length) – The inner cutoff radius where the smoothing of the potential starts. r_i must be smaller than r_cut. sigma (PhysicalQuantity of type length) – Potential parameter. epsilon (PhysicalQuantity of type energy) – Potential parameter. sigmaSpecial (PhysicalQuantity of type length) – Potential parameter. This parameter is only used when bonded_mode is set to evaluate34. epsilonSpecial (PhysicalQuantity of type energy) – Potential parameter. This parameter is only used when bonded_mode is set to evaluate34. bonded_mode – Either LennardJonesSplinePotential.evaluateAll or LennardJonesSplinePotential.evaluate34. If evaluateAll is chosen, interactions between all particles - even those that are connected by fixed bonds - are evaluated, using the sigma and epsilon parameters. If evaluate34 is chosen, interactions between particles that are connected by bonds with a path length of at most two (i.e. are connected by a bond or are bonded to a common atom) are omitted. Interactions between particles that are connected by a bonded path of length three use the sigmaSpecial and epsilonSpecial parameters, while all other interactions use the normal sigma and epsilon parameters.
getAllParameterNames()

Return the names of all used parameters as a list.

getAllParameters()

Return all parameters of this potential and their current values as a <parameterName / parameterValue> dictionary.

static getDefaults()

Get the default parameters of this potential and return them in form of a dictionary of <parameter name, default value> key-value pairs.

getInteractionMode()

Return the currently used interaction mode.

getParameter(parameterName)

Get the current value of the parameter parameterName.

setBondedMode(bonded_mode)

Set the way how particles that are connected by bonds are treated.

Parameters: bonded_mode – Either LennardJonesSplinePotential.evaluateAll or LennardJonesSplinePotential.evaluate34. If evaluateAll is chosen, interactions between all particles - even those that are connected by bonds - are evaluated, using the sigma and epsilon parameters. If evaluate34 is chosen, interactions between particles that are connected by less than three bonds (i.e. are connected by a bond or are bonded to a common atom) are omitted.
setCutoff(r_cut)

Set the cutoff radius for this potential.

Parameters: r_cut (PhysicalQuantity of type length) – The cutoff radius of this potential.
setEpsilon(epsilon)

Set the epsilon parameter.

Parameters: epsilon (PhysicalQuantity of type energy) – Potential parameter.
setEpsilonSpecial(epsilonSpecial)

Set the epsilonSpecial parameter.

Parameters: epsilonSpecial (PhysicalQuantity of type energy) – Potential parameter. This parameter is only used when bonded_mode is set to evaluate34.
setInnerCutoff(r_i)

Set the inner cutoff.

Parameters: r_i (PhysicalQuantity of type length) – The inner cutoff radius where the smoothing of the potential starts. r_i must be smaller than r_cut.
setParameter(parameterName, value)

Set the parameter parameterName to the given value.

Parameters: parameterName (str) – The name of the parameter that will be modified. value – The new value that will be assigned to the parameter parameterName.
setSigma(sigma)

Set the sigma parameter.

Parameters: sigma (PhysicalQuantity of type length) – Potential parameter.
setSigmaSpecial(sigmaSpecial)

Set the sigmaSpecial parameter.

Parameters: sigmaSpecial (PhysicalQuantity of type length) – Potential parameter. This parameter is only used when bonded_mode is set to evaluate34.

## Usage Examples¶

Define a potential for argon by adding particle types and interaction functions to the TremoloXPotentialSet.

# -------------------------------------------------------------
# Argon crystal
# -------------------------------------------------------------

# Set up lattice
vector_a = [5.316, 0.0, 0.0]*Angstrom
vector_b = [0.0, 5.316, 0.0]*Angstrom
vector_c = [0.0, 0.0, 5.316]*Angstrom
lattice = UnitCell(vector_a, vector_b, vector_c)

# Define elements
elements = [Argon, Argon, Argon, Argon]

# Define coordinates
fractional_coordinates = [[ 0.0,  0.0,  0.0],
[ 0.5,  0.5,  0.0],
[ 0.5,  0.0,  0.5],
[ 0.0,  0.5,  0.5]]

# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates
)

# Create a new potential set for argon
potentialSet = TremoloXPotentialSet(name='Argon_TraPPE')

# Add the particle type, containing the Lennard-Jones parameters, to the potential set
potentialSet.addParticleType(ParticleType(symbol='Ar', mass=39.948*atomic_mass_unit, sigma=3.39*Angstrom, epsilon=0.01*eV))

# Add the Lennard-Jones potential to the potential set
potentialSet.addPotential(LennardJonesSplinePotential('Ar', 'Ar', r_cut=9.0*Angstrom, r_i=7.0*Angstrom))

# Create a TremoloX calculator from the potential set
calculator=TremoloXCalculator(parameters=potentialSet)
bulk_configuration.setCalculator(calculator)



The Lennard Jones parameters of this example are taken from the TraPPE force field.

## Notes¶

The LennardJonesSplinePotential typically describes a combination of van der Waals and repulsive interactions.

To describe the interaction between two particles $$i$$ and $$j$$, the Lennard-Jones potential uses the following potential function:

$V_{ij}(r) = 4\epsilon_{ij} \left [ \left(\frac{\sigma_{ij}}{r} \right )^{12} - \left(\frac{\sigma_{ij}}{r} \right )^6 \right] \, .$

If not specified explicitly in the potential, the Lennard-Jones parameters $$\sigma$$ and $$\epsilon$$ are taken from the ParticleType the potential acts on. The parameters between different types are calculated based on the Lorentz-Berthelot mixing rules

$\epsilon_{ij} = \sqrt{\epsilon_i \cdot \epsilon_j}$

and

$\sigma_{ij} = \frac{\sigma_i + \sigma_j}{2} \, .$

Lennard-Jones parameters can be taken from various force fields, such as the Universal Force Field (UFF), the Generalized AMBER Force Field (GAFF), the COMPASS force field, or, as in the above example, the Transferable Potentials for Phase Equilibria (TraPPE) force field.

Note that some force fields, such as e.g. AMBER, use the slightly different formula $$V(r)=\epsilon [(\sigma/r)^{12} - 2 (\sigma/r)^6]$$ to describe Lennard-Jones interactions. In order to use parameters defined for that formula in TremoloX’s Lennard-Jones potentials, the $$\sigma$$ values taken from these force fields have to be multiplied with $$2^{-1/6}$$.

The best choice of parameters depends on whether the respective force field has been designed for the desired context. Therefore, one should always carefully read the force field publication before using a new potential parameter set and ideally compare some test results against experiments or suitable quantum mechanical calculations.

The ensure a smooth transition to zero at the cutoff-distance, a spline-based smoothing function S is invoked as $$U(r) = U^{LJ}(r) \cdot S(r)$$ which switches the potential to zero over the interval $$[r_i, r_{cut}]$$.

When using bonded force fields the bonded_mode parameter can be used to modify how this potential acts between atoms that are connected via less than 4 bonds. If LennardJonesPotential.evaluateAll (or “mode_bondless”) is chosen, the potential acts between all selected atoms independent of the bonds between them. If LennardJonesPotential.evaluate34 (or “mode_14”) is chosen, the potential is switched off for all atoms that are connected via one or two consecutive bonds. For atoms separated by exactly three bonds (i.e. atoms 1 and 4 in a bonded sequence), the special Lennard-Jones parameters (respectively the combined epsilon14 and sigma14 of the ParticleType) are used instead.