SearcharxivSearch

arXiv subjects

Susi Lehtola

Publications and source records attributed to Susi Lehtola.

At least 19 recordsLinked to original sources

Automatic generation of exchange-correlation response kernels

Computing density-functional response properties requires contracting derivatives of the exchange--correlation (xc) energy with perturbed densities on a grid. While the xc functional's derivatives have long been available to high orders from libraries such as Libxc, the surrounding contraction layer - the chain rule that combines them with the grid-based basis-function and density data into the total xc contribution - has instead been hand-derived and hand-coded in every program, for every functional family, spin case, and property. We present libxckernel, a library that automatically generates this layer by symbolic differentiation. The xc functional's ingredients are expressed as sesquilinear forms in the density matrix, so the xc energy can be differentiated to any order while the functional derivatives remain opaque. The basis functions and the orbital coefficients may both be complex. The chain rule then produces any xc matrix element: Fock matrices, orbital Hessians, and response terms of any order. Terms sharing a pattern are collapsed for efficiency. Extensible plugins emit the expressions as NumPy Einstein sums, compiled C kernels with C++/Fortran interfaces, or host-program specific source code. libxckernel is free and open-source software under the BSD-3-Clause license, enabling rapid implementation of functionality missing from many electronic structure programs. We demonstrate it by extending Psi4 with meta-generalized gradient approximation (mGGA) response kernels for orbital stability analysis and time-dependent density-functional theory (TD-DFT), GGA and mGGA analytic nuclear Hessians, and exact quadrature grid response, and by extending GPAW with mGGA and triplet TD-DFT kernels and gradient-corrected kernels for periodic dielectric response.

physics.comp-ph

libwignernj: a reusable C/C++/Fortran/Python library for exact Wigner symbols and related coefficients

We describe libwignernj, a freely available, BSD-licensed library that evaluates Wigner 3j, 6j, and 9j symbols, Clebsch--Gordan, Racah $W$, and Fano $X$ coefficients, and Gaunt coefficients over both complex and real spherical harmonics in standards-compliant C99. libwignernj represents factorials by the vector of their signed prime-exponent decomposition - a prime-factorization technique introduced for the angular-momentum coefficients by Dodds and Wiechers (Comput. Phys. Commun. 4, 268 (1972)) and refined in a long line of subsequent work - and combines that representation with the multiword-integer Racah sum of Johansson and Forssén (SIAM J. Sci. Comput. 38, A376 (2016)), under which every intermediate quantity is an exact rational and all rounding is confined to the final floating-point conversion. Single-, double-, and long-double-precision results are correct to the last representable bit, and IEEE 754 binary128 evaluation through libquadmath and arbitrary-precision evaluation through the GNU Multiple-Precision Floating-Point Reliable (MPFR) library are optionally exposed. libwignernj has no mandatory runtime dependencies and no caller-side initialization step, making it easy to embed across the atomic, molecular, nuclear, and electromagnetic-scattering applications in which these coefficients arise. C++, CPython, and Fortran 90 bindings ship alongside the C library. Half-integer angular momenta are encoded exactly via integer $2j$ arguments throughout the application programming interface (API). CMake-package and pkg-config files ship for drop-in integration into downstream projects, and a continuous-integration (CI) pipeline runs the full test suite on Linux (shared and static), macOS, and Windows on every push.

physics.comp-ph

Real Quantum Chemistry With Complex Orbitals

We follow up our study of basis set truncation errors for atoms in magnetic fields [Åström and Lehtola, J. Phys. Chem. A, 2023, 127, 10872]. Our previous study employed an approximate real-valued model. In this work, we implement a scheme to allow the use of complex basis functions and the true, complex Hamiltonian with linear molecules in a parallel magnetic field within the usual real-basis machinery of quantum chemistry. Our method performs additional unitary transformations before and after a conventional Fock build, thus allowing the reuse of existing software methods and algorithms. We apply our approach to calculations on low-lying configurations of the atoms $Z \leq 18$ in static magnetic fields up to 0.6 $B_0$. The calculations employ the uncontracted aug-cc-pVTZ and the benchmarking quality AHGBSP3-9 Gaussian-type orbital basis sets. We compare total energies obtained with real and complex orbitals using these basis sets to fully numerical ones at the complete basis set limit. We see that the states of the real-valued Hamiltonian are superpositions of the true eigenstates that are correctly captured by the complex calculations. Our results show that the complex basis machinery is necessary for targeting states with the correct symmetry for the studied range of magnetic field strengths. The novel tool is key for future work where we aim to optimize basis sets for finite-field calculations.

