ljts

mdhelper.openmm.pair.ljts(cutoff: float | Quantity, cutoff_ljts: float | Quantity = None, *, coefs: dict[str, float] | tuple[float, float, float] = (1, 1, 4), powers: dict[str, float] | tuple[float, float] = (12, 6), shift: bool = True, mix: str = 'arithmetic', mie: bool = False, wca: bool = False, global_params: dict[str, float | Quantity] = None, per_params: list = None, tab_funcs: dict[str, ndarray[int | float] | Quantity | Discrete2DFunction] = None) CustomNonbondedForce[source]

Implements the generalized Lennard-Jones truncated and shifted (LJTS) pair potential and its derivatives, such as the Mie and Weeks–Chandler–Andersen (WCA) potentials.

The generalized LJ potential is given by

\[u_\mathrm{LJ}(r_{12})=C\epsilon_{12} \left[A\left(\frac{\sigma_{12}}{r_{12}}\right)^{\gamma_\mathrm{r}} -B\left(\frac{\sigma_{12}}{r_{12}}\right)^{\gamma_\mathrm{a}}\right]\]

where \(\sigma_{12}\) is the average particle size in \(\mathrm{nm}\), \(\epsilon_{12}\) is the dispersion energy in \(\mathrm{kJ/mol}\), and \(A\), \(B\), \(C\), \(\gamma_\mathrm{r}\), and \(\gamma_\mathrm{a}\) are constants.

The standard 12-6 LJ potential, which is the most frequently used form, uses \(A=1\), \(B=1\), \(C=4\), \(\gamma_\mathrm{r}=12\), and \(\gamma_\mathrm{a}=6\).

While \(\gamma_\mathrm{a}=6\) is justified by the London dispersion force, no such rationale exists for \(\gamma_\mathrm{r}=12\). By relaxing the restrictions on what values \(\gamma_\mathrm{r}\) and \(\gamma_\mathrm{a}\) can take on and keeping \(A=1\) and \(B=1\), the Mie potential is obtained:

\[\begin{split}\begin{gather*} u_\mathrm{Mie}(r_{12})=C_\mathrm{Mie}\epsilon_{12} \left[\left(\frac{\sigma_{12}}{r_{12}}\right)^{\gamma_\mathrm{r}} -\left(\frac{\sigma_{12}}{r_{12}}\right)^{\gamma_\mathrm{a}}\right]\\ C_\mathrm{Mie}=\frac{\gamma_\mathrm{r}} {\gamma_\mathrm{r}-\gamma_\mathrm{a}} \left(\frac{\gamma_\mathrm{r}}{\gamma_\mathrm{a}}\right) ^{\gamma_\mathrm{a}/(\gamma_\mathrm{r}-\gamma_\mathrm{a})} \end{gather*}\end{split}\]

In dense fluids, it is common to use a purely repulsive potential. The standard 12-6 LJ potential can be truncated and shifted at a cutoff of \(r_\mathrm{cut}=2^{1/6}\sigma_{12}\) to get the WCA potential, which is widely employed as a reference potential in simulations of liquid systems. A generalized WCA potential can be acquired by truncating and shifting the Mie potential instead at a cutoff of \(r_\mathrm{WCA}=(\gamma_\mathrm{r}/\gamma_\mathrm{a}) ^{1/(\gamma_\mathrm{r}-\gamma_\mathrm{a})}\sigma_{12}\):

\[\begin{split}u_\mathrm{WCA}(r_{12})=\begin{cases} C_\mathrm{Mie}\epsilon_{12}\left[ \left(\dfrac{\sigma_{12}}{r_{12}}\right)^{\gamma_\mathrm{r}} -\left(\dfrac{\sigma_{12}}{r_{12}}\right)^{\gamma_\mathrm{a}} \right]+\epsilon_{12},&\mathrm{if}\,r_{12}<r_\mathrm{WCA}\\ 0,&\mathrm{if}\,r_{12}\geq r_\mathrm{WCA} \end{cases}\end{split}\]

In the case where flexibility is allowed for all constants and the cutoff, the generalized LJTS potential is obtained:

\[\begin{split}u_\mathrm{LJTS}(r_{12})=\begin{cases} u_\mathrm{LJ}(r_{12})-u_\mathrm{LJ}(r_\mathrm{cut}), &\mathrm{if}\,r_{12}<r_\mathrm{cut}\\ 0,&\mathrm{if}\,r_{12}\geq r_\mathrm{cut} \end{cases}\end{split}\]

