xnn.common.models.charge_solve.gaussian_coulomb_matrix#
- xnn.common.models.charge_solve.gaussian_coulomb_matrix(pos, sigma, cell=None, accuracy=1e-10, background=True)[source]#
AwithE = 1/2 q^T A qthe Coulomb energy of Gaussian charges, one structure.Charge
iis a normalized Gaussian of standard deviationsigma_i(0: a point charge). Two of them interact througherf(r / (sqrt(2) gamma_ij)) / rwithgamma_ij = sqrt(sigma_i^2 + sigma_j^2), and each with itself through1 / (2 sigma_i sqrt(pi)), so the diagonal is1 / (sigma_i sqrt(pi))(zero for a point charge). This is the electrostatic matrix of charge equilibration with Gaussian charges (Ko et al., Nat. Commun. 12, 398, 2021, eq. 3 and 6 without the hardness; the EEQ of D4 with radiussqrt(2) sigma).For a periodic cell the lattice sum is split the Ewald way at
alpha:[erf(r / (sqrt(2) gamma_ij)) - erf(alpha r)] / rover the images within the real-space cutoff,4 pi / V sum_k exp(-k^2 / 4 alpha^2) / k^2 cos(k . (r_i - r_j))overk != 0,-2 alpha / sqrt(pi)on the diagonal and, withbackground,-pi / (V alpha^2)in every element (the neutralizing background of a charged cell). Both tails are cut where they fall belowaccuracy. Dense and differentiable inpos,sigmaandcell; memoryO(N^2)times the number of real-space images.- Parameters:
pos (Tensor) – Positions
(N, 3).sigma (Tensor) – Gaussian widths
(N,)in the length unit ofpos.cell (Tensor or None) – Row-vector cell
(3, 3)of a periodic structure (periodic along all three axes);Nonefor a molecule.accuracy (float, optional) – Relative truncation of the Ewald tails, by default
1e-10.background (bool, optional) – Include the neutralizing background of a charged cell, by default
True(no effect on a neutral one).
- Returns:
(N, N)symmetric, ine^2per length unit (multiply by the Coulomb constant for an energy).- Return type:
Tensor