MatGL
M3GNet, MEGNet and TensorNet, with pre-trained universal potentials. Replaces the archived m3gnet repository.
Tool 055 of 100 in the MolForge directory of open-source tools. Every fact below was read from the repository's host on 2026-11-28.

What MatGL is
MatGL, the Materials Graph Library, is a PyTorch package for graph neural networks on crystals and molecules. A structure is turned into a graph of atoms and bonds, and the network learns to predict either a property of the whole structure or an energy whose derivatives give forces and stresses. It implements MEGNet for property prediction, M3GNet, which adds three-body terms and serves as an interatomic potential, TensorNet and SO3Net. The package replaces the earlier m3gnet repository.
Pre-trained models are downloaded by name: universal potentials trained on Materials Project relaxation trajectories covering most of the periodic table, and property models for formation energy and band gap. Structures come in as pymatgen objects; an ASE calculator and a relaxer class let the potentials drive geometry optimisation and molecular dynamics. Training new models on custom data uses PyTorch Lightning with the provided data loaders.
The universal potentials are trained on near-equilibrium DFT data, so they suit screening and pre-relaxation. A system-specific potential remains the safer choice for detailed dynamics far from equilibrium.
Features
- MEGNet, M3GNet, TensorNet and SO3Net architectures in PyTorch
- Pre-trained universal potentials and property models loadable by name
- ASE calculator and relaxer for optimisation and molecular dynamics
- Works directly with pymatgen Structure and Molecule objects
- Training pipeline on PyTorch Lightning for custom data sets
- Predicts energies, forces and stresses from one model
What it is for
- Pre-relax candidate crystal structures before expensive DFT
- Screen formation energies and band gaps of hypothetical compounds
- Run exploratory molecular dynamics across diverse chemistries without training
- Fine-tune a universal potential on a focused set of DFT calculations
Verified facts
| Family | Machine-learned interatomic potentials |
|---|---|
| Language or basis | Materials graphs |
| Repository | https://github.com/materialyzeai/matgl (GitHub) |
| Licence | BSD-3-Clause (SPDX identifier as declared in the repository) |
| Main language on GitHub | Python |
| Last commit | 2026-11-25 |
| Latest release | v4.1.4 (2026-11-04) |
| Stars | 580 on 2026-11-28 |
| Open issues and pull requests | 1 on 2026-11-28 |
| Repository created | 2022-08-29 |
| Verified | 2026-11-28 by MolForge's checking script, against the host's API |
Where MatGL fits
Learn quantum-accurate potentials that run at near-classical cost, from quantum-chemistry data.
It is the first place to look when you want a learned potential.
Successor of materialsvirtuallab/m3gnet; the repository now lives under the materialyzeai organisation.
Questions people ask
- What happened to the m3gnet repository?
- Its models were re-implemented in MatGL and the original repository was archived. The M3GNet architecture and the pre-trained universal potential are available in MatGL under new model names, alongside MEGNet and newer architectures. New work should target MatGL; the old TensorFlow code is no longer developed.
- Can MatGL potentials be used in ASE or LAMMPS?
- An ASE calculator ships with the package, so any ASE optimiser or integrator can drive a MatGL potential, and pymatgen structures convert to ASE Atoms. There is no native LAMMPS pair style in the package itself; running inside LAMMPS would require a bridge that calls Python.
- How is MatGL different from CHGNet?
- Both offer universal potentials trained on Materials Project trajectories. MatGL is a library with several architectures and property models, and is maintained alongside pymatgen. CHGNet is one architecture that additionally predicts magnetic moments as a proxy for charge state. Choosing between them is a question of which features and workflows you need.
- Do I need a GPU to use the pre-trained models?
- No. Loading a model and relaxing a structure works on a CPU, and that is how most screening scripts run. A GPU helps when training new models or when running long molecular dynamics on large cells, where the per-step cost on CPUs adds up.
- Is MatGL open source?
- Yes. The repository declares the BSD-3-Clause licence (SPDX identifier read from the host on 2026-11-28). Read the licence text in the repository before redistributing or embedding it.
- Where is the MatGL source code?
- At https://github.com/materialyzeai/matgl (GitHub). Successor of materialsvirtuallab/m3gnet; the repository now lives under the materialyzeai organisation.
- Is MatGL still maintained?
- The last commit was pushed on 2026-11-25 and the latest tagged release is v4.1.4 from 2026-11-04; the repository had 1 open issues and pull requests on 2026-11-28.
- Does MolForge use MatGL?
- No. MolForge runs nine of the hundred tools in this directory (RDKit, OpenMM, AutoDock Vina, Open Babel, MDTraj, pymbar and NGL, plus PySCF and xTB in MFsig); MatGL is listed because of its place in machine-learned interatomic potentials, not because we run it.
Our comments on MatGL
MolForge does not run MatGL in production. This page is a verified pointer, not a review: the facts above come from the repository on the date shown, the description is ours, and we make no claim about accuracy or speed that we have not measured. If you maintain MatGL and something here is wrong or out of date, write to hello@molforge.ai and we will correct the source file.
Test status
Not tested by MolForge. To check MatGL yourself: clone the repository, follow the installation section of its README, and run the test suite the project ships before trusting a result; the last-commit date and the open issue count above tell you how alive the project is.