physics.comp-ph

Semi-Local Exchange-Correlation Approximations in Density Functional Theory

Density functional theory has become the workhorse of modern electronic structure calculations, with wide-ranging applications in chemistry, physics, materials science, biochemistry, etc. At its heart lies the exchange-correlation functional, a quantity which exactly encapsulates the many-body effects stemming from the quantum mechanical interactions between the electrons. Yet, the exact functional is unknown, and computationally tractable approximations are therefore necessary for practical applications. Over the past six decades, hundreds of density functional approximations have been proposed with varying accuracy and computational efficiency. This review surveys the theoretical foundations of semi-local functionals, including local density approximations, generalized gradient approximations, and meta-generalized gradient approximations. We provide a comprehensive, consistently organized discussion that consolidates both historical developments and recent advances in this field. Beginning with the essentials of Kohn-Sham density functional theory, we present the construction principles of semi-local exchange-correlation functionals. Special attention is given to the physical motivations underlying functional development, the mathematical properties that guide their construction, and the practical considerations that determine their applicability across different chemical and physical systems. This work is intended to serve as both an introduction for newcomers to the field and a comprehensive reference for practitioners. By consolidating the extensive literature on semi-local functionals and providing a unified framework for their construction and application, we aim to facilitate further developments in density functional approximations and their use in tackling the diverse challenges of modern computational chemistry and condensed matter physics.

physics.chem-ph

The Python Simulations of Chemistry Framework: 10 years of an open-source quantum chemistry project

Over the past decade, the Python-based Simulations of Chemistry Framework (PySCF) has developed into a widely used open-source platform for electronic structure theory and quantum chemical method development. This article reviews the major advances since the previous overview in 2020, covering new modules and methodology, infrastructure changes, and performance benchmarks.

physics.chem-ph

Reaching precise proton affinities in non-Born-Oppenheimer calculations

An attractive way to model nuclear quantum effects is to describe select nuclei quantum mechanically at the same level as the electrons. This non-Born-Oppenheimer (non-BO) method is known by many names including the nuclear-electronic orbital (NEO) and the multicomponent method. Two basis sets are typically used for such calculations: a nuclear basis set and an electronic basis set. In this work, we investigate the convergence of non-BO proton affinities (PAs) with respect to the protonic and electronic basis sets. PAs are a sensitive measure of the proton and electron densities. We demonstrate that most protonic basis sets are sufficient for non-BO density-functional calculations of PAs, resulting in convergence to within 0.1 kcal/mol of the complete protonic basis set limit. This indicates that the truncation error is dominated by the electronic basis, and that smaller protonic basis sets could be developed. We show that non-BO calculations should use uncontracted electronic basis sets on the quantum protons. The contraction coefficients in typical electronic basis sets have been derived for point nuclear charge distributions, and uncontracting the electronic basis set on the quantized proton leads to significantly faster convergence to the electronic basis set limit. Uncontraction leads to results of one $ζ$-level higher quality with negligible additional computational cost in multiple diffuse basis set families: Jensen's polarization consistent aug-pc-X basis sets, Dunning's correlation-consistent aug-cc-pVXZ basis sets, as well as the Karlsruhe def2-XZPD basis sets. In specific, the aug-pc-3 electronic basis set already affords PAs converged beyond 0.1 kcal/mol when uncontracted on the quantum proton.

physics.chem-ph

A Reusable Library for Second-Order Orbital Optimization Using the Trust Region Method

