--- id: chgnet version: "0.4.2" license: Modified BSD license_treatment: permissive maintenance: active --- # chgnet — Pretrained Universal Neural Network Potential for Charge-informed Atomistic Modeling License: permissive · Maintenance: active · Downloads: 143.0K/mo ## 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 above — 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 pip install chgnet uv add chgnet 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_current - Install friction: medium - Maintenance: active - Downloads: 143.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags neural network potential for materials, graph neural network force field, structure prediction and relaxation, charge-informed atomistic modeling, materials property prediction, molecular dynamics with neural networks, crystal structure optimization, materials-science, machine-learning-potential, graph-neural-networks [View on SkillFed](https://skillfed.io/packages/chgnet) · [View on PyPI](https://pypi.org/project/chgnet/)