---
title: 'TurboGAP: High-Performance GAP & MD Simulations'
url: https://www.emergentmind.com/topics/turbogap
type: topic
---

# TurboGAP: High-Performance GAP & MD Simulations

Searching arXiv for recent TurboGAP papers and related records.
TurboGAP denotes a set of closely related high-performance implementations for Gaussian Approximation Potential (GAP) workflows. In the cited literature, the name refers both to a data-parallel implementation of GAP fitting using ScaLAPACK with MPI and OpenMP, and to a software package for efficient molecular dynamics simulations using GAP machine-learning interatomic potentials (MLIP). In its 2025 molecular augmented dynamics (MAD) formulation, TurboGAP evaluates the GAP interatomic energy together with analytical “experimental forces” derived from an experimental-agreement potential, with linear-scaling routines for X-ray/neutron diffraction and local observables such as core-electron binding energies used in X-ray photoelectron spectroscopy. The same code base is also extended to radiation-induced cascade simulations through two-temperature molecular dynamics, adaptive timestepping, and electronic stopping models, with demonstrated simulations from \(10^3\) to \(10^6\) atoms [2207.03803], [2509.22388], [2509.26199].

## 1. Scope and problem setting

TurboGAP is positioned at the intersection of MLIP fitting, large-scale molecular dynamics, and experiment-driven atomistic modeling. For disordered systems, the central difficulty is that aligning theoretical atomistic structural models with available experimental data requires navigating a vast configurational space, while faithful realizations require large system sizes with quantum-mechanical accuracy in order to capture the distribution of structural motifs present in experiment. Traditional equilibrium sampling approaches offer no guarantee of generating structures that coincide with experimental data for such systems. Within that context, MAD is introduced as a modified molecular dynamics method that can generate ab-initio accurate, low-energy structures through a multi-objective optimization of the interatomic potential energy and the experimental potential, with TurboGAP acting as the high-performance engine for the required force evaluations [2509.22388].

A distinct, but complementary, use of the same name appears in the GAP-fitting literature. There, TurboGAP is a data-parallel implementation of Gaussian Approximation Potential fitting that overcomes the single-node memory and compute limits of earlier serial or purely OpenMP-parallel codes, scales to thousands of cores, and enables higher-level workflows such as committee models or hyperparameter optimisation [2207.03803].

A common misunderstanding is to treat TurboGAP as only a force-evaluation backend or only a training code. The published record instead assigns it both roles: distributed fitting of GAP models, and large-scale deployment of those models in molecular dynamics, including MAD and radiation-damage simulations. This suggests that the term “TurboGAP” is best understood as a computational framework centered on GAP models rather than as a single narrowly scoped executable.

## 2. GAP formalism and interatomic representation

At the level of the interatomic model, TurboGAP uses the standard GAP decomposition in which the total potential energy is written as a sum of atomic energies,
$$
E_{\rm tot}=\sum_i E_i,
$$
or, equivalently in the fitting formulation,
$$
E_A=\sum_{i=1}^{N_A}\varepsilon(x_i).
$$
Each local contribution is obtained through sparse Gaussian-process regression over a set of reference environments. In the simulation-oriented description,
$$
E_i=\sum_{s=1}^{N_{\rm sparse}} \alpha_s\,K(\mathbf{D}_i,\mathbf{D}_s),
$$
where \(\mathbf{D}_i\) is the vector of descriptors, \(K\) is the kernel, \(\{\alpha_s\}\) are regression coefficients, and \(N_{\rm sparse}\) is the number of sparse points. In the fitting-oriented description, the sparse model is written as
$$
\varepsilon(x_i)=\sum_{j=1}^{M} c_j\,k(x_i,x_j),
$$
with a sparse set \(\{x_j\}_{j=1}^M\) and weights \(\{c_j\}\) determined from energies, forces, and stresses through a regularised least-squares formulation [2509.26199], [2207.03803].