We present a reusable, open-source software implementation of the second-order trust region algorithm in the new OpenTrustRegion library. We apply the implementation to the general-purpose optimization of molecular orbitals in various contexts within electronic-structure theory. Our permissibly licensed implementation can be included in any software package, be it free and open-source, academically licensed closed-source, or commercial. Detailing the implementation in OpenTrustRegion, we present a review of the theory behind trust region-based methods alongside various extensions. We demonstrate the robustness and efficiency of our optimization library with extensive benchmarks for self-consistent field calculations, orbital localization, as well as orbital symmetrization tasks, featuring challenging and pathological systems.

physics.chem-ph

Atomic Confinement Potentials and the Generation of Numerical Atomic Orbitals

We aim to develop novel reusable open source infrastructure [Lehtola, J. Chem. Phys. 159, 180901 (2023)] for numerical atomic orbitals (NAOs). Soft confinement potentials are typically used to force the NAO radial basis functions $ψ_{nl}(r)$ to vanish smoothly in increasing $r$ and to generate localized unoccupied states; we review such potentials and other commonly-used techniques in NAO generation as a follow-up to our recent study on atoms in hard-wall confinement [Åström and Lehtola, J. Phys. Chem. A 129, 2791 (2025)]. In addition to NAO generation, confinement potentials are also employed to simulate environmental effects in other research areas, such as studies of (i) atoms in solids, (ii) quantum dots, and (iii) high-pressure chemistry. As in our earlier work, we perform fully numerical density functional calculations with spherically averaged densities, as is usual in NAO studies. Our calculations employ the the finite element method (FEM) implemented in the HelFEM program, yielding variational energies and enabling the use of various boundary conditions. We consider four families of potentials to study the Mg and Ca atoms, which are textbook examples of extended electronic structures. We show that the resulting ground-state orbitals are surprisingly insensitive to the employed form of the confinement potential, and that the orbitals decay quickly under confinement. We study increasingly steep potentials and examine how they approach the hard-wall limit. Finally, we assess NAO basis set truncation errors for types of singular potentials that are now broadly used in the NAO literature.

physics.comp-ph

OpenOrbitalOptimizer -- a reusable open source library for self-consistent field calculations

According to the modern paradigms of software engineering, standard tasks are best accomplished by reusable open source libraries. We describe OpenOrbitalOptimizer: a reusable open source C++ library for the iterative solution of coupled self-consistent field (SCF) equations $\boldsymbol{F}_{p}^σ(\{\boldsymbol{C}_{p}^σ\})\boldsymbol{C}_{p}^σ=\boldsymbol{C}_{p}^σ\boldsymbol{E}_{p}^σ$ for an arbitrary number of particle types $p$ and symmetries. Although OpenOrbitalOptimizer is a new project, it already implements standard algorithms for solving SCF equations: Pulay's direct inversion in the iterative subspace (DIIS), energy DIIS (EDIIS), augmented DIIS (ADIIS), and the optimal damping algorithm (ODA). The library was designed as an easy way to introduce the state-of-the-art convergence accelerators in a number of legacy programs. It is easy to interface with various programs, as it only requires a function to evaluate the total energy $E$ and Fock matrices $\{\boldsymbol{F}_{p}^σ\}$ for a given set of orbitals $\{\boldsymbol{C}_{p}^σ\}$. The only assumption behind the library is that one is able to easily store Fock and orbital matrices in memory, and to diagonalize the Fock matrices in full, which is the case in the overwhelming majority of quantum chemistry applications. We exemplify the library with nuclear-electronic orbital (NEO) calculations of protonated water clusters with Gaussian-type orbital basis sets. We find that a minimal-basis protonic guess works well, and that the stepwise SCF algorithm requires less computational time than the simultaneous SCF algorithm.

physics.comp-ph

Density functional benchmark for quadruple hydrogen bonds

