Skip to content

M3GNet

Materials Virtual Lab

M3GNet is an archived materials graph neural network implementation with three-body interactions, a pretrained interatomic potential, and workflows for crystal relaxation, molecular dynamics and model training.

Catalog updated ·

Overview

M3GNet provides a materials graph neural network architecture and an implementation for interatomic potentials and property-prediction surrogate models. Its graph representation includes three-body interactions, atomic coordinates and the crystal lattice matrix, enabling forces and stresses to be obtained through automatic differentiation. The repository supplies a pretrained potential developed using Materials Project relaxation data, alongside tools for applying and training models.

In a computational materials workflow, the pretrained potential can support crystal structure relaxation and molecular dynamics. The documented relaxation example accepts a pymatgen Structure and returns a final structure plus a trajectory containing energies. A separate command-line interface reads a crystal structure file and writes the relaxed structure to standard output or a file. Molecular dynamics examples save trajectories and thermodynamic logs. For custom potential training, PotentialTrainer accepts structures, energies, per-atom forces and optional stress matrices, with validation data used to select the stopping epoch.

This repository is archived and no longer maintained; its README identifies MatGL, based on the Deep Graph Library and PyTorch, as the replacement. It is therefore most relevant as a reference implementation or for examining existing M3GNet workflows. The pretrained potential is intended to reproduce Materials Project DFT results rather than experimental measurements. The supplied cubic-crystal comparisons show material-dependent discrepancies, including for some iodides and noble gases, so broad elemental coverage should not be treated as uniform accuracy. The README also reports substantial GPU-memory requirements for its illustrated training configuration; these are source-described requirements, not independently tested compatibility.

Key Features

  • Materials graph architecture incorporating three-body interactions, atomic coordinates and a 3×3 crystal lattice matrix for differentiable force and stress calculations.
  • Default pretrained interatomic potential trained on Materials Project relaxation data and accessible through Relaxer.
  • Structure relaxation returning a final structure and energy trajectory, with a CLI supporting structure-file input and relaxed-structure output.
  • MolecularDynamics workflow with configurable temperature, ensemble and timestep, plus trajectory and thermodynamic-log output.
  • Custom interatomic-potential training through PotentialTrainer using structures, energies, forces and optional stresses, with validation inputs.
  • Architecture intended for developing surrogate models for materials-property prediction as well as interatomic potentials.

Use Cases

  • Intended evaluation: assess pretrained crystal relaxation on representative materials by comparing final structures and energies with appropriate DFT references.
  • Intended evaluation: explore molecular dynamics on a selected crystal, inspecting the saved trajectory and thermodynamic log before using results scientifically.
  • Intended evaluation: train a domain-specific interatomic potential from structures, energies, forces and optional stresses, then assess it on held-out materials.
  • Use the archived implementation as a reference when examining legacy M3GNet workflows or planning a transition to MatGL.

How to Use

  1. Read the repository README, especially its archive notice. Decide whether this reference implementation is needed or whether the recommended MatGL replacement better fits the project.
  2. Consult the README installation and system-requirement sections. Follow its documented package-installation route and any relevant platform-specific instructions; do not assume the archived dependencies have current compatibility.
  3. Prepare a pymatgen Structure and follow the documented Relaxer example. Inspect the returned final_structure and trajectory energies. The README also describes file-based relaxation through the CLI.
  4. For dynamics, follow the MolecularDynamics example and choose temperature, ensemble, timestep and recording settings. Inspect both trajectory and thermodynamic-log outputs as part of an intended evaluation.
  5. For custom training, prepare energies in eV, forces in eV/Å and optional stresses in GPa, checking the documented stress sign convention. Use validation inputs and consult the API documentation. The source identifies MPF.2021.2.8 as the pretrained potential's training dataset.

Related resources

Allegro

Model

Allegro implements an E(3)-equivariant interatomic potential as a NequIP extension, with documented GPU acceleration options and a separate plugin for LAMMPS simulations.

Open sourcePython

Computational Chemistry · Materials Discovery

An ASE routing Skill in the computational-chemistry-agent-skills collection that separates workflow preparation from calculator configuration and delegates execution elsewhere.

Computational Chemistry · Materials Discovery

ChemAgent (AI4Chem) is a research framework for chemistry and materials tool use, linked to the CheMatAgent paper on tree-search planning, tool execution and ChemToolBench-based training.

Computational Chemistry · Materials Discovery

ChemGraph is a Python agent framework that connects natural-language chemistry requests to molecular construction, simulations, analysis, and reporting, with CLI, Python, Streamlit, and MCP interfaces.

Open sourcePython

Computational Chemistry · Materials Discovery

CHGNet

Model

CHGNet is a pretrained, charge-informed neural network potential for crystal structures, predicting energies, forces, stresses and magnetic moments for relaxation and molecular dynamics workflows.

Open sourcePython

Computational Chemistry · Materials Discovery

DeePMD-kit is a toolkit for training and fine-tuning Deep Potential interatomic models from quantum-mechanical reference data, then exporting them for inference and molecular dynamics.

Open sourcePythonC++

Computational Chemistry · Materials Discovery

Related guides

Agents

AI Agents for Chemistry: From Chatbots to Autonomous Research

A practical guide to eight chemistry and biomedical research agents: how tools, memory, planning and multi-agent roles work, which projects fit different tasks, and how to evaluate bounded autonomy with scientific oversight.