The silicon GAP used for radiation-damage studies combines three separate descriptors: a two-body kernel up to \(r_{\rm cut}=5.0\) Å, a three-body kernel up to \(r_{\rm cut}=4.0\) Å, and a turboSOAP many-body kernel with hard cut \(5.0\) Å, smooth cutoff \(4.0\) Å, \(l_{\max}=8\), \(\alpha_{\max}=8\), and \(\zeta=6\). To capture the highly repulsive part of the potential-energy surface at very short distances, a tabulated Ziegler–Biersack–Littmark (ZBL) potential is appended,
$$
E_{\rm rep}(r)=\frac{Z_1 Z_2 e^2}{4\pi\epsilon_0\,r}\,\phi(r/a)\,f_{\rm cut}(r),
$$
with the universal screening function
$$
\phi(x)=0.1818e^{-3.2x}+0.5099e^{-0.9423x}+0.2802e^{-0.4029x}+0.02817e^{-0.2016x}.
$$
This combination is specifically motivated by the need to describe cascade events involving very short interatomic separations [2509.26199].

In the fitting formulation, numerical stability is improved by constructing an over-determined Tikhonov-regularised least-squares system and solving it through distributed QR factorisation rather than by direct inversion of the normal equations. That choice is central to TurboGAP’s ability to handle large sparse sets and large observation counts [2207.03803].

## 3. Molecular augmented dynamics and experimental-force machinery

In MAD, TurboGAP couples the GAP potential to an experimental-agreement potential within a single Hamiltonian,
$$
\mathcal{H}=T+V(\{\mathbf r\})+\tilde V(\{\mathbf r\}),
$$
where \(V\) is the GAP interatomic energy and
$$
\tilde V=\tfrac{\gamma}{2}\sum_{i=1}^M w_i^2\bigl[h^i_{\rm pred}(\{\mathbf r\})-h^i_{\rm exp}\bigr]^2
$$
is a quadratic experimental potential measuring deviation of \(M\) predicted observables from experiment. The MAD dynamics then minimizes both the physical energy and the experimental deviation simultaneously. TurboGAP provides both the GAP forces \(-\nabla V\) and the analytical gradients, or “experimental forces,” \(-\nabla \tilde V\) in \(\mathcal O(N)\) time, enabling large-scale simulations up to millions of atoms [2509.22388].

The linear-scaling character of the method depends on the fact that all key routines in TurboGAP—GAP evaluation, neighbor-list construction, and experimental observable gradients—scale linearly with system size \(N\). Neighbor searching with a finite cutoff \(r_{\rm cut}\) is \(\mathcal O(N)\). Kernel-density estimation of partial pair distributions and their gradients for XRD, ND, and PDF is \(\mathcal O(N)\). Summations over local descriptors for XPS are \(\mathcal O(N)\). The overall cost is therefore described as
$$
\mathrm{Cost}(N)\propto N+\text{(small fixed overheads)}.
$$

The CPU algorithmic steps per MD step are specified explicitly: build or update the neighbor list; compute \(\hat g_{ab}(r)\) via Gaussian KDE; Fourier transform partial PDFs to structure factors \(\hat S_{ab}(Q)\) via a short-cut explicit sum over \(Q\)-points; assemble predicted intensity \(\hat I^{\rm X}(Q)\) and its gradient; combine with experimental weights and form \(\tilde{\mathbf f}_k\); then return total forces and virial contributions. This sequence makes clear that experimental matching is not a post-processing layer but part of the force loop itself [2509.22388].

TurboGAP also implements the generalized virial stress including experimental forces,
$$
\phi^{\alpha\beta,\rm tot}
= -\tfrac12 \sum_{i=1}^N \sum_{j\neq i} (r_j^\alpha-r_i^\alpha)\;f_{ij}^{\beta,\rm tot},
$$
$$
\sigma^{\alpha\beta,\rm tot}=-\frac{1}{\Omega}\,\phi^{\alpha\beta,\rm tot},
\qquad
P^{\rm tot}=-\tfrac13 \mathrm{Tr}\,\sigma^{\rm tot}+\frac{N\,k_{\rm B}\,T}{\Omega}.
$$
Because \(\phi\) gathers contributions from both \(\nabla V\) and \(\nabla\tilde V\), TurboGAP can run fully flexible-cell NPT MAD simulations in which volume and shape evolve to match experimental densities automatically [2509.22388].

## 4. CPU and GPU implementations and measured performance

On CPUs, TurboGAP uses an MPI + OpenMP programming model. Each MPI rank owns a subset of atoms; within each rank, OpenMP threads loop over local atoms. Neighbor lists are Verlet lists with cutoff \(r_{\rm cut}\), updated infrequently relative to MD timesteps. Data structures include SoA arrays of positions \(\{\mathbf r_i\}\), species labels, partial-PDF histograms \(g_{ab}(r)\) in radial bins, and pre-computed scattering factors \(f_a(Q)\) or neutron lengths \(\bar b_a\). Strong-scaling on 27 000 atoms achieves \(\sim 80\%\) efficiency up to 512 CPU cores, and the experimental-force subroutines remain strictly \(\mathcal O(N)\) and comparably priced even when the dominant cost remains the GAP force and descriptor evaluation [2509.22388].