Hydrogen bonding is an important non-covalent interaction that plays a major role in molecular self-organization and supramolecular structures. It can be described accurately with ab initio quantum chemical wave function methods, which become computationally expensive for large molecular assemblies. Density functional theory (DFT) offers a better balance between accuracy and computational cost, and can be routinely applied to large systems. A large number of density functional approximations (DFAs) has been developed, but their accuracy depend on the application, necessitating benchmark studies to guide their selection for use in applications. Some of us have recently determined highly accurate hydrogen bonding energies of 14 quadruply hydrogen-bonded dimers by extrapolating coupled-cluster energies to the complete basis set limit as well as extrapolating electron correlation contributions with a continued-fraction approach [U. Ahmed et al, Phys. Chem. Chem. Phys., 2024, 26, 24470]. In this work, we study the reproduction of these bonding energies at the DFT level using 152 DFAs. The top ten functionals are composed of eight variants of the Berkeley functionals both with and without dispersion corrections, and two Minnesota 2011 functionals augmented with a further dispersion correction. We find the B97M-V functional with the non-local correlation functional replaced by an empirical D3BJ dispersion correction to be the best functional, while changes to the dispersion part in other Berkeley functionals lead to poorer performance in our study.

physics.chem-ph

Repulsive interatomic potentials calculated at three levels of theory

The high-energy repulsive interaction between nuclei at distances much smaller than the equilibrium bond length is the key quantity determining the nuclear stopping power and atom scattering in keV and MeV radiation events. This interaction is traditionally modeled within orbital-free density functional theory with frozen atomic electron densities, following the Ziegler-Biersack-Littmark (ZBL) model. In this work, we calculate atom pair specific repulsive interatomic potentials with the ZBL model, and compare them to two kinds of quantum chemical calculations - second-order Møller-Plesset perturbation theory in flexible Gaussian basis sets as well as density functional theory with numerical atomic orbital basis sets - which go well beyond the limitations in the ZBL model, allowing the density to relax in the calculations. We show that the repulsive interatomic potentials predicted by the two quantum chemical models agree within $\sim$ 1% for potential energies above 30 eV, while the ZBL pair-specific potentials and universal ZBL potentials differ much more from either of these calculations. We provide new pair-specific fits of the screening functions in terms of 3 exponentials to the calculations for all pairs $Z_1$-$Z_2$ for $1 \leq Z_i \leq 92$, and show that they agree within $\sim 2$% with the raw data. We use the new potentials to simulate ion implantation depth profiles in single crystalline Si and show very good agreement with experiment. However, we also show that under channeling conditions, the attractive part of the potential can affect the depth profiles. The full data sets of all the calculated interatomic potentials as well as analytic fits to the data are shared as open access.

physics.comp-ph

Coupled-cluster pairing models for radicals with strong correlations

The pairing hierarchy of perfect pairing (PP), perfect quadruples (PQ) and perfect hextuples (PH) are sparsified coupled cluster models that are exact in a pairing active space for 2, 4, and 6 electron clusters, respectively. We describe and implement three extensions for radicals. First is the trivial generalization that does not correlate radical orbitals. The second model (PQr, PHr) includes terms that entangle pair indices and radical indices such that their maximum total number is 2 for PQ and 3 for PH (like their closed-shell versions). The third family of extended radical models (PPxr, PQxr, and PHxr) include cluster amplitudes that entangle up to 1, 2, and 3 pair indices with up to 1, 2, and 3 radical indices. Notably, PPxr and PQxr are exact for (3e,3o) and (5e,5o), respectively, while still having only $O(N)$ and $O(N^{2}$) amplitudes like their parent models (for $N$ paired electrons). Orbital optimization is considered for PPxr. A series of large-scale numerical tests of these models are presented for spin gaps, and ionization energies of polyenes and polyenyl radicals, ranging in size from ethene and allyl radical up to C$_{22}$H$_{24}$ in full-valence active spaces up to (122e,122o). The xR models perform best.

physics.chem-ph

Review of the finite difference Hartree-Fock method for atoms and diatomic molecules, and its implementation in the x2dhf program

