xnn.ffnn.models.amoeba#

AMOEBA and HIPPO: polarizable atomic multipole force fields.

AMOEBA (Ren and Ponder, J. Phys. Chem. B 107, 5933, 2003; Ponder et al., J. Phys. Chem. B 114, 2549, 2010; Shi et al., JCTC 9, 4046, 2013) writes the energy as

U = U_bond + U_angle + U_strbnd + U_oop + U_torsion + U_vdw
  • U_ele^perm + U_ele^ind

with the anharmonic MM3 bond and angle polynomials, a stretch-bend cross term, Allinger out-of-plane bending at trigonal centers, Fourier torsions (plus pi-torsions across double bonds and splined torsion-torsion maps), Halgren’s buffered 14-7 van der Waals form with hydrogen sites displaced along their bonds, permanent atomic multipoles through the quadrupole in local frames defined by the bonded neighbours, and induced dipoles obtained from mutual induction with Thole damping. Interactions between atoms separated by one or two bonds are left out, 1,4 and 1,5 multipole interactions are scaled, and permanent multipoles do not polarize atoms of their own polarization group.

HIPPO (Rackers et al., JCTC 17, 7056, 2021) keeps the valence terms and the multipoles but replaces every intermolecular term by one derived from a model electron density: each atom is a point core charge plus a hydrogen-like valence density, so permanent electrostatics acquire charge penetration (damped multipole interactions), the same damping enters the induction, the exchange repulsion is an anisotropic multipolar overlap model, the dispersion is a damped C6 term and a short-range charge-transfer term is added; a charge-flux term lets the monopoles follow the bond and angle geometry.

Both fields are one implementation here: Amoeba evaluates the shared valence and induction machinery with the AMOEBA nonbonded terms, Hippo the same with the HIPPO ones. Parameters come from the .frc libraries of xnn.ffnn.models.amoebalib; the model binds a library to one MolecularTopology (types, bonds and everything derived from them, including the polarization groups and the multipole frames) and evaluates any conformation of that system. Forces are autograd derivatives: the local frames are built from the positions inside the graph, so the torques of the anisotropic terms become forces without any explicit conversion, and the induced dipoles are solved with a differentiable dense linear solve, so the gradient of the non-variational polarization energy (the induced dipoles see the group-based direct field, the energy the connectivity-based polar field) is exact.

Conventions and scope#

  • Units inside the model are eV and Angstrom; multipoles stay in e, e A and e A^2. The Coulomb constant is Tinker’s 332.063713 kcal A / (mol e^2).

  • Dipoles and quadrupoles in the parameter files are in atomic units (e bohr and e bohr^2, as the distributed multipole analysis delivers them); they are converted to e Angstrom at assembly and the traceless quadrupoles are divided by three (the convention of the Tinker files), so the interaction tensors are the plain derivatives of the kernel.

  • Nonbonded interactions come from the neighbor list within cutoff. For clusters they are evaluated in full (no switching, no cutoffs below the neighbor cutoff), as the reference calculations of the papers do. For periodic cells the multipoles, the induction and HIPPO’s dispersion are Ewald sums with the reciprocal part on a particle mesh, and the short-range terms are switched off smoothly between a taper distance and their cutoff (amoeba_ewald.py); the induced dipoles of a cell are solved iteratively (preconditioned conjugate gradients) with the gradient from the converged dipoles through an implicit backward pass.

  • The HIPPO repulsion is K_i K_j S^2_total / R with the multipole expansion applied to the squared overlap of two normalised 1s Slater functions (the paper’s f_exp), the charge-penetration kernels are the Coulomb potentials of the model densities; their derivative ladders are formed exactly from exponential-polynomial series rather than from transcribed formulas.

Module Attributes

FAST_POLICY

the minimum number of pairs per GPU model and precision from which the fast implementation runs in evaluation; it is faster at every size measured, so it runs on every GPU.

TRAINING_POLICY

The same for training (an energy and force loss through the kernels)

Functions

amoeba_pair_block(R, r_vec, scales, q_i, ...)

The AMOEBA multipole pairs as one function of per-pair tensors: the permanent multipole energies (per pair and summed to the atoms) and, with thole = (alpha_i, alpha_k, thole_i, thole_k), the real-space permanent fields and mutual ladder of the induction (_real_space_fields()).

bicubic_interpolate(f, fx, fy, fxy, x, y, ...)

Bicubic interpolation (the Numerical Recipes construction) inside the cell with corner values f (M, 4) and derivatives, corners counted counter-clockwise from the lower left: (x1,y1), (x2,y1), (x2,y2), (x1,y2).

buffered_14_7(rv, rmin, eps, delta, gamma)

Halgren's buffered 14-7 energy eps ((1 + delta) / (rho + delta))^7 ((1 + gamma) / (rho^7 + gamma) - 2) with rho = rv / rmin.

core_valence_kernel(zeta[, slot])

Potential of a hydrogen-like valence density of exponent zeta: [1 - (1 + zeta R / 2) exp(-zeta R)] / R.

core_valence_ladder(R, zi, zk, slot, order)

The ladder of the one-center (core-valence) kernel of the exponent of zi (slot="i") or zk (slot="j"), or its deficit, with a zero D_4 (a core carries no quadrupole).

coulomb_kernel()

1/R.

coulomb_ladder(R, order)

The undamped ladder 1/R, -1/R^3, 3/R^5, -15/R^7, 105/R^9.

derivative_ladder(kernel, R, zi, zj, order)

[D_0, ..., D_order] with D_n = (1/R d/dR)^n g evaluated per pair, or with deficit the deficits C_n - D_n from the Coulomb ladder.

