Ground and excited state gradients with end-to-end differentiable semiempirical quantum chemistry
Abstract
Accurate and efficient gradients of molecular energy with respect to nuclear degrees of freedom are essential for geometry optimization and molecular dynamics, including simulations that go beyond the Born–Oppenheimer regime. A common approach involves deriving analytical formulas for new electronic structure methods, which is often conceptually difficult and requires tedious coding. Here, we implement analytical, semi-numerical, and automatic differentiation (AD)-based gradient pathways for semiempirical Hamiltonian models in the PYSEQM software package, leveraging both graphics processing unit (GPU) and central processing unit (CPU) architectures. We further extend these capabilities to excited states calculated using the configuration interaction singles and time-dependent Hartree–Fock ansätze. We benchmark wall time, peak memory usage, and accuracy across three molecular families of varying chemical complexity, including systems of up to a thousand atoms. For ground-state simulations, analytical and AD gradients achieve near-identical GPU runtimes, while semi-numerical gradients are slower on GPU but remain competitive on CPU. For excited states, both analytical and custom AD approaches using implicit differentiation show similar performance and low memory requirements, whereas gradients with full AD are memory-limited. AD gradients match analytical ones in accuracy across all tested systems, aided by a quaternion-based diatomic frame rotation for two-center quantities that ensures smooth energy surfaces. Overall, automatic differentiation emerges as a practical alternative to analytical gradients in semiempirical quantum chemistry, offering high accuracy while allowing seamless integration in AI-driven workflows and popular packages, such as PyTorch and JAX. Our results provide actionable guidance for selecting optimal gradient strategies in large-scale ground- and excited-state molecular dynamics simulations.
Article Details
Journal Info
The Journal of Chemical Physics
American Institute of Physics
Authors (6)
Vishikh Athavale
Theoretical Division, Los Alamos National Laboratory 1 , Los Alamos, New Mexico 87545,
Maksim Kulichenko
Theoretical Division, Los Alamos National Laboratory 1 , Los Alamos, New Mexico 87545,
Nikita Fedik
NVIDIA Corporation 2 , 2788 San Tomas Expressway, Santa Clara, California 95051,
Sebastian Fernandez-Alberti
Departamento de Ciencia y Tecnologia, Universidad Nacional de Quilmes/CONICET 3 , B1876BXD Bernal,
Anders M. N. Niklasson
Theoretical Division, Los Alamos National Laboratory 3 , Los Alamos, New Mexico 87545,
Sergei Tretiak
Theoretical Division, Los Alamos National Laboratory 1 , Los Alamos, New Mexico 87545,