Design: analytic nuclear gradient of molecular g-xTB¶
Status: implemented as a numpy reference for molecules, closed and open
shell, both Fock conventions of the SCF driver, with and without the revD4
dispersion: python/vibeqc/semiempirical/methods/gxtb_gradient.py and its
helpers gxtb_gradient_terms.py, gxtb_gradient_integrals.py,
gxtb_gradient_eeq.py, gxtb_gradient_dispersion.py. Experimental, like the
energy. Tests: tests/test_gxtb_gradient.py (fast) and
tests/test_gxtb_gradient_fd.py (finite-difference table, slow).
The method is g-xTB (T. Froitzheim, M. Mueller, A. Hansen, S. Grimme, ChemRxiv 2025, doi:10.26434/chemrxiv-2025-bjxvt; “M n” main text, “S n” SI equations) in the reading of the upstream v1.1.0 program (program conventions). The SI gives the Lagrangian frame (S 23, S 24) and the gradients of the coordination number, the repulsion, H0 and the scaled overlap (S 39-48, S 57-61, S 68-71). It defers the basis response, ACP, first to fourth order, AES, spin, MFX, OFX and revD4 to “a future version”; the program v1.1.0 itself has only numerical gradients. Everything below that is not one of those SI equations is derived here.
1. The energy as a function of the geometry¶
Atomic units; R are the nuclear positions, P_s (s = alpha, beta) the
spin densities in the q-vSZP AO basis, P = P_a + P_b. The driver
(gxtb.GxtbSystem.evaluate) computes
E = E_incr + E_rep + Tr((H0 + H_ACP) P) + E1 + E2 + E3 + E4 + E_AES
+ E_MFX + E_OFX + E_spin + E_disp
and every density-dependent term is a function of the spin densities and of these geometry-dependent objects only:
object |
where it enters |
|---|---|
SCF overlap |
Mulliken charges of E1-E4, AES and revD4, MFX, OFX, spin |
moment integrals |
AES dipoles and quadrupoles |
H0 (H0 basis overlap, frame projectors, levels, distance polynomial) |
|
ACP projector overlap |
|
distance kernels (gamma, tau, AES pair tensors, MFX kernel) |
E1-E3, AES, MFX |
g-xTB CN ( |
Hubbard and first-order scaling, H0 levels, ACP weights, repulsion |
q-vSZP CN and EEQ_BC charges q |
|
revD4 CN |
dispersion |
The fixed-density nuclear gradient of a term is therefore linear in its
partial derivatives with respect to these objects. The code collects them as
weights (GradientWeights: on S, D, M2, on the core Hamiltonian, on the
three charge/CN models, and an already resolved explicit gradient) and
contracts the sum of all weights with the object derivatives once
(GradientContext.backpropagate, reverse mode). The same contraction serves
the energy, the Pulay term and the Z-vector terms, which only add weights.
Gradient sign: gradient[A, :] = dE/dR_A (Eh/bohr).
2. Integrals and their derivatives¶
2.1 Overlap and moments¶
All integrals are evaluated analytically in gxtb_gradient_integrals.py
with the Obara-Saika recurrence for one-dimensional Cartesian overlaps
(S. Obara, A. Saika, J. Chem. Phys. 84, 3963 (1986),
doi:10.1063/1.450106):
S_(i+1)j = X_PA S_ij + (i S_(i-1)j + j S_i(j-1)) / 2p
S_i(j+1) = X_PB S_ij + (i S_(i-1)j + j S_i(j-1)) / 2p
S_00 = sqrt(pi/p) exp(-ab/p X_AB^2)
Moments about the bra centre A raise the bra power,
<i|(x - A_x)^e|j> = S_(i+e)j, soD^AandM2^Aneed no extra recursion.Ket-centre derivative of a primitive:
d/dB_x x_B^j e^(-b x_B^2) = 2b x_B^(j+1) - j x_B^(j-1).Bra-centre derivative by translational invariance,
d/dA = -d/dB. For the moments this holds because their origin is the bra atom and moves with it. One-centre blocks have no centre derivative.Spherical functions are
sqrt(4 pi/(2l+1)) r^l Y_lmwith the real harmonics ofgxtb_h0.real_solid_harmonics(vibe-qc’s order and signs); the Cartesian-to-spherical matrix is fitted once per l.
The values agree with vibe-qc’s libint overlaps (SCF basis, H0 basis, the
ACP two-basis overlap) and with gxtb_aes.aes_integrals to 1e-14.
2.2 Contraction-coefficient response¶
A q-vSZP shell of atom C is phi = n sum_i c_i(q_eff,C) N_l(zeta_i) g_i with
c = c0 + c1 q_eff and the renormalisation n = (c^T T c)^(-1/2)
(gxtb_basis). Its derivative dd_i/dq_eff = n c1_i - n^3 c_i (c^T T c1) is
stored with the basis (dlibint_coefficients). For an integral class X with
weight W,
dE/dq_eff,C = sum_mn W_mn [X(d phi_m, phi_n) delta_(C, atom m)
+ X(phi_m, d phi_n) delta_(C, atom n)]
which the integral routine returns per atom together with the centre gradient. The chain to the geometry is S 28:
q_eff,A = q_A - b q_A^2 + a sqrt(CN_A) + c CN_A q_A
dq_eff/dq = 1 - 2 b q + c CN, dq_eff/dCN = a / (2 sqrt CN) + c q
with q the EEQ_BC charges and CN the q-vSZP coordination number. The H0
basis (scaled exponents) has its own effective charge
q'_eff = w0 (q - b q^2) + w2 a sqrt(CN) + w3 c CN q
(gxtb_h0.h0_effective_charges), differentiated the same way. Both feed the
same two adjoint vectors w_q, w_CNq.
At CN = 0 (an atom without neighbours) the derivative of sqrt(CN) is
taken as zero, as in gxtb_basis and gxtb_repulsion: such an atom has no
CN gradient.
2.3 EEQ_BC charges: one adjoint solve¶
The EEQ_BC charges solve M y = r with y = (q, lambda),
r = (C chi, Q) and the symmetric bordered matrix
M = [[1 + C o J, 1], [1^T, 0]] (gxtb_eeqbc; o the elementwise product).
Every use of the charges in the energy contracts dq/dR with an accumulated
w = dE/dq (basis, H0 basis, repulsion). Instead of 3N forward solves,
w . dq/dR = zeta . (dr/dR - dM/dR y), M zeta = (w, 0)
(gxtb_gradient_eeq.eeqbc_adjoint_gradient, one solve). Written out,
zeta . dr - zeta . dM y
= sum_(A != B) dc_AB (X_AA - X_AB) capacitance, X_AB = zeta_A (chi_B - J_AB q_B)
+ sum_B (C^T zeta)_B dchi_B electronegativity
- sum_AB zeta_A C_AB q_B dJ_AB Coulomb matrix,
with dc_AB the derivative of the bond capacitance in R_AB, dchi through
the EEQ_BC CN and local charge, and dJ through R_AB (off-diagonal), the
Gaussian widths (CN) and the local-charge hardness (diagonal). The result
equals the contraction of the module’s forward derivative dqdr to 1e-16.
2.4 Coordination numbers¶
All four CN families share the erf counting function
(gxtb_cn.coordination_numbers) whose derivative tensors
dCN_A/dR_B exist; adjoint weights are contracted with them directly
(S 48 for the g-xTB CN).
3. Core Hamiltonian¶
3.1 H0 (S 63-71, program reading)¶
For mu on atom A, nu on B != A,
H_mu nu = kappa_mu nu (h_mu + h_nu) pi_mu pi_nu S~_mu nu,
kappa = (K_l + K_l')/4, h = -(h_l - k^CN_l CN_A), pi_mu = 1 + k^shp_A F_l R_AB/Rc_AB
and H_mu mu = h_mu. With the density weight W (symmetric),
dE/dS~_mu nu = W kappa (h + h) pi pion the off-atom blocks,dE/dh_k = W_kk + 2 sum_(nu off atom) W_k nu kappa pi pi S~_k nu, thendh/dCN_A = k^CN_l(weights on the g-xTB CN),the polynomial:
dE/dR_AB = sum_(mu on A, nu on B) W kappa (h + h) S~ (k^shp_A F_mu pi_nu + pi_mu k^shp_B F_nu) / Rc_AB.
3.2 Scaled overlap and frame projectors (S 29-46)¶
S~ = sum_k f_k Pi^k_i S Pi^k_j per off-atom shell-pair block (l <= 2;
f blocks unscaled), with the projectors onto |m| = k of the bond frame.
The SI differentiates the rotation matrices and treats the z axis
separately (S 39-46). The implementation uses a frame-free form instead:
Pi^k is the spectral projector of M(u) = (u.L)^2 = -(u.A)^2
(u the unit bond vector, A_c the real antisymmetric generators of
rotations in vibe-qc’s real-harmonic basis, eigenvalues k^2),
Pi^k = prod_(j != k) (M - j^2)/(k^2 - j^2),
dPi^k/du_c = sum over the factors with M replaced by dM/du_c = -(A_c (u.A) + (u.A) A_c)
and dE/dR_B = (1 - u u^T)/R_AB dE/du = -dE/dR_A. No special axis exists.
The projectors equal gxtb_h0.diatomic_frame_projectors to 1e-15. The
weight on the plain H0-basis overlap is sum_k f_k Pi^k_i W~ Pi^k_j, which
goes through Sec. 2.1-2.2 with the H0 basis.
3.3 ACP (M 22-24, program reading)¶
H_ACP = S_P w S_P^T with w_p = c_p (1 + k^ACP sqrt(CN_A)):
dE/dS_P = 2 W S_P diag(w) (two-basis overlap, coefficient response on the
SCF side only) and dE/dw_p = (S_P^T W S_P)_pp, then
dw/dCN = c k^ACP/(2 sqrt CN).
4. Two-electron-like terms at fixed density¶
Notation: p_l = sum_(mu in l) (P S)_mu mu Mulliken shell populations,
q_l = n^ref_l - p_l, q_A = sum_(l in A) q_l. For any energy that depends
on S only through Mulliken populations with potential v_l = dE/dq_l, the
weight on S is W^S_mu nu = -1/2 (v_mu + v_nu) P_mu nu (by AO, symmetrised).
4.1 First to fourth order (M 25-40, S 82-144)¶
Kernel adjoints at fixed charges (CoulombModel.adjoints):
dE/dgamma_ij = 1/2 q_i q_j - [i, j on different atoms] q_i drho_j
dE/dtau_ij = 1/3 (q_A(i) Gamma_A(i) q_i) q_j
dE/dmu_l = q_l f(q_A(l))
and the kernels’ derivatives (shell i on A, j on B):
gamma = 1/(R + e^(-k2x R)/eta): dgamma/dR = -gamma^2 (1 - k2x e^(-k2x R)/eta),
dgamma/deta = gamma^2 e^(-k2x R)/eta^2
eta_ij = 2/(1/U_i + 1/U_j): deta_ij/dU_i = eta_ij^2/(2 U_i^2)
U_l = u_l G (1 + k2U sqrt CN): dU/dCN = u G k2U/(2 sqrt CN)
tau (A != B) = (k3 x - k3x k3 x^2/2) e^(-k3x x), x = R/eta:
dtau/dx = (k3 - k3x k3 x) e^(-k3x x) - k3x tau
tau (A = B) = -gamma^2/2 (enters through gamma)
mu_l = mu0_l (1 + k1 sqrt CN): dmu/dCN = mu0 k1/(2 sqrt CN)
E4 has no geometry dependence beyond the populations (S 144). The same
module provides the potential and the charge Hessian-vector product needed
by the Z-vector (Sec. 5), with
f''(q) = k_dis 2 k_x/sqrt(pi) (-2 k_x^2) [(q - k_s) e^(-k_x^2 (q-k_s)^2) + (q + k_s) e^(-k_x^2 (q+k_s)^2)].
4.2 Anisotropic electrostatics (M 32, 33, S 108-117)¶
E = sum_(A > B) m_A^T K_AB(r) m_B, m = (q, d, Q),
d_A = -sum_(mu in A, nu) P D^A, Q_A = -sum P (3/2 M2^A - 1/2 tr M2^A).
With the potentials V = dE/dm (all five parts):
weight on S from the charges:
-1/2 (Vq_A(mu) + Vq_A(nu)) P_mu nu,on
D^A_x:-Vd_A,x P_mu nu(mu on A),on
M2^A_ab:-P_mu nu (3/2 VQ_A,ab - 1/2 delta_ab tr VQ_A),explicit:
sum_(A>B) m_A^T dK_AB/dr m_BwithK = sum_n f_n(R) Poly_n(r),f_n = k_n/2 [1 - erf(-s_n (R - R0))]/R^n,df_n/dR = k_n [s_n/sqrt(pi) e^(-s_n^2 (R-R0)^2)/R^n - n/2 (1 - erf(-s_n(R-R0)))/R^(n+1)]and the analytic derivatives of the polynomial pair tensors of the five parts (aes_pair_polynomials; checked againstgxtb_aes._pair_matrix).
4.3 Mulliken-approximated exchange (M 41, 42, S 146-153)¶
E_x = -1/4 sum_s sum_mn g_mn [(P S)_mn (S P)_mn + P_mn (S P S)_mn]:
dE/dS = -1/4 sum_s sym[P (g o SP) + (g o PS) P + (g o P)(SP) + (PS)(g o P)]
dE/dg_mn = -1/4 sum_s [(PS)_mn (SP)_mn + P_mn (SPS)_mn]
and g = (a + (1-a) erf(w R)) / (R + e^(-kR)/(eta c)), k = k1 + k2 R0,
dg/dR = (1-a) 2w/sqrt(pi) e^(-w^2 R^2) / den - num (1 - k e^(-kR)/(eta c)) / den^2.
4.4 On-site exchange (M 43, S 154-159)¶
E_OFX depends on S only through the dual density P~ = (PS + SP)/2 per
spin: with G = dE/dP~ (-2 L_kl P~_kl off the diagonal on one atom, the
population part y = Y d, d_m = P~_mm, on the diagonal) the weight is
W^S = 1/2 (P G + G P).
4.5 Spin polarisation (M 34, 35)¶
m_l = p^a_l - p^b_l, w_l = dE/dm_l: W^S = 1/2 (w_mu + w_nu)(P_a - P_b).
4.6 Repulsion and increments¶
The repulsion module returns its explicit gradient, dE/dq and dE/dCN
(S 57-61); the charge and CN parts are added to the adjoint vectors so that
the single EEQ_BC adjoint solve (Sec. 2.3) covers all charge users. The
increments are constant.
4.7 revD4 dispersion (M 44, S 161-175)¶
The two-body part depends on the self-consistent Mulliken charges
q_A = Z^val_A - p_A; gxtb_dispersion provides the fixed-charge gradient
(two- and three-body, with the revD4 CN) and dE/dq, which give the weights
(explicit; S weight as for any Mulliken potential). The Z-vector also needs
the charge Hessian and the charge tangent of the fixed-charge gradient
(gxtb_gradient_dispersion): per pair
E_AB = -f_AB C6_AB, C6_AB = (W_A z_A)^T C6ref (W_B z_B),
d2E/dq_A^2 = -f (W_A z_A'')^T C6ref (W_B z_B),
d2E/dq_A dq_B = -f (W_A z_A')^T C6ref (W_B z_B'),
z'' = T''/T(q_ref), T'' = -2 b c^2 sech^2(c q + d) tanh(c q + d),
and the tangent of the gradient replaces C6 by its charge differential and
dC6/dCN_A by (dW_A z_A')^T C6ref (W_B z_B) dq_A + (dW_A z_A)^T C6ref (W_B z_B') dq_B.
The three-body part is charge independent.
5. Orbital response¶
5.1 Variational convention¶
With fock_convention="variational" the SCF Fock matrix is
F_s = F^E_s = dE/dP_s. The orbitals satisfy C^T S C = 1 and
F C = S C eps, so (S 23)
dE/dR = dE/dR|_P - sum_s <P_s F^E_s P_s, dS/dR>,
P_s F^E_s P_s = C_o eps_o C_o^T being the energy-weighted density. dS/dR
is the total derivative, including the contraction response of Sec. 2.2.
5.2 Program convention: derivation¶
The program’s Fock matrix F^prog_s differs from F^E_s: it omits the
dipole-quadrupole and quadrupole-quadrupole AES potentials and doubles the
on-site exchange population part off the diagonal
(gxtb_exchange.ofx_fock). The SCF solves F^prog C = S C eps, so the
converged density does not make E stationary and the orbital response is
needed.
Per spin, perturb the orbitals as dC = C(-1/2 S^R + kappa) with
S^R = C^T (dS/dR) C and kappa antisymmetric. Occupied-occupied and
virtual-virtual rotations do not change P. With X_ai = kappa_ai - 1/2 S^R_ai,
dP = -C_o S^R_oo C_o^T + D(X), D(X) = C_v X C_o^T + C_o X^T C_v^T,
dE/dR = dE/dR|_P - sum_s <C_o F^E_oo C_o^T, dS> + 2 sum_s F^E_vo . X.
X follows from differentiating the SCF condition
(C_v^T F^prog C_o)_ai = 0 (with C^T F^prog C = eps):
(eps_a - eps_i) X_ai + [C_v^T L(D(X)) C_o]_ai
= eps_i S^R_ai - [C_v^T dF^prog/dR|_P C_o]_ai + [C_v^T L(P S' P) C_o]_ai,
i.e. A X = b, with L_st = dF^prog_s/dP_t the linear response of the
program Fock matrix to the density (both spins coupled) and
P S' P = C_o S^R_oo C_o^T = P_s dS P_s. Instead of one solve per
coordinate, solve once
A^T Z = 2 F^E_vo, (A^T Z)_s = (eps_a - eps_i) o Z_s + C_v^T [L^T(D(Z))]_s C_o,
so 2 F^E . X = Z . b. With T_s = 1/2 D(Z_s) (symmetric) the final
gradient is
dE/dR = dE/dR|_P
- sum_s <P_s F^E_s P_s, dS>
+ sum_s <sym(C_v Z_s eps_o C_o^T), dS>
+ sum_s <P_s [L^T(T)]_s P_s, dS>
- d/dR sum_s <F^prog_s(P, R), T_s>|_P .
The derivation holds for closed and open shells; the restricted closed-shell
SCF is the case P_a = P_b, solved in the same two-spin form
(Z_a = Z_b).
5.3 The pieces of the Z-vector terms¶
L and L^T.
F^prog = F^E + Delta F,Delta F = -F^E[E_dQ + E_QQ] + Delta F_OFX. The Hessian parts are symmetric; onlyDelta F_OFX = 1/2 (y_k + y_l) S_kl(k != l, all AO pairs,y = Y d,d_m = (P S)_mm) is not. Its adjoint isDelta F_OFX^T[T] = 1/2 (u_a + u_b) S_abwithu = Y^T r,r_k = sum_(l != k) T_kl S_kl. The response of the Coulomb part uses the analytic charge Hessian of Sec. 4.1, the revD4 part the one of Sec. 4.7; every other part of the Fock matrix is linear in the density, and its response is the Fock builder applied to the density change (gxtb_gradient_terms.fock_response).The fixed-density derivative of
<F^prog, T>. Mixed partial derivatives commute, so for theF^Epartd/dR <F^E(P), T>|_P = d/dt [dE/dR|_(P + tT)]: the tangent of the energy weights along T. All terms except E1-E4 and revD4 are at most quadratic in P, so their tangent is the exact polarisation identity[w(P + T) - w(P - T)]/2(an algebraic identity, not a finite difference); E1-E4 and revD4 have analytic tangents (CoulombModel.adjoints(q, dq),hessian_vector,DispersionResponse.evaluate(q, dq)). The departure contributes the negative tangent of the dQ and QQ weights and, for OFX,d/dS <Delta F_OFX, T> = y_a T_ab (a != b) + u_b P_ab.All these are weights again and go through the one contraction of Sec. 1.
5.4 Cost¶
The linear system has n_occ x n_virt unknowns per spin. It is solved with
GMRES (scipy), preconditioned by 1/(eps_a - eps_i), to a relative
residual of 1e-12. Each iteration costs one Fock-response build
(O(n_AO^3) matrix products plus the AES pair loop), about the cost of one
SCF iteration; 4 to 15 iterations were needed for the molecules of Sec. 7.
If GMRES stalls (a near-singular A, Sec. 6) and the system is small, A is
built column by column and solved with a pseudo-inverse.
The right-hand side and the final terms add one response build and two
tangent-weight evaluations. Measured wall time of the whole program-convention
gradient is 0.9-1.4x that of the variational one (0.6-4 s per gradient for
the molecules of Sec. 7 on a heavily loaded machine, numpy reference code). The memory is
dominated by the integral derivative arrays (10 x 3 x n_AO^2 for the moment
derivatives).
6. Invariances¶
Translation. Exact in both conventions (the net force is below 1e-15 Eh/bohr in every case).
Rotation. Exact for the variational convention. The program’s on-site exchange Fock matrix doubles the population part only off the diagonal in the AO basis; this is not invariant under rotations of the p, d and f functions of a shell. The program-convention SCF density, and with it the energy, therefore depends on the orientation of the molecule; the analytic gradient reproduces this (it agrees with finite differences), and the net torque is not zero (1e-11 to 1e-6 Eh in the table). This is a property of the program’s energy, not of the gradient.
Degenerate open shells. For a symmetric open shell with a partly filled degenerate level (OH, X 2Pi) the variational energy is invariant under rotations of the occupied pi orbital about the axis; A then has a zero mode whose direction is orthogonal to the right-hand side (
F^E_vo . X_theta = dE/dtheta = 0), so the singular system is consistent and GMRES returns a solution. The SCF density along that mode is not determined, which limits how tightly the driver converges it (Sec. 7). In the program convention the mode is only nearly soft (an eigenvalue of A of 2.8e-10 Eh for OH): plain Fock iterations then drift by 1e-9 per iteration without converging, so the gradient driver finishes the SCF with Newton steps (-A^{-1} rwith the same response operator, the near-null mode handled by a pseudo-inverse with relative cutoff 1e-7). The derivative of the program energy along R then depends on the ratio of two quantities at noise level (the energy slope along the mode and its eigenvalue) and is determined to about 1e-7 Eh/bohr only (Sec. 7, note c).
7. Validation¶
Analytic gradient against central finite differences of
gxtb_single_point energies, Richardson-extrapolated from steps
h = 2e-3 and 4e-3 bohr ((4 D(h) - D(2h))/3), with the SCF thresholds
energy_threshold = 1e-13, density_threshold = 1e-11 (unless stated).
The analytic gradient uses the driver’s SCF (energy_threshold = 1e-12,
density_threshold = 1e-9) polished to a density change below 1e-11.
Maximum absolute deviation over all 3N components, Eh/bohr; |g|max the
largest gradient component; torque the largest component of
sum_A (R_A - R_c) x g_A. Geometries are distorted from equilibrium
(the scripts are in the test file). Without dispersion unless marked.
| molecule | charge, unpaired | convention | max dev | |g|max | torque | Z-vector iterations |
|—|—|—|—|—|—|—|
| H2O | 0, 0 | variational | 4.3e-12 | 6.3e-2 | 1.5e-13 | - |
| H2O | 0, 0 | program | 4.7e-12 | 6.3e-2 | 4.3e-7 | 8 |
| H2O + revD4 | 0, 0 | variational | 8.0e-12 | 6.3e-2 | 1.4e-13 | - |
| H2O + revD4 | 0, 0 | program | 5.1e-12 | 6.3e-2 | 4.4e-7 | 8 |
| NH3 | 0, 0 | variational | 2.9e-12 | 1.5e-2 | 3.2e-13 | - |
| NH3 | 0, 0 | program | 4.0e-12 | 1.5e-2 | 1.5e-7 | 9 |
| CH4 | 0, 0 | variational | 2.4e-12 | 2.9e-2 | 1.2e-13 | - |
| CH4 | 0, 0 | program | 3.0e-12 | 2.9e-2 | 4.2e-11 | 9 |
| formamide | 0, 0 | variational | 1.6e-11 | 1.2e-2 | 2.2e-12 | - |
| formamide | 0, 0 | program | 1.5e-11 | 1.2e-2 | 1.4e-6 | 15 |
| formamide + revD4 | 0, 0 | variational | 1.6e-11 | 1.2e-2 | 2.3e-12 | - |
| formamide + revD4 | 0, 0 | program | 2.1e-11 | 1.2e-2 | 1.4e-6 | 15 |
| LiF | 0, 0 | variational | 2.6e-12 | 4.7e-3 | 1e-17 | - |
| LiF | 0, 0 | program | 4.4e-12 | 4.7e-3 | 2.1e-9 | 9 |
| SiH4 | 0, 0 | variational | 2.2e-11 | 7.1e-3 | 5.1e-14 | - |
| SiH4 | 0, 0 | program | 2.5e-11 | 7.1e-3 | 1.9e-10 | 11 |
| H2S | 0, 0 | variational | 2.2e-11 | 1.1e-2 | 4.8e-13 | - |
| H2S | 0, 0 | program | 2.3e-11 | 1.1e-2 | 1.2e-7 | 12 |
| HBr | 0, 0 | variational | 1.0e-10 | 1.2e-2 | 3.5e-17 | - |
| HBr | 0, 0 | program | 1.5e-10 | 1.2e-2 | 2.3e-7 | 9 |
| CuH | 0, 0 | variational | 1.0e-11 | 1.1e-2 | 3.4e-18 | - |
| CuH | 0, 0 | program | 4.1e-11 | 1.1e-2 | 5.5e-8 | 8 |
| CuH + revD4 | 0, 0 | variational | 8.9e-11 | 1.0e-2 | 2.0e-17 | - |
| CuH + revD4 | 0, 0 | program | 7.3e-11 | 1.0e-2 | 5.4e-8 | 8 |
| OH- | -1, 0 | variational | 6.5e-12 | 6.8e-3 | 1.3e-16 | - |
| OH- | -1, 0 | program | 8.9e-12 | 6.8e-3 | 2.5e-7 | 4 |
| H3O+ | +1, 0 | variational | 9.2e-12 | 2.0e-2 | 7.5e-14 | - |
| H3O+ | +1, 0 | program | 8.3e-12 | 2.0e-2 | 3.2e-8 | 9 |
| CH3 | 0, 1 | variational | 4.3e-12 | 7.9e-3 | 2.5e-16 | - |
| CH3 | 0, 1 | program | 1.0e-9 (a) | 7.9e-3 | 2.1e-7 | 13 |
| CH3 + revD4 | 0, 1 | variational | 6.2e-12 | 7.9e-3 | 1.5e-16 | - |
| CH3 + revD4 | 0, 1 | program | 8.6e-10 (a) | 7.9e-3 | 2.1e-7 | 13 |
| O2 | 0, 2 | variational | 5.5e-12 | 4.2e-2 | 1.9e-16 | - |
| O2 | 0, 2 | program | 1.4e-11 | 4.2e-2 | 1.1e-7 | 7 |
| OH | 0, 1 | variational | 9.7e-10 (b) | 1.0e-2 | 1.7e-16 | - |
| OH | 0, 1 | program | 5.1e-7 (c) | 1.0e-2 | 1.9e-7 | 10 |
(a) Limited by the driver’s energies: the program-convention energy is not stationary in the density, and the open-shell DIIS reaches the density threshold of 1e-11 only after 100-250 iterations with ~1e-11 Eh of energy noise left. Against energies of fully converged densities (the gradient driver’s polished SCF, same geometries) all 12 components of CH3 agree to 4e-12 or better.
(b) OH has a partly filled pi shell. The driver’s DIIS does not converge the
density along the pi rotation about the axis (its rms density change stays
at ~5e-4); the reference energies are converged by the energy criterion only
(energy_threshold = 1e-12), which gives the 1e-9 floor. The variational
energy is flat along that rotation, so the gradient is well defined.
(c) Not met; see Sec. 6. The program convention of OH is ill-conditioned: the orbital Hessian A of its SCF has one eigenvalue of 2.8e-10 Eh (the next is 0.12 Eh), the pi orientation. The driver’s energies differ from those of Newton-converged densities by up to 2e-9 Eh, which accounts for the 5e-7 deviation against them; against energies of Newton-converged densities the deviation is 1e-8 to 7e-8 (three components checked), and solving the Z-vector equations with that mode projected out changes the gradient by up to 1.5e-8. At this level the gradient of the program-convention energy of OH is not determined by the SCF; the variational convention has no such problem.
The noise floor of the finite differences: the plain central difference at h = 2e-3 differs from the Richardson value by 3e-8 to 2e-6 (truncation); SCF energies converged to ~1e-13 Eh give a noise of ~1e-10 Eh/bohr in the extrapolated derivative. The deviations above are at or below that floor except where stated.
8. Limits and open points¶
The gradient is that of the energy at the SCF density; the driver’s thresholds and the polishing tolerance (
density_tolerance, default 1e-11 max-abs change) set its accuracy.The AES interaction is cut at 200 bohr and revD4 at its cutoffs; the energy is discontinuous there, and the gradient is that of the cut energy.
At CN = 0 the square-root derivatives are taken as zero (Sec. 2.2).
Periodic systems and the stress are not covered.