dipole_field(m, r, D1, D2)

The field of dipoles m (..., M, 3) at the other ends of the pairs.

dipole_field_tensor(r, D1, D2)

(M, 3, 3) tensor T with field = T mu for a dipole at the other end of r: D_2 r r^T + D_1 I.

exchange_polarization_tensor(r_vec, R, i_, ...)

The exchange-polarization tensors of the atoms, (N, 3, 3).

hippo_pair_block(R, r_vec, scales, q_i, q_k, ...)

The HIPPO pairs as one function of per-pair tensors: charge-penetration electrostatics, Pauli repulsion, damped dispersion and charge transfer (per pair and summed to the atoms) and, with polar, the real-space permanent fields and mutual ladder of the induction.

ion_terms(i_, k_, R, weight, cls_idx, N, B, ...)

The terms of ions per atom, from the pairs i_, k_ at the distances R with weight (zero drops a pair).

lattice_jumps(pos, reference, cell, batch, pbc)

The whole lattice vectors (N, 3) by which every atom moved from reference to pos: the rounded fractional displacements along the periodic axes (zero in the zero cell of a molecule).

masked_sum(values, index, on, size)

The rows of values (M,) or (M, C) whose mask on is set, summed into the size entries index names.

multipole_energy(ci, di, Qi, ck, dk, Qk, r, D)

Interaction energy of two multipole sets through a radial kernel.

multipole_field(c, d, Q, r, D, at_k)

Electric field of a multipole set through a radial kernel.

mutual_field_real(mu, r, D1, D2, ik, ki, N)

The real-space field of dipoles mu (N, 3) through the pair ladders, both directions of every pair at once: gather by ik = [i; k], scatter by ki = [k; i].

overlap_coulomb_kernel(zi, zj, near)

Coulomb interaction kernel of two hydrogen-like densities (the two-center charge-penetration damping): the closed form [1 - A^2 (1 + 2 B + zeta_i R / 2) e^(-zeta_i R) - B^2 (1 + 2 A + zeta_j R / 2) e^(-zeta_j R)] / R with A = zeta_j^2 / (zeta_j^2 - zeta_i^2) and B = zeta_i^2 / (zeta_i^2 - zeta_j^2), or with near its series [1 - e^-p sum_k q^2k P_k(p)] / R in q = (zeta_i - zeta_j) R / 2, p = (zeta_i + zeta_j) R / 2, which holds at equal and nearly equal exponents where the closed form cancels (P_0 is the equal-exponent form 1 + 11/16 p + 3/16 p^2 + 1/48 p^3).

slater_overlap(zi, zj, near)

Overlap of two normalised 1s Slater functions with exponents zeta_i / 2 and zeta_j / 2 (the HIPPO pseudo-orbitals): the closed form, or with near the identity S = (1 - rho^2)^(3/2) e^-s [s^2 c1(t) + (s + 1) c2(t)] with s = (zeta_i + zeta_j) R / 4, t = (zeta_i - zeta_j) R / 4, rho = t / s, c2 = sinh t / t and c1 = (t cosh t - sinh t) / t^3 as series in t, which holds at equal and nearly equal exponents (e^-s (1 + s + s^2 / 3) at equal ones).

squared_overlap(zi, zj, near)

The squared overlap S^2 of two Slater densities (HIPPO repulsion).

thole_ladder(R, alpha_i, alpha_j, thole_i, ...)

The Thole-damped ladder D_1 to D_3 (D_0 is the plain Coulomb 1/R): u = R / (alpha_i alpha_j)^(1/6), a = min(thole_i, thole_j) (the other when one is zero, undamped when both are), lambda_3 = 1 - e^-au^3, lambda_5 = 1 - (1 + au^3) e^-au^3, lambda_7 = 1 - (1 + au^3 + 3/5 a^2 u^6) e^-au^3.

tortor_spline_tables(angles1, angles2, values)

(df/dx, df/dy, d2f/dxdy) on a periodic torsion-torsion grid.

two_center(R, zi, zk, order, kernel[, deficit])

The ladder of a two-center kernel (overlap_coulomb_kernel() or squared_overlap()), or its deficit, with its series in the exponent difference where |zeta_i - zeta_k| R is small (equal exponents included) and its closed form elsewhere.

two_center_ladder(R, zi, zk, order, kernel)

The ladder of a two-center kernel (overlap_coulomb_kernel() or squared_overlap()), or its deficit, on every pair, selected between its series for equal and nearly equal exponents and its closed form without a host synchronization; each form sees a stand-in exponent on the pairs of the other (equal exponents for the series, distinct ones for the closed form).

Classes

Amoeba(ffield, topology, *[, cutoff, ...])

The AMOEBA polarizable multipole force field.

AmoebaForceField(library[, trainable, ...])

The trainable parameter tensors of an AMOEBA / HIPPO library.

DipolePredictor([kind, history])

Extrapolate the induced dipoles of the next step from the last few.

Hippo(ffield, topology, *[, cutoff, ...])

The HIPPO force field (Rackers et al. 2021): AMOEBA's valence terms and multipoles with density-based intermolecular terms.

RadialSeries(terms)

A radial function sum_k c_k R^p_k exp(-(n_k zeta_i + m_k zeta_j) R / 2).

StepPlan([skin, capacity])

What an evaluation of a structure decides on the host, recorded once and reused while the structure moves by small steps (molecular dynamics between rebuilds of the pair list): the image shifts of every bonded vector, the unique pairs of the neighbor list with their image shifts and scale factors, the layout of the Ewald sums and the polarizable atoms.