Author: Zheng Cheng ([email protected])
torch-dmff (torch-based Differentiable Molecular Force Field) is a PyTorch implementation of the previously JAX-based DMFF(). It enables the differentiable calculation of the polarizable energy of organics systems whose parameters like atomic multipole moments and dispersion coefficients are predicted via pytorch-based neural networks.
All interations involved in torch-DMFF are briefly introduced below and the users are encouraged to read the references for more mathematical details:
The electrostatic interaction between two atoms can be described using multipole expansion, in which the electron cloud of an atom can be expanded as a series of multipole moments including charges, dipoles, quadrupoles, and octupoles etc. If only the charges (zero-moment) are considered, it is reduced to the point charge model in classical force fields:
where
More complex (and supposedly more accurate) force field can be obtained by including more multipoles with higher orders. Some force fields, such as MPID, goes as high as octupoles. Currently in DMFF, we support up to quadrupoles:
where
The
Different to charges, the definition of multipole moments depends on the coordinate system. The exact value of the moment tensor will be rotated in accord to different coordinate systems. There are three types of frames involved in DMFF, each used in a different scenario:
- Global frame: coordinate system binds to the simulation box. It is same for all the atoms. We use this frame to calculate the charge density structure factor
$S(\vec{k})$ in reciprocal space. - Local frame: this frame is defined differently on each atom, determined by the positions of its peripheral atoms. Normally, atomic multipole moments are most stable in the local frame, so it is the most suitable frame for force field input. In DMFF API, the local frames are defined using the same way as the AMOEBA plugin in OpenMM. The details can found in the following references:
- OpenMM forcefield.py, line 4894~4933
- J. Chem. Theory Comput. 2013, 9, 9, 4046–4063
- Quasi internal frame, aka. QI frame: this frame is defined for each pair of interaction sites, in which the z-axis is pointing from one site to another. In this frame, the real-space interaction tensor (
$T_{tu}^{AB}$ ) can be greatly simplified due to symmetry. We thus use this frame in the real space calculation of PME.
DMFF supports polarizable force fields, in which the dipole moment of the atom can respond to the change of the external electric field. In practice, each atom has not only permanent multipoles
Other damping functions between multipole moments can be found in Ref 6, table I.
It is noted that the atomic damping parameter dmff.admp.pme.DEFAULT_THOLE_WIDTH
variable, which is set to 5.0 by default.
We solve
The last two terms are related to
where the off-diagonal term of
In the current version, we temporarily assume that the polarizability is spherically symmetric, thus the polarizability polarizabilityXX, polarizabilityYY, polarizabilityZZ
) in the xml API is averaged internally. In future, it is relatively simple to relax this restriction: simply change the reciprocal of the polarizability to the inverse of the matrix when calculating the diagonal terms of the
In ADMP, we assume that the following expansion is used for the long-range dispersion interaction:
where the dispersion coefficients are determined by the following combination rule:
Note that the dispersion terms should be consecutive even powers according to the perturbation theory, so the odd dispersion terms are not supported in ADMP.
In ADMP, this long-range dispersion is computed using PME (vida infra), just as electrostatic terms.
In the classical module, dispersions are treated as short-range interactions using standard cutoff scheme.
The long-range potential includes electrostatic, polarization, and dispersion (in ADMP) interactions. Taking charge-charge interaction as example, the interaction decays in the form of
In PME, the interaction tensor is splitted into the short-range part and the long-range part, which are tackled in real space and reciprocal space, respectively. For example, the Coulomb interaction is decomposed as:
The first term is a short-range term, which can be calculated directly by using a simple distance cutoff in real space. The second term is a long-range term, which needs to be calculated in reciprocal space by fast Fourier transform(FFT). The total energy of charge-charge interaction is computed as:
As for multipolar PME and dispersion PME, the users and developers are referred to Ref 2, 3, and 5 for mathematical details.
The key parameters in PME include:
-
$\kappa$ : controls the separation of the long-range and the short-range. The larger$\kappa$ is, the faster the real space energy decays, the smaller the cutoff distance can be used in the real space, and more difficult it is to converge the reciprocal energy and the larger$K_{max}$ it needs; -
$r_{c}$ : cutoff distance in real space; -
$K_{max}$ : controls the number of maximum k-points in all three dimensions
In DMFF, we determine these parameters in the same way as in OpenMM:
where the user needs to specify the cutoff distance
In the current version, the dispersion PME calculator uses the same parameters as in electrostatic PME.