yukawa

mdhelper.openmm.pair.yukawa(cutoff: float | Quantity, cutoff_yukawa: float | Quantity = None, *, shift: bool = True, mix: str = 'geometric', per_params: list = None, global_params: dict[str, float | Quantity] = None, tab_funcs: dict[str, ndarray[int | float] | Quantity | Discrete2DFunction] = None) CustomNonbondedForce[source]

Implements the generalized intermolecular Yukawa pair potential.

The potential energy between two Yukawa particles is given by

\[u_\mathrm{Yukawa}(r_{12})=\frac{\alpha_{12} \exp(-\kappa r_{12})}{r_{12}}\]

where \(\alpha_{12}\) is a magnitude scaling constant in \(\mathrm{nm}\cdot\mathrm{kJ/mol}\) and \(\kappa\) is a screening length in \(\mathrm{nm}^{-1}\).

After creating the pair potential, 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_yukawafloat or openmm.unit.Quantity, optional

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

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

shiftbool, keyword-only, default: True

Determines whether the Yukawa potential is shifted at its cutoff to \(0\,\mathrm{kJ/mol}\).

mixstr, keyword-only, default: "geometric"

Mixing rule for \(\alpha_{12}\).

Valid values:

  • "geometric": Geometric mixing rule.

    \[\alpha_{12}=\sqrt{\alpha_1\alpha_2}\]

    Global parameter: \(\kappa\).

    Per-particle parameter: \(\alpha_i\).

  • "alpha12 = ...;": Custom mixing rule. The string containing the expressions for \(\alpha_{12}\) (and optionally, \(\kappa\)) 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.

    Should you want to use the geometric mixing rule for \(\alpha_{12}\) and specify an alternate definition for \(\kappa\), you can include "geometric;" in the string but

    Be aware that the parameters and functions used in the geometric mixing rule will take precedence over those defined here.

global_paramsdict, keyword-only, optional

Additional global parameters for use in the definition of \(\alpha_{12}\) (and optionally, \(\kappa\)).

per_paramslist, keyword-only, optional

Additional per-particle parameters for use in the definition of \(\alpha_{12}\) (and optionally, \(\kappa\)).

tab_funcsdict, keyword-only, optional

Optional tabulated functions for use in the definition of \(\alpha_{12}\) (and optionally, \(\kappa\)).

Returns:
pair_yukawaopenmm.CustomNonbondedForce

Yukawa pair potential.