/atomistic-skills:ml-generative-diffcspfrom Atomistic Skills
Generates crystal structures using DiffCSP++, a diffusion model with space group symmetry constraints. Supports composition-constrained generation via space group + Wyckoff positions and unconditional generation from trained distributions.
Ships in Atomistic Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Generate novel crystal structures using DiffCSP++ (ICLR 2024), a diffusion model that leverages space group symmetry constraints for crystal structure prediction (CSP) and ab initio generation.
[!IMPORTANT] GPU Required: DiffCSP++ inference is significantly faster on GPU.
diffcsp MCP server and its scripts run in the diffcsp environment: on x86_64 a uv environment created on first use (CUDA 12.6 or 13 by driver), on aarch64 the generative container image.git clone https://github.com/jiaor17/DiffCSP-PP) cloned next to this project as ../DiffCSP-PP, or anywhere with DIFFCSP_REPO pointing to it. venv/run mounts it into the container on aarch64.checkpoints/ directory (e.g. checkpoints/mp_csp/). The DiffCSP-PP README links them on Google Drive; Google Drive needs an interactive download, so fetch them by hand (or with gdown --folder).| Model | Type | Description |
|---|---|---|
mp_csp | CSP | Materials Project — composition-constrained generation |
mp_gen | Gen | Materials Project — unconditional generation |
perov_csp | CSP | Perovskite — composition-constrained generation |
perov_gen | Gen | Perovskite — unconditional generation |
carbon_gen | Gen | Carbon — unconditional generation |
mpts_csp | CSP | MPTS-52 — composition-constrained generation |
Generate structures with exact composition using the generate_structures_with_symmetry MCP tool:
diffcsp.generate_structures_with_symmetry(
spacegroup=58, # Space group number (1-230)
wyckoff_letters="2a,2d,4g", # Wyckoff positions (comma-separated or shorthand "adg")
atom_types="Mn,Li,O", # Element per Wyckoff position
model_name="mp_csp", # CSP model
num_samples=5, # Number of structures to generate
step_lr=1e-5, # Langevin step size
output_dir="research/my_project"
)
Generate multiple structures from a JSON specification file. This is useful when you have many different compositions to generate at once.
JSON format (see examples/example.json):
[
{"spacegroup_number": 58, "wyckoff_letters": ["2a","2d","4g"], "atom_types": ["Mn","Li","O"]},
{"spacegroup_number": 194, "wyckoff_letters": "abff", "atom_types": ["Tm","Tm","Ni","As"]}
]
Run the batch generation script:
${CLAUDE_SKILL_DIR}/../../venv/run diffcsp python ${CLAUDE_SKILL_DIR}/scripts/batch_generate.py \
--json_file ${CLAUDE_SKILL_DIR}/examples/example.json \
--model mp_csp \
--output_dir diffcsp_batch_output \
--step_lr 1e-5
Generate structures from the training distribution without specifying composition. Requires a generation model (mp_gen, perov_gen, or carbon_gen).
${CLAUDE_SKILL_DIR}/../../venv/run diffcsp python ${CLAUDE_SKILL_DIR}/scripts/unconditional_generate.py \
--model mp_gen \
--num_structures 100 \
--output_dir diffcsp_gen_output \
--step_lr 5e-6
| Parameter | Default | Description |
|---|---|---|
spacegroup | — | Space group number (1-230) |
wyckoff_letters | — | Wyckoff positions (e.g., "2a,2d,4g" or shorthand "adg") |
atom_types | — | Element for each Wyckoff position (e.g., "Mn,Li,O") |
model_name | mp_csp | Pre-trained model name |
num_samples | 1 | Number of structures per composition |
step_lr | 1e-5 | Langevin dynamics step size |
batch_size | 128 | Batch size for parallel generation |
structure_XXXX.cif: Generated crystal structure files (pymatgen CIF format)generation_metadata.json: Generation parameters and statistics[!WARNING] Space Group Knowledge Required: You need to know the space group number and Wyckoff positions for your target composition. Use ICSD, Materials Project, or pyxtal to find these.
[!NOTE] Wyckoff Notation: Positions can be given as full labels (
"2a,2d,4g") or shorthand letters ("adg"). The number prefix is the site multiplicity — it's automatically determined from the space group.
diffcsp (uv on x86_64; the generative image on aarch64).atom_types; Gen models can generate without them.DiffCSP++ works well in combination with:
Author: Bowen Deng Contact: GitHub @learningmatter-mit
examples/Li2ZrCl6-symmetry/README.md (opens in a new tab)examples/Li2ZrCl6-symmetry/generation_metadata.json (opens in a new tab)examples/Li2ZrCl6-symmetry/structure_0000.cif (opens in a new tab)examples/Li2ZrCl6-symmetry/structure_0001.cif (opens in a new tab)examples/Li2ZrCl6-symmetry/structure_0002.cif (opens in a new tab)examples/batch-json/README.md (opens in a new tab)examples/batch-json/generation_metadata.json (opens in a new tab)examples/batch-json/structure_0000.cif (opens in a new tab)examples/batch-json/structure_0001.cif (opens in a new tab)examples/example.json (opens in a new tab)examples/unconditional/README.md (opens in a new tab)examples/unconditional/generation_metadata.json (opens in a new tab)examples/unconditional/structure_0000.cif (opens in a new tab)examples/unconditional/structure_0001.cif (opens in a new tab)examples/unconditional/structure_0002.cif (opens in a new tab)examples/unconditional/structure_0003.cif (opens in a new tab)examples/unconditional/structure_0004.cif (opens in a new tab)scripts/batch_generate.py (opens in a new tab)scripts/unconditional_generate.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub learningmatter-mit/atomisticskills --plugin atomistic-skills133 skills in this plugin
/chem-bond-dissociationCalculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation./chem-conformer-searchGenerate molecular conformers with RDKit ETKDG, relax with MLIPs, and rank by energy with Boltzmann weighting./chem-db-mofQuery multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al. via Materials Cloud) and download CIF structures with optional element or identifier filters.Other plugins' skills for the same job