We present an extensive review of the two-dimensional finite difference Hartree--Fock (FD HF) method, and present its implementation in the newest version of X2DHF, the FD HF program for atoms and diatomic molecules. The program was originally published in Comput. Phys. Commun. in 1996, and was last revised in 2013. X2DHF can be used to obtain HF limit values of total energies and multipole moments for a wide range of diatomic molecules and their ions, using either point nuclei or a finite nuclear model. Polarizabilities ($α_{zz}$) and hyperpolarizabilities ($β_{zzz}$, $γ_{zzzz}$, ${A}_{z,zz}$, ${B}_{zz,zz}$) can also be computed by the program with the finite-field method. X2DHF has been extensively used in the literature to assess the accuracy of existing atomic basis sets and to help in developing new ones. As a new feature since the last revision, the program can now also perform Kohn-Sham density functional calculations with local and generalized gradient exchange-correlation functionals with the Libxc library of density functionals, enabling new types of studies. Furthermore, the initialization of calculations has been greatly simplified. As before, X2DHF can also perform one-particle calculations with (smooth) Coulomb, Green-Sellin-Zachor and Krammers-Henneberger potentials, while calculations with a superposition of atomic potentials have been added as a new feature. The program is easy to install from the GitHub repository and build via CMake using the x2dhfctl script that facilitates creating its single- and multiple-threaded versions, as well as building in Libxc support. Calculations can be carried out with X2DHF in double- or quadruple-precision arithmetic.

physics.comp-ph

Systematic study of confinement induced effects on atomic electronic structure

We point out that although a litany of studies have been published on atoms in hard-wall confinement, they have not been systematic or have not used robust numerical methods. We report a methodical study of atoms in hard-wall confinement employing a robust finite element method (FEM) in HelFEM that guarantees variational results and allows easily finding the numerically exact solution. Our fully numerical calculations are non-relativistic and are carried out at three levels of density functional theory with spherically averaged densities: the PW92, PBE, and r$^2$SCAN functionals. The three are in excellent agreement, confirming the physicality of our results. We systematically examine low lying configurations of the H-Xe atoms and their monocations, and investigate how the configurations - especially the ground state - behave as a function of the position of the hard-wall boundary. We consider both spin-polarized as well as spin-restricted densities, and demonstrate that spin-polarization effects are significant in open shell configurations, even though some previous studies have only considered the spin-restricted model. We demonstrate the importance of considering ground state changes for confined atoms by computing the ionization radii for the H-Xe atoms and observe significant differences to earlier studies. Confirming previous observations, we identify electron shifts on the outermost shells for a majority of the elements: valence $s$ electrons are highly unfavored under strong confinement, and the high-lying $3d$ and $4f$ orbitals become occupied in atoms of periods 2-3 and 3-4, respectively. We also comment on deficiencies of a commonly used density based estimate for the van der Waals (vdW) radius of atoms, and propose a better behaved variant in terms of the number of electrons outside the vdW radius that we expect will prove useful in future studies.

physics.atom-ph

Ensemble Generalization of the Perdew-Zunger Self-Interaction Correction: a Way Out of Multiple Minima and Symmetry Breaking

The Perdew-Zunger (PZ) self-interaction correction (SIC) is an established tool to correct unphysical behavior in density functional approximations. Yet, PZ-SIC is well-known to sometimes break molecular symmetries. An example of this is the benzene molecule, for which PZ-SIC predicts a symmetry-broken electron density and molecular geometry, since the method does not describe the two possible Kekulé structures on an even footing, leading to local minima [Lehtola et al, J. Chem. Theory Comput. 2016, 12, 3195]. PZ-SIC is often implemented with Fermi-Löwdin orbitals (FLOs), yielding the FLO-SIC method, which likewise has issues with symmetry breaking and local minima [Trepte et al, J. Chem. Phys. 2021, 155, 224109]. In this work, we propose a generalization of PZ-SIC - the ensemble PZ-SIC (E-PZ-SIC) method - which shares the asymptotic computational scaling of PZ-SIC (albeit with an additional prefactor). E-PZ-SIC is straightforwardly applicable to various molecules, merely requiring one to average the self-interaction correction over all possible Kekulé structures, in line with chemical intuition. We showcase the implementation of E-PZ-SIC with FLOs, as the resulting E-FLO-SIC method is easy to realize on top of an existing implementation of FLO-SIC. We show that E-FLO-SIC indeed eliminates symmetry breaking, reproducing a symmetric electron density and molecular geometry for benzene. The ensemble approach suggested herein could also be employed within approximate or locally scaled variants of PZ-SIC and their FLO-SIC versions.

physics.chem-ph

Importance profiles. Visualization of atomic basis set requirements

