xnn.ffnn.models.amoeba_ewald.multipole_pme#
- xnn.ffnn.models.amoeba_ewald.multipole_pme(q, d, Q, pos, cell, alpha, mesh, order, hessian=True)[source]#
Reciprocal-space potential of Gaussian-smeared multipoles at the atoms, with its gradient and (optionally) its Hessian.
The sources
q_k delta - d_k . grad delta + Q_k : grad grad deltaare spread asq_k W + d_k . grad_k W + Q_k : grad_k grad_k W(Wthe spline weight, differentiated with respect to the atom position); the potential is interpolated back with the same weights. A one-structureMeshPlan; use a plan directly to reuse the setup.- Parameters:
q (Tensor) – Charges
(N,).d (Tensor) – Dipoles
(N, 3)in e Angstrom.Q (Tensor) – Quadrupoles
(N, 3, 3)(traceless, divided by three), orNone.pos (Tensor) – Positions
(N, 3).cell (Tensor) – Lattice vectors as rows
(3, 3).alpha (float) – Ewald coefficient.
order (int) – B-spline order (at least 4; 5 keeps the second derivatives continuous).
hessian (bool, optional) – Whether to return the Hessian (needed for quadrupole energies).
- Returns:
phi(N,),grad phi(N, 3)andgrad grad phi(N, 3, 3)(Nonewithouthessian), ine / Angstromand its derivatives (multiply by the Coulomb constant).- Return type:
tuple of Tensor