skillfed

chgnet

Pretrained Universal Neural Network Potential for Charge-informed Atomistic Modeling

chgnet v0.4.2 143.0K downloads/30d#11,190 on PyPI398
Permissive license Modified BSD Active released

What it is and what it does

CHGNet is a pretrained universal neural network potential designed for atomistic modeling of crystal structures. It predicts energy, forces, stress, and magnetic moments by learning from over 1.5 million structures from the Materials Project, using charge information (inferred from DFT magnetic moments) to capture electron interactions and local ionic environments. The model achieves near-DFT accuracy while being orders of magnitude faster, making it suitable for high-throughput materials discovery and structure optimization.

The package integrates with pymatgen for structure handling and ase for molecular dynamics simulations. It provides multiple pretrained checkpoints (including versions trained on different datasets like MPtrj and R2SCAN) that can be loaded directly or fine-tuned for specific systems. Users can perform direct inference on static structures, run structure relaxations, or conduct charge-informed molecular dynamics without needing to train a model from scratch.

Use it for:

  • Predict stability and properties of crystal structures for high-throughput materials screening without expensive DFT calculations.
  • Optimize atomic positions and cell parameters for new materials or hypothetical structures using CHGNet-based relaxation.
  • Run molecular dynamics simulations with charge-informed forces to study thermal properties and phase behavior.
  • Fine-tune the pretrained model on a custom dataset to improve accuracy for a specific class of materials or chemical system.
  • Calculate elastic properties (bulk modulus, shear modulus) and phonon properties using CHGNet with atomate2 workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

CHGNet is a pretrained graph neural network that predicts energy, forces, stress, and magnetic moments for crystal structures, enabling structure optimization and molecular dynamics simulations with charge-informed accuracy.

Yes, with conditions. CHGNet is actively maintained, has no known vulnerabilities, and offers a practical alternative to DFT for structure prediction and relaxation. Install it if you need fast, charge-informed atomistic modeling and can manage the dependencies (torch, pymatgen, ase). Medium install friction is manageable given the prebuilt wheels. Not suitable if you require absolute DFT accuracy or work exclusively with systems outside the Materials Project's coverage.

Install

chgnet on PyPI

pip

pip install chgnet

uv

uv add chgnet

poetry

poetry add chgnet

Installing chgnet

Before you install

Medium install friction due to dependencies on torch, pymatgen, and ase. The package is actively maintained with recent commits and provides prebuilt wheels for Python 3.10–3.12 across major platforms (macOS, Linux, Windows), reducing compilation burden.

License in practice

Licensed under Modified BSD (permissive), allowing use in commercial and private projects with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

pip install chgnet

from chgnet.model.model import CHGNet
from pymatgen.core import Structure

chgnet = CHGNet.load()
structure = Structure.from_file('structure.cif')
prediction = chgnet.predict_structure(structure)
print(prediction['e'])  # energy per atom

Requires torch and pymatgen; GPU support optional but recommended for large-scale simulations. Python ≥3.10 required.

Verify before relying

  • Specific accuracy metrics or benchmarks compared to DFT for different material classes beyond the Matbench Discovery reference.
  • Memory requirements and computational cost for typical structure relaxation or MD workflows.
  • Whether fine-tuning on custom datasets is production-ready or still experimental.

Package facts

License Modified BSD (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 7 — ase, cython, numpy, nvidia-ml-py3, pymatgen, torch, typing-extensions
Maintenance actively maintained — 326 days since the last release
Last repo commit
First released
Downloads 143,005/month — #11,190 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: chgnet-0.4.2-cp310-cp310-macosx_10_9_universal2.whl; chgnet-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; chgnet-0.4.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; chgnet-0.4.2-cp310-cp310-musllinux_1_2_i686.whl; chgnet-0.4.2-cp310-cp310-musllinux_1_2_x86_64.whl; chgnet-0.4.2-cp310-cp310-win32.whl; chgnet-0.4.2-cp310-cp310-win_amd64.whl; chgnet-0.4.2-cp311-cp311-macosx_10_9_universal2.whl; chgnet-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; chgnet-0.4.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; chgnet-0.4.2-cp311-cp311-musllinux_1_2_i686.whl; chgnet-0.4.2-cp311-cp311-musllinux_1_2_x86_64.whl; chgnet-0.4.2-cp311-cp311-win32.whl; chgnet-0.4.2-cp311-cp311-win_amd64.whl; chgnet-0.4.2-cp312-cp312-macosx_10_9_universal2.whl; chgnet-0.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; chgnet-0.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; chgnet-0.4.2-cp312-cp312-musllinux_1_2_i686.whl; chgnet-0.4.2-cp312-cp312-musllinux_1_2_x86_64.whl; chgnet-0.4.2-cp312-cp312-win32.whl

Intended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: ChemistryTopic :: Scientific/Engineering :: Physics

Tags

neural network potential for materialsgraph neural network force fieldstructure prediction and relaxationcharge-informed atomistic modelingmaterials property predictionmolecular dynamics with neural networkscrystal structure optimization
materials-sciencemachine-learning-potentialgraph-neural-networks

More Artificial Intelligence packages