FSIM: A Pedagogical and Extensible HPC Framework for the Hartree–Fock Method

Mario Hernández Vera · 2025

Read FSIM: A Pedagogical and Extensible HPC Framework for the Hartree–Fock Method by Mario Hernández Vera (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-2510-24968.txt.

Introduction

Mario Hernandez Vera, the sole author, built FSIM, a teach first code frame for the Hartree-Fock method in quantum chem work. That method and its core sums are a hub of how molecule math is done, yet big pro codes are hard for students to pick apart. FSIM is a small, clear take meant to be read as much as run.

Written in an object based style in C++, the code stresses neat parts and plain form. It covers the known McMurchie and Davidson scheme for the core sums. Shared and spread run modes are both laid out for large machines. Small class tasks point to ways to speed the code and test its growth.

Catalog record

CREATORMario Hernández Vera
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE74 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2510-24968

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

FSIM: A Pedagogical and Extensible HPC Framework for the Hartree–Fock Method Mario Hernández Vera Abstract Efficient computation of molecular integrals and Hartree–Fock energy remains a central topic in quantum-chemistry algorithm development. Although many sophisticated open-source packages are available, understanding their implementations from first principles can be difficult for students and developers alike. In this work, we present a concise overview and an extensible pedagogical framework that implement the Hartree–Fock method and the McMurchie-Davidson scheme for molecular integral evaluation. The implementation follows an object-oriented design in C++, emphasizing clarity and modularity. We also discuss strategies for parallel execution, including distributed computing with MPI and shared-memory parallelization with OpenMP. Beyond presenting a working reference, this work establishes a learning platform for further exploration, including suggested mini-projects for algorithmic optimization and HPC scalability. The accompanying open-source library, FSIM, described in this work, serves as a compact resource for teaching and research in computational chemistry and high-performance computing. 1 Introduction The Hartree–Fock (HF) method remains one of the cornerstones of quantum chemistry Helgaker2000 . Together with the Born–Oppenheimer (BO) approximation, it provides a powerful and widely used framework for describing the electronic structure of molecules. Although the HF model neglects static and dynamic electron correlation, it yields molecular orbitals that serve as the reference basis for more accurate post-Hartree–Fock approaches. For this reason, reliable and efficient HF implementations are fundamental components of nearly all modern electronic-structure codes. A major source of efficiency in contemporary HF programs arises from the use of Gaussian-type orbitals (GTOs) as basis functions. The analytic properties of Gaussians enable systematic and efficient evaluation of molecular integrals, allowing calculations to scale to systems containing hundreds or even thousands of atoms. With appropriate integral-screening and parallelization techniques, the HF method has become a key workload on modern high-performance computing (HPC) systems. Indeed, many demonstrations of large-scale HPC performance have used quantum-chemistry benchmarks—often based on HF or related methods—to showcase parallel scalability and computational efficiency stocks2024hfexascale . Beyond its scientific importance, the HF method continues to hold significant educational and technological value . As computer architectures evolve—through multicore processors, GPUs, and other accelerators—quantum-chemistry algorithms must be adapted to exploit these resources effectively Gordon2020 . Open, modular implementations allow students and developers to experiment with data structures, memory layouts, and parallel strategies, fostering a deeper understanding of algorithmic bottlenecks and opportunities for optimization. The transparent formulation of HF theory and its mapping to modern HPC paradigms therefore provide a fertile training ground at the intersection of chemistry, physics, and computer science . Despite this potential, relatively few open-source, pedagogically oriented C++ implementations combine high-performance computing features with a clear exposition of the theoretical and computational structure of the HF method. Most mature quantum-chemistry packages are large, complex, and heavily optimized for performance rather than clarity, making them difficult to study and extend. To address this gap, the first part of this paper provides a concise pedagogical review of the HF formalism and the McMurchie–Davidson (McD) scheme for Gaussian integral evaluation MCMURCHIE1978218 , establishing the theoretical foundation for implementation. Building on this foundation, we introduce FSIM—a minimal, open-source C++ library that implements the restricted HF method using the McD integral scheme and supports parallelization through MPI and OpenMP, designed primarily as a pedagogical demonstration rather than a production-scale code. FSIM is designed as a modular and extensible framework that bridges theory and implementation, serving as both a pedagogical tool and a platform for further exploration. The accompanying mini-projects and open design aim to encourage students to extend the code, explore optimization strategies, and contribute to future high-performance developments. We would like to emphasize that this work is not positioned as a production electronic-structure package, but rather as a minimal reference implementation intended for educational use and software review. The remainder of this paper is organized to bridge theoretical foundations with practical implementation and learning opportunities. Section 2 introduces the mathematical formulation of the HF method, beginning with the definition of Gaussian basis functions and progressing through the evaluation of molecular integrals. This theoretical groundwork provides the context for Section 3 , which describes the design and structure of the FSIM library. Here, we outline the software architecture, the self-consistent field (SCF) solver, and the integral engine implementation. Section 3.4 presents validation tests and performance results, while Section 3.5 analyzes the profiling of both serial and parallel components of the code. To highlight its educational intent, Section 4 proposes a series of guided mini-projects that extend the framework toward more advanced optimization and scalability studies. 2 Mathematical and Theoretical Formulation The mathematical formalism of the Hartree–Fock method and the McMurchie–Davidson scheme for integrals have been described in detail by many authors, for example in the well-known textbook Ref. Helgaker2000 . Here, we include a summary of key concepts and equations for consistency within this paper. 2.1 Basis Functions 2.1.1 Contracted Gaussian-type orbitals Molecular orbitals (MOs) are commonly expressed as linear combinations of atomic orbitals (AOs), following the linear combination of atomic orbitals (LCAO) framework. This representation forms the foundation of most electronic-structure methods, as it allows the many-electron Schrödinger equation to be reformulated in terms of a finite basis set: \psi_{p}(\mathbf{r})=\sum_{\mu}C_{\mu p}\,\phi_{\mu}(\mathbf{r}), (1) where \phi_{\mu}(\mathbf{r}) are the atomic basis functions and C_{\mu p} are the molecular orbital coefficients. In quantum chemistry calculations, atomic basis functions are usually represented by contracted Gaussian-type orbitals (CGTOs) with real solid harmonic angular dependence. A CGTO centered on the nucleus at \mathbf{A} is defined as a fixed linear combination of primitive real solid harmonic Gaussian functions: \phi_{\mu}^{lm}(\mathbf{r})=\sum_{k}d_{k}^{\mu}\,G_{lm}(\mathbf{r},\alpha_{k},\mathbf{A}), (2) where (l,m) are angular-momentum quantum numbers, d_{k}^{\mu} are contraction coefficients, and \alpha_{k} are primitive Gaussian exponents. Each primitive real solid harmonic Gaussian function is given by G_{lm}(\mathbf{r},\alpha,\mathbf{A})=S_{lm}(\mathbf{r}-\mathbf{A})\,e^{-\alpha|\mathbf{r}-\mathbf{A}|^{2}}, (3) where S_{lm}(\mathbf{r}-\mathbf{A})=r_{A}^{l}\,Y_{lm}(\widehat{\mathbf{r}-\mathbf{A}}) is a real solid harmonic constructed from the spherical harmonics Y_{lm} . For normalization, each primitive function is multiplied by a factor N_{lm}(\alpha) such that \langle G_{lm}|G_{lm}\rangle=1 . For the purpose of integral evaluation, it is convenient to expand each primitive real solid harmonic Gaussian in terms of primitive Cartesian Gaussian-type orbitals Helgaker2000 : G_{lm}(\mathbf{r},\alpha,\mathbf{A})=\sum_{|i|=l}S_{i}^{lm}\,(x-A_{x})^{i_{x}}(y-A_{y})^{i_{y}}(z-A_{z})^{i_{z}}e^{-\alpha|\mathbf{r}-\mathbf{A}|^{2}}, (4) where i=(i_{x},i_{y},i_{z}) is a multi-index with |i|=i_{x}+i_{y}+i_{z}=l , and S_{i}^{lm} are the solid harmonic to Cartesian transformation coefficients, whose explicit expressions are given in Ref. Helgaker2000 . The final expansion of a CGTO in the Cartesian primitive basis can be written as \phi_{\mu}^{lm}(\mathbf{r})=\sum_{k}^{K}\sum_{\begin{subarray}{c}i_{x},i_{y},i_{z}\end{subarray}}d_{k}^{\mu}\,S_{i_{x},i_{y},i_{z}}^{lm}\,(x-A_{x})^{i_{x}}(y-A_{y})^{i_{y}}(z-A_{z})^{i_{z}}e^{-\alpha_{k}^{\mu}|\mathbf{r}-\mathbf{A}_{\mu}|^{2}}. (5) The expansion in Cartesian primitive basis Gaussians increases the number of integrals to be evaluated, but enables highly efficient computation because all Gaussian integrals are analytically tractable and can be evaluated through recurrence relations Helgaker2000 ; 2012Reine . 2.1.2 Cartesian Gaussian Functions It is useful to briefly review the definition of a primitive Cartesian Gaussian-type orbital, as these functions form a central component of the basis expansion and molecular integral evaluation. One such function centered at \mathbf{A} is defined as G_{i_{x}i_{y}i_{z}}(\mathbf{r};\alpha,\mathbf{A})=(x-A_{x})^{i_{x}}(y-A_{y})^{i_{y}}(z-A_{z})^{i_{z}}e^{-\alpha|\mathbf{r}-\mathbf{A}|^{2}}, (6) where \alpha>0 is the orbital exponent, (i_{x},i_{y},i_{z}) are nonnegative integers, and the total angular-momentum quantum number is \ell=i_{x}+i_{y}+i_{z} . A Cartesian Gaussian is separable in the Cartesian directions: G_{i_{x}i_{y}i_{z}}(\alpha,\mathbf{r}_{A})=G_{i_{x}}(\alpha,x_{A})\,G_{i_{y}}(\alpha,y_{A})\,G_{i_{z}}(\alpha,z_{A}), (7) where, for example, the x component is G_{i_{x}}(\alpha,x_{A})=x_{A}^{i_{x}}\,e^{-\alpha x_{A}^{2}},\quad\text{with }x_{A}=x-A_{x}. (8) The main advantage of Gaussians is their simple algebraic properties. The Gaussian product theorem states that the product of two spherical Gaussians centered at \mathbf{A} and \mathbf{B} with exponents \alpha

Read the complete text