Sampling Lattices in Semi-Grand Canonical Ensemble with Autoregressive Machine Learning

James Damewood, Daniel Schwalbe‐Koda, Rafael Gómez‐Bombarelli

Abstract

Calculating thermodynamic potentials and observables efficiently and accurately is key for the application of statistical mechanics simulations to materials science. However, naive Monte Carlo approaches struggle to scale to complex materials like high entropy alloys or multicomponent catalysts. To address this, we adapt machine-learning based generative modeling to the materials space by transforming them into the semi-grand canonical ensemble. We introduce SEGAL (Semi-grand Ensemble Generation by Autoregressive Lattices), a framework that is transferable across wide ranges of thermodynamic conditions and can be implemented with any internal energy model. We demonstrate its applicability to benchmark systems (AgPd, CuAu) and discuss future directions for improvement.

Introduction

Predicting stable atomic arrangements is a fundamental challenge in materials design. Traditionally, researchers calculate free energy using statistical mechanics, typically via Markov Chain Monte Carlo (MCMC) simulations. However, MCMC faces significant bottlenecks: high computational costs due to serial energy evaluations, "critical slowing down" near phase transitions, and a lack of transferability between different thermodynamic states. SEGAL addresses these gaps by replacing the stochastic random walk of MCMC with a generative neural network that learns the underlying physics of the semi-grand canonical ensemble, where temperature and chemical potential are fixed but composition fluctuates.

The SEGAL Framework

SEGAL utilizes Autoregressive Neural Networks to break down the probability of a complete lattice configuration into a sequence of conditional probabilities. The model determines the occupancy of a specific site based on previously placed atoms and external thermodynamic conditions.

Autoregressive sampling architecture for lattice configurations conditioned on temperature (T) and chemical potential (μ).

Key features of the methodology include:

  • Physics-Informed Training: The model minimizes the Kullback-Leibler (KL) divergence between its predicted distribution and the true Boltzmann distribution, effectively minimizing the variational grand potential.
  • Conditioning: By taking temperature ($T$) and chemical potential difference ($\Delta\mu$) as inputs, a single model can interpolate and generate samples for any condition within its training range.
  • Refinement: Self-Normalized Importance Sampling (SNIS) is used to correct minor biases, ensuring the exactness of the generated ensembles.

Results and Validation

The framework was validated on the Ising model and alloy systems (CuAu, AgPd) using Cluster Expansion and Crystal Graph Convolutional Neural Networks (CGCNN).

Accuracy and Efficiency

On the Ising model benchmark, SEGAL achieved free energy accuracy within $O(10^{-4})$, matching state-of-the-art MCMC algorithms like the Wang-Landau method.

Comparison of free energy calculations between the autoregressive model (AR), exact solutions, and the Wang-Landau method across varying temperatures and magnetic fields.

In practical alloy simulations, SEGAL demonstrated significant efficiency gains. For the AgPd system, it required approximately 4x fewer energy evaluations than metadynamics, while for the CuAu system, the speedup reached nearly 7x. The model successfully recovered complex phase diagram features, such as the asymmetric miscibility gap in AgPd and various ordered intermetallic phases in CuAu.

Automated Phase Detection

A notable insight from the study is the use of Normalized Effective Sample Size (NESS) as a sensor for phase transitions. The authors observed that NESS drops sharply near phase boundaries, providing an automated method for detecting transitions without manual inspection. Furthermore, the model naturally learned to respect physical symmetries like lattice rotations and translations through the process of free energy minimization.

Conclusion and Future Outlook

While SEGAL offers a transformative approach to ensemble sampling, challenges remain in scaling to very large lattices and capturing full degeneracy in ground-state searches. Future work will explore the integration of graph convolutional layers to improve scalability and active learning strategies to refine performance near first-order transitions. By enabling differentiable thermodynamics, SEGAL allows for the direct calculation of properties like heat capacity, paving the way for more robust materials discovery workflows.

Summary updated

Abstract

Calculating thermodynamic potentials and observables efficiently and accurately is key for the application of statistical mechanics simulations to materials science. However, naive Monte Carlo approaches, on which such calculations are often dependent, struggle to scale to complex materials in many state-of-the-art disciplines such as the design of high entropy alloys or multicomponent catalysts. To address this issue, we adapt sampling tools built upon machine-learning based generative modeling to the materials space by transforming them into the semi-grand canonical ensemble. Furthermore, we show that the resulting models are transferable across wide-ranges of thermodynamic conditions and can be implemented with any internal energy model U, allowing integration into many existing materials workflows. We demonstrate the applicability of this approach to the simulation of benchmark systems (AgPd, CuAu) that exhibit diverse thermodynamic behavior in their phase diagrams. Finally, we discuss remaining challenges in model development and promising research directions for future improvements.
BibTeX
@inproceedings{damewood2022sampling,
  author = {James Damewood and Daniel Schwalbe‐Koda and Rafael Gómez‐Bombarelli},
  title = {{Sampling Lattices in Semi-Grand Canonical Ensemble with Autoregressive Machine Learning}},
  booktitle = {Npj},
  year = {2022},
  doi = {10.1038/s41524-022-00736-4},
}
Figure