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.

MatGL, open-source tool for machine-learned interatomic potentials: M3GNet, MEGNet and TensorNet, with pre-trained universal potentials

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

What it is for

Verified facts

FamilyMachine-learned interatomic potentials
Language or basisMaterials graphs
Repositoryhttps://github.com/materialyzeai/matgl (GitHub)
LicenceBSD-3-Clause (SPDX identifier as declared in the repository)
Main language on GitHubPython
Last commit2026-11-25
Latest releasev4.1.4 (2026-11-04)
Stars580 on 2026-11-28
Open issues and pull requests1 on 2026-11-28
Repository created2022-08-29
Verified2026-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.

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.

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.

Guides that explain the methods

Other tools in machine-learned interatomic potentials