LennardJonesMNPotential

class LennardJonesMNPotential(particleType1, particleType2, A, B, m, n, r_cut=None, ASpecial=None, BSpecial=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.
  • A (PhysicalQuantity of the length**m * energy) – Potential parameter.
  • B (PhysicalQuantity of the length**n * energy) – Potential parameter.
  • m (float) – Potential parameter.
  • n (float) – Potential parameter.
  • r_cut (PhysicalQuantity of type length) – The cutoff radius of this potential.
  • ASpecial (PhysicalQuantity of type length**m * energy) – Potential parameter. This parameter is only used when bonded_mode is set to evaluate34.
  • BSpecial (PhysicalQuantity of type length**n * energy) – Potential parameter. This parameter is only used when bonded_mode is set to evaluate34.
  • bonded_mode

    Either LennardJonesMNPotential.evaluateAll or LennardJonesMNPotential.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.

setA(A)

Set the parameter A.

Parameters:A (PhysicalQuantity of the length**m * energy) – Potential parameter.
setASpecial(ASpecial)

Set the parameter ASpecial.

Parameters:ASpecial (PhysicalQuantity of type length**m * energy) – Potential parameter. This parameter is only used when bonded_mode is set to evaluate34.
setB(B)

Set the parameter B.

Parameters:B (PhysicalQuantity of the length**n * energy) – Potential parameter.
setBSpecial(BSpecial)

Set the parameter BSpecial.

Parameters:BSpecial (PhysicalQuantity of type length**n * energy) – Potential parameter. This parameter is only used when bonded_mode is set to evaluate34.
setBondedMode(bonded_mode)

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

Parameters:bonded_mode

Either LennardJonesMNPotential.evaluateAll or LennardJonesMNPotential.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.
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.
setm(m)

Set the parameter m.

Parameters:m (float) – Potential parameter.
setn(n)

Set the parameter n.

Parameters:n (float) – Potential parameter.

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_COMPASS')

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

# Add the Lennard-Jones potential to the potential set
potentialSet.addPotential(LennardJonesMNPotential('Ar', 'Ar',
                                                  A=3456.895*eV*Angstrom**9.0,
                                                  B=88.773*eV*Angstrom**6.0,
                                                  m=9.0,
                                                  n=6.0,
                                                  r_cut=9.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 COMPASS force field.

Notes

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

To describe the interaction between two particles \(i\) and \(j\), this potential uses the following potential function:

\[V_{ij}(r) = \frac{A_{ij}}{r^{m}} -\frac{B_{ij}}{r^{n}} \, .\]

This form permits a more flexible definition of a Lennard-Jones potential. You have to manually specify the interaction parameters between all pairs of particle types, and therefore you can use any set of combination rules you want.

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

The best choice 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.

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.