pymatgen Materials Analysis
Analyze, validate, convert, and transform crystal structures and computed materials data with reproducible, provenance-preserving pymatgen workflows.
Data & AnalyticsAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
Guides work with current pymatgen APIs (pymatgen 2026.5.4 / pymatgen-core 2026.7.16) in a way that keeps every result auditable.
- Structure & composition validation: parses CIF/POSCAR and reports occupancies, disorder, oxidation-state decoration, minimum interatomic distances, and every parser warning instead of silently accepting fixes.
- Symmetry sensitivity: sweeps
symprecandangle_tolerancegrids so space-group assignments come with their tolerance context. - Format conversion: produces a representation-loss plan first, writes only to a new path, and round-trip-checks the properties you care about.
- Local phase diagrams: builds convex hulls offline from a strict JSON schema that requires total energies from one compatible correction scheme.
- VASP / Q-Chem I/O: parses band structures and DOS selectively from vasprun.xml while forcing convergence, k-path, and Fermi-level checks.
- Materials Project queries: dry-run planning by default;
--executeallows exactly one bounded query with explicit fields, filters, and result caps. - Artifact manifests: checksums, versions, and sources for full provenance.
Who it's for
- Materials and chemistry researchers validating DFT-derived numbers before publication
- Graduate students building crystal-structure cleanup or conversion pipelines
- Labs consuming Materials Project data who must respect CC BY attribution and citations
- Anyone running computational workflows where reproducibility (pinned versions, provenance) matters
Examples
- "Can I trust this CIF?" —
composition_structure_validator.py structure.cifsurfaces partial occupancies, site-merging warnings, and suspiciously close atom pairs in one pass. - "My space group disagrees with the paper" —
symmetry_sensitivity_report.py structure.cif --symprec 0.001,0.01,0.1explains the gap between the Materials Project convention (0.1 Å) and pymatgen's 0.01 Å default. - "Is my Li-Fe-O structure on the hull?" — collect same-scheme total energies into JSON and run
phase_diagram_generator.py entries.json --analyze Li2Ofor hull distance and decomposition products.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/pymatgen folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/pymatgen/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/pymatgen ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Make sure Claude Code is installed and you can open a terminal.
- Clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r scientific-agent-skills/skills/pymatgen ~/.claude/skills/ - Install Python 3.11+ and
uv, then from the skill folder runuv venv --python 3.11 .venv-pymatgenfollowed byuv pip install --python .venv-pymatgen/bin/python "pymatgen==2026.5.4" "pymatgen-core==2026.7.16" "mp-api==0.46.4". - (Optional) For Materials Project access, export the key only as a shell variable:
export MP_API_KEY=your_key. Never pass it as a CLI argument or commit it to a file. - Restart Claude Code and ask something like "validate this CIF file" to trigger the skill.
- Sanity-check the tooling with
python scripts/composition_structure_validator.py --help.
View source on GitHub ↗License: MIT