pymatgen

Analyze materials structures and data using pymatgen APIs.

94|11|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/swaruplab/operon --skill pymatgen-swaruplab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymatgen
Source: https://github.com/swaruplab/operon/tree/main/src-tauri/protocols/pymatgen
Command: npx skills add https://github.com/swaruplab/operon --skill pymatgen-swaruplab

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Pymatgen provides a comprehensive, programmable toolkit for researchers to work with crystal structures, perform advanced analyses, and manage data workflows without manual scripting.

Core Features & Use Cases

  • Structure creation, manipulation, and conversion across 100+ file formats (CIF, POSCAR, XYZ, etc.)
  • Symmetry, space-group analysis, phase diagrams, and electronic structure analysis (band structure, DOS)
  • Materials Project integration via MPRester for programmatic data access and high-throughput workflows
  • Prototyping, validation, and reproducible analysis pipelines for computational materials science
  • Lightweight I/O and serialization with as_dict/from_dict for robust data persistence

Quick Start

Install pymatgen and load a structure from a file to start exploring analysis and conversion capabilities.

Frequently Asked Questions about pymatgen

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

FAQPage Schema
How do I convert a crystal structure file between CIF and POSCAR formats?

You can convert crystal structures across 100+ file formats including CIF, POSCAR, and XYZ using pymatgen structure manipulation and format conversion capabilities. It handles file parsing and writing without manual scripting.

Can I pull materials data from Materials Project for high-throughput workflows?

Yes, you can access Materials Project data programmatically by integrating the mp-api package with pymatgen's MPRester. This enables automated data retrieval and high-throughput computational workflows for materials analysis.

How do I generate and analyze phase diagrams from computed materials data?

You can generate and analyze phase diagrams using pymatgen's built-in tools for computational materials science. It processes computed entries to plot phase stability and perform thermodynamic analysis directly.

Do I need Python 3.10 or higher to run pymatgen for electronic structure analysis?

Yes, you need Python 3.10 or higher to run pymatgen for electronic structure analysis including band structure and DOS. The mp-api package is optional for Materials Project access, and PyYAML is optional for YAML export.

What is the best way to perform symmetry and space-group analysis on a crystal structure?

The best way to perform symmetry and space-group analysis is loading your structure file into pymatgen. It provides programmatic symmetry analysis tools to identify space groups and validate structural properties automatically.

How do I serialize parsed structure data for reproducible analysis pipelines?

You can serialize parsed structure data using pymatgen's lightweight as_dict and from_dict I/O methods. This ensures robust data persistence and enables reproducible analysis pipelines for computational materials science.