After creating the pair potentials, particles should be registered using openmm.openmm.CustomNonbondedForce.addParticle().

Parameters:
cutofffloat or openmm.unit.Quantity

Shared cutoff distance for all nonbonded interactions in the simulation sytem. Must be less than half the minimum periodic simulation box dimension.

Reference unit: \(\mathrm{nm}\).

cutoff_ljtsfloat or openmm.unit.Quantity, optional

Cutoff distance \(r_\mathrm{cut}\) for the LJTS potential. Must be less than the shared cutoff distance. If not provided, it is set to the shared cutoff distance. If the WCA potential is used, the dynamic cutoff \(r_\mathrm{WCA}\) is used instead.

Reference unit: \(\mathrm{nm}\).

coefstuple or dict, keyword-only, default: (1, 1, 4)

Coefficients \(A\), \(B\), and \(C\), in that order. If a dict is provided, use the keys "A", "B", and "C", respectively. If the Mie or WCA potential is used, the appropriate coefficients are used instead.

powerstuple or dict, keyword-only, default: (12, 6)

Powers \(\gamma_\mathrm{r}\) and \(\gamma_\mathrm{a}\), in that order. If a dict is provided, use the keys "r" and "a", respectively.

shiftbool, keyword-only, default: True

Determines whether the LJTS potential is shifted at its cutoff to \(0\,\mathrm{kJ/mol}\). If the WCA potential is used, a dynamic shift of \(\epsilon_{12}\) is used instead.

miebool, keyword-only, default: False

Determines whether to use the Mie potential. If True, coefs is superseded by the correct values for the Mie potential. Only one of mie and wca can be True.

wcabool, keyword-only, default: False

Determines whether to use the WCA potential. If True, cutoff_ljts, coefs, and shift are superseded by the correct values for the WCA potential. Only one of mie and wca can be True.

mixstr, keyword-only, default: "arithmetic"

Mixing rule for \(\sigma_{12}\) and \(\epsilon_{12}\).

Valid values:

  • "arithmetic": Lorentz-Berthelot combining rule.

    \[\begin{split}\begin{gather*} \sigma_{12}=\frac{\sigma_1+\sigma_2}{2}\\ \epsilon_{12}=\sqrt{\epsilon_1\epsilon_2} \end{gather*}\end{split}\]

    Per-particle parameters: \((\sigma_i,\,\epsilon_i)\).

  • "geometric": Geometric mixing rule.

    \[\begin{split}\begin{gather*} \sigma_{12}=\sqrt{\sigma_1\sigma_2}\\ \epsilon_{12}=\sqrt{\epsilon_1\epsilon_2} \end{gather*}\end{split}\]

    Per-particle parameters: \((\sigma_i,\,\epsilon_i)\).

  • "sixthpower": Sixth-power mixing rule.

    \[\begin{split}\begin{gather*} \sigma_{12}=\left(\frac{\sigma_1^6 +\sigma_2^6}{2}\right)^{1/6}\\ \epsilon_{12}=\frac{2\sqrt{\epsilon_1\epsilon_2} \sigma_1^3\sigma_2^3}{\sigma_1^6+\sigma_2^6} \end{gather*}\end{split}\]

    Per-particle parameters: \((\sigma_i,\,\epsilon_i)\).

  • "sigma12 = ...; epsilon12 = ...;": Custom mixing rule. The string containing the expression for \(\sigma_{12}\) and \(\epsilon_{12}\) must be written in valid C++ syntax, with any custom global and per-particle parameters and tabulated functions defined in global_params, per_params, and tab_funcs, respectively.

global_paramsdict, keyword-only, optional

Additional global parameters for use in the definition of \(\sigma_{12}\) and \(\epsilon_{12}\).

per_paramslist, keyword-only, optional

Additional per-particle parameters for use in the definition of \(\sigma_{12}\) and \(\epsilon_{12}\).

tab_funcsdict, keyword-only, optional

Optional tabulated functions for use in the definition of \(\sigma_{12}\) and \(\epsilon_{12}\).

Returns:
pair_ljtsopenmm.CustomNonbondedForce

LJTS pair potential.