Pymatgen structure

From jinzhezenggroup/computational-chemistry-agent-skills · View interactive version

Pymatgen structure is an AI agent skill from the GitHub repository jinzhezenggroup/computational-chemistry-agent-skills. Structure manipulation and crystal analysis workflows based on pymatgen. USE WHEN you need to read/write common atomistic formats (CIF, POSCAR, XYZ), build supercells, perform site substitution/doping, inspect symmetry (space group), or compute local structure descriptors for materials tasks.

How to use this skill

Skill file

pymatgen Structure Operations

Use this skill to perform structure preprocessing and analysis with pymatgen.

Scope

This skill should:

This skill should not:

If the user asks for DFT submission, hand off to a submission skill such as dpdisp-submit after preprocessing is done.

Hard requirement

The user must provide an input structure source (file path or explicit coordinates + lattice).

If structure input is missing, stop and ask for it.

Supported input/output formats

Typical input formats:

Typical output formats:

Expected workflow

  1. Read user-provided structure.
  2. Validate periodicity and cell information.
  3. Confirm requested operation (convert, supercell, substitution, analysis).
  4. Collect only missing critical parameters.
  5. Execute operation via pymatgen.
  6. Write output structure(s) and a short result summary.
  7. If requested, prepare handoff-ready files for downstream skills.

For concrete command patterns, see references/commands-and-workflow.md.

Operations this skill should handle

A) Format conversion

B) Supercell construction

C) Substitution / doping-like edits

D) Symmetry and composition analysis

E) Local environment quick checks

Parameters to collect

Must provide

Operation-specific

For format conversion:

For supercell:

For substitution:

For symmetry analysis:

Required behavior

  1. Check file existence/readability before processing.
  2. Detect and report missing lattice info for periodic workflows.
  3. Do not silently drop atoms or reorder species without notice.
  4. Explicitly show assumptions (for example tolerance values).
  5. Return exact output file paths.

Defaulting policy

Allowed only for low-risk defaults, clearly labeled.

Reasonable defaults:

Do not silently invent:

Expected output

Provide:

  1. output file path(s)
  2. concise summary of changes (atom count, composition, lattice deltas)
  3. analysis result highlights (for example space group)
  4. explicit assumptions and unresolved choices
  5. next-step suggestion when user wants downstream DFT/MD submission

Common failure points

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.