What do you want to do?
3 use cases
-
Predict energy, forces and magnetic moments of a crystal
Load a pretrained CHGNet and run a static calculation on a CIF structure.
View prompt
Using CederGroupHub/chgnet, install it with `pip install chgnet`, load a CIF with pymatgen and run `chgnet.predict_structure(structure)`. Print energy, forces, stress and magmom with their units.
-
Pre-relax structures before a DFT run
Use StructOptimizer to relax a structure and get site-wise magnetic moments to seed spin-polarized DFT.
View prompt
With CederGroupHub/chgnet, relax my CIF using `relaxer = StructOptimizer()` and `result = relaxer.relax(structure)`, then print the relaxed structure and total energy in eV.
-
Run a short charge-informed molecular dynamics simulation
Drive an ASE molecular dynamics run with the pretrained model on a crystal.
View prompt
Using CederGroupHub/chgnet, run `MolecularDynamics` with ensemble nvt on my CIF at <temperature> K, timestep 2, then call `md.run(50)` and summarise md_out.log.
Quick start with Chgnet
- Check you have what it needs: Python and pip; A crystal structure file such as a CIF; pymatgen for loading structures.
- Open CederGroupHub/chgnet on GitHub and read the README and license.
- Install with
pip install chgnet - Load the default model with
chgnet = CHGNet.load() - Read your structure with
Structure.from_file('examples/mp-18767-LiMnO2.cif'), using your own CIF path - Call
chgnet.predict_structure(structure)to get the prediction
These steps come from our top use case, Predict energy, forces and magnetic moments of a crystal, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for CederGroupHub/chgnet
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forMaterials scientists and computational chemists who want fast ML-based energies, relaxations and molecular dynamics for crystals.
- Why it is hot413 stars, talked about in 2 AI sources we track
- LanguagePython
- Sourcegithub.com/CederGroupHub/chgnet ยท Back to Hot repos
Requirements
- Python and pip
- A crystal structure file such as a CIF
- pymatgen for loading structures
- CPU, NVIDIA GPU, Intel GPU or Apple silicon (device picked automatically)
Add this badge to your README
Maintain Chgnet? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/cedergrouphub-chgnet/?utm_source=github&utm_medium=badge&utm_campaign=CederGroupHub-chgnet)
HTML
<a href="https://dedupedai.com/use-cases/cedergrouphub-chgnet/?utm_source=github&utm_medium=badge&utm_campaign=CederGroupHub-chgnet"><img src="https://dedupedai.com/badge/CederGroupHub/chgnet.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Chgnet
What is Chgnet?
CHGNet is a pretrained universal neural network potential for charge-informed atomistic modeling. It is trained on Materials Project trajectories and predicts energy, forces, stress and magnetic moments of a crystal structure with near DFT accuracy, and runs structure relaxation and molecular dynamics through a Python API. It is an open-source project on GitHub: https://github.com/CederGroupHub/chgnet.
How do I use Chgnet?
Install with pip install chgnet; then load the default model with chgnet = CHGNet.load(); read your structure with Structure.from_file('examples/mp-18767-LiMnO2.cif'), using your own CIF path. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Chgnet for?
Materials scientists and computational chemists who want fast ML-based energies, relaxations and molecular dynamics for crystals.
What can I do with Chgnet?
3 use cases so far, for example: Predict energy, forces and magnetic moments of a crystal; Pre-relax structures before a DFT run; Run a short charge-informed molecular dynamics simulation. Each has steps and a copy-paste agent prompt.
What do I need to run Chgnet?
Python and pip; A crystal structure file such as a CIF; pymatgen for loading structures; CPU, NVIDIA GPU, Intel GPU or Apple silicon (device picked automatically).
What are alternatives to Chgnet?
Other hot AI repos in Security and science: Failproofai, Codex Security, Semgrep, Mace, Syft.
Is Chgnet safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.