agentleFS
Hongyu-yuHongyu-yu/matsci-ai-skills/skills/pymatgen-core/SKILL.md

pymatgen-core

Skill19 starsChanged 10 months agoMITView on GitHub

Use for pymatgen core objects and structure manipulation: Element/Specie/Composition, Lattice/Site/Structure/Molecule, oxidation states, structure edits, transformations, and serialization.

  • Installs packages

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ensure pymatgen is installed in your Python environment:

    line 16

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pymatgen Core

Overview

Pymatgen core provides the fundamental objects for representing chemistry, lattices, sites, and structures. Use it to build, edit, and serialize structures and molecules before moving into specialized analysis or IO modules.

Required Python Environment

Ensure pymatgen is installed in your Python environment:

pip install pymatgen
# or
conda install -c conda-forge pymatgen

Example usage pattern:

from pymatgen.core import Structure, Lattice, Element
# your code here

When to Use This Skill

  • Build or edit Structure/Molecule objects
  • Work with compositions, oxidation states, or lattice transforms
  • Serialize objects for storage or downstream workflows

Core Capabilities

1. Structures and Molecules

  • Structure/IStructure for periodic systems
  • Molecule/IMolecule for non-periodic systems
  • Site operations and lattice utilities

2. Chemistry Primitives

  • Element, Specie, Composition, and oxidation states
  • Formula reduction and fraction calculations

3. Transformations and Serialization

  • Structure edits and transformations
  • Monty as_dict() / from_dict() serialization

Quick Workflow

  1. Identify the primary object type (Structure, Molecule, or Composition).
  2. Load/build and validate oxidation states or primitive cells.
  3. Apply transformations or edits.
  4. Serialize with as_dict() or export via .to().

Resources

scripts/

Executable examples in the scripts/ directory:

  • 2013-01-01-Basic_functionality.py - Basic structure, lattice, and composition operations.
  • 2013-01-01-Ordering_Disordered_Structures.py - Ordering disordered structures and site occupancy handling.

references/

Detailed reference material (load as needed):

  • references/modules.md - Core objects and usage patterns
  • references/docs/usage.md - Local usage overview
  • references/docs/pymatgen.core.md - API details

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.