Graph neural networks for materials have multiplied in recent years, but each implementation lived in its own repository: MEGNet on TensorFlow, M3GNet on PyTorch, CHGNet with its own scripts. Porting a model to new data or comparing architectures was a project in itself. Libraries for a single architecture and packages like PyTorch-Geometric already existed, but materials science lacked a common layer that would tie together crystal structures, training, and molecular dynamics runs. MatGL fills this niche, building on DGL, a library that benchmarks show outperforms PyTorch-Geometric in memory and speed on large graphs.
MatGL is built on four components: a data pipeline, model architectures, training, and simulation interfaces. The pipeline takes Pymatgen or ASE structures, builds graphs with a specified cutoff radius, and caches them for reuse. The architectures, MEGNet, M3GNet, CHGNet, TensorNet, and SO3Net, are implemented modularly: layers, pooling, and activation functions are shared across models. Training goes through PyTorch Lightning, allowing scaling to multiple GPUs. For interatomic potentials, a Potential class is implemented that automatically handles energy normalization and computes forces, stresses, and Hessians via autodifferentiation. Interfaces to ASE and LAMMPS let you run structure relaxation and molecular dynamics with a single command.
Benchmarks on four datasets show that MatGL reproduces the accuracy of the original models. On QM9, the free energy prediction error for M3GNet is 0.025 eV, for TensorNet 0.027 eV, and for SO3Net 0.025 eV; MEGNet lags with 0.037 eV. On Matbench for formation energy, M3GNet, TensorNet, and SO3Net give errors of 0.020–0.024 eV/atom, while MEGNet gives 0.037 eV/atom. For potentials on ANI-1x, the equivariant SO3Net achieves a force error of 0.035 eV/Å, compared to 0.075 eV/Å for M3GNet with transfer learning. On crystals from the Materials Project, CHGNet outperforms M3GNet and TensorNet: an energy error of 19.9 meV/atom versus 23.0 and 30.3 meV/atom. Inference speed for TensorNet on QM9 is 14.9 seconds for 6541 molecules on a single RTX 3090, while MEGNet takes 12 seconds but with worse accuracy.
MatGL does for graph models of materials what scikit-learn did for classical machine learning: it provides a unified interface where you can take a ready-made model, train your own, or compare architectures on the same data. This lowers the entry barrier for experimentalists and speeds up reproducibility. Unlike neighboring works that focus on a single architecture or on reinforcement learning, MatGL offers five models at once and links them to ASE and LAMMPS, turning the library into a platform for the full cycle, from data to molecular dynamics.
The next step is support for multi-GPU training and working with databases exceeding millions of structures. The authors plan to use memory-mapped databases for storing graphs to lift the memory limitation. This will allow training universal potentials on the entire Materials Project and running molecular dynamics for systems with hundreds of thousands of atoms.
The library is already integrated into MatSciML and the Amsterdam Modeling Suite, expanding its use in high-throughput materials screening and industrial modeling.
Upcoming versions are expected to support distributed training and optimize the data pipeline for datasets with tens of millions of structures.
For materials science, the key unsolved problem is transferring models to chemical compositions and structures far from the training set. MatGL provides a tool for systematically testing such generalizability: you can quickly train a model on one dataset and run it on another without rewriting code. This directly relates to the question of how universal universal potentials really are beyond equilibrium configurations.
This section is addressed to the author of the paper and their colleagues. Neighbouring works were found by meaning-based search across our archive, not by word overlap. We do not review: we show the field around the work.
What the work does
MatGL brings together five graph architectures (MEGNet, M3GNet, CHGNet, TensorNet, SO3Net) in a single library with a data pipeline, training via PyTorch Lightning, and interfaces to ASE/LAMMPS. The authors reproduced the accuracy of the original models on QM9, Matbench, ANI-1x, and MPF-2021.2.8, showing errors comparable to DFT and high inference speed.
Where its strength is
A unified interface for training, comparing, and running five architectures, linking crystal structures to molecular dynamics, which makes the library a full-cycle platform.
Where it could go next
Worth trying
Why this may matter
Such an extension would allow MatGL to cover another class of materials science problems, namely predicting magnetic properties, and strengthen its role as a universal platform for graph models in materials science.
Nearby works in our archive
The archive is sparse around this work: the closest review is only 0.55, against a usual 0.64. It looks like few have drilled nearby.
The pretrained M3GNet potential in MatGL predicts the energy and forces for a crystal of 1000 atoms in fractions of a second, whereas a DFT calculation of the same system would take hours on a supercomputer.