ml-generative-mattergen
Generate inorganic material structures using MatterGen, a diffusion-based generative model.
Skill by learningmatter-mit
Chalk Labs
Need help deploying ml-generative-mattergen?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/learningmatter-mit-ml-generative-mattergen
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 2
codeload.github.com· found in install commandgithub.com· found in code
Files it touches
~/.claude/skills/ml-generative-mattergen
What's inside
- Skill name
ml-generative-mattergen- Description
- Generate inorganic material structures using MatterGen, a diffusion-based generative model.
- License
- MIT
- Instructions
- 179 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (9)
- SKILL.md
- README.md · examples/finetuning/
- adapter_config.json · examples/finetuning/example_finetuned_model/
- adapter_model.bin · examples/finetuning/example_finetuned_model/
- make_dummy.py · examples/finetuning/
- run_finetune_example.sh · examples/finetuning/
- prepare_training_data.py · scripts/
- run_finetuning.py · scripts/
- setup_mattergen.py · scripts/
SKILL.md (first lines)
# MatterGen Structure Generation Skill
This skill provides tools for generating novel inorganic material structures using MatterGen, a state-of-the-art diffusion-based generative model for crystalline materials.
## 1. Prerequisites
> [!IMPORTANT]
> **GPU Required**: MatterGen generation needs a CUDA GPU (NVIDIA driver ≥ 525).
- Runs as the `mattergen` MCP server and its scripts run in the `mattergen` environment: on x86_64 a uv environment created on first use (CUDA 12.6 or 13 by driver), on aarch64 the `generative` container image.
- A MatterGen checkout next to this project as `../mattergen`, or anywhere with `MATTERGEN_REPO` pointing to it. MatterGen's PyPI distribution omits the data files it needs (sampling configs, GemNet scale factors), so it runs from the checkout, as upstream installs it. Fetch it with the setup script, which pins the verified commit, skips the LFS checkpoints (the weights come from Hugging Face) and replaces `np.math`, which NumPy 2 removed:
```bash
${CLAUDE_SKILL_DIR}/../../venv/run mattergen python ${CLAUDE_SKILL_DIR}/scripts/setup_mattergen.py
```
`venv/run` mounts it into the container on aarch64.
- On aarch64 (e.g. NVIDIA DGX Spark) the image carries PyG's extensions compiled for CUDA, which PyG publishes no aarch64 wheels for; nothing needs building on the host.
## 2. Available Models
MatterGen provides several pretrained models:
- `mattergen_base`: Base unconditional generative model
- `mp_20_base`: Materials Project base model
- `dft_mag_density`: Model for magnetic density conditioning
- `chemical_system`: Model for chemical system conditioning
## 3. MCP Tool Usage
The MCP tool automatically loads models when needed - no explicit load step required.
### Unconditional Generation
Generate novel structures without conditioning:
```python
from mcp_base import mattergen.generate_structures
result = mattergen.generate_structures(
model_name="mattergen_base",
num_structures=10,
batch_size=10,
output_dir="research/my_project/generated"
)
```
### Chemical System Conditioning
Generate structures from a specific chemical system (controls which elements appear):
```python
result = mattergen.generate_structures(
chemical_system="Li-Fe-P-O", # Automatically uses chemical_system model
guidance_scale=1.0, # Recommended for chemical system conditioning
num_structures=20,
batch_size=10,
output_dir="research/cathode_materials/generated"
)
```
> [!NOTE]
> Chemical system conditioning controls which **elements** appear, but **NOT** the exact stoichiometry.
> For example, `chemical_system="Li-Zr-Cl"` can generate Li3Cl5, LiZrCl4, Li2ZrCl5, etc., but you cannot specify exactly "Li2ZrCl6".
## 4. Fine-Tuning (Skill Scripts)
Fine-tune MatterGen on custom datasets using the skill scripts:
### Step 1: Prepare Training Data
```bash
# Convert structures and properties to CSV format
${CLAUDE_SKILL_DIR}/../../venv/run mattergen python ${CLAUDE_SKILL_DIR}/scripts/prepare_training_data.py \
--structures-json training_structures.json \
--property-name "formation_energy" \
--output training_data.csv
```
**Training data JSON format**:
```json
[
{
"structure": {<pymatgen Structure dict>},
"properties": {"formation_energy": -2.5}
},
...
]
```
### Step 2: Run Fine-Tuning
```bash
${CLAUDE_SKILL_DIR}/../../venv/run mattergen python ${CLAUDE_SKILL_DIR}/scripts/run_finetuning.py \
--training-data training_data.csv \
--property-name "formation_energy" \
--base-model "mattergen_base" \
--epochs 100 \
--output-dir finetuned_formation_energy
```
**Fine-tuning parameters**:
- `--training-data`: Path to CSV from Step 1
- `--property-name`: Property to condition on (must match CSV column)
- `--base-model`: Starting model (mattergen_base, chemical_system, etc.)
- `--epochs`: Training epochs (100-200 recommended)
- `--learning-rate`: Learning rate (default: 5e-6)
- `--batch-size`: Batch size (default: 32)
> [!TIP]
> - Start with 2 epochs for quick testing
> - Use 100-200 epochs for actual fine-tuning
> - GPU required (fine-tuning on CPU is extremely slow)
## 5. Output Files
### Generation OutputFrom learningmatter-mit/AtomisticSkills, MIT.
More from learningmatter-mit/AtomisticSkills
- 0.681score
drug-complex-system-builder
learningmatter-mit
Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-binding-site-definition
learningmatter-mit
Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-mmpbsa-gbsa
learningmatter-mit
Compute single-trajectory MM-GBSA and / or MM-PBSA binding free energy estimates from a protein-ligand MD trajectory.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-pocket-detection
learningmatter-mit
Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-sorption-relax
learningmatter-mit
Prepares supercells for porous frameworks based on minimum interplanar distance and relaxes them using standard MLIP relaxation tools.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-protein-ligand-md
learningmatter-mit
Run a protein-ligand MD simulation in OpenMM with energy minimization, restrained equilibration, and production NPT, producing trajectory and checkpoint files…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-db-qmof
learningmatter-mit
Query the Quantum MOF (QMOF) database via Materials Project's MPContribs platform for DFT-computed properties (bandgap) and optimized crystal structures of…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-bond-dissociation
learningmatter-mit
Calculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-hazard-toxicity
learningmatter-mit
Extract explicit safety warnings, GHS classifications, LD50 toxicity profiles, and acute oral toxicity triage from PubChem PUG VIEW.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-redocking-rmsd
learningmatter-mit
Compute symmetry-corrected heavy-atom RMSD between docked poses and a reference crystal ligand to validate docking protocols.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-pose-validation
learningmatter-mit
Validate docked or generated ligand poses for physical plausibility using PoseBusters, filtering out chemically invalid or clashing poses before downstream…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-dft-orca-optimization
learningmatter-mit
Run DFT geometry optimization (minimization or TS search) on a molecular structure using ORCA via SCINE/ReaDuct wrapper.
SkillAFreshness: A★ 183Claude Code +9
Signals
- Stars
- 183
- Forks
- 31
- Open issues
- 0
- Last commit (this folder)
- Oct 6, 2026 (25 days ago)
- Last release
- Oct 6, 2026 (24 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Website
- arxiv.org/abs/2605.24002
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from learningmatter-mit
- 0.681score
drug-binding-site-definition
learningmatter-mit
Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-complex-system-builder
learningmatter-mit
Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-mmpbsa-gbsa
learningmatter-mit
Compute single-trajectory MM-GBSA and / or MM-PBSA binding free energy estimates from a protein-ligand MD trajectory.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-pocket-detection
learningmatter-mit
Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-pose-validation
learningmatter-mit
Validate docked or generated ligand poses for physical plausibility using PoseBusters, filtering out chemically invalid or clashing poses before downstream…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-sorption-relax
learningmatter-mit
Prepares supercells for porous frameworks based on minimum interplanar distance and relaxes them using standard MLIP relaxation tools.
SkillAFreshness: A★ 183Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get ml-generative-mattergen running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
ml-generative-mattergen skill. Agent Mart. https://agentmart.dev/skills/learningmatter-mit-ml-generative-mattergen (last updated 2026-10-24)