pymatgen-core

Represent and manipulate pymatgen core objects and structures.

16|Updated Dec 28, 2025
One-click install
npx skills add https://github.com/Hongyu-yu/matsci-ai-skills --skill pymatgen-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pymatgen-core
Source: https://github.com/Hongyu-yu/matsci-ai-skills/tree/main/skills/pymatgen-core
Command: npx skills add https://github.com/Hongyu-yu/matsci-ai-skills --skill pymatgen-core

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Pymatgen core provides the fundamental objects for representing chemistry, lattices, sites, and structures, enabling precise edits, transformations, and serialization for downstream workflows in materials science and computational chemistry.

Core Features & Use Cases

  • Core objects: Element, Specie, Composition, Lattice, Site, Structure, Molecule, and oxidation states.
  • Transformations and serialization: perform edits, transformations, and Monty-based as_dict serialization for storage and data exchange.
  • Use Case: Build a Structure, modify sites, and export to dict or JSON for analysis or sharing.

Quick Start

Create or load a pymatgen Structure, perform edits or transformations, and serialize to a dict for storage.

Frequently Asked Questions about pymatgen-core

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

FAQPage Schema
How do I serialize a pymatgen Structure to a dictionary for data exchange?

Serialize pymatgen Structure objects to dictionaries using Monty-based as_dict serialization, enabling robust storage and data exchange. This allows you to export built structures, lattices, and sites for downstream analysis or sharing.

What are the core objects needed to build a custom lattice and structure in materials science?

Building a custom lattice and structure requires core pymatgen objects like Element, Specie, Composition, Lattice, and Site. These fundamental components enable precise representation and manipulation of chemistry for computational materials workflows.

Do I need pymatgen installed to edit and transform structures and molecules?

Yes, you need a Python environment with pymatgen installed to edit and transform structures and molecules. The implementation relies on this core dependency to perform precise edits, transformations, and Monty-based serialization.

Can I modify sites and apply oxidation states to an existing Composition?

Yes, you can modify sites and apply oxidation states to an existing Composition using pymatgen core objects. This supports precise structural edits and transformations across materials workflows.

What is the best way to represent chemistry and lattices for computational workflows?

The best way to represent chemistry and lattices for computational workflows is using pymatgen core objects. They enable precise edits, transformations, and Monty-based as_dict and from_dict serialization for robust data exchange.