{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "cedergrouphub-chgnet--predict-crystal-energy-forces-and-magmoms-with-chgnet",
 "repo": "CederGroupHub/chgnet",
 "repo_url": "https://github.com/CederGroupHub/chgnet",
 "repo_slug": "cedergrouphub-chgnet",
 "title": "Predict energy, forces and magnetic moments of a crystal",
 "page_title": "How to predict energy, forces and magnetic moments of a crystal with Chgnet",
 "summary": "Load a pretrained CHGNet and run a static calculation on a CIF structure.",
 "who": "A materials scientist who needs a quick estimate before spending DFT time.",
 "problem": "A DFT static calculation for every candidate structure is slow and costly.",
 "outcome": "Predicted energy per atom, forces, stress and magnetic moments for your structure.",
 "steps": [
  "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",
  "Print energy (eV/atom), forces (eV/A), stress (GPa) and magmom (mu_B) from the result"
 ],
 "agent_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.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "Predictions are model estimates, so check anything important against DFT.",
 "category": "Security and science",
 "tags": [
  "Security and science"
 ],
 "lang": "python",
 "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)"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/cedergrouphub-chgnet/predict-crystal-energy-forces-and-magmoms-with-chgnet/",
 "md": "https://dedupedai.com/use-cases/cedergrouphub-chgnet/predict-crystal-energy-forces-and-magmoms-with-chgnet/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/cedergrouphub-chgnet--predict-crystal-energy-forces-and-magmoms-with-chgnet.json",
 "api_version": "v1"
}
