pymatgen

Create crystal structures, compute phase diagrams, and analyze electronic structures with pymatgen.

38|7|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/lamm-mit/ScienceSkills --skill pymatgen-lamm-mit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymatgen
Source: https://github.com/lamm-mit/ScienceSkills/tree/main/skills/pymatgen
Command: npx skills add https://github.com/lamm-mit/ScienceSkills --skill pymatgen-lamm-mit

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides a comprehensive toolkit for materials scientists to create, analyze, and manipulate crystal structures, compute phase diagrams and thermodynamics, and analyze electronic structures.

Core Features & Use Cases

  • Crystal Structure Analysis: Create, manipulate, and analyze crystal structures and molecules.
  • Phase Diagrams: Compute phase diagrams and assess thermodynamic stability.
  • Electronic Structure Analysis: Analyze band structures, density of states, and electronic properties.
  • Materials Project Integration: Access Materials Project's database of computed materials programmatically.
  • Use Case: Imagine you have a crystal structure for a new material. Use this Skill to compute its phase diagram, analyze its electronic structure, and extract information from the Materials Project database.

Quick Start

Use the pymatgen skill to compute the phase diagram for a given material composition. First, install pymatgen and mp-api: ```bash pip install pymatgen mp-api

Then, run the following command:
```bash
python scripts/phase_diagram_generator.py Li-Fe-O --analyze "LiFeO2"

Frequently Asked Questions about pymatgen

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

FAQPage Schema
How do I compute a phase diagram for a specific material composition?

To compute a phase diagram, install pymatgen and mp-api via pip, then run the phase_diagram_generator.py script with your composition, such as Li-Fe-O, and specify a material like LiFeO2 to analyze its thermodynamic stability.

Can I access Materials Project database entries programmatically for crystal structure analysis?

Yes, you can access the Materials Project database programmatically using the mp-api dependency. This integration allows you to extract computed materials data, manipulate crystal structures, and analyze electronic properties directly within your Python workflow.

What Python libraries do I need to analyze electronic structure and density of states?

You need pymatgen, mp-api, pandas, matplotlib, and numpy to analyze electronic structure, density of states, and band structures. These dependencies support computation, data manipulation, and visualization for materials science workflows.

Does this approach require expertise in materials science and quantum mechanics packages?

Yes, this toolkit requires expertise in materials science and computational resources. It leverages open-source quantum mechanics packages alongside pymatgen to perform complex tasks like phase diagram computation and electronic structure analysis for material design.

What is the best way to assess thermodynamic stability of a new material?

The best way to assess thermodynamic stability is to compute the phase diagram using the pymatgen toolkit. By inputting your material composition, you can evaluate its stability relative to competing phases and extract relevant thermodynamic data from the Materials Project.

Are there limitations when creating and manipulating crystal structures and molecules?

Limitations include the need for substantial computational resources and materials science expertise. While pymatgen supports creating and manipulating crystal structures, complex electronic structure analysis and phase diagram computation depend on integrating external open-source quantum mechanics packages.

Related Skills