/atomistic-skills:mat-kinetic-monte-carlofrom Atomistic Skills
Simulates long-time kinetics using rejection-free kinetic Monte Carlo (KMC) with event catalog construction, rate assignment via TST/Arrhenius, detailed-balance validation, superbasin handling, and transport analysis.
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.
Run kinetic Monte Carlo simulations to evolve a system on experimental (long) timescales using a continuous-time Markov jump process defined by elementary events and their rates.
This skill focuses on best-practice, physics-grounded KMC:
This skill is designed to compose with:
Barrier computations and phonon calculations require MLIP models (MACE, MatGL, FairChem). These run through the corresponding MCP servers or directly via wrapper scripts:
src/mcp_server/mace_server.py — provides relax_structure, predict_structure tools.
Used by neb-barrier and phonon scripts via src/utils/mlips/mace/mace_wrapper.py.src/mcp_server/matgl_server.py — same interface, CHGNet/TensorNet models.src/mcp_server/fairchem_server.py — UMA/ESEN models.KMC scripts themselves do not call MLIPs — they consume barrier/prefactor values computed upstream by the NEB and phonon skills.
KMC simulates a Poisson process over discrete events with rates {k_m}.
At a given state:
This is equivalent to the Gillespie direct method / residence-time algorithm and the classic rejection-free "n-fold way" formulation.
Key property: No time-step bias; time is advanced by the correct exponential waiting-time distribution.
Best for:
Requires:
Best for:
Typical approaches:
This skill provides guidance + validation criteria, but the included scripts implement lattice KMC (event table provided).
Examples:
Best practice: choose the coarsest state that still makes the dynamics approximately Markovian.
For lattice KMC you need:
Validation:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/build_lattice_from_structure.py \
--structure relaxed.cif \
--site_element Li \
--cutoff 3.2 \
--out lattice.json
An "elementary event" must specify:
Best practice:
Most atomistic KMC models use Arrhenius / transition-state theory:
k = nu(T) * exp(-dG_barrier(T) / kBT)
Common approximations:
Critical: detailed balance / microreversibility
If your simulation is intended to reproduce equilibrium thermodynamics, rates must satisfy:
k_ij / k_ji = exp(-(F_j - F_i) / kBT)
At minimum (energy-only model):
k_ij / k_ji ~ exp(-(E_j - E_i) / kBT)
Correctness checks:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/validate_detailed_balance.py \
--config kmc_config.json
Completeness checks (modern best practice):
If you see "stuck" behavior or unrealistically slow kinetics, the event catalog is likely incomplete.
A common failure mode: the system executes extremely frequent small-barrier back-and-forth transitions ("flickers"), wasting steps without making physical progress.
Best-practice solutions include:
At minimum:
Use a rejection-free algorithm (residence-time / Gillespie / n-fold way):
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/run_lattice_kmc.py \
--config kmc_config.json
Modern performance guidance:
Typical outputs:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/analyze_kmc_msd.py \
--trace kmc_run_T800K/kmc_trace.npz \
--dim 3 \
--out kmc_run_T800K/D_fit.json
build_lattice_from_structure.py: Builds a lattice site network from a crystal structure for vacancy/sublattice diffusion KMC. Uses ASE neighbor list with periodic image shifts.run_lattice_kmc.py: Rejection-free lattice KMC engine for carrier hops on a fixed site network. Implements local rate updates + Fenwick tree for O(log N) event sampling.validate_detailed_balance.py: Checks microreversibility for rate models and verifies neighbor graph is bidirectional with opposite shifts.analyze_kmc_msd.py: Computes tracer diffusivity (D_tracer), collective/charge diffusivity (D_J), and Haven ratio from KMC traces using the single-point Einstein relation D = MSD/(2dt). D_J is the physically relevant quantity for ionic conductivity via the Nernst-Einstein relation. Composable with diffusion-analysis workflows (D → σ via Nernst-Einstein).See examples/kmc_config.example.json.
The included engine supports:
constant: k = nu * exp(-E_barrier / kBT)symmetric_site_energy: k = nu * exp(-(E0 + max(0, E_j - E_i)) / kBT) — enforces microreversibility if prefactors are equal.kmc_trace.npz: time, MSD, and carrier unwrapped positions (carrier_r_A, carrier_r0_A)kmc_summary.json: runtime metadata, step counts, rates, basic diagnosticsD_fit.json (from analyze_kmc_msd.py): D_tracer (A^2/s, m^2/s, cm^2/s), D_J (collective diffusivity), Haven ratio, MSD values# 1) Build site network from relaxed structure
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/build_lattice_from_structure.py \
--structure relaxed.cif \
--site_element Li \
--cutoff 3.2 \
--out lattice.json
# 2) Validate detailed balance (if using site energies)
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/validate_detailed_balance.py \
--config kmc_config.json
# 3) Run KMC
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/run_lattice_kmc.py \
--config kmc_config.json
# 4) Analyze -> D_tracer, D_J, Haven ratio
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/analyze_kmc_msd.py \
--trace kmc_run_T800K/kmc_trace.npz \
--dim 3 \
--out kmc_run_T800K/D_fit.json
End-to-end predictive workflow for H in BCC W using MLIP-computed parameters:
# 1) Build + relax NEB endpoints (Env: mlip, GPU)
${CLAUDE_SKILL_DIR}/../../venv/run mlip python ${CLAUDE_SKILL_DIR}/examples/literature_validation/prepare_h_migration.py \
--model_type mace --model_name MACE-OMAT-0-small
# 2) NEB barrier (Env: mlip, GPU)
${CLAUDE_SKILL_DIR}/../../venv/run mlip python ${CLAUDE_SKILL_DIR}/../chem-neb-barrier/scripts/calculate_barrier.py \
--start_structure start_relaxed.cif --end_structure end_relaxed.cif \
--model_type mace --model_name MACE-OMAT-0-small \
--n_images 5 --fmax 0.02 --output_dir neb_results
# 3) Phonon at equilibrium + saddle point (Env: mlip, GPU)
${CLAUDE_SKILL_DIR}/../../venv/run mlip python ${CLAUDE_SKILL_DIR}/../mat-phonon/scripts/calculate_phonon.py \
--structure start_relaxed.cif --model_type mace --model_name MACE-OMAT-0-small \
--supercell_matrix "[[2,0,0],[0,2,0],[0,0,2]]" --output_dir phonon_eq
${CLAUDE_SKILL_DIR}/../../venv/run mlip python ${CLAUDE_SKILL_DIR}/../mat-phonon/scripts/calculate_phonon.py \
--structure saddle_point.cif --model_type mace --model_name MACE-OMAT-0-small \
--supercell_matrix "[[2,0,0],[0,2,0],[0,0,2]]" --output_dir phonon_ts
# 4) Vineyard hTST prefactor (Env: cpu)
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/examples/literature_validation/compute_htst_prefactor.py \
--phonon_eq phonon_eq/phonon.yaml --phonon_ts phonon_ts/phonon.yaml \
--neb_results neb_results/neb_results.json --output htst_results.json
# 5) KMC with MLIP-derived parameters (Env: cpu)
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/examples/literature_validation/validate_h_in_bcc_w.py \
--from_mlip htst_results.json --out_dir mlip_validation
See examples/literature_validation/README.md for full details.
constant, symmetric_site_energy). Custom rate models require extending the engine.Author: Matthew Cox Contact: GitHub @mcox3406
examples/analytical_validation/README.md (opens in a new tab)examples/analytical_validation/validate_random_walk.py (opens in a new tab)examples/analytical_validation/validation_plot.png (opens in a new tab)examples/analytical_validation/validation_summary.json (opens in a new tab)examples/kmc_config.example.json (opens in a new tab)examples/literature_validation/README.md (opens in a new tab)examples/literature_validation/compute_htst_prefactor.py (opens in a new tab)examples/literature_validation/prepare_h_migration.py (opens in a new tab)examples/literature_validation/validate_h_in_bcc_w.py (opens in a new tab)scripts/analyze_kmc_msd.py (opens in a new tab)scripts/build_lattice_from_structure.py (opens in a new tab)scripts/run_lattice_kmc.py (opens in a new tab)scripts/validate_detailed_balance.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
133 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.npx claudepluginhub learningmatter-mit/atomisticskills --plugin atomistic-skillsOther plugins' skills for the same job