Efficient implementation of atom-density representations

Félix Musil, Max Veit, Alexander Goscinski, Guillaume Fraux, Michael J. Willatt, Markus Stricker, Till Junge, Michele CeriottiRefubium 2022 · DOI

TL;DR

This paper introduces librascal, a new, efficient, and modular open-source library for computing atom-density representations, like SOAP, which are crucial for modern atomistic machine learning. By optimizing various computational steps and introducing data reduction techniques, librascal can significantly speed up the evaluation of these representations, leading to faster and more efficient materials modeling.

What Problem Does This Paper Address?

Predicting the properties of materials and molecules using atomistic machine learning (ML) relies heavily on transforming atomic structures into numerical representations that capture essential physical information. These representations, often based on local atomic environments, need to be invariant or covariant to fundamental symmetries (like translation and rotation) and sensitive to structural changes. While many effective representations exist, their computational cost, especially for large-scale simulations like molecular dynamics, can be a significant bottleneck. This paper addresses the challenge of efficiently computing these atom-density-based representations, aiming to reduce the computational burden without sacrificing accuracy or symmetry properties.

Methods

The core contribution is the development of librascal, a modular library designed for efficient computation of atom-density representations. Key methodological aspects include:

  • Density Expansion Optimization: The paper details how to optimize the expansion of local atomic densities using radial and angular basis sets. This includes exploring different radial basis functions (Gaussian Type Orbital - GTO, Discrete Variable Representation - DVR) and implementing spline interpolation for efficient radial integral evaluation.
  • Spherical Harmonics and Invariants: Efficient computation of spherical harmonics and their combination into spherical invariants (like the SOAP power spectrum) is addressed.
  • Gradient Computation: Optimized methods for computing gradients of these representations are presented, which are essential for calculating forces and stresses.
  • Feature Dimensionality Reduction: A crucial aspect is the application of data-driven techniques (like furthest point sampling) to select a subset of features. This "lossy" strategy significantly reduces the number of features needed, leading to substantial speedups.
  • Modular Design: librascal is built with a modular design to facilitate rapid prototyping and the integration of new developments.

Datasets

The paper uses a variety of datasets for benchmarking, representing different challenges in atomistic modeling:

  • Bulk Silicon: A simple, single-species system often used for benchmarking.
  • Liquid Methane: A two-species system with homogeneous distribution.
  • Solvated CH3SO3H: A multi-species system with an inhomogeneous distribution, representing a more challenging scenario.
  • Molecular Crystals (CSD1000r): Multi-species systems where not all species are present in every structure.
  • QM9: A dataset of isolated molecules with up to 9 heavy atoms and up to five chemical species.

Key Insights and Ideas

  • Unified Formalism: Many effective atom-density representations can be viewed as discretizations of n-body correlation functions, suggesting a common ground for optimization.
  • Radial Basis Flexibility: The choice of radial basis function for density expansion is flexible and can be optimized for computational efficiency, with spline interpolation offering significant speedups.
  • Feature Redundancy: Realistic structural datasets often exhibit high correlation between different features in the representation vector, meaning a smaller subset can often capture most of the predictive information.
  • Accuracy-Cost Trade-off: Feature dimensionality reduction offers a powerful way to balance computational cost and predictive accuracy, allowing for significant speedups with minimal loss in performance.
  • Modularity is Key: A modular implementation like librascal is essential for rapid development and adaptation to new representation formalisms and optimization strategies.

Key Results

  • Significant Speedups: librascal can reduce the computational cost of evaluating atom-density representations by up to a factor of 4-5, especially when combined with feature dimensionality reduction.
  • Minimal Accuracy Loss: Feature selection strategies, when applied judiciously, lead to minimal impact on the model's symmetry properties and do not significantly affect predictive accuracy.
  • Efficient Gradient Calculation: The implementation provides efficient computation of gradients, which is crucial for force calculations in molecular dynamics.
  • Benchmarking Against QUIP: Comparisons with the established QUIP code show that librascal offers substantial performance improvements, particularly when feature sparsification is employed.

Limitations and Future Work

  • Focus on SOAP: While the library is modular, the primary focus of the paper's optimization and benchmarking is on SOAP features.
  • Serial Implementation: The current implementation is primarily serial, though the modular design is noted as being well-suited for parallelization.
  • Future Work: The authors suggest further optimization of the radial basis set choice based on information efficiency, and the integration of other libraries for equivariant features and kernels. They also highlight the need for further research into data-driven selection of features and samples to achieve the best accuracy-cost balance.

Summary updated

Abstract

Physically motivated and mathematically robust atom-centered representations of molecular structures are key to the success of modern atomistic machine learning. They lie at the foundation of a wide range of methods to predict the properties of both materials and molecules and to explore and visualize their chemical structures and compositions. Recently, it has become clear that many of the most effective representations share a fundamental formal connection. They can all be expressed as a discretization of n-body correlation functions of the local atom density, suggesting the opportunity of standardizing and, more importantly, optimizing their evaluation. We present an implementation, named librascal, whose modular design lends itself both to developing refinements to the density-based formalism and to rapid prototyping for new developments of rotationally equivariant atomistic representations. As an example, we discuss smooth overlap of atomic position (SOAP) features, perhaps the most widely used member of this family of representations, to show how the expansion of the local density can be optimized for any choice of radial basis sets. We discuss the representation in the context of a kernel ridge regression model, commonly used with SOAP features, and analyze how the computational effort scales for each of the individual steps of the calculation. By applying data reduction techniques in feature space, we show how to reduce the total computational cost by a factor of up to 4 without affecting the model’s symmetry properties and without significantly impacting its accuracy.
BibTeX
@inproceedings{musil2022efficient,
  author = {Félix Musil and Max Veit and Alexander Goscinski and Guillaume Fraux and Michael J. Willatt and Markus Stricker and Till Junge and Michele Ceriotti},
  title = {{Efficient implementation of atom-density representations}},
  booktitle = {Refubium},
  year = {2022},
  doi = {10.17169/refubium-34235},
}
Figure