lj_coul

mdhelper.openmm.pair.lj_coul(cutoff: float | Quantity, tol: float = 0.0001, *, g_ewald: float | Quantity = None, dims: float | Quantity = None) NonbondedForce[source]

Implements the standard Lennard-Jones (LJ) and Coulomb pair potentials.

The potential energy between two charged LJ particles is given by

\[\begin{split}\begin{gather*} u_\mathrm{Coul}(r_{12})=\frac{q_1q_2}{4\pi\varepsilon_0r_{12}}\\ u_\mathrm{LJ}(r_{12})=4\epsilon_{12}\left[\left( \frac{\sigma_{12}}{r_{12}}\right)^{12} -\left(\frac{\sigma_{12}}{r_{12}} \right)^6\right] \end{gather*}\end{split}\]

where \(q_1\) and \(q_2\) are the particle charges in \(\mathrm{e}\), \(\varepsilon_0\) is the vacuum permittivity, \(\sigma_{12}\) is the averged particle size in \(\mathrm{nm}\), and \(\epsilon_{12}\) is the dispersion energy in \(\mathrm{kJ/mol}\). \(q_1\), \(q_2\), \(\sigma_{12}\), and \(\epsilon_{12}\) are determined from per-particle parameters charge, sigma, and epsilon, respectively, which are set in the main script using openmm.openmm.NonbondedForce.addParticle().

The mixing rule for \(\sigma_{12}\) and \(\epsilon_{12}\) is the 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}\]

To disable the LJ potential and use a different excluded volume interaction potential but keep the Coulomb potential, set \(\sigma_{12}=0\,\mathrm{nm}\) and \(\epsilon_{12}=0\,\mathrm{kJ/mol}\) for all particles.

To account for a solvent implicitly using its relative permittivity \(\varepsilon_\mathrm{r}\), scale the particle charges \(q_i\) by \(1/\sqrt{\varepsilon_\mathrm{r}}\).

Parameters:
cutofffloat or openmm.unit.Quantity

Shared cutoff distance \(r_\mathrm{cut}\) for all nonbonded interactions in the simulation sytem. Must be less than half the minimum periodic simulation box dimension.

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

tolfloat, default: 1e-4

Error tolerance \(\delta\) for Ewald summation.

g_ewaldfloat or openmm.unit.Quantity, keyword-only, optional

Ewald splitting parameter \(g_\mathrm{Ewald}\). If not provided, it is computed using

\[g_\mathrm{Ewald}=\frac{\sqrt{-\log(2\delta)}}{r_\mathrm{cut}}\]

Reference unit: \(\mathrm{nm}^{-1}\).

dimsfloat or openmm.unit.Quantity, keyword-only, optional

Simulation system dimensions. Must be provided with g_ewald to calculate the number of mesh nodes \(n_\mathrm{mesh}\). Both dims and g_ewald must either have units or be unitless.

Shape: \((3,)\).

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

Returns:
pair_lj_coulopenmm.NonbondedForce

Hybrid LJ and Coulomb pair potentials.