xnn.ffnn.models.amoeba_ewald#
Ewald and particle-mesh Ewald sums for atomic multipoles and r^-6 dispersion.
The periodic electrostatics of the AMOEBA / HIPPO models (amoeba.py):
the real-space ladder of the screened Coulomb kernel
erfc(alpha R) / R(ewald_ladder()), in the sameD_n = (1/R d/dR)^n gform as the plain Coulomb ladder, so every pair term of the vacuum model carries over by swapping the kernel; a zeroalphagives the Coulomb ladder, which is how molecular structures of a mixed batch keep their vacuum terms;the reciprocal-space part on a B-spline mesh after Essmann et al., J. Chem. Phys. 103, 8577 (1995): the multipoles are spread with the cardinal B-splines and their first and second derivatives (a point dipole is the derivative of a point charge), the mesh potential is formed with the same influence function as for point charges, and the potential, the field and the field gradient are interpolated back onto the atoms with the same splines, so that the reciprocal energy is
1/2 sum_i [q_i phi + d_i . grad phi + Q_i : grad grad phi]and the reciprocal field drives the induced dipoles (multipole_pme()); the influence function carries the least-squares spline moduli (least_squares_moduli()) rather than the Euler exponential-spline ones of the paper, which at coarse meshes leaves a far smaller mean error in the energies and reproduces Tinker’s;the self-interaction terms of Gaussian-smeared multipoles, half the interaction of a multipole with its own smeared kernel
erf(alpha R) / Rat zero separation,-alpha / sqrt(pi) [q^2 + 2 alpha^2 / 3 |d|^2 + 8 alpha^4 / 5 Q:Q]for the quadrupole convention of the model, and the self field4 alpha^3 / (3 sqrt(pi)) dthat the mesh field of a dipole at its own site must be corrected by;the Ewald sum of the
-c_i c_j / R^6dispersion (Essmann et al., eq. 5.1 and following): the real-space kernelg(alpha R) / R^6withg(x) = e^{-x^2} (1 + x^2 + x^4 / 2), the reciprocal kernelpi^(3/2) alpha^3 / 3 [(1 - 2 b^2) e^{-b^2} + 2 b^3 sqrt(pi) erfc(b)],b = k / (2 alpha), including thek = 0term, and the self termalpha^6 / 12 sum c_i^2(dispersion_pme());the C2 polynomial switch between a taper distance and a cutoff (
switching()): the unique quintic with unit value and zero first and second derivatives at the taper, and zero value and derivatives at the cutoff,1 - 10 x^3 + 15 x^4 - 6 x^5in the reduced distance;Tinker-compatible defaults: the Ewald coefficient that makes
erfc(alpha r_c) / r_cequal1e-8at the real-space cutoff (ewald_coefficient()) and the mesh of at least 1.2 points per Angstrom (0.8 for dispersion) rounded up to an even size with prime factors 2, 3 and 5, at least 16 (pme_grid_size()).
Everything is written in differentiable tensor operations: forces follow from the positions through the spline weights, the stress from the cell through the reciprocal vectors, the volume and the fractional coordinates.
Functions
|
Cardinal B-spline weights |
|
The derivative of |
|
Per-atom reciprocal energies of the |
|
|
|
The Ewald coefficient for a real-space cutoff. |
|
The ladder |
|
The smallest even size of at least |
|
The 3D spline weights |
|
Mark a pure function of per-pair tensors for the fused path. |
|
Evaluate the |
Whether the |
|
|
The gradient of a mesh sum with respect to the Jacobians |
|
|
|
|
|
Spread the stencil coefficients |
|
The influence function of structures with the inverse cells |
|
|
|
|
|
The inverse of |
|
The spline stencils of atoms at the scaled fractional coordinates |
|
|
|
Per-atom spurious mesh self-interaction of the multipoles, |
|
Moments of the spurious, position-averaged mesh self-interaction. |
|
Reciprocal-space potential of Gaussian-smeared multipoles at the atoms, with its gradient and (optionally) its Hessian. |
|
Per-atom reciprocal energies |
|
Per-atom self energies |
|
Mesh dimensions from the cell lengths: at least |
|
Bring the cell terms a step plan keeps for one mesh group (the |
|
Mark a function as a named region of the PyTorch profiler, which also becomes an NVTX range in Nsight timelines under |
|
The second derivatives |
|
|
|
The mesh coefficients |
|
The potential |
|
The C2 switch |
|
|
Classes
|
The fixed particle-mesh data of a group of periodic structures on one mesh. |