mat-diffusion-analysis
Calculate ionic diffusion coefficients and activation energy from MD trajectories using pymatgen.
Skill by learningmatter-mit
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-mat-diffusion-analysis
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
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 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/mat-diffusion-analysis
What's inside
- Skill name
mat-diffusion-analysis- Description
- Calculate ionic diffusion coefficients and activation energy from MD trajectories using pymatgen.
- License
- MIT
- Instructions
- 62 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (11)
- SKILL.md
- LGPS_221.cif · examples/LGPS/
- README.md · examples/LGPS/
- arrhenius_plot.png · examples/LGPS/
- msd_Li_1000K.png · examples/LGPS/
- msd_Li_600K.png · examples/LGPS/
- msd_Li_700K.png · examples/LGPS/
- msd_Li_800K.png · examples/LGPS/
- msd_Li_900K.png · examples/LGPS/
- analyze_diffusion.py · scripts/
- calculate_activation_energy.py · scripts/
SKILL.md (first lines)
# Diffusion Analysis
## Goal
To accurately calculate the ionic diffusivity ($D$) and activation energy ($E_a$) of specific atomic species in a material using Molecular Dynamics (MD) trajectories and the Arrhenius relation: $D(T) = D_0 \exp\left(-\frac{E_a}{k_B T}\right)$.
## Instructions
1. **MD Preparation**: Run NVT or NPT MD simulations at multiple temperatures (typically 4-6 points between 600K and 1200K).
- Use the `run_md` tool from a relevant potential skill (e.g., [mace](../mace/SKILL.md) or [matgl](../matgl/SKILL.md)).
- **Batch Processing**: You can pass a directory or a list of CIF paths to `structure_data` to run multiple MD simulations concurrently via the MCP tool.
- **Supercell Expansion**: Ensure supercells are sufficiently large (> 10 Å in all dimensions). The `run_md` tool natively supports this via the `supercell_min_length` argument (defaults to 10.0 Å) which performs orthogonal expansion automatically.
- **Optimization**: Use the `diffusion` monitor (see [mat-md-monitors](../mat-md-monitors/SKILL.md)) to automatically stop simulations once the transport properties have converged.
```python
mace.run_md(
structure_data=["candidates/A.cif", "candidates/B.cif"],
temperature=600,
supercell_min_length=10.0,
monitor=True,
monitor_type="diffusion",
monitor_params={"specie": "Li", "threshold": 0.05, "check_interval_ps": 5.0}
)
```
*Note: If the `diffusion` monitor triggers an early stop, it will automatically save the `diffusion_{specie}.json` and `msd_{specie}.png` directly into the trajectory output directory. You can skip Step 2 and proceed directly to Step 3 for any trajectories that converged early.*
2. **Individual Diffusivity Analysis**: For each temperature directory that did *not* hit the early stopping criteria, run the analysis script to extract the diffusivity and Mean Square Displacement (MSD).
```bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/analyze_diffusion.py \
results/md_600K/trajectory.traj \
--species Li \
--temperature 600 \
--ignore_ps 5.0 \
--output_dir results/md_600K
```
- `--ignore_ps`: Time to skip for equilibration. Default is 5.0 ps.
- The script automatically detects the frame interval from the `.log` file if present.
3. **Activation Energy Fitting**: Once all individual results are generated, use the fitting script to combine data and perform a weighted Arrhenius fit.
```bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/calculate_activation_energy.py results/
```
- The script looks for `md_*K/diffusion_results.json` patterns.
- It performs error propagation to calculate uncertainty in $E_a$ and extrapolated room-temperature conductivity.
## Examples
- **Superionic Conductor (LGPS)**: A complete workflow demonstration including supercell preparation, multi-temperature MD, and final Arrhenius plotting for $Li_{10}GeP_2S_{12}$ is available in the [LGPS Example](examples/LGPS/README.md).
## Constraints
- **Trajectory Format**: Trajectories MUST be in ASE `.traj` format.
- **Environments**: All analysis scripts require the **cpu** environment.
- **Linearity**: The diffusivity calculation assumes a linear diffusive regime. Always inspect the generated MSD plots to ensure linearity after the `ignore_ps` period.
- **Atom Count**: To ensure statistical significance, the system should contain a sufficient number of mobile ions (> 20 recommended).
- **Paths**: Always use relative paths from the project root when executing scripts.
## See Also
- [mat-md-monitors](../mat-md-monitors/SKILL.md): Real-time monitoring tools for MD simulations.
---
**Author:** Bowen Deng
**Contact:** [GitHub @learningmatter-mit](https://github.com/learningmatter-mit)From 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 5, 2026 (24 days ago)
- Last release
- Oct 6, 2026 (23 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
Cite this page
mat-diffusion-analysis skill. Agent Mart. https://agentmart.dev/skills/learningmatter-mit-mat-diffusion-analysis (last updated 2026-10-24)