Design: g-xTB on the cyclic cluster (g-xTB-SECCM)¶
Status. Experimental, numpy reference implementation of the energy,
the analytic gradient and the strain derivative
(python/vibeqc/semiempirical/seccm/gxtb.py, gxtb_gradient*.py,
gxtb_aes_lattice.py, front-door method gxtb-seccm). No cyclic-cluster or other periodic formulation of g-xTB has
been published: the upstream program is molecular only, and a k-point
periodic g-xTB in CP2K exists only as an unreleased manuscript. Every
closure below is therefore a design decision of vibe-qc, made for the
method paper on cyclic cluster models for semi-empirical Hamiltonians. The
revD4 dispersion is included by default as a lattice sum
(include_dispersion=False gives g-xTB without dispersion). The analytic
gradient and strain derivative (section “Derivatives”) make the cell
optimisation, equation-of-state and elastic-constant tasks available.
The molecular method is g-xTB of Froitzheim, Mueller, Hansen and Grimme (2025) in the reading of the upstream v1.1.0 program (program conventions); its parameters are fetched from the upstream GPL repository at run time and are never stored in vibe-qc. The cyclic cluster is that of Bredow, Geudtner and Jug (2001) with the Wigner-Seitz weights of Peintinger and Bredow (2014). The closure classes are those of the GFN2-SECCM functional note.
Model and normalisation¶
The cluster is the Born-von Karman supercell of N1 x N2 x N3 primitive
cells built by the SECCM front door, with the cluster translations
identified with zero. One density matrix P (per spin) lives on the cluster
basis; it is the Gamma point of the cluster. Every term of the energy is
written for the cluster and divided by the group order, so energy is per
primitive cell. A molecule of the same atoms is the limit in which every
image is far away.
Translation covariance is the structural requirement on every closure: a term is evaluated at the actual image vector R_B + T - R_A of each pair, and the set of images it sums over is defined by the lattice, not by the order or the representative positions of the atoms. A closure that picks images ad hoc (for example the nearest image of each shell separately, with a kernel that is not a function of that image vector) breaks the invariance under a rigid translation of the cluster; this was the defect of the earlier shell-resolved AES of GFN2-SECCM and is excluded here by construction.
The three closure classes¶
Lattice sum. Sum over every image R_B + T within a cutoff that the decay of the kernel sets, an atom’s own images included. Used for classical pair functions that decay exponentially or faster. The result is the infinite-crystal value for the given charges, independent of the cluster size.
Ewald completion. The 1/R part of the isotropic Coulomb energy, summed completely by the Ewald-regularised lattice potential of the cluster superlattice (1-D, 2-D or 3-D;
gxtb_lattice.py).Wigner-Seitz (WS) records. Each atom sees every other atom (and, in small clusters, its own images) through the image(s) inside its WS cell, with fractional weights for ties. Used for quantities that multiply the density matrix of the cluster and whose infinite-crystal sum would double count a density-matrix element (exchange), and for the anisotropic electrostatics.
For the matrix elements between basis functions the route offers a choice
(orbital_closure), discussed below: the WS records of the classic cyclic
cluster, or the Born-von Karman lattice sum (default).
Term by term¶
Term |
Kernel range |
Closure |
Thermodynamic limit |
|---|---|---|---|
E_incr |
none |
per atom |
exact |
CN (q-vSZP, EEQ_BC, g-xTB) |
erfc counting function |
lattice sum, 45 bohr (EEQ_BC CN keeps its 25 bohr cutoff) |
exact |
EEQ_BC charges |
bond capacitance (erfc) times Gaussian Coulomb |
lattice sum of the Hadamard product; no Ewald |
exact for the periodic charge model |
q-vSZP basis |
per atom |
from the periodic charges and CN |
exact |
E_rep |
exp(-alpha (R + R0)^1.5) |
lattice sum, 45 bohr |
exact |
Overlap, H0 (scaled diatomic frame per image) |
Gaussian, long for diffuse q-vSZP primitives |
|
Gamma point of the cluster |
H_ACP |
Gaussian projector overlaps |
|
Gamma point |
Multipole integrals (AES moments) |
Gaussian |
|
Gamma point |
E(1) on site |
local |
none |
exact |
E(1) off site |
gamma - 1/R (drho sums to zero per atom) |
lattice sum |
exact |
E(2) |
1/R plus gamma - 1/R ~ exp(-k2x R)/R^2 |
Ewald for 1/R, lattice sum for the remainder |
exact for the charges |
E(3) |
tau(R/eta) exponential |
lattice sum |
exact |
E(4) |
on site |
none |
exact |
E_AES |
damped R^-3 … R^-9 |
|
Ewald: exact tin-foil (3-D) / 2-D sum; WS: see AES section |
E_x (MFX) |
g(R) -> 1/R |
WS records, cyclic matrix products |
converges with density-matrix decay |
E_OFX |
on site |
none (cyclic dual density) |
exact |
E_spin |
on site |
none |
exact |
revD4 CN |
erf counting function, k = 7.5 |
lattice sum, 45 bohr |
exact |
E_revD4 two-body |
R^-6, R^-8, self-consistent charges |
lattice sum; |
exact for the (smoothly) truncated model |
E_revD4 three-body (ATM) |
R^-9, zero charges |
image triples; smooth: weight 1 with all legs <= 20 bohr, product of C2 leg switches to 0 at 25 bohr; program: hard 20 bohr |
exact for the (smoothly) truncated model |
The cutoffs: the counting functions, the bond capacitance and the
repulsion are below 1e-20 of their contact values at 45 bohr. The slowest
lattice sum is the second-order remainder gamma - 1/R =
-exp(-k2x R)/(eta R (R + exp(-k2x R)/eta)), whose cutoff is
-ln(lattice_tolerance)/k2x (91 bohr for the default 1e-13 and
k2x = 0.33 bohr^-1). result.lattice_cutoffs records them.
Coordination numbers and the increments¶
All four coordination numbers (q-vSZP basis, EEQ_BC, the g-xTB CN of H0, ACP, Coulomb and repulsion; revD4 later) are sums of an error-function counting function, which decays like a Gaussian. Their lattice sum over all images, own images included, is the crystal value; the WS sum would cut neighbours at the WS boundary of small clusters and is not used. The increments are atomic constants.
EEQ_BC under periodic boundary conditions¶
EEQ_BC (Froitzheim et al. 2025, Eqs. 10, 13, 15) is not the plain EEQ system. Its interaction matrix is the Hadamard (element-wise) product of the Maxwell capacitance matrix and the Coulomb matrix of Gaussian charges, A = I + C o J, and the right-hand side is b = C chi. Every off-diagonal element is therefore -c_AB erf(gamma_AB R)/R with the bond capacitance c_AB ~ erfc(k_BC (R - R_vdW)/R_vdW), which decays faster than any power of R. The long-range Coulomb interaction of the charges is screened by the capacitance pair by pair (“each bond capacitor independently attenuates the Coulomb interaction for one atom pair”). Consequently the periodic EEQ_BC needs no Ewald sum: the lattice sum of A converges absolutely, and an Ewald completion would add a long-range Coulomb coupling that the model does not contain. (The planning note that listed Ewald for the EEQ_BC Coulomb matrix overlooked the Hadamard form.)
Restricted to translation-symmetric charges, the infinite-crystal equations become, with every pair quantity at |R_B + T - R_A|:
A_AA = 1 + C_AA (eta_A + sqrt(2/pi)/a_A) - sum_{T != 0} c J (A, A+T)
A_AB = -sum_T c J (A, B+T) (A != B)
C_AA = sum_{(B,T) != (A,0)} c, b = C' chi,
C'_AA = C_AA - sum_{T != 0} c (A, A+T), C'_AB = -sum_T c (A, B+T).
C’ is the capacitance operator folded onto periodic charges: an atom and its own images carry the same electronegativity, so their bonds transfer no charge. The diagonal of A keeps the full crystal C_AA. With T = {0} these are the molecular equations term by term. The Lagrange constraint fixes the charge of the cell (the route admits neutral cells). The local charge uses Q/N per cell, which is intensive.
EEQ_BC is not exactly size consistent: the single Lagrange multiplier couples all atoms, so two unlike fragments that do not interact still exchange a small charge (the capacitance limits it, it does not remove it). In a periodic cell this means that a molecular crystal of two different molecules has slightly charged molecules even at infinite separation; the effect is part of the model and is the same in the molecular limit.
The charge-dependent basis (q-vSZP, q_eff from the EEQ_BC charges and the q-vSZP CN) is then per atom and translation invariant.
Repulsion¶
Z_eff (EEQ_BC charges) and alpha (g-xTB CN) are per atom; the pair function decays like exp(-alpha (R + R0)^1.5). Lattice sum, own images included, E = 1/2 sum_A sum_{(B,T) != (A,0)} Z_A Z_B f_AB.
Matrix elements of the basis functions (orbital closure)¶
The overlap S, the extended-Hueckel H0 with its distance polynomial and the diatomic-frame scaling, the AO-projector overlaps of the ACP and the dipole and quadrupole integrals are matrix elements between functions at R_A and at an image R_B + T. Each image block is computed by the molecular term module on the home cluster together with its translated copy, so the diatomic frame, the polynomial and the scaling are those of the actual image vector (every tie image has its own frame).
orbital_closure="wigner_seitz": M[mu(A), nu(B)] = sum_T w_ABT M(mu at R_A, nu at R_B + T) over the WS records. This is the classic cyclic cluster; it is exact once the WS cell holds the whole range of the basis functions.orbital_closure="lattice_sum"(default): the sum over every image, the Born-von Karman operator of the cluster, i.e. Gamma-point sampling of the supercell. The overlap is then positive definite for any cluster.
The default is the lattice sum because of a property of q-vSZP found here:
its primitives are diffuse (smallest exponents 0.03 bohr^-2 for Li,
0.07-0.08 for H, B, C, N), the overlap of two Li functions is still about
1e-2 at 10 bohr and that of two C functions 1e-3. The WS-truncated overlap
of a 3-D cluster is then indefinite until the WS radius exceeds that range:
LiH (rock salt) gives a lowest eigenvalue of -0.16 for 2x2x2 and -0.07 for
3x3x3, and no SCF is defined. 1-D and 2-D clusters (polyethylene, h-BN) and
diamond 2x2x2 have a positive WS overlap, and both closures converge to the
same per-cell energy as the cluster grows (polyethylene: 1e-6 Eh apart at
N = 6). The lattice-sum range is set by basis_tolerance on the Gaussian
factor exp(-mu R^2) of the most diffuse primitive pair.
The ACP is the product of cyclic AO-projector overlaps, S_P W S_P^T. For the lattice sum this is exact: the Bloch sum of the crystal operator sum_{C,U} S(mu, p_CU) w S(p_CU, nu_T) over T factorises into the two lattice-summed overlaps. For WS it keeps positive semi-definiteness of each projector channel and translation covariance; the two image choices (AO to projector, projector to AO) are made independently.
Isotropic electrostatics, first to fourth order¶
The shell charges are reference occupations minus the Mulliken populations of the cyclic overlap, q = n_ref - diag(P S) summed per shell.
E(2). gamma_ij(R) = 1/(R + exp(-k2x R)/eta_ij) tends to 1/R. It is split exactly as gamma = 1/R + (gamma - 1/R): the 1/R part acts on the atomic charges through the Ewald matrix Phi of the cluster superlattice, and the remainder, which decays like exp(-k2x R)/R^2, is lattice summed. The on-site element (R = 1e-12 bohr in the program) is kept as the molecular on-site gamma; the Ewald diagonal holds the interaction of a charge with its own images. For a neutral cell 1/2 q^T (gamma_sr + Phi) q is the energy of the infinite crystal at these charges. In 3-D the Ewald sum carries tin-foil boundary conditions (no surface dipole term).
E(1) off site. The field sum_j gamma_ij drho_j acts on the reference-charge differences drho = Z_l - n_ref,l, which sum to zero per atom. The 1/R part then cancels for each atom, and the field is the lattice sum of (gamma - 1/R) drho. (The tabulated reference occupations sum to the valence charge only to 1e-8 e; the dropped residue changes the molecular limit by less than 1e-9 Eh.)
E(3). tau_ij = (k3 x - 1/2 k3x k3 x^2) exp(-k3x x), x = R/eta, decays exponentially; lattice sum, own images included. On site -1/2 gamma^2.
E(4) and the on-site part of E(1) are local.
Anisotropic electrostatics (AES)¶
The atomic dipoles and quadrupoles are Mulliken partitions of the cyclic density with the multipole integrals about each atom (orbital closure). The interaction kernels are damped, f_n(R)/R^n with f_n = k_n/2 [1 + erf(s (R - R0))], for the charge-dipole (n = 3, energy ~R^-2), the charge-quadrupole and dipole-dipole (n = 5, ~R^-3), the dipole-quadrupole (n = 7, ~R^-4) and the quadrupole-quadrupole (n = 9, ~R^-5) parts. The damping tends to k_n, not 1, at long range.
The kernels as multipole tensors. With r = R_B - R_A, phi = 1/R and a
traceless Q, every part of the program’s pair polynomial
(methods/gxtb_aes.py) is a damped Cartesian multipole tensor of order
l = l_A + l_B (l = 0, 1, 2 for q, d, Q),
K_{l_A l_B} = k d_l(R) (-1)^{l_A} / (phi_A phi_B) grad^{l_A + l_B} phi,
phi_q = phi_d = 1, phi_Q = 3, d_l = f_n / k_n,
checked to rounding against the program’s matrices for random moments,
with one exception found here: the program’s quadrupole-quadrupole
polynomial has 3 Tr(Q_A Q_B) R^4 where the Coulomb tensor
1/9 Q_A : grad^4 phi : Q_B has 2. The program’s kernel is that tensor plus
an isotropic pair term k9 d5(R) Tr(Q_A Q_B) / (3 R^5) (the polynomial as
methods/gxtb_aes.py decodes it from the v1.1.0 program, M 33 and S 108-117
of Froitzheim et al.; whether the 3 is intended is a question for the
upstream authors, and the closure reproduces it). The charge-quadrupole
block r_a r_b / R^5 differs from 1/3 grad_a grad_b phi by an isotropic part
that a traceless Q does not see.
Convergence of a lattice sum (for a neutral cell): in 1-D every part converges absolutely; in 2-D every part converges absolutely (the slowest, ~R^-2 summed over a plane, behaves like the dipole-dipole R^-3 sum of the cell dipoles, so a truncation at radius L errs by O(1/L)); in 3-D the charge-dipole and dipole-dipole sums are conditionally convergent and their value depends on the shape of the summation region (the depolarisation term of a polar crystal); charge-quadrupole converges only through the neutrality of the cell, and dipole-quadrupole, quadrupole-quadrupole and the isotropic R^-5 term converge absolutely.
Multipolar Ewald closure (aes_closure="ewald", the default in 2-D and
3-D; seccm/gxtb_aes_lattice.py). Each damped kernel is split exactly into
the undamped multipole kernel and a short-range remainder,
d_l grad^l phi = grad^l phi + (d_l - 1) grad^l phi,
d_l - 1 = -1/2 erfc(s (R - R0)),
with the program’s k_n scaling of each order kept. The undamped part is
summed over the whole lattice by the multipolar Ewald method (W. Smith,
CCP5 Info. Quart. 46, 18 (1998);
Aguado and Madden 2003;
Laino and Hutter 2008; the same
construction for the damped GFN2-xTB tensors in CP2K:
Alizadeh et al. 2026): real
space with the derivative tensors of erfc(alpha R)/R from Smith’s radial
functions B_n (grad B_n = -r B_(n+1)), reciprocal space with the (i G)^l
derivatives of the Gaussian-screened potential, and the self term of every
atom with its own images (lim r -> 0 of grad^l erf(alpha r)/r). The
isotropic R^-5 term has no harmonic structure and is summed by the Ewald
method for R^-p (Nijboer and De Wette 1957; Williams 1971): real space
Q(5/2, alpha^2 R^2)/R^5, reciprocal space
F(G) = pi^(3/2)/Gamma(5/2) alpha^2 [exp(-x) - x E1(x)], x = G^2/(4 alpha^2),
with its G = 0 term (an absolutely convergent sum has one), self term
-alpha^5/Gamma(7/2). The remainder decays like a Gaussian and is lattice
summed over every image within R0_max + (sqrt(-ln tol) + 1.5)/s3 (about
20 bohr), an atom’s own images included. The sums are converged to
aes_tolerance (1e-15); the result does not depend on alpha.
Boundary condition. In 3-D the G = 0 term of the multipole sum is omitted: the tin-foil (conducting) boundary, i.e. the energy of the infinite crystal at zero macroscopic field, as for the Ewald completion of E(2). A finite sample of shape with depolarisation tensor N in vacuum adds the surface term
E_surface = 2 pi / V [2 k3 P.N.D + k5 D.N.D] (per cluster)
with P = sum_A q_A R_A (it depends on the choice of the cell) and D = sum_A d_A (de Leeuw, Perram and Smith 1980, doi:10.1098/rspa.1980.0135, with the program’s k3 and k5 on the charge-dipole and dipole-dipole blocks). Only these two blocks have one; the charge-quadrupole block has none for a neutral cell and the others converge absolutely. Which boundary condition matches the molecular parametrisation is not a technical question (below); tin-foil is the standard choice for bulk crystals and the one the 1/R part of E(2) uses, so the two electrostatic terms are consistent.
2-D. The 3-D sum of the cell padded with a vacuum vector c along the
plane normal n, plus the slab term
2 pi / V [2 k3 P_n D_n + k5 D_n^2] (the G -> 0 limit along n;
Yeh and Berkowitz 1999). For a slab
thinner than c . n this term makes the G_parallel = 0 part exact (the
periodic 1-D kernel -2 pi |z| + 2 pi z^2 / L of the laterally averaged
density); the replica layers then interact only through G_parallel != 0
components, which fall like exp(-G_min gap), and the gap is chosen so that
this is below aes_tolerance. The isotropic R^-5 term is not harmonic: its
replica layers add 2 pi / (3 A |z + m L|^3) each, which is subtracted in
closed form (Hurwitz zeta). The remainder sums only over the true 2-D
images. In 2-D there is no shape term (absolute convergence); P_n is
independent of the choice of the cell because the lattice vectors lie in
the plane.
1-D is not implemented: every block converges absolutely and the WS
records converge to the lattice sum as the cluster grows (as L^-1 for the
charge-dipole and L^-2 for the R^-3 blocks); aes_closure="ewald" is
refused there, and the 1-D default is the WS closure.
The 200 bohr cutoff of the molecular program is a truncation of the molecular pair list; the Ewald closure sums the infinite crystal and does not apply it (the WS records do, to their record vectors).
Wigner-Seitz closure (aes_closure="wigner_seitz"): the damped kernel
over the WS records, each at its own image vector. It is translation
covariant, reproduces the molecule exactly in a large cell and is supercell
consistent. As the cluster grows it converges to the lattice sum in 1-D and
2-D (slowly: O(1/L) in 2-D for a polar cell); in 3-D it converges to the sum
over atom-centred WS-shaped regions, which for crystals with vanishing atomic
dipoles and quadrupoles by symmetry (rock salt, diamond) is the unambiguous
value and for polar crystals carries a shape term of that region (evidence
below).
Mulliken-approximated exchange (MFX) and on-site exchange (OFX)¶
E_x = -1/4 sum_sigma sum_mu nu g_mu nu [(P S)(S P) + P (S P S)]_mu nu with a kernel that tends to 1/R (100 % long-range exchange). The kernel is folded over the WS records (each record at its own image distance, on-site block molecular) and the products are products of cyclic matrices; the image choices of S and g are independent, the standard cyclic-cluster approximation (with the lattice-summed S this is the minimum-image exchange of Gamma-point hybrid codes).
Why WS and not Ewald or a lattice sum: exchange is not a classical interaction of charges. In the crystal its energy is sum_T g(R_T) |P(0, T)|^2-like products, weighted by density-matrix elements between a function and an image; the cluster density matrix defines one such element per pair, which must not be reused for every image. A lattice sum of g would count the same element once per image and diverge like the Gamma-point exchange (the q -> 0 divergence of k-space exact exchange); an Ewald sum would assign a long-range exchange energy to a pair that has none. With the WS rule the energy converges as the density matrix decays across the WS cell: exponentially for insulators, slowly for small gaps, and not at all for metals at T = 0 (no smearing is defined in g-xTB; degenerate frontier levels of symmetric clusters are a further open point).
OFX uses the cyclic dual density 1/2 (P S + S P) on each atom; spin polarisation uses the cyclic Mulliken shell magnetisations. Both are on site and need no closure.
Dispersion¶
revD4 (gxtb_revd4_lattice.py, a thin wrapper around the molecular
gxtb_dispersion module, whose element data, D4S weights, zeta and C6 it
uses; periodic D4 of
Caldeweyher et al. 2020 is the
template). The molecular program truncates both terms (two-body pairs beyond
60 bohr, ATM triples with a pair beyond 20 bohr) without switching. The
cyclic closure is a lattice sum over every image pair with the cutoff rule
of dispersion_cutoffs:
"smooth"(default; a deliberate, labelled departure from the program for periodic work): every pair within 60 bohr and every triple whose three legs are within 20 bohr keeps the program’s weight 1 exactly; beyond, a pair carries S(R; 60, 10) and a triple the product of S(R_leg; 20, 5) over its three legs, with the C2 quintic switch S(R; R_on, w) = 1 - 10 x^3 + 15 x^4 - 6 x^5, x = (R - R_on)/w in [0, 1]. The energy is a C2 function of atoms and cell, and the analytic derivatives are exact (no frozen lists)."program": the hard cutoffs; the energy jumps when an image pair crosses 60 bohr or an ATM leg crosses 20 bohr, and the derivatives are those of the fixed image lists.
Both modes keep the program’s molecular parity: the switching windows lie outside its cutoffs, so a molecule whose images are beyond 70 bohr (25 bohr for ATM legs) is evaluated exactly as by the program. A window inside the cutoffs (for example 50-60 bohr) would avoid the extra image terms but would change molecules larger than 50 bohr and every ATM triple with a leg between 15 and 20 bohr, which is common. The thermodynamic limit is the crystal sum of a model truncated smoothly between 60 and 70 bohr (two-body) and 20 and 25 bohr (ATM legs) instead of sharply at 60 and 20 bohr; the R^-6 tail beyond (about -C6 2 pi rho / (3 R^3) per atom in 3-D) is dropped as in the program. The switched windows change the crystal energy relative to the hard cutoffs by -3e-6 (two-body) and +5e-5 (ATM) Eh per diamond cell, a measure of how far the program’s 20 bohr ATM truncation is from converged in a dense solid.
CN: lattice sum of the erf counting function (k = 7.5, 4/3 Pyykko radii).
Two-body: C6_AB depends on the CN of both atoms and on their self-consistent Mulliken charges, not on the image, so E2 = -1/2 sum_AB C6_AB(q_A, q_B) F_AB with F_AB the sum of the damped distance factors over the images within 60 bohr (own images included). dE2/dq_A enters the cyclic Fock matrix as -1/2 (v_A + v_B) S, as in the molecular driver.
Three-body: charge independent (C6 at zero charge); each crystal triple with all three distances within 20 bohr is counted once per cluster, E3 = 1/3 sum_A sum_{pairs of images j < k around A} e(A, j, k).
SCF¶
Restricted for closed shells, unrestricted otherwise (the cluster of a cell
with multiplicity m is ferromagnetic, group_order (m - 1) unpaired
electrons). Start density, Fock matrix conventions (program default,
variational optional) and the final diagonalisation of the unmixed Fock
matrix are the molecular driver’s. Pulay DIIS on the orthogonalised
commutator converges the cluster energy to 1e-10 Eh. Damping is not used
to hide a periodic defect.
Evidence¶
The invariants are tested in tests/test_seccm_gxtb.py (fast) and
tests/test_seccm_gxtb_series.py (slow); the numbers below were measured
with the closures of their time: the WS AES and the program’s hard revD4
cutoffs (the defaults until the multipolar Ewald AES and the smooth
cutoffs; their evidence is the next subsection). With the WS AES and the
smooth cutoffs every statement of this list still holds (tested).
Isolated limit with dispersion: N2 in an 80 bohr box (every image beyond the 60 bohr two-body cutoff) reproduces
gxtb_single_pointwith revD4 to better than 1e-9 Eh in 1-D, 2-D and 3-D (tested). A polar water-methane pair differs by the dipole-image energy, -4.7e-6 Eh (3-D, 60 bohr) and -1.4e-6 Eh (90 bohr), an L^-3 law; its two-body dispersion differs by 4.7e-8 and 1.8e-8 Eh (images and polarised charges), the ATM term by less than 1e-20 Eh.Isolated limit without dispersion: N2 in a 40 bohr box reproduces
gxtb_single_point(..., include_dispersion=False)to 1e-14 Eh in 1-D, 2-D and 3-D. A polar molecule (H2O) differs by the dipole-image energy, which falls as L^-3 (3-D: -1.10 L^-3 Eh bohr^3, 2-D: +2.39, 1-D: +0.635, constant between L = 30 and 60 bohr), the physical energy of the periodic dipole array, not an error of a closure.Supercell consistency: a primitive cell with cluster 2N and the doubled cell with cluster N agree to the SCF precision (polyethylene 1e-14 Eh per cell; the oblique 2-D h-BN cell likewise).
Translation and gauge invariance: rigid translation, wrapping an atom by a lattice vector, a unimodular change of the lattice vectors and a permutation of the atoms leave the energy unchanged to 1e-9 Eh (measured differences: 0 to a few 1e-14 Eh for h-BN 2x2 and polyethylene, with and without dispersion; supercell consistency with dispersion 0 Eh for polyethylene).
With dispersion: polyethylene N = 4, 6, 8 gives -78.611219, -78.611975, -78.612029 Eh per cell (two-body -0.010305, ATM +0.000158); the oligomer increments are -78.6120371 (m = 7) and -78.6120368 (m = 8). Diamond 2x2x2: -76.158518 Eh (two-body -0.019910, ATM +0.005094), 71 s.
The series below are without dispersion.
Cluster-size series, energy per cell in Eh, default closures:
Cluster
Polyethylene (1-D, C2H4)
h-BN (2-D)
2
-78.590055
-79.696314
3
-78.598092
-79.732313
4
-78.601116
-79.734294
5
-78.601750
-79.734193
6
-78.601876
8
-78.601930
Polyethylene approaches its limit monotonically; with the WS orbital closure N = 4, 5, 6 give -78.601130, -78.601754, -78.601875. Long oligomers H(C2H4)mH of the molecular driver give the per-cell increment E(m) - E(m - 1) = -78.6019391 (m = 7) and -78.6019385 (m = 8); the cyclic value approaches it from above (N = 6: 6.3e-5 Eh, N = 8: 8.1e-6 Eh). h-BN oscillates by 1e-4 Eh between even and odd N at N = 4, 5 (tie images of the WS records of exchange and AES).
3-D, energy per cell in Eh:
Cluster
LiH lattice sum
diamond lattice sum
diamond WS
1x1x1
-8.425499 (q = 1.63)
-76.740682
-75.113638
2x2x2
-8.128773 (q = 0.52)
-76.143702
-76.195492
3x3x3
-8.146293 (q = 0.39)
-76.223352
-76.218631
(LiH with the WS closure is refused: indefinite overlap at 2x2x2 and 3x3x3.) The 3-D series converge slowly: Gamma-point sampling of small supercells, WS exchange and, for LiH, the cluster dependence of the Mulliken charges (1.63, 0.52, 0.39 e) are all still moving at 3x3x3. A 1x1x1 cluster is not a meaningful model in any dimension (q = 1.89 e for h-BN with WS records).
Open shell: a triplet O2 chain at 40 bohr spacing reproduces the molecular triplet for N = 1 (0 Eh); N = 2 and 3 differ by 7e-9 and 1.4e-8 Eh per cell, the WS-record AES (quadrupole-quadrupole, R^-5) and its polarisation response from the neighbours at 40 bohr that enter as tie images; the same per-cell difference appears for closed-shell N2, so it is a property of the AES closure, not of the open-shell route.
Evidence for the multipolar Ewald AES¶
Fast tests: tests/test_seccm_gxtb_aes_ewald.py; slow:
tests/test_seccm_gxtb_series.py. Scratch drivers for the series below.
Point-dipole lattice. Parallel dipoles on a simple-cubic lattice give the tin-foil energy -2 pi d^2 / (3 a^3) per dipole (the Lorentz sphere sum vanishes, its surface term removed) to 1e-16 Eh for alpha = 0.6, 0.9 and 1.4 bohr^-1, and trace W = -3 E.
Splitting and gap independence. Random damped moments (k3, k5, k7 of a stand-in model) on oblique 3-D and 2-D cells: the energy changes by below 5e-17 Eh between alpha and 0.7 alpha or 1.5 alpha; the 2-D energy changes by below 2e-15 Eh between the automatic gap (37 bohr), 25, 50 and 90 bohr.
Independent references. 2-D charge-dipole plus dipole-dipole energy against the same dipoles as +-charge pairs in the independent Parry sum of
gxtb_lattice.py, Richardson-extrapolated in the pair separation: 1e-9 Eh (the pair model’s own rounding floor is 1e-7); 3-D likewise against the point-charge Ewald sum. The l = 4 tensor and the isotropic R^-5 term against a direct sum over 61^3 images with its continuum tail: 3e-11 Eh, and the 2-D R^-5 sum against a direct sum over 801^2 images: 5e-16.Isolated limit. At fixed moments the Ewald energy minus the program’s molecular pair sum (N2-like moments) is, per part, dd 3.2e-8, 1.0e-9, 3.1e-11 Eh and QQ -2.2e-10, -7.0e-12, -2.2e-13 Eh at L = 40, 80, 160 bohr in 3-D (2-D: 1.96e-8, 6.2e-10, 1.9e-11): an L^-5 law, the image energy of a nonpolar molecule. The SCF reproduces
gxtb_single_pointfor N2 at 160 bohr to 1e-10 Eh (tested; 1.1e-9 and 1.7e-9 Eh at 80 bohr in 2-D and 3-D). A polar molecule (H2O) differs by its dipole-image energy, now including the charge-dipole and dipole-dipole image terms of the atomic multipoles: (E - E_mol) L^3 = -1.377, -1.404, -1.410 Eh bohr^3 at L = 30, 60, 90 bohr in 3-D (WS: -1.079, -1.100, -1.105) and 3.071, 3.053, 3.048 in 2-D (WS: 2.406, 2.392, 2.388).Supercell consistency and invariances (fixed moments, tested): the doubled cell, a rigid translation, wrapping an atom, a permutation and a unimodular change of the lattice vectors leave the energy per cell unchanged to 1e-12 Eh in 2-D and 3-D.
Shape term, fixed moments. The moments of one SCF (Ewald closure) are replicated over clusters of different size and shape, and the AES energy per cell is evaluated with the WS records and with the Ewald closure (the latter is the same for every cluster to the printed 1e-12). WS minus Ewald, Eh per cell:
Cluster
polar LiF (rock salt, Li shifted along 111)
BeO (wurtzite)
HF sheet (2-D, dipoles along the normal)
1
+5.29e-5
+1.63e-3
-3.01e-4
2
+5.62e-5
+1.19e-3
-2.37e-4
3
+1.19e-4
+1.15e-3
-1.49e-4
4
+1.07e-4
+1.15e-3
-1.23e-4
5
+1.05e-4
+1.16e-3
-9.41e-5
6
+1.03e-4
-8.18e-5
8
-6.12e-5
other shapes
2x2x4: +1.17e-4, 4x4x8: +1.19e-4, 8x8x4: +1.39e-4
2x2x4: +3.93e-4, 3x3x2: +1.97e-3, 4x4x2: +2.77e-3
2x4: -1.90e-4 (= 4x2)
(N x N x N in 3-D, N x N in 2-D; the fcc supercells of LiF are rhombohedral, the wurtzite N x N x N clusters are 1.62 times taller along the polar c axis than wide.) In 3-D the WS sum converges to a limit that is not the crystal sum and that depends on the cluster shape. For BeO it follows the depolarisation factor along c: +3.9e-4 (2x2x4, 3.2 times taller than wide), +1.16e-3 (N x N x N, 1.6), +1.97e-3 (3x3x2, 1.1) and +2.77e-3 Eh per cell (4x4x2, 0.8), i.e. 0.011 to 0.075 eV, almost all of it the charge-dipole block. In 2-D the WS sum converges, as 1/N (N (WS - Ewald) = -4.5e-4 to -4.9e-4 for N = 2 … 8), to the Ewald value.
Shape term, self-consistent. SCF energies per cell without dispersion (the moments respond to the closure), WS minus Ewald: polar LiF -6.26e-4 (1x1x1), -5.71e-5 (2x2x2), -5.32e-4 (2x2x4 and 4x2x2), -5.87e-4 (3x3x3); BeO -1.10e-3 (1x1x1), +8.11e-4 (2x2x2), -1.16e-3 (3x3x2; Ewald AES -8.0e-4, -8.3e-5, -9.9e-6 Eh, WS AES -6.9e-3, +4.4e-4, -2.6e-3 Eh); HF sheet -2.62e-4, -1.56e-4, -1.28e-4, -9.63e-5, -8.32e-5 (N = 2 … 6). The Ewald AES energy itself is stable (LiF: -6.2e-5, -3.8e-6, +1.4e-5, +2.4e-5 Eh; HF sheet per-cell total -100.4510047, -100.4510000, -100.4509999, -100.4509999 Eh for N = 3 … 6, where the WS series is still moving by 3e-5 per step), while the WS AES energy of LiF swings between -2.2e-4 (2x2x2) and -1.7e-3 Eh (3x3x3, 2x2x4) with the cluster shape and parity.
Cost (numpy, host load 85-110 on 18 cores): building the Ewald forms is a fixed cost per geometry; SCF wall times WS / Ewald 58 / 68 s (LiF 2x2x2), 205 / 289 s (LiF 3x3x3), 594 / 838 s (BeO 3x3x2, 72 atoms), 18 / 45 s (HF sheet 6x6).
Default. The Ewald closure is the default in 2-D and 3-D: it is the crystal sum (no shape term, no truncation), it is supercell consistent and alpha independent to rounding, and it converges in 2-D where the WS sum errs by O(1/N); in nonpolar crystals with vanishing atomic multipoles both closures agree. The WS closure stays available, and stays the 1-D default.
Derivatives¶
compute_gradient=True and compute_stress=True give the analytic gradient
of the per-cell energy with respect to the cluster atoms and the strain
derivative W[a, b] = dE/d eps_ab of the
stress contract (homogeneous strain
x -> (1 + eps) x of atoms and cyclic translations, fixed Wigner-Seitz
topology, unsymmetrised, Eh per primitive cell). Implementation:
python/vibeqc/semiempirical/seccm/gxtb_gradient.py (driver),
gxtb_gradient_terms.py (weights and the cyclic contraction),
gxtb_gradient_images.py (image-batched integrals) and
gxtb_gradient_lattice.py (lattice sums, EEQ_BC, Ewald, revD4). Both Fock
conventions, both orbital closures, closed and open shell, 1-D to 3-D, with
and without dispersion. gradient_method="finite_difference" replaces the
gradient by central differences over topology.rebuild_displacements (a
cross-check).
Frame¶
The molecular gradient (design note) writes the
energy as a function of a few geometry-dependent objects (overlap, moment
integrals, core Hamiltonian, distance kernels, coordination numbers, EEQ_BC
charges), collects the energy’s partial derivatives with respect to them
(weights) and contracts the weights with the object derivatives once. The
cyclic energy is the same function of the cyclic objects, so the weights
are computed by the same expressions on the cyclic matrices (the molecular
weight functions of H0 + ACP, OFX and spin run unchanged), the Pulay term is
-sum_s <P_s F^E_s P_s, dS> with the cyclic S, and in the program
convention the Z-vector is the molecular one with the response operator of
the cyclic Fock matrix (A^T Z = 2 F^E_vo, GMRES, Newton polishing of soft
modes; Sec. 5 of the molecular note). Only the contraction changes: every
object is an image sum, and every image term is a function of its image
vector.
Record virial. For an energy E = sum_i e_i(d_i) over image pairs with
d = R_B + T - R_A, the chain rule under d -> (1 + eps) d gives
dE/d eps_ab = sum_i (de_i/dd)_a d_b, and the gradient is -f on A and
+f on B with f = de/dd. Every term below except the reciprocal and
background parts of the Ewald sum is of this form; the energy at fixed
topology is translation invariant, so the net force vanishes to rounding.
Term by term¶
Orbital-closure matrix elements.
M_cyc[mu(a), nu(b)] = sum_T W_T[a, b] M(mu at R_a, nu at R_b + T)for the SCF overlap, the dipole and second moments about the bra atom, the H0-basis overlap with its bond frame and distance polynomial, and the ACP projector overlap;W_Tare the WS weights (orbital_closure="wigner_seitz") or the Born-von Karman image set ("lattice_sum"). A weightGonM_cycputsG W_Ton the image block, whose derivative depends ondonly (overlaps are translation invariant; the moments are taken about the bra centre, which moves with it), so the ket-centre derivative of the Obara-Saika integrals givesfandf d^T. The H0 block carries, besides the plain H0-basis overlap, the frame projectors of the image vector (their derivative in the unit vector,(1 - u u^T)/|d|) and the polynomial in|d|; on-site blocks (a = b,T = 0) have no centre derivative. The coefficient response of the q-vSZP contraction (SCF and H0 bases) goes to the effective charges of the home atoms. The ACP isS_P w S_P^Twith the cyclicS_P, so the weight onS_Pis2 G S_P diag(w); the projector weights depend on the g-xTB CN. The image sums are batched per shell pair over all images.E(1)-E(4).
gamma = onsite + short + Phi,field = short,tau = tau0 + sum_T tau. The adjoints split intodE/dgamma(E(2), and E(3) through the same-atomtau = -gamma^2/2) anddE/dfield = -q drho^T(E(1));short(home off-atom and every image, own images included) takes both, the on-sitegamma0takes the first (it depends on the Hubbard parameters, hence on the CN, only). The image kernelsgamma - 1/Randtau(R/eta)are differentiated inRandeta(molecular Sec. 4.1 formulas),etathrough the Hubbard parameters to the g-xTB CN.Ewald part of E(2).
E = sum_AB G_AB Phi_ABwithGthe atom sums ofdE/dgamma(a neutral distribution, so the derivative at fixed splitting parameter is the derivative of the converged sum). Real space: record virial oferfc(alpha r)/rover all images, own images included. 3-D (Nielsen and Martin 1985): the structure-factor gradient, andsum_k c_k S(k) [2 k k^T (1/k^2 + 1/(4 alpha^2)) - 1] + pi/(V alpha^2) sum Gfor the strain. 2-D (Parry, de Leeuw-Perram): the first-order changes of the areaA (delta - n n^T), the heightz n n^T, the phasez (K n^T + n K^T)and|K|,-K K^T/|K|, applied to theg != 0andg = 0terms. 1-D (Porto): direct differentiation in the axis lengthL(dL = L t t^T), the axial coordinatez(v t^T + t v^T - z t t^T) andrho^2(2 v v^T - 2 z dz), with theEincolumn and the Gauss-Legendre integrals of theg != 0columns differentiated under the same quadrature.AES, WS closure.
E = sum_rec (w/2) m_a^T K(d) m_bover the WS records; the record virial of the molecular pair tensors and damped kernels (aes_pair_polynomials); the moments’ weights go to the cyclic moment integrals above.AES, Ewald closure (
LatticeAes.evaluate, at fixed moments). Real space and the remainder: record virial of each image term, withgrad^(l+1)of erfc(alpha R)/R and of 1/R and the slope of the damping. Reciprocal space: the energy is2 pi / V sum_G f(G) sum C_(l l') S_l^* S_l'with the structure factorsS_l = sum_A s_l,A exp(i G.R_A),s_0 = q,s_1 = G.d,s_2 = G.Q.G; the phasesG.Rare invariant under strain (G -> (1 + eps)^-T G), sodE/d eps_ab = -delta_ab E_rec - 2 pi / V sum_G G_a d/dG_b [f sum C S^* S]withd f/dG = -2 G f (1/(4 alpha^2) + 1/G^2)andds_1/dG = d,ds_2/dG = 2 Q G; the R^-5 term likewise withdF/dG = -pi^(3/2) / Gamma(5/2) E1(x) G / 2. The self terms are strain independent. 2-D slab term:dV = V tr(eps), the slab coordinate and the cell height scale withn.eps.n,dD_n/d eps_ab = -n_a D_b + D_n n_a n_b; the replica correction of the R^-5 term is~ 1/(A L^3)at fixedz/L, sodC/d eps = -C (1 + 2 n n^T). The potentials of the SCF and the Fock response of the Z-vector are the derivative of the same bilinear form.MFX. The kernel
g(|d|)per WS label is differentiated in|d|(molecular Sec. 4.3); its weight is the molecular one on the cyclic matrices.Coordination numbers (g-xTB, q-vSZP, EEQ_BC with its local charge, revD4):
sum_A w_A CN_Ais a lattice sum of counting functions, record virial ofw_A count'(R).Repulsion.
E = 1/2 sum Z_A Z_B f_AB(R)over image pairs; explicit part,dE/dqto the EEQ_BC adjoint,dE/dCNto the g-xTB CN.EEQ_BC. One adjoint solve
M zeta = (w, 0)of the lattice-summed bordered matrix, thenL = sum_(A,B,T) c [z_A (chi_A - chi_B - h_A q_A) + J z_A q_B]at fixedz, q(molecular Sec. 2.3 with every pair quantity an image sum;C', the crystalC_AAon the diagonal and the folded capacitance follow from this form). The bond capacitance andJ = erf(gamma R)/Rgive record virials; the widths (CN), the hardness and the electronegativity (CN and local charge) go to the two lattice CN sums. WithT = {0}this is the molecular adjoint to 1e-16.revD4. Two-body
-1/2 sum C6_AB(q) S(R) f(R)over image pairs, three-bodysum S(a) S(b) S(c) eover the image triples of the energy (S = 1 within the program’s cutoffs, hard step for"program"): record virials of each pair and of the three legs of each triple, withd(S f)/d(r^2) = S df/d(r^2) + f S'(R)/(2R)and the leg switches in the product rule;C6carries the lattice revD4 CN;dE/dq, the charge Hessian and the charge tangent of the fixed-charge derivative feed the Fock response and the Z-vector, as in the molecule.
revD4 cutoffs. With dispersion_cutoffs="program" the energy jumps
when an image pair crosses 60 bohr or an ATM leg crosses 20 bohr, and the
derivatives are those of the energy with the image lists held fixed (the
convention of the Wigner-Seitz records); the lists are rebuilt with every
energy. A raw finite-difference oracle then measures the jumps; the program
mode checks below either choose geometries without pairs within 0.05 bohr
of a cutoff or freeze the lists by lattice label. The jump sizes along an
isotropic strain scan of +-2 % (per primitive cell, 2x2x2 clusters, fixed
charges; the program’s crossing shells are degenerate in a cubic crystal):
Crystal |
two-body (60 bohr): crossings, max / median jump |
ATM (20 bohr): crossings, max / median jump |
|---|---|---|
diamond |
24, 1.9e-7 / 6.0e-8 Eh |
3, 8.2e-6 / 6.7e-6 Eh |
LiF (rock salt) |
15, 4.6e-8 / 2.8e-8 Eh |
1, 4.6e-6 Eh |
The ATM jumps dominate: a single crossing changes the energy by 1e-5 Eh per
cell and the trace of the strain derivative W by about 9 times that (R^-9), so
an equation of state sampled at 1e-3 strain steps or elastic constants from
finite differences of W can carry errors of tens of GPa where a crossing
falls between the points (diamond: 7e-5 Eh / 1e-3 strain over a 76 bohr^3
cell is 27 GPa). With "smooth" (default) the energy is C2 and the
analytic derivatives are exact; the measured agreement across what used to
be a crossing is in “Validation”. The other lattice sums (counting
functions, repulsion, capacitances, orbital images) are cut where their
terms are below 1e-12 of their contact values.
Invariances¶
Net force below 1e-15 Eh/bohr in every case (translation invariance at fixed topology).
Isolated limit: N2 in an 80 bohr box (1-D, 2-D, 3-D, dispersion on, both conventions) reproduces the molecular
gxtb_gradientto 6e-16 Eh/bohr,Wequals the atomic virialsum_A g_A R_A^Tand its antisymmetric part the molecular torque. A distorted CH4 differs by 2-3e-8 Eh/bohr at 80 bohr: its small dipole interacts with its images.Rotation: in the variational convention
Wis symmetric to 1e-14 and rotates asQ W Q^T. In the program convention the energy depends on the orientation (molecular note, Sec. 6: the doubled off-diagonal on-site exchange population term is not rotation invariant), and soWhas an antisymmetric part (4e-12 to 1.4e-7 Eh in the table below). The analyticWreproduces the finite-difference derivative of that energy component by component; in the isolated limit its antisymmetric part is the molecular torque.
Validation¶
Analytic derivatives against central differences of the cyclic energy
(SCF to energy_tolerance = 1e-13, density_tolerance = 1e-10; the
derivative state polished to a density change below 1e-11), Richardson
extrapolated from steps 1e-4 and 2e-4 (bohr for atoms, strain for W):
the largest deviation over three components of two atoms (gradient,
Eh/bohr) and over all nine strain components (W, Eh per cell). The plain
central difference at 1e-4 differs from the Richardson value by 1e-9 to
6e-8 in W (truncation), which is the floor of seccm_strain_derivative_fd
at its default step. Dispersion on everywhere except where marked; “frozen”
means the revD4 pair and triple lists were held at their reference labels in
the finite differences (see “Hard cutoffs”), otherwise the geometry was
chosen with no image pair within 0.05 bohr of a cutoff. Distorted
geometries, lattice-sum orbital closure unless marked. Scratch drivers;
the regression subset is in tests/test_seccm_gxtb_gradient*.py and
tests/test_seccm_gxtb_stress.py.
| System (cluster, atoms) | Convention | Gradient dev | |g|max | W dev | |W|max | antisym(W) |
|—|—|—|—|—|—|—|
| polyethylene 1-D (2, 12) | program | 9.4e-11 | 5.9e-2 | 1.5e-10 | 0.10 | 1.5e-8 |
| polyethylene 1-D (2, 12) | variational | 9.6e-11 | 5.9e-2 | 1.8e-10 | 0.10 | 2.0e-14 |
| polyethylene 1-D, WS closure | program | 1.4e-10 | 5.3e-2 | 1.2e-10 | 0.096 | 4.6e-8 |
| h-BN 2-D oblique (2x2, 8) | program | 7.5e-11 | 5.6e-3 | 1.0e-10 | 0.053 | 3.7e-9 |
| O2 triplet chain 1-D (2, 4; 4 unpaired), frozen | program | 8.4e-11 | 4.3e-2 | 3.6e-10 | 0.21 | 1.4e-7 |
| O2 triplet chain, frozen | variational | 2.1e-10 | 4.3e-2 | 3.0e-10 | 0.21 | 8e-15 |
| LiH triclinic 3-D (2x2x2, 16), frozen (a) | program | 1.2e-11 | 4.0e-4 | 3.4e-11 | 0.092 | 6.7e-10 |
| LiH triclinic, no dispersion (a) | variational | 6.4e-12 | 4.1e-4 | 4.7e-11 | 0.084 | 2.6e-14 |
| diamond 3-D (2x2x2, 16), frozen | program | 3.1e-11 | 1.0e-2 | 1.3e-10 | 0.047 | 2.0e-10 |
| LiF rock salt 3-D (2x2x2, 16), frozen | program | 1.3e-10 | 1.4e-4 | 2.0e-10 | 0.091 | 3.7e-12 |
| Ewald AES, smooth revD4 (b): polar LiF 3-D (1x1x1, 2) | program | 8.5e-11 | 2.9e-2 | 2.2e-10 | 0.19 | |
| Ewald AES, smooth revD4 (b): h-BN 2-D (2x2, 8) | program | 9.3e-11 | 5.5e-3 | 1.5e-10 | 0.071 | |
| Ewald AES, smooth revD4 (b): BeO wurtzite 3-D (1x1x1, 4) | variational | 2.0e-10 | 5.6e-3 | 4.0e-10 | 0.98 | |
(a) With the counting functions of the coordination numbers evaluated as
0.5 erfc(x) in the finite differences. The cell has very small
coordination numbers (g-xTB CN of H 2e-11, q-vSZP CN 6e-11: every
neighbour sits in the erf tail), and the energy code evaluates the counting
function as 0.5 (1 + erf(-x)), which cancels to an absolute error of
1e-16; through sqrt(CN) (Hubbard parameters, q-vSZP effective charge, ACP
weights) this makes the energy itself noisy at about 1e-12 Eh. With the
module’s evaluation the same comparison gives 9.5e-10 Eh/bohr and 1.8e-8 Eh
(the noise divided by the step); the analytic derivative, which uses
exp(-x^2), is unchanged. LiF shows the same effect at 1e-10 Eh/bohr.
(b) The multipolar Ewald AES and the smooth revD4 cutoffs (the defaults), no list freezing, randomly distorted (0.05 bohr) cells; the Z-vector path in the program convention. Net force below 1e-12 Eh/bohr (2-D: the slab term acts on the 1e-9 e residual charge of the cell) and 1e-16 in 3-D.
revD4 block alone (fixed charges, distorted and sheared diamond primitive cell, Richardson from 1e-4 and 2e-4) at the strains where an image pair sits exactly at 60 bohr, an ATM leg exactly at 20 bohr, and a leg at 21 bohr inside the switch: with the smooth cutoffs W agrees to 8.8e-13, 4.4e-13 and 1.5e-12 Eh and the gradient to 1.0e-12, 5.2e-13 and 6.7e-13 Eh/bohr; with the program’s hard cutoffs the same differences measure the jumps (3.0e-5, 1.8e-3 and 1.9e-5 Eh in W). E(V) along an isotropic strain scan of +-1 % (81 points, diamond, fixed charges): the program energy deviates from a degree-8 polynomial by up to 1.1e-6 Eh (second differences up to 2.3e-6, the steps) and its fixed-list trace W from the polynomial’s derivative by 1.2e-3; the smooth energy deviates by 9.3e-12 Eh and its analytic trace W by 1.3e-8 (the accuracy of the fit’s derivative). Rock-salt LiF (charges +-0.6): program 1.7e-8 Eh and 2.0e-5, smooth 2.4e-12 Eh and 1.3e-8.
Further measurements (same settings):
Fixed-density term by term (polyethylene, program convention, the Pulay and Z-vector terms excluded): H0 + ACP, E(1)-E(4), AES, MFX, OFX, repulsion and revD4 each to 1e-11 Eh/bohr and 4e-11 Eh in
W(revD4 1.8e-6 inW_xxat the first geometry, which had an image pair 0.004 bohr inside the 60 bohr cutoff; no deviation once that is avoided).Lattice building blocks against finite differences: Ewald 1-D, 2-D and 3-D on non-aligned cells, gradient and all nine strain components to 1e-11 (and
trace W = -Efor a neutral distribution); lattice CN, repulsion, EEQ_BC adjoint and revD4 with its charge tangent to 1e-10 or better on the h-BN cluster.Net force below 1e-15 Eh/bohr in every run.
Rotation (polyethylene, rotation by 0.37 rad about a general axis): in the variational convention
|W_rot - Q W Q^T| = 3.5e-15and the gradient rotates to 5e-16; in the program convention the energy changes by 1.4e-8 Eh per cell, the gradient by 4e-8 Eh/bohr andWby 3.6e-7 Eh (the orientation dependence of the program’s energy, which the analytic derivative reproduces component by component).Cell optimisation through the front door (
optimize_seccm_cell, polyethylene 2-cell cluster, dispersion on,force_tolerance = 1e-3): converged on a fresh topology in 2 macro-iterations and 15 evaluations, energy -78.577636 -> -78.601946 Eh per cell, axis 4.7942 -> 4.8151 bohr, final force 2.5e-4 Eh/bohr, stress residual 3.1e-6 Eh/bohr.Elastic constants through the front door (
seccm_elastic_constants, diamond 2x2x2, clamped ion, symmetry strains, unrelaxed reference with 15.7 GPa prestress): C11 = 1148, C12 = 191, C44 = 778 GPa, cubic pattern to 1e-12 GPa, energy second differences within 0.22 GPa of the stress derivatives, 5 evaluations, 633 s.Cost (numpy, wall time on a host with a load average of 60-90 on 18 cores, before the one-copy-per-set operator build): SCF and derivative 2 s and 9 s (polyethylene, 12 atoms), 35 s and 54 s (LiH, 16 atoms), 88 s and 168 s (diamond, 16 atoms), 144 s and 224 s (LiF). The image-batched integral contraction dominates; the Z-vector needs 9-14 GMRES iterations.
Limits¶
Numpy reference; a derivative evaluation costs one to five SCF times (above).
The program convention’s soft modes (molecular Sec. 6) apply unchanged.
Charged cells and smearing remain open (energy-side items); the multipolar Ewald AES is not implemented in 1-D.
Open questions for the paper¶
Boundary condition of the 3-D AES. The multipolar Ewald closure (default) uses the tin-foil boundary with the program’s k_n scaling of each order; the WS closure carries the shape term of atom-centred WS regions. Which boundary matches the molecular parametrisation of g-xTB is a scientific choice; tin-foil is the one consistent with the Ewald completion of E(2). The program’s isotropic Tr(Q_A Q_B)/(3 R^5) term of the quadrupole-quadrupole kernel (see the AES section) is reproduced; whether it is intended is a question for the upstream authors.
Orbital closure. The diffuse q-vSZP functions make the classic WS cyclic cluster impractical in 3-D (indefinite overlap); the Born-von Karman matrix elements fix that at the price of aliasing (Gamma-point sampling). Whether a solid-state contraction of q-vSZP, or a screened overlap, would restore the WS cyclic cluster is open.
Exchange convergence. MFX has 100 % long-range exchange; its cluster-size convergence follows the density-matrix decay. Its effect on band gaps and on small-gap systems should be quantified.
EEQ_BC in solids. The parametrisation was fitted on molecules; the periodic EEQ_BC charges of ionic solids (LiF, LiH) and their effect through the q-vSZP effective charge need validation against a reference charge model.
Occupations. T = 0 Aufbau with degenerate frontier levels in symmetric clusters; a fractional-occupation rule would extend the method.
Charged cells. The 1-D and 2-D Ewald sums need a background convention for a charged cell; the route refuses charged cells.
Dispersion cutoffs. The default smooth cutoffs keep the program’s terms and switch the images beyond off (60-70 bohr, ATM legs 20-25 bohr), so the crystal limit is that of a smoothly truncated model. The ATM sum of a dense solid is far from converged at 20 bohr (diamond: the 20-25 bohr window adds 5e-5 Eh per cell); whether a periodic g-xTB should sum the ATM term further, and add the analytic R^-6 tail of the two-body term, is a question for the parametrisation.