Design: three-dimensional electrostatics for PM6-SECCM¶
Status (#1114): PM6-SECCM still refuses a Madelung embedding of the unmodified PM6 pair interaction in three cyclic dimensions, and this note records why that refusal is correct, what a convergent scheme has to change, and how the s/p/d integrals of the molecular kernel enter the cyclic engine. The s/p/d integrals are in the cyclic engine (its general s/p/d path), and the faded-pair scheme of the section “A convergent scheme changes the pair interaction” is implemented as a separate, explicitly named model variant, with its analytic gradient and strain derivative (see “Implementation of the faded-pair variant” and “Derivatives of the faded-pair variant”). The one- and two-dimensional embedding is unchanged; its truncation behaviour follows from the same analysis and is stated below.
The question was whether “exact NDDO pair interactions inside the
Wigner-Seitz (WS) supercell, plus an Ewald sum of the point-charge 1/R
tail” converges with cluster size because the remainder vanishes for neutral
cells. It does not. The remainder is a sum of same-sign R^-3 terms whose
cell-summed coefficient is not zero, so it diverges logarithmically in three
dimensions for every ordering.
Long-range form of the NDDO pair interaction¶
Every two-centre NDDO integral is a sum of Klopman terms between the point charges of two AO products (Dewar and Thiel 1977, Eq. 17; Thiel and Voityuk 1992, Eq. 18),
with additive terms \(\rho\) fixed by the one-centre integrals. For large \(R\),
The first term is the Coulomb law. The second is not a solution of the
Laplace equation: it is an isotropic R^-3 interaction that no multipole of a
real charge distribution produces. It appears in the monopole-monopole part
of the electron-electron, electron-core and core-core interactions, each with
its own additive terms.
Collect the classical (density-diagonal) interaction of two atoms with shell populations \(N_s\) (\(s\) = s, p, d shells; the monopole additive term of the shell is \(\rho_s\)), core charge \(Z\) and core additive term \(\rho_c\). Define for each atom
Expanding the four monopole terms gives, for spherical shell populations,
For a main-group atom PM6 uses one additive term \(\rho = 1/(2 G_{ss})\) for
the s and p monopoles and for the core, so \(D = \rho\,q\) and \(M = \rho^2 q\)
and \(C_{AB} = -\tfrac12 q_A q_B(\rho_A + \rho_B)^2\). For transition metals
the core term (poc) and the d monopole term (\(1/(2F^0_{dd})\)) differ from
the s term, so \(D\) and \(M\) are nonzero even for a neutral atom.
The coefficient was checked against the pair blocks of the molecular kernel
(pm6_spd_pair), as \((E_{AB} - q_Aq_B/R)\,R^3\) at \(R\) = 40, 80, 160 bohr:
pair (assumed populations) |
\(C_{AB}\) predicted |
\(R\) = 40 |
\(R\) = 80 |
\(R\) = 160 |
|---|---|---|---|---|
Mg(+1.5) O(-1.5) |
10.9216 |
10.8786 |
10.9108 |
10.9189 |
Na(+0.8) Cl(-0.8) |
6.6897 |
6.6502 |
6.6798 |
6.6872 |
Li(+0.8) F(-0.8) |
1.7312 |
1.7287 |
1.7306 |
1.7311 |
Fe(+1.0) O(-1.0) |
7.6686 |
7.6486 |
7.6636 |
7.6673 |
Cu(0) Cu(0) |
-0.00270 |
-0.00265 |
-0.00269 |
-0.00270 |
(atomic units; the populations are illustrative, the formula holds for any).
Non-spherical populations add the true multipole interactions
(charge-dipole R^-2, dipole-dipole and charge-quadrupole R^-3). Those are
traceless, conditionally convergent, and the subject of ordinary multipole
Ewald sums. The isotropic term above is separate from them.
The lattice sum of the remainder¶
Sum \(C_{AB}\) over the atoms of two neutral cells (\(\sum_A q_A = 0\)):
Two cells a lattice vector \(\mathbf T\) apart therefore interact, beyond the Coulomb law, as \(-D_\text{cell}^2/T^3\) to leading order. The dependence on the positions inside the cells is of order \(T^{-4}\) and sums absolutely. The energy per cell of the remainder is
In one dimension \(\sum T^{-3}\) converges; the part beyond a cluster of length \(L\) is of order \(L^{-2}\).
In two dimensions it converges; the part beyond \(L\) is \(2\pi/(A_\text{cell} L)\).
In three dimensions \(\sum_{T<L} T^{-3} \simeq (4\pi/V_\text{cell})\ln L\). Every term has the same sign, so no summation order, no neutral grouping and no symmetric shell makes it converge:
\(D_\text{cell}\) vanishes only when every atom has the same additive terms and the cell is neutral, that is for elemental main-group solids. This is the “NDDO error” of Stewart 2008 (Eqs. 2 and 3): the potential of a binary solid diverges because the one-centre integrals differ between the elements.
The same sum enters the Fock matrix. The derivative of \(E_\text{rem}\) with respect to a shell population is \((\sum_B M_B + 2\rho_s D_\text{cell})\cdot\tfrac12\sum T^{-3}\): a uniform shift, which is harmless, plus a shift proportional to \(\rho_s\), which differs between elements and shells. A growing cluster therefore drives charge between the sublattices without bound.
Magnitudes with PM6 parameters (additive terms in bohr: Li 1.233, F 1.093, Na 3.351, Cl 1.221, Mg 1.912, O 1.204):
crystal |
assumed charges |
\(D_\text{cell}\) |
\(V_\text{cell}\) (bohr\(^3\)) |
\(2\pi D^2/V\) (Hartree per unit of \(\ln L\)) |
|---|---|---|---|---|
LiF |
±0.8 |
0.112 |
110.3 |
0.0007 |
MgO |
±1.5 |
1.063 |
125.9 |
0.056 |
NaCl |
±0.8 |
1.704 |
302.7 |
0.060 |
Doubling the cluster edge of MgO or NaCl changes the energy per formula unit
by about 0.04 Hartree (25 kcal/mol). A cluster-size study of the unmodified
interaction cannot converge, and allow_truncated_electrostatics=True
remains a mechanics probe.
Consequence for the proposed scheme. “Exact NDDO pairs inside the WS cell, Ewald point charges for everything else” assigns the NDDO form to \(R\) inside the WS cell and the Coulomb form outside. Its energy differs from a fixed model by \(E_\text{rem}(L)\) evaluated over the WS cell, so it drifts as \(\ln L\). The scheme is sound in one and two dimensions, where the neglected part outside the WS cell is finite and decays as \(L^{-2}\) and \(L^{-1}\). That is the truncation error of the existing 1-D and 2-D embedding (for a two-dimensional MgO-like sheet with \(D_\text{cell}\approx 1\) and \(A_\text{cell}\approx 30\) bohr\(^2\) it is about \(0.1/L\) Hartree with \(L\) in bohr). In three dimensions the scheme has no limit and stays refused.
A convergent scheme changes the pair interaction¶
A three-dimensional limit exists only if the isotropic R^-3 term is removed
at long range. Stewart’s solid-state PM6 does this by fading the NDDO
integrals into point-charge integrals (Stewart 2008, Eq. 4, written there for
the monopole integral; the program applies it to the whole pair block): for
a pair at distance \(R\)
where \(B\) stands for the whole pair block (two-electron integrals, both core attractions and the core-core energy) and the point-charge block has \((\mu\mu|\lambda\lambda) = 1/R\), core attractions \(-Z/R\) on the diagonal and core-core energy \(Z_A Z_B/R\), with every other integral zero. The paper gives \(R_0\) = 5 angstrom and \(\kappa\) = 0.05 angstrom\(^{-2}\); the current MOPAC source uses 3 angstrom and 0.025 angstrom\(^{-2}\). This is a different Hamiltonian from molecular PM6 for pairs beyond \(R_0\), so a molecule in a large box does not reproduce the molecular energy, and the two parameters are part of the model. They must be explicit options and recorded in the provenance.
With the faded blocks the lattice energy splits exactly into
The first sum has a Gaussian envelope and converges absolutely (\(f \approx 10^{-8}\) at \(R_0 + 27\) angstrom for \(\kappa\) = 0.025). The second is the point-charge Madelung sum of the net atomic charges of a neutral cell, for which the existing Ewald machinery (the one MSINDO-SECCM and the 1-D and 2-D PM6 embedding use) applies with the usual tin-foil convention. Stewart replaces the Ewald sum by a truncation of the effective interatomic distance at 30 angstrom (Eq. 5); with an integer number of neutral cells both give the same limit, and Ewald avoids the dependence on that cutoff.
In the cyclic engine:
Pair records inside the WS supercell use the faded block \(B(R)\) with their WS weights, for the Coulomb and for the exchange contractions.
The short-range sum is completed over images beyond the WS cell with the density-diagonal (Coulomb-only) contraction, as the Gamma-periodic PM6 driver already does for its image cells, out to the radius where \(f\) falls below a threshold. Exchange between such images is zero in the cyclic model.
The Ewald potential of the net charges enters the Fock diagonal as in the 1-D and 2-D embedding, minus the point-charge terms of the pairs already represented in steps 1 and 2, so nothing is counted twice.
The cluster-size error is then governed by \(f\) at the WS radius and by the cyclic approximation of the exchange, not by the electrostatics.
The request in #1114 to also Ewald-sum the dipole and quadrupole terms is compatible with this scheme: replace \(B^\text{pc}\) by the point-multipole interaction through quadrupoles. The faded remainder still has a Gaussian envelope, and the multipole sums are standard. It is an extension of Stewart’s model, not a reproduction of it, because solid-state MOPAC fades to monopoles only.
Implementation of the faded-pair variant¶
run_pm6_seccm(..., faded_pair_electrostatics=True, fade_onset_angstrom=R0, fade_exponent_per_angstrom2=kappa) (native option
PM6SECCMOptions::faded_pair_electrostatics). Both fade parameters are
required: there is no default, because the paper and MOPAC differ and the
fade is part of the Hamiltonian. The result names the model in
electrostatics_model with its parameters, the route plan records
pm6_electrostatics_variant = "faded_pair_ewald" and cites
Stewart 2008 (Eq. 4 is the fade
of the monopole integral; the same Gaussian is applied here to the whole
electrostatic block, as the design above specifies). Departures from the
paper: the net charges are Ewald-summed (the existing 3-D Madelung matrix of
the cyclic topology) instead of the effective-interatomic-distance
truncation of its Eq. 5, and the resonance integrals keep their NDDO form
(they are not electrostatic and decay exponentially).
The variant always runs on the general s/p/d path (the s/p pair integrals
there are the s/p kernel’s). Per directed Wigner-Seitz record the block is
faded before the Fock and core Hamiltonian are assembled, the core-core
energy as f E_core + (1 - f) Z_A Z_B / R. The Coulomb-only completion runs
over every image (A, B + T) with f > 1e-10 and weight 1 - w_WS(A, B, T)
(tied images are completed to full weight, self images included). It is
linear in the atomic density blocks, so the images of one ordered atom pair
are summed once before the SCF into a Coulomb tensor, a core-attraction
block and a core-core constant. Three cyclic dimensions only, not combined
with madelung=True.
Measured (standalone build, rocksalt LiF at a0 = 4.03 angstrom, primitive fcc cell, N x N x N clusters): energy per cell for R0 = 3 angstrom, kappa = 0.025 angstrom^-2 of -17.6852902, -17.6893875, -17.6899394 and -17.6899998 Hartree for N = 2 to 5, successive changes 4.1e-3, 5.5e-4 and 6.0e-5 Hartree; with the paper’s 5 angstrom and 0.05 angstrom^-2 the changes are 4.1e-3 and 5.5e-4 for N = 2 to 4. The Li charge converges to 0.859.
Derivatives of the faded-pair variant¶
compute_gradient=True and compute_stress=True return the analytic
gradient and the strain derivative \(W_{ab} = \partial E/\partial
\varepsilon_{ab}\) of the faded-pair energy on the contract of
the stress design: fixed Wigner-Seitz records,
Hartree per primitive cell, unsymmetrized. Every piece of the energy is a
function of record displacements \(\mathbf d\) and of the cyclic
translations, so the per-record derivative \(\mathbf g = \partial
E_\text{rec}/\partial\mathbf d\) is deposited twice, as for the standard
model: \(-\mathbf g\) and \(+\mathbf g\) on the two atoms, and
\(\mathbf g\otimes\mathbf d\) into \(W\).
With \(\hat{\mathbf d} = \mathbf d/R\) and \(f'(R) = -2\kappa (R - R_0) f(R)\) beyond \(R_0\) (zero inside, so \(f\) is continuously differentiable at the onset), the blocks and their derivatives are
with \(\lambda = 1\) for a WS record and \(\lambda = 0\) for a completion
image, \(\partial_k B\) from pm6_spd_pair_gradient and
\(\partial_k B^\text{pc} = -(d_k/R^2) B^\text{pc}\). The same rule applies to
the core-core energy with \(B^\text{pc} = Z_A Z_B/R\). The fade derivative is
therefore exact: no frozen-weight approximation. The overlap (resonance)
part is not faded.
A WS record of weight \(w\) contracts \(\partial_k B_f\) with the densities and the coefficients of the standard model, \(\{w, w, 0, w/2\}\) for resonance, first core, second core and two-electron terms.
A completion image \(A \to B + \mathbf T\) of weight \(c_{AB}\) and its mirror \(B \to A - \mathbf T\) of weight \(c_{BA}\) contract with \(\{0, c_{AB}, c_{BA}, (c_{AB} + c_{BA})/2\}\) and no exchange blocks. The mirror has displacement \(-\mathbf d\) and derivative \(-\mathbf g\), which deposits the same gradient and the same \(\mathbf g\otimes\mathbf d\), so both enter as one record. The energy and the derivatives enumerate the images with one function (
for_each_completion_image).The Ewald sum of the net charges is the 3-D embedding of the cyclic engine. Its fixed-charge gradient is
indo::_add_madelung_gradient(3-D branch) and its strain derivativeseccm_madelung_strain_derivative(3-D Ewald with the volume and reciprocal-vector terms of Nielsen and Martin, own-image term included). The charges are diagonal populations of the orthonormal NDDO basis, so neither has an overlap or Pulay term.
The fixed topology of this model has two parts: the WS records with their weights, as for every SECCM route, and the completion image set (lattice labels with \(R \le r_\text{max}\) and completion weights \(1 - w_\text{WS}\)). An image that crosses \(r_\text{max}\) under a deformation changes the energy by less than \(10^{-10}\) times its remainder, below the finite-difference noise; the WS switching margins of the topology bound the admissible strain as before. Because \(f''\) jumps from \(0\) to \(-2\kappa\) at \(R_0\), a second derivative (Hessian, elastic constants by differentiation of \(W\)) is only piecewise smooth where a pair distance crosses \(R_0\).
Measured (standalone build of the native kernels, SCF to 1e-11, jittered cells, central differences of the same fixed-topology energy, all nine components of \(W\); gradient over the first two atoms of the 16-atom cells, all atoms of the 4-atom cell), maximum deviation in Hartree per primitive cell and Hartree per bohr:
cell (2 x 2 x 2 primitive cells unless noted) |
\(R_0\), \(\kappa\) |
max \(\lvert W\rvert\) |
max \(\lvert W - W_\text{FD}\rvert\) |
max \(\lvert g\rvert\) |
max \(\lvert g - g_\text{FD}\rvert\) |
|---|---|---|---|---|---|
rocksalt LiF, \(a_0\) = 4.03 angstrom |
3, 0.025 |
1.1e-2 |
1.4e-8 |
3.4e-4 |
1.5e-9 |
rocksalt NaCl, \(a_0\) = 5.64 angstrom |
5, 0.05 |
1.1e-1 |
6.5e-9 |
2.7e-4 |
1.1e-9 |
diamond C, \(a_0\) = 3.567 angstrom |
5, 0.05 |
4.6e-2 |
1.5e-8 |
4.7e-3 |
4.5e-10 |
LiF under a general triclinic deformation |
3, 0.025 |
2.9e-2 |
1.2e-8 |
4.4e-4 |
1.2e-9 |
triclinic LiH, one 4-atom cell |
1.5, 0.2 |
2.3e-1 |
9.3e-9 |
4.4e-2 |
8.3e-11 |
(\(h\) = 1e-4 bohr for the gradient and 1e-4 for the strain.) The strain error falls as \(h^2\) (triclinic LiH: 3.7e-8, 9.3e-9 and 2.4e-9 at \(h\) = 2e-4, 1e-4 and 5e-5), the antisymmetric part of \(W\) is below 4e-13 and the gradient sums to zero to 2e-16. The steep fade of the LiH cell puts nearly every pair in the switching region; with \(f'\) set to zero there (a frozen fade) the same comparison fails by 2.0e-2 in \(W\) and 1.3e-3 in the gradient, so the fade derivative is both necessary and exercised.
Acceptance tests for an implementation¶
Rocksalt point charges: the Ewald part reproduces the Madelung constant 1.747565.
With fixed \(R_0\) and \(\kappa\) the energy per cell of LiF, MgO and NaCl converges with cluster size, and the change between the two largest clusters is below a stated threshold; the same clusters with \(f \equiv 1\) show the \(\ln L\) drift with the slope \(2\pi D_\text{cell}^2/V_\text{cell}\) computed from the converged charges.
A translation of the cluster origin and a change of the Ewald splitting parameter leave the energy unchanged.
Agreement with solid-state MOPAC on one covalent and one ionic crystal at the same \(R_0\), \(\kappa\) and geometry.
MgO clusters with an open degenerate frontier¶
Rocksalt MgO (\(a_0\) = 4.21 Å) converges on the 2 x 2 x 2 cluster under both electrostatics models. The 3 x 3 x 3 cluster does not. A probe build of the SCF, which reports the frontier level set and the population spread between translation-equivalent atoms at each iteration, found the cause in the first iteration. The Fock matrix of the first iterate is translation symmetric, but its occupation boundary cuts a 16-fold degenerate O 2p set: 15 pairs for 16 levels. That holds for the neutral-atom start of the faded path, for the second iterate of the truncated s/p path, and for a fully ionic start (Mg 0, O 8 electrons). Integer Aufbau fills an arbitrary 15 of the 16 levels, the iterate loses the cluster translation symmetry (Mg population spread 0.05 e, O 0.16 e), and the broken iterates drift for 300 or more iterations without converging.
A degeneracy-averaged occupation keeps the iterates symmetric to 1e-11 and
converges in 13 iterations, from the neutral and from the ionic start. The
state it reaches still has the open frontier: 15 pairs in the 16-fold set,
then a gap of 0.36 Ha to the next level. The Mg population is 1.11 (faded,
level at -0.179 Ha) or 1.34 (truncated, -0.287 Ha). The cluster has one
more level below its main gap than it has valence pairs, so no
closed-shell determinant keeps its translation symmetry. Integer
occupations cannot converge there, and damping does not change that. The
truncated 4 x 4 x 4 cluster has the same kind of frontier, 7 pairs in 8
levels. The charge-density-wave iterates are therefore not a converged
ground state of the model, and no symmetric closed-shell state exists to
test for stability. The route refuses. On a cyclic cluster the native SCF
fills a frontier set that is degenerate within 1e-6 Ha equally in every
iteration, and a converged state whose frontier is still open is refused
with the pair and level counts. An unconverged run whose last iterate
breaks the translation symmetry for another reason reports the population
spread. tests/test_pm6_seccm_faded_pair.py pins the MgO refusal. The
molecular limit keeps integer Aufbau iterates.
The same cut slows the 2 x 2 x 2 faded run. Its first iterate fills 7 of an 8-fold set and breaks the symmetry (Mg spread 3e-13 e, O 0.31 e). The run returns to the symmetric gapped state (gap 0.308 Ha) only after about 100 iterations, inside the damped window. With the degeneracy-averaged occupation it converges in 13 iterations to the same energy, -11.5952203013 Ha per cell.
The 16-atom OMx diamond charge-density wave
(design_seccm_omx.md) has a different cause. That
state is translation symmetric and gapped, and the symmetric state there is
a gapped saddle along the sublattice charge transfer. The integer MSINDO Ge
fixture is the same frontier case as MgO: 6 pairs in 8 degenerate levels
(occupation_mode="reference" in msindo.md).
The s/p/d integrals in the cyclic engine¶
The molecular s/p/d kernel builds its Fock matrix from stored tensors, and
the pair function pm6_spd_pair(first, second, displacement) returns the
complete block of one pair for any combination of H, s/p and s/p/d atoms:
\((\mu\nu|\lambda\sigma)\), both core attractions and the overlap. The cyclic
engine needs exactly this per WS record:
one block per record (central atom, image atom, displacement), computed once before the SCF;
Coulomb contractions with the record weight on both atomic blocks, and exchange contractions on the central-image block with the same weight, as the s/p engine does now for its 16 x 16 blocks;
the one-centre tensor
pm6_spd_one_center_integralsfor each atom;resonance integrals from the block’s overlap with the s, p, d betas.
This is now the general s/p/d path of the cyclic engine (seccm/pm6.cpp):
a cell with a d-orbital element takes it, by the molecular kernel’s rule,
with the s/p/d populations in the Madelung charges and the SCF schedule of
the molecular s/p/d driver; its molecular limit is molecular PM6, and its
analytic gradient and strain derivative contract pm6_spd_pair_gradient.
The faded-pair variant contracts the same block derivatives after the fade
(see “Derivatives of the faded-pair variant”).