The GPU path is implemented in HIP, with HOP for runtime portability, plus cuBLAS/hipBLAS for small dense linear algebra. Positions and neighbor lists are transferred to GPU once, while partial-PDF accumulators reside in GPU global memory. For very large \(N\), the domain of atoms is split into \(B\) batches to fit HBM memory, with typical \(B=4\text{–}16\). The GPU workflow is decomposed into three kernels: PDF build; PDF-to-structure-factor transform through a small dense matrix–vector product; and intensity-plus-gradient contraction. Host–device transfer is overlapped with compute [2509.22388].

Benchmarks on the LUMI supercomputer quantify both absolute timing and scaling. For strong scaling on 27 000 atoms, the XRD/ND experimental-force subroutines decrease from \(180\) s on 1 rank (\(\sim 64\) cores) to \(0.45\) s on 512 ranks on the CPU side, and from \(2.1\) s on 1 GPU to \(0.55\) s on 4 GPUs on the GPU side. Relative to 1 \(\times\) 64-core CPU, the reported speedups are \(\times 400\) for 512 CPU cores and \(\times 330\) for 4 GPUs. For weak scaling from 1 728 to \(10^6\) atoms, both CPU and GPU timings remain linear, with \(\sim 85\%\) CPU efficiency and \(\sim 92\%\) GPU efficiency at 512 ranks. On 1 \(\times\) AMD MI250x die, the experimental-force subroutines for \(N\sim 10^5\) run in a few tens of milliseconds—up to \(100\times\) faster than a single 64-core MPI rank on LUMI-C. In a full MAD MD step, adding the GPU experimental forces costs \(<10\%\) of the total, versus \(\sim 25\%\) on CPU, and the GPU version runs \(\sim 2\text{–}5\times\) faster per MD step than the CPU one, including GAP evaluation [2509.22388].

A frequent misconception is that the experimental observables dominate the runtime once they are coupled to a machine-learned potential. The published measurements indicate the opposite for the GPU implementation: explicit batching and high-throughput kernels push the experimental-force cost to \(\ll 10\%\) of the total GAP+MD expense [2509.22388].

## 5. Radiation-induced cascade simulations

For radiation damage simulations, TurboGAP is extended with a two-temperature molecular dynamics model, also denoted TT-MD or “EPH,” based on electron density-dependent coupling of electronic and atomic subsystems. The atomic subsystem follows a generalized Langevin equation,
$$
m_I\ddot{\mathbf r}_I
= -\nabla_I U_{\rm adiab}
-\sum_J B_{IJ}\,\dot{\mathbf r}_J
+\sum_J W_{IJ}\,\boldsymbol\xi_J(t),
$$
while the electronic subsystem obeys
$$
C_e(T_e)\,\frac{\partial T_e}{\partial t}
=\nabla\!\bigl[\kappa_e(T_e)\,\nabla T_e\bigr]
+Q_{ei}(\{\mathbf r_I,\dot{\mathbf r}_I\})
+S_{\rm ext}(\mathbf{x},t).
$$
In TurboGAP these equations are integrated jointly via finite-difference for the electronic mesh, Verlet, and stochastic updates [2509.26199].

Two electronic stopping models are implemented. The friction-based electronic stopping (FES) model applies a velocity-dependent drag using a tabulated stopping power \(S_e(E)\), with a user-selectable low-energy cutoff \(E_{\rm cut}\). The first-principles-derived stopping model instead uses the electron-density-dependent friction tensor \(B_{IJ}\), derived from time-dependent DFT studies of stopping power; no ad hoc cutoff is needed, and the same model also produces the correct electron–phonon coupling at low energies. TurboGAP additionally implements adaptive calculation of the timestep through maximum displacement and maximum energy-change criteria, with the actual \(\Delta t\) clamped to \([\Delta t_{\min},\Delta t_{\max}]\) [2509.26199].

