pymatgen

Automate crystalline materials analysis and data handling with Python.

1|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/JosephWoodall/noosphere --skill pymatgen-josephwoodall
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymatgen
Source: https://github.com/JosephWoodall/noosphere/tree/main/.agent/skills/pymatgen
Command: npx skills add https://github.com/JosephWoodall/noosphere --skill pymatgen-josephwoodall

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymatgen, mp-api, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Researchers often struggle to load, analyze, and compare crystal structures across formats, leading to manual, error-prone workflows. Pymatgen provides a single, programmable toolkit to handle structures, formats, and data from the Materials Project with robust APIs and workflows.

Core Features & Use Cases

  • Structure creation, manipulation, and transformation (supercells, symmetry reduction, interpolation).
  • File I/O across 100+ formats (CIF, POSCAR/CONTCAR, XYZ, PDB, JSON/YAML) and serialization for provenance.
  • Phase diagrams, thermodynamics, and Materials Project integration (MPRester) for high-throughput analysis.
  • Electronic structure analysis (band structure, DOS), surface and adsorption studies, and compatibility with common codes (VASP, Gaussian, Quantum ESPRESSO).
  • Use case: generate doped structures and prepare VASP inputs for HT screening or retrieve materials data via mp-api for quick phase-diagram exploration.

Quick Start

Install pymatgen and load a CIF to begin exploring crystal structures.

Frequently Asked Questions about pymatgen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze crystal structures and retrieve materials data using Python?

To automate crystalline materials analysis, use Python with the pymatgen library to manipulate structures and the optional mp-api to retrieve Materials Project data. It supports file I/O across formats like CIF, POSCAR, and XYZ.

Can I generate VASP inputs and prepare doped structures for high-throughput screening?

Yes, you can generate doped structures and prepare VASP inputs for high-throughput screening. The toolkit supports creating supercells, symmetry reduction, and interpolation for compatibility with common codes like VASP, Gaussian, and Quantum ESPRESSO.

Does pymatgen support electronic structure analysis like band structure and DOS?

Yes, pymatgen supports electronic structure analysis including band structure and density of states (DOS). It also handles phase diagrams, thermodynamics, and surface and adsorption studies for comprehensive research workflows.

What's the best way to load and compare crystal structures across different file formats?

The best way to load and compare crystal structures across formats is using pymatgen's programmable toolkit, which supports file I/O across 100+ formats including CIF, POSCAR/CONTCAR, XYZ, PDB, and JSON/YAML with serialization for provenance.

Do I need mp-api to access Materials Project data for phase diagram exploration?

Yes, you need the optional mp-api dependency to access Materials Project data via MPRester for quick phase-diagram exploration. The core pymatgen library handles the local structure manipulation and analysis independently.

Are there limitations when using pymatgen for file I/O and serialization?

Pymatgen supports file I/O across 100+ formats and serialization for provenance, but requires Python and the pymatgen library. Optional mp-api is needed for Materials Project access, which may limit high-throughput data retrieval without it.