Taylor-mode automatic differentiation for constructing molecular rovibrational Hamiltonian operators
Andrey Yachmenev, Emil Vogt, Álvaro Fernández Corral, Yahya Saleh · 2025
Read Taylor-mode automatic differentiation for constructing molecular rovibrational Hamiltonian operators by Andrey Yachmenev, Emil Vogt, Álvaro Fernández Corral, Yahya Saleh (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-20129.txt.
Introduction
Andrey Yachmenev, Emil Vogt, Álvaro Fernández Corral, and Yahya Saleh present an automated tool for building molecule motion operators in this 2025 paper. The operators describe how molecules spin and vibrate, and they are needed to predict spectra. Building them by hand for each new molecule and frame choice is slow.
Their framework expands the energy operators as Taylor series for any molecule and coordinate system. Writing the operators as sums of products makes later calculations fast on product bases. The engine borrows automatic differentiation tools from machine learning, above all a Python library called JAX. It builds high-order expansions that are both fast and exact. The code is public, and the authors aim it at researchers who read spectra and face new molecules.
Catalog record
| CREATOR | Andrey Yachmenev, Emil Vogt, Álvaro Fernández Corral, Yahya Saleh |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 35 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2506-20129
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Taylor-mode automatic differentiation for constructing molecular rovibrational Hamiltonian operators Andrey Yachmenev, Emil Vogt, Álvaro Fernández Corral, Yahya Saleh Abstract We present an automated framework for constructing Taylor series expansions of rovibrational kinetic and potential energy operators for arbitrary molecules, internal coordinate systems, and molecular frame embedding conditions. Expressing operators in a sum-of-products form allows for computationally efficient evaluations of matrix elements in product basis sets. Our approach uses automatic differentiation tools from the Python machine learning ecosystem, particularly the JAX library, to efficiently and accurately generate high-order Taylor expansions of rovibrational operators. The implementation is available at https://github.com/robochimps/vibrojet . I Introduction Accurate calculations of molecular rovibrational spectra, especially for floppy molecules, weakly bound complexes, and highly excited states in general, are often computationally demanding. These calculations benefit significantly from the use of tailored coordinates that effectively capture the essential rovibrational motions specific to each molecule Oenen et al. 2024 ; Schneider and Rauhut 2024 ; Saleh et al. 2025 ; Vogt et al. 2025 . While several advanced generalized methodologies exist to perform such calculations Yurchenko et al. 2007 ; Mátyus et al. 2009 ; Wang and Carrington 2009 , applying them to a new molecule typically requires more than simply providing a potential energy surface (PES). It also involves defining an appropriate kinetic energy operator (KEO) based on the chosen internal coordinates and molecular frame embedding conditions. This setup process demands considerable expertise in both the theoretical foundations and practical aspects of implementation. The challenge of choosing optimal internal coordinates and frame embeddings has been the subject of ongoing research, with most recent advances focused on variational optimization of coordinate systems Zhang et al. 2024 ; Saleh et al. 2025 ; Vogt et al. 2025 . However, even after suitable coordinates are defined, constructing the PES and KEO in those coordinates, and efficiently evaluating their matrix elements in a chosen basis set remains nontrivial. The matrix elements are typically computed using multidimensional numerical integration methods, such as Gaussian quadrature, often combined with Smolyak sparse grids to mitigate the curse of dimensionality Avila and Carrington 2013 . An alternative approach, which is the focus of this study, involves expressing the rovibrational operators as sums of products of univariate functions, which significantly reduces the complexity of multidimensional integration. For example, when a direct product basis of univariate functions is used, multidimensional integrals reduce to a sum of products of one-dimensional integrals. Molecular PESs and dipole moment surfaces are commonly represented in a sum-of-products form by fitting analytic functions to electronic structure data computed on a grid of molecular geometries. For the KEO, one established approach involves using symbolic algebra to derive an analytical expression, followed by manual restructuring into a product form and hand-coded implementation Yurchenko and Mellor 2020 . This process is tedious and highly system specific, it must be repeated for every new molecule type, coordinate system, and frame embedding condition. Moreover, the embedding must be analytically expressible, which often excludes commonly used schemes like the Eckart frame due to their algebraic complexity. A more general and flexible alternative is to construct the rovibrational operators in a sum-of-products form via Taylor series expansions Yurchenko et al. 2007 ; Yachmenev and Yurchenko 2015 or least-squares fitting techniques Peláez and Meyer 2013 ; Ziegler and Rauhut 2016 . In the Taylor expansion approach, derivatives can be computed using finite-difference methods Ovsyannikov et al. 2009 or automatic differentiation (AD), particularly via forward-mode propagation of Taylor series Yachmenev and Yurchenko 2015 . These methods are well-suited for handling complex coordinate transformations and frame embeddings, including those defined implicitly by nonlinear equations (e.g., Eckart conditions), enabling fully automated construction of KEOs without manual symbolic manipulation. In this work, we introduce Vibrojet , a general Python-based framework for constructing Taylor series expansions of molecular rovibrational operators using modern AD tools. Specifically, we employ the JAX library and its jet module, which supports efficient Taylor-mode differentiation. We further employ an efficient approach for computing high-order partial derivatives by propagating families of univariate Taylor series Griewank et al. 2000 ; Walter 2012 . Compared to our previous Fortran-based implementation Yachmenev and Yurchenko 2015 , the new Python framework offers several advantages, including simpler setup for new molecules and coordinates systems, integration with a broader scientific computing ecosystem, and more accessible platform-specific optimization and parallelization. This manuscript is organized as follows. In Section II , we present a general numerical approach for constructing the KEOs of molecules. The Taylor-mode AD approach is described in Section III and details of its implementation in Section IV . Finally, Section V provides illustrative examples of Taylor series expansion for the PES and KEO of selected molecules and demonstrates their use in variational calculations of vibrational energy levels. II Numerical procedure for KEO The general form of the rovibrational KEO is given by \displaystyle\hat{T}=\sum_{\lambda,\mu=1}^{M+6}p_{\lambda}^{\dagger}G_{\lambda\mu}(\boldsymbol{\xi})p_{\mu}+U(\boldsymbol{\xi}), where p_{\lambda=1..M+6}=\{-i\hbar\partial/\partial\xi_{1} , ... , -i\hbar\partial/\partial\xi_{M} , \hat{J}_{x} , \hat{J}_{y} , \hat{J}_{z} , -i\hbar\partial/\partial X_{\text{cm}} , -i\hbar\partial/\partial Y_{\text{cm}} , -i\hbar\partial/\partial Z_{\text{cm}}\} are the momentum operators conjugate to the M vibrational coordinates \boldsymbol{\xi}=\xi_{1},\xi_{2},...\xi_{M} , three Cartesian components of the rotational angular momentum operator \mathbf{J} , and three Cartesian momentum operators of the overall translation. The mass-weighted contravariant metric tensor G_{\lambda\mu} and pseudopotential U can be computed as Sørensen 1979 ; Mátyus et al. 2009 \displaystyle G_{\lambda\mu}=[\mathbf{g}^{-1}]_{\lambda\mu}, \displaystyle g_{\lambda\mu}=\sum_{i=1}^{N}\sum_{\alpha=x,y,z}m_{i}t_{i\alpha,\lambda}t_{i\alpha,\mu}, \displaystyle U=\frac{\hbar^{2}}{32}\sum_{\lambda,\mu=1}^{M}\left[\frac{G_{\lambda\mu}}{\tilde{g}^{2}}\frac{\partial\tilde{g}}{\partial\xi_{\lambda}}\frac{\partial\tilde{g}}{\partial\xi_{\mu}}+4\frac{\partial}{\partial\xi_{\lambda}}\left(\frac{G_{\lambda\mu}}{\tilde{g}}\frac{\partial\tilde{G}}{\partial\xi_{\mu}}\right)\right], where \tilde{g}=\det(g_{\lambda\mu}) . The t_{i\alpha,\lambda} vectors are defined in terms of the Cartesian coordinates r_{i\alpha} ( \alpha=x,y,z ) of the i=1..N atoms in the molecule, as \displaystyle t_{i\alpha,\lambda} \displaystyle=\frac{\partial r_{i\alpha}}{\partial\xi_{\lambda}},~~~(\lambda=1..M), \displaystyle t_{i\alpha,M+\beta} \displaystyle=\sum_{\gamma=x,y,z}\epsilon_{\alpha\beta\gamma}r_{i\gamma},~~~(\beta=x,y,z), \displaystyle t_{i\alpha,M+3+\beta} \displaystyle=\delta_{\alpha\lambda},~~~(\beta=X_{\text{cm}},Y_{\text{cm}},Z_{\text{cm}}), for vibrational, rotational, and translational coordinates, respectively. From the equations above, it follows that the KEO can be constructed automatically, provided a coordinate transformation function is defined that maps the internal vibrational coordinates \xi_{\lambda} ( \lambda=1..M ) to the Cartesian coordinates r_{i\alpha} of the atoms \displaystyle\mathbf{r}_{i}\equiv(x_{i},y_{i},z_{i})=\mathbf{f}_{i}(\xi_{1},\xi_{2},...\xi_{M}). Defining such a transformation establishes, either implicitly or explicitly, an orientation of the Cartesian x,y,z axes relative to the molecule. This orientation may itself vary with changes of the internal coordinates. Popular choices for orientation of the molecular frame x,y,z axes include the principal axes system (PAS) and the Eckart frame. The PAS choice minimizes the off-diagonal elements in the pure rotational block of the G -matrix, whereas the Eckart frame is designed to minimize the off-diagonal elements in the rovibrational (Coriolis) part of the G -matrix. The orientation of the molecular frame can be conveniently expressed using a rotation matrix \mathbf{d}(\boldsymbol{\xi}) , which maps reference Cartesian coordinates of atoms (user-defined or derived from a Z-matrix) into the Eckart or PAS frame \displaystyle\mathbf{r}_{i}=\mathbf{d}\cdot\bar{\mathbf{r}}_{i}\equiv\mathbf{d}\cdot\mathbf{f}_{i}(\xi_{1},...,\xi_{M}). (1) The conditions defining the Eckart or PAS frames can be formulated in terms of the rotation matrix \mathbf{d} as follows \displaystyle\mathbf{u}\mathbf{d}^{T}-\mathbf{d}\mathbf{u}^{T} \displaystyle=\mathbf{0},~~~(\text{Eckart}) (2) \displaystyle[\mathbf{d}\bar{\mathbf{u}}\mathbf{d}^{T}]_{\alpha\beta} \displaystyle=0,~~~\alpha\neq\beta,~~~(\text{PAS}). (3) Here, the matrices \mathbf{u} and \bar{\mathbf{u}} are defined as \displaystyle u_{\alpha\beta} \displaystyle=\sum_{i=1}^{N}m_{i}r_{i\alpha}^{\text{(ref)}}\bar{r}_{i\beta}, \displaystyle\bar{u}_{\alpha\beta} \displaystyle=\sum_{i=1}^{N}m_{i}\bar{r}_{i\alpha}\bar{r}_{i\beta}. The Eckart conditions are defined with respect to a reference geometry, typically chosen as the equilibrium geometry r_{i\alpha}^{\text{(ref)}}=r_{i\alpha}^{\text{(eq)}} , around which the rovibrational coupling elements of the G -matrix are minimized. The frame embedding conditions can be incorporated directly into the coordinate transformation function \mathbf{f}_{i} in ( 1 ), or handled externally through generalized routines. Below, we briefly outline a numerical solution of the Eckart equations, originally presented in Yachmenev and Yurchenko 2015