chgnet
Pretrained Universal Neural Network Potential for Charge-informed Atomistic Modeling
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 chgnetuv
uv add chgnetpoetry
poetry add chgnetInstalling 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
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
chempropChemprop trains and deploys message passing…
permissive · top 15,000 on PyPI
fairchem-coreProvides pretrained machine learning models for…
permissive · top 15,000 on PyPI
pyocseAutomates simulation workflows for organic…
permissive · top 15,000 on PyPI
symfcSymfc computes force constants from atomic…
unclear · top 15,000 on PyPI
matscipyMatscipy provides domain-specific computational…
copyleft · top 15,000 on PyPI
phonopyPhonopy calculates phonon properties and…
permissive · top 15,000 on PyPI
vesin-torchComputes neighbor lists for atomistic systems…
permissive · top 15,000 on PyPI
anastructAnalyzes 2D frames and trusses to compute…
copyleft · top 15,000 on PyPI
ViennaRNAViennaRNA provides Python bindings to a C…
unclear · top 15,000 on PyPI
pyxtalPyXtal generates crystal structures with…
permissive · top 15,000 on PyPI