Change Log


  • Move AtomRef Fitting to numpy to avoid bug (@BowenD-UCB)
  • NVE ensemble added (@kenko911)
  • Migrate from pytorch_lightning to lightning.


  • Pin dependencies to support latest DGL 2.x. @kenko911


  • Implementation of CHGnet + pre-trained models. (@BowenD-UCB)


  • First 1.0.0 release to reflect the maturity of the matgl code! All changes below are the efforts of @kenko911.
  • Equivariant TensorNet and SO3Net are now implemented in MatGL.
  • Refactoring of M3GNetCalculator and M3GNetDataset into generic PESCalculator and MGLDataset for use with all models instead of just M3GNet.
  • Training framework has been unified for all models.
  • ZBL repulsive potentials has been implemented.


  • Added Tensor Placement Calls For Ease of Training with PyTorch Lightning (@melo-gonzo).
  • Allow extraction of intermediate outputs in “embedding”, “gc_1”, “gc_2”, “gc_3”, and “readout” layers for use as atom, bond, and structure features. (@JiQi535)


  • Update Potential version numbers.


  • set pbc_offsift and pos as float64 by @lbluque in
  • Bump pytorch-lightning from 2.0.7 to 2.0.8 by @dependabot in
  • add cpu() to avoid crash when using ase with GPU by @kenko911 in
  • Added the united test for hessian in to improve the coverage score by @kenko911 in
  • AtomRef Updates by @lbluque in
  • Bump pymatgen from 2023.8.10 to 2023.9.2 by @dependabot in
  • Remove torch.unique for finding the maximum three body index and little cleanup in united tests by @kenko911 in
  • Bump pymatgen from 2023.9.2 to 2023.9.10 by @dependabot in
  • Add united test for trainer.test and description in the example by @kenko911 in
  • Bump pytorch-lightning from 2.0.8 to 2.0.9 by @dependabot in
  • Sequence instead of list for inputs by @lbluque in
  • Avoiding crashes for PES training without stresses and update pretrained models by @kenko911 in
  • Bump pymatgen from 2023.9.10 to 2023.9.25 by @dependabot in
  • Allow to choose distribution in xavier_init by @lbluque in
  • An example for the simple training of M3GNet formation energy model is added by @kenko911 in
  • Directed line graph by @lbluque in
  • Bump pymatgen from 2023.9.25 to 2023.10.4 by @dependabot in
  • Bump torch from 2.0.1 to 2.1.0 by @dependabot in
  • Bump pymatgen from 2023.10.4 to 2023.10.11 by @dependabot in
  • add testing to m3gnet potential training example by @lbluque in
  • Update Training a MEGNet Formation Energy Model with PyTorch Lightnin… by @1152041831 in
  • Bump pymatgen from 2023.10.11 to 2023.11.12 by @dependabot in
  • dEdLat contribution for stress calculations is added and Universal Potentials are updated by @kenko911 in
  • Bump torch from 2.1.0 to 2.1.1 by @dependabot in

New Contributors

  • @1152041831 made their first contribution in

Full Changelog:…v0.8.6


  • Extend the functionality of ASE-interface for molecular systems and include more different ensembles. (@kenko911)
  • Improve the dgl graph construction and fix the if statements for stress and atomwise training. (@kenko911)
  • Refactored MEGNetDataset and M3GNetDataset classes with optimizations.


  • Bug fix for np.meshgrid. (@kenko911)


  • Add site-wise predictions for Potential. (@lbluque)
  • Enable CLI tool to be used for multi-fidelity models. (@kenko911)
  • Minor fix for model version for DIRECT model.


  • Fixed bug with loading of models trained with GPUs.
  • Updated default model for relaxations to be the M3GNet-MP-2021.2.8-DIRECT-PES model.


  • Fix a bug with use of set2set in M3Gnet implementation that affected intensive models such as the formation energy model. M3GNet model version is updated to 2 to invalidate previous models. Note that PES models are unaffected. (@kenko911)


  • Minor optimizations for memory and isolated atom training (@kenko911)


  • MatGL now supports structures with isolated atoms. (@JiQi535)
  • Fourier expansion layer and generalize cutoff polynomial. (@lbluque)
  • Radial bessel (zeroth order bessel). (@lbluque)


  • Simple CLI tool mgl added.


  • Bug fix for training loss_fn.


  • Refactoring of training utilities. Added example for training an M3GNet potential.


  • Minor internal refactoring of basis expansions into (@lbluque)


  • Critical bug fix for code regression affecting pre-loaded models.


  • M3GNet Formation energy model added, with example notebook.
  • M3GNet.predict_structure method added.
  • Massively improved documentation at


  • Minor doc and code usability improvements.


  • Minor improvements to model versioning scheme.
  • Added matgl.get_available_pretrained_models() to help with model discovery.
  • Misc doc and error message improvements.


  • Model versioning scheme implemented.
  • Added convenience method to clear cache.


  • Model serialization has been completely rewritten to make it easier to use models out of the box.
  • Convenience method matgl.load_model is now the default way to load models.
  • Added a TransformedTargetModel.
  • Enable serialization of Potential.
  • IMPORTANT: Pre-trained models have been reserialized. These models can only be used with v0.5.0+!


  • Pre-trained M3GNet universal potential
  • Pytorch lightning training utility.


  • Major refactoring of MEGNet and M3GNet models and organization of internal implementations. Only key API are exposed via matgl.models or matgl.layers to hide internal implementations (which may change).
  • Pre-trained models ported over to new implementation.
  • Model download now implemented.


  • Fixes for pre-trained model download.
  • Speed up M3GNet 3-body computations.


  • Pre-trained MEGNet models for formation energies and band gaps are now available.
  • MEGNet model implemented with predict_structure convenience method.
  • Example notebook demonstrating pre-trained model usage is available.


  • Initial working version with m3gnet and megnet.

© Copyright 2022, Materials Virtual Lab