pyPRISM.potential.LennardJones module

class pyPRISM.potential.LennardJones.LennardJones(epsilon, sigma=None, rcut=None, shift=False)[source]

Bases: pyPRISM.potential.Potential.Potential

12-6 Lennard-Jones potential

Mathematical Definition

\[U_{\alpha,\beta}(r) = 4\epsilon_{\alpha,\beta}\left[\left(\frac{\sigma_{\alpha,\beta}}{r}\right)^{12.0} - \left(\frac{\sigma_{\alpha,\beta}}{r}\right)^{6.0}\right]\]
\[U_{\alpha,\beta}^{shift}(r) = U_{\alpha,\beta}(r) - U_{\alpha,\beta}(r_{cut})\]

Variable Definitions

\(\epsilon_{\alpha,\beta}\)
Strength of attraction between sites \(\alpha\) and \(\beta\).
\(\sigma_{\alpha,\beta}\)
Length scale of interaction between sites \(\alpha\) and \(\beta\).
\(r\)
Distance between sites.
\(r_{cut}\)
Cutoff distance between sites.

Description

The classic 12-6 LJ potential. To facilitate direct comparison with molecular simulation, the simulation may be cut and shifted to zero at a specified cutoff distance by setting the rcut and shift parameters. The full (non-truncated) LJ potential is accessed using \(r_{cut}\) = None and \(shift\) = False.

Example

import pyPRISM

#Define a PRISM system and set the A-B interaction potential
sys = pyPRISM.System(['A','B'],kT=1.0)
sys.domain = pyPRISM.Domain(dr=0.1,length=1024)
sys.potential['A','B'] = pyPRISM.potential.LennardJones(epsilon=1.0,sigma=1.0,rcut=2.5,shift=True)

Warning

If sigma is specified such that it does not fall on the solution grid of the Domain object specified in System, then the sigma will effectively be rounded. A warning should be emitted during the construction of a PRISM object if this occurs.

__init__(epsilon, sigma=None, rcut=None, shift=False)[source]

Constructor

Parameters:
  • epsilon (float) – Depth of attractive well
  • sigma (float, optional) – Contact distance. If not specified, sigma will be calculated from the diameters specified in the System object.
  • rcut (float, optional) – Cutoff distance for potential. Useful for comparing directly to results from simulations where cutoffs are necessary.
  • shift (bool,*optional*) – If \(r_{cut}\) is specified, shift the potential by its value at the cutoff. If \(r_{cut}\) is not specified, this parameter is ignored.
calculate(r)[source]

Calculate value of potential

r

Array of pair distances at which to calculate potential values

Type:float np.ndarray
calculate_attractive(r)[source]

Calculate the attractive tail of the Lennard Jones potential. Returns zero at \(r<\sigma\)