Recent developments in fully numerical methods promise interesting opportunities for new, compact atomic orbital (AO) basis sets that maximize the overlap to fully numerical reference wave functions, following the pioneering work of Richardson and coworkers from the early 1960s. Motivated by this technique, we suggest a way to visualize the importance of AO basis functions employing fully numerical wave functions computed at the complete basis set (CBS) limit: the importance of a normalized AO basis function $|α\rangle$ centered on some nucleus can be visualized by projecting $|α\rangle$ on the set of numerically represented occupied orbitals $|ψ_{i}\rangle$ as $I_{0}(α)=\sum_{i}\langleα|ψ_{i}\rangle\langleψ_{i}|α\rangle$. Choosing $α$ to be a continuous parameter describing the orbital basis, such as the exponent of a Gaussian-type orbital (GTO) or Slater-type orbital (STO) basis function, one is then able to visualize the importance of various functions. The proposed visualization $I_{0}(α)$ has the important property $0\leq I_{0}(α)\leq1$ which allows unambiguous interpretation. We also propose a straightforward generalization of the importance profile for polyatomic appliations $I(α)$, in which the importance of a test function $|α\rangle$ is measured as the increase in projection from the atomic minimal basis. We exemplify the methods with importance profiles computed for atoms from the first three rows, and for a set of chemically diverse diatomic molecules. We find that the importance profile offers a way to visualize the atomic basis set requirements for a given system in an a priori manner, provided that a fully numerical reference wave function is available.

physics.chem-ph

Revisiting Gauge-Independent Kinetic Energy Densities in Meta-GGAs and Local Hybrid Calculations of Magnetizabilities

In a recent study [J. Chem. Theory Comput. 2021, 17, 1457-1468], some of us examined the accuracy of magnetizabilities calculated with density functionals representing the local density approximation (LDA), generalized gradient approximation (GGA), meta-GGA (mGGA) as well as global hybrid (GH) and range-separated (RS) hybrid functionals by assessment against accurate reference values obtained with coupled-cluster theory with singles, doubles and perturbative triples [CCSD(T)]. Our study was later extended to local-hybrid (LH) functionals by Holzer et al. [J. Chem. Theory Comput. 2021, 17, 2928-2947]; in this work, we examine a larger selection of LH functionals, also including range-separated LH (RSLH) functionals and strong-correlation LH (scLH) functionals. Holzer et al also studied the importance of the physically correct handling of the magnetic gauge dependence of the kinetic energy density $(τ)$ in mGGA calculations by comparing the Maximoff--Scuseria formulation of $τ$ used in our aforementioned study to the more physical current-density extension derived by Dobson. In this work, we also revisit this comparison with a larger selection of mGGA functionals. We find that the newly tested LH, RSLH and scLH functionals outperform all the functionals considered in the previous studies. The various LH functionals afford the seven lowest mean absolute errors, while also showing remarkably small standard deviations and mean errors. Most strikingly, the best two functionals are scLHs that also perform remarkably well in cases with significant multiconfigurational character such as the ozone molecule, which is traditionally excluded from the statistical error evaluation due to its large errors with common density functionals.

physics.chem-ph

A call to arms: making the case for more reusable libraries

The traditional foundation of science lies on the cornerstones of theory and experiment. Theory is used to explain experiment, which in turn guides the development of theory. Since the advent of computers and the development of computational algorithms, computation has risen as the third cornerstone of science, joining theory and experiment on an equal footing. Computation has become an essential part of modern science, amending experiment by enabling accurate comparison of complicated theories to sophisticated experiments, as well as guiding by triage both the design and targets of experiments and the development of novel theories and computational methods. Like experiment, computation relies on continued investment in infrastructure: it requires both hardware (the physical computer on which the calculation is run) as well as software (the source code of the programs that performs the wanted simulations). In this Perspective, I discuss present-day challenges on the software side in computational chemistry, which arise from the fast-paced development of algorithms, programming models, as well as hardware. I argue that many of these challenges could be solved with reusable open source libraries, which are a public good, enhance the reproducibility of science, and accelerate the development and availability of state-of-the-art methods and improved software.

physics.comp-ph