Table of Contents
Fetching ...

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

Mario Hernández Vera

TL;DR

FSIM presents a minimal, pedagogical C++ implementation of restricted Hartree–Fock that leverages the McMurchie–Davidson scheme for analytic Gaussian integrals. The framework combines a clear object-oriented design with MPI and OpenMP parallelization, enabling educational exploration of one- and four-index integrals and a DIIS-accelerated SCF loop. Key contributions include a transparent integral engine, modular software architecture, rigorous testing against established codes, and a curated set of mini-projects to study algorithmic optimization and scalability. By providing a compact, reproducible platform, FSIM bridges theory and practice in computational chemistry and high-performance computing, offering a practical tool for teaching and research on modern HPC architectures.

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 implements 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.

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

TL;DR

FSIM presents a minimal, pedagogical C++ implementation of restricted Hartree–Fock that leverages the McMurchie–Davidson scheme for analytic Gaussian integrals. The framework combines a clear object-oriented design with MPI and OpenMP parallelization, enabling educational exploration of one- and four-index integrals and a DIIS-accelerated SCF loop. Key contributions include a transparent integral engine, modular software architecture, rigorous testing against established codes, and a curated set of mini-projects to study algorithmic optimization and scalability. By providing a compact, reproducible platform, FSIM bridges theory and practice in computational chemistry and high-performance computing, offering a practical tool for teaching and research on modern HPC architectures.

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 implements 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.

Paper Structure

This paper contains 25 sections, 76 equations, 4 figures, 3 tables, 1 algorithm.

Figures (4)

  • Figure 1: Layered architecture of the FSIM library. The system is organized into three main layers: the User Interface Layer, which handles user input and provides a unified API through the Algorithm class; the Algorithm Implementation Layer, which coordinates the execution of Hartree-Fock calculations using either OpenMP or MPI parallel strategies; and the Computational Engine Layer, which performs molecular integral evaluation and SCF iterations through the MolecularIntegralEngine and HartreeFockEngine components. Core data structures such as BasisSetData, ShellPairData, and HermiteCoeffData support the numerical computations, while external dependencies (OpenMPI, Armadillo, Ctensor, and OpenMP) provide linear algebra, tensor–based data structures, and parallelization capabilities. To maintain simplicity, only the main classes are shown, omitting lower-level implementation details. The source code is hosted here: https://gitlab.com/marhvera/fsim.
  • Figure 2: Comparison of SCF convergence for the HF method with and without DIIS acceleration for H2O and the aug-cc-pVDZ basis. The plot shows the logarithmic decay of the absolute energy difference $\left| E_i - E_\mathrm{final} \right|$ as a function of iteration number.
  • Figure 2: CPU utilization from gprofng profiling. Times are exclusive CPU times normalized to the total runtime of 18.643 s.
  • Figure 3: HF execution times for small molecular systems using different parallelization models. The top panel shows results obtained with OpenMP using one to three threads, while the bottom panel shows corresponding results with MPI using two to four processes. Both plots illustrate how parallelization significantly reduces wall-clock time for small molecules and demonstrate the impact of shared- versus distributed-memory parallelism within the FSIM framework.