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 delta are spread as q_k W + d_k . grad_k W + Q_k : grad_k grad_k W (W the spline weight, differentiated with respect to the atom position); the potential is interpolated back with the same weights. A one-structure MeshPlan; 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), or None.

  • pos (Tensor) – Positions (N, 3).

  • cell (Tensor) – Lattice vectors as rows (3, 3).

  • alpha (float) – Ewald coefficient.

  • mesh (list of int) – Mesh dimensions (K_1, K_2, K_3).

  • 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) and grad grad phi (N, 3, 3) (None without hessian), in e / Angstrom and its derivatives (multiply by the Coulomb constant).

Return type:

tuple of Tensor