The published silicon cascade setup uses PKA energies of 0.1, 0.2, 0.4, 1, 2, 5, and 10 keV, with system sizes from 4 096 atoms up to \(10^6\) atoms. Initial equilibration is at 300 K and 0 bar for 20 ps with a Berendsen thermostat/barostat. The EPH model employs an electronic bath approximately \(4\times\) larger than the atomistic cell with 20–22 Å grid spacing in \(x,y,z\), \(C_e=9.74\times 10^{-5}\,{\rm eV/K/\AA^3}\), and \(\kappa_e=9.74\times10^{-2}\,{\rm eV/K/\AA/ps}\). FES runs use an SRIM-2013 \(S_e(E)\) file and two cutoffs, \(E_{\rm cut}=\{1,10\}\) eV. Production cascades run to 10 ps [2509.26199].

Defect generation is analyzed by Wigner–Seitz analysis in OVITO. The number of interstitials peaks during the “heat spike” at 0.2–0.7 ps and then relaxes to survivors. EPH yields systematically more survivors, for example \(35\pm1.4\) versus \(26\pm0.8\) for 2 keV, and larger average clusters. Interstitial clusters are defined by a 5.3 Å criterion; violin plots show that EPH’s largest clusters exceed 100 atoms, whereas FES stays below \(\sim 100\). Ion-beam mixing is quantified through
$$
R^2(t)=\sum_i |\mathbf r_i(t)-\mathbf r_i(0)|^2,
\qquad
Q=\frac{\langle R^2\rangle_{\rm final}}{6\,n_0\,E_D},
$$
with a spectrum-integrated version for heavy-ion experiments. The reported \(Q\) values agree within error bars with experiments of Matteson et al. (1981) and Paine et al. (1981); for Ar 110 keV, \(Q_{\rm sim}=62\pm3\) \(\AA^5/{\rm eV}\) versus \(58\pm32\) \(\AA^5/{\rm eV}\) [2509.26199].

## 6. Massively parallel fitting and workflow integration

The fitting implementation of TurboGAP distributes the training structures and their associated observations almost evenly across MPI ranks and uses OpenMP within each rank to parallelise over sparse points. Data partitioning is along the observation dimension \(N\), since both memory and computation scale proportionally to \(N\). A greedy load-balancing assigns each XYZ structure to the MPI rank currently holding the fewest total observations. Each rank then computes the local descriptor vectors and their kernels for all sparse points, forms its partial covariance block, and assembles the local contribution to the regularised least-squares system without any inter-rank communication during descriptor or kernel evaluation [2207.03803].

The global solve is mapped onto ScaLAPACK. TurboGAP distributes the rows of the least-squares matrix \(A\) and the entries of \(b\) in a block-cyclic fashion over a \(1\times P\) MPI grid; applies PDGEQRF for QR factorisation; applies PDORMQR to form \(Q^T b\); and solves the triangular system through PDTRTRS. To minimise memory blow-up in PDTRTRS, the code dynamically switches the ScaLAPACK column block size for that call. A practical column block size of order 50–200 is reported to provide a good trade-off between workspace and performance [2207.03803].

The benchmarked training sets illustrate the scale of the distributed fit. For a High-Entropy Alloy MoNbTaVW dataset with \(N=396{,}178\) observations and \(M=20{,}300\) sparse points, the global matrix \(A\) has approximately \(8.45\times10^9\) entries, or about 67.6 GB. For a Silicon Carbide dataset with \(N=2{,}482{,}085\) observations and the same \(M=20{,}300\), \(A\) has approximately \(5.08\times10^{10}\) entries, or about 406 GB. The covariance time \(t_{\rm cov}\) scales almost perfectly inversely with the total number of cores, whereas the QR solve time \(t_{\rm QR}\) benefits less from node count because of inter-node communication overheads in ScaLAPACK. A 50:50 split of MPI tasks to OpenMP threads per node generally maximises efficiency and keeps memory overhead low, while pure MPI often saturates at moderate node counts and incurs a large memory footprint [2207.03803].

The reduction in fit times and the removal of single-node memory limits are explicitly connected to higher-level workflows. The cited applications are committee-model uncertainty quantification, automated hyperparameter optimisation, and on-the-fly active learning loops combining DFT sampling with GAP retraining. Best-practice recommendations include performing sparse-point selection in a small serial pre-run, using a moderate ScaLAPACK column block size of around 100, and reserving some cores for OpenMP to amortise memory and communication cost [2207.03803].

Source: https://www.emergentmind.com/topics/turbogap