Skala: Accurate and scalable exchange-correlation with deep learning

Skala: Accurate and scalable exchange-correlation with deep learning#

Overview#

Skala is a deep-learning exchange-correlation functional designed to provide chemical accuracy (less than 1 kcal/mol) for a wide range of chemical systems without using expensive non-local features like exact exchange or hand-crafted density convolutions. The model is trained on a large dataset of highly accurate total atomization energies, thermochemical properties, like ionization potentials and proton affinities, conformer energies, reaction paths, and non-covalent interactions.

Learn more

To learn more about the Skala functional, check out the blog post or the preprint.

What Skala provides#

Skala is first of all the functional itself: a trained neural network model. Around the model, this project provides several ways to use it, from a ready-to-use Python package to building blocks for integrating Skala into your own electronic structure code.

The Skala model

The trained exchange-correlation functional. Released checkpoints are distributed as TorchScript files (.fun) on Hugging Face and documented in the model cards. A checkpoint takes density features on an integration grid (density, density gradient, kinetic energy density, grid coordinates and weights, and atomic coordinates) and returns the exchange-correlation energy density on that grid. Because the checkpoints are TorchScript files, they can be evaluated from Python as well as from compiled languages through LibTorch. To understand the architecture behind the checkpoints better we also provide the model source on GitHub, while this is not the actual trained model, it should help further the understanding of what happens in the traced models. See the model README for details.

The skala Python package

The published package on PyPI loads the released checkpoints and adds Skala to PySCF as an add-on. It provides drop-in Kohn-Sham classes for PySCF on CPU and GPU4PySCF on GPU, as well as an ASE calculator for energies, forces, and geometry optimizations. This is the easiest way to run calculations with Skala.

C++ and Fortran examples

Minimal programs that load a Skala checkpoint and evaluate the exchange-correlation energy and its derivatives directly from C++ with LibTorch and from Fortran with FTorch. They start from precomputed input features and are the starting point if you want to call the model from your own code.

GauXC

GauXC is a CPU/GPU library for the numerical integration of exchange-correlation functionals used by electronic structure codes. We provide a version of GauXC with Skala support and bindings for C++, C, and Fortran. GauXC builds the integration grid and the density features from a density matrix and returns the exchange-correlation energy and potential, which makes it the recommended way to add Skala to an existing DFT code.

Benchmarks

A reproducible timing benchmark that compares Skala with traditional functionals in PySCF and GPU4PySCF on molecules of increasing size, together with an interactive report.

Skala in electronic structure packages#

Skala is already available in the following electronic structure codes. Refer to their documentation for installation and input options.

CP2K

See the GauXC section of the CP2K manual.

FHI-aims

See the exchange-correlation section of the FHI-aims manual.