/atomistic-skills:mat-stabilityfrom Atomistic Skills
Calculates thermodynamic stability and energy above the convex hull (E_hull) of a material at 0K using pymatgen phase diagram analysis with Materials Project data.
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.
[!NOTE] Steps written
server.toolare MCP tool calls:matgl.relax_structureis therelax_structuretool of thematglserver (mcp__matgl__relax_structure, ormcp__plugin_atomistic-skills_matgl__relax_structurewhen installed as a plugin). Without a connected server, run the same tools from the shell. Tools named in one command share a process, so a model loaded byload_modelstays loaded:${CLAUDE_SKILL_DIR}/../../venv/run mlip python -m src.mcp_server.cli matgl relax_structure key=value
To determine the thermodynamic stability of a material at 0K by computing the energy above the convex hull ($E_{hull}$) using pymatgen phase diagram analysis with structures from Materials Project.
[!TIP] Finite Temperature Stability: While this skill focuses on 0K stability (potential energy), you can construct a finite-temperature phase diagram by replacing potential energies with Free Energies ($G = U + F_{\text{vib}}$) calculated from the mat-qha-thermal-expansion skill.
Electrochemical Stability: The phase diagram constructed here can be seamlessly reused to calculate the material's electrochemical window (ECW) against a specific mobile ion (e.g., Li/Li+). See the mat-electrochemical-window skill for detailed methods.
Select Level of Theory: Choose the target accuracy level for stability calculations.
TensorNet-MatPES-r2SCAN-v2025.1-PES (MatGL) or MACE-MH-1 with matpes_r2scan headNote: r2SCAN shows high accuracy for predicting thermodynamic stability (MAE 80 meV/atom for formation energies vs PBE's 175 meV/atom)1. Using r2SCAN-trained potentials ensures consistency with Materials Project's r2SCAN entries.
Query Materials Project Hull: Retrieve all structures on the convex hull in the target material's chemical space.
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/query_mp_hull.py \
--formula "Li-Fe-P-O" \
--target "LiFePO4" \
--thermo_type "R2SCAN" \
--output hull_structures/
This script will:
hull_entries.json manifestRelax All Structures: Perform structural relaxation on all hull structures using the same MLIP.
# (if using MatGL)
matgl.relax_structure(
structure_data="hull_structures/", # Pass directory containing all CIF files
relax_cell=True,
model_name="TensorNet-MatPES-r2SCAN-v2025.1-PES",
fmax=0.02,
steps=500,
output_dir="relaxed/"
)
The MCP tool will automatically:
hull_structures/relaxed/ for each structurerelaxed_energy.txt files for compute_ehull.pyCritical: Use the same MLIP and settings for all relaxations to ensure energy consistency.
Construct Convex Hull & Calculate Stability: Build a pymatgen phase diagram using the relaxed energies.
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/compute_ehull.py \
--hull_manifest hull_entries.json \
--relaxed_dir relaxed/ \
--target_material LiFePO4 \
--calculate_ecw \
--mobile_ion Li \
--output stability_analysis.json
The script will:
ComputedEntry objects for pymatgenPhaseDiagram--calculate_ecw is provided, calculate the intrinsic Electrochemical Stability Window ($V_{red}$ and $V_{ox}$) against the specified --mobile_ion.Interpret Stability: Assess the thermodynamic stability based on $E_{hull}$ (energy above hull in meV/atom):
The decomposition reaction and products are also reported by pymatgen.
# Step 1: Query Materials Project hull in Li-P-S space
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/query_mp_hull.py \
--formula "Li-P-S" \
--target "Li3PS4" \
--thermo_type "R2SCAN" \
--output hull_structures/
# Step 2: Batch relax all structures with MatGL r2SCAN
matgl.relax_structure(
structure_data="hull_structures/",
relax_cell=True,
model_name="TensorNet-MatPES-r2SCAN-v2025.1-PES",
fmax=0.05,
steps=20,
output_dir="relaxed/"
)
# Step 3: Compute Integrated Stability and ECW
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/compute_ehull.py \
--hull_manifest hull_entries.json \
--relaxed_dir relaxed/ \
--target_material Li3PS4 \
--calculate_ecw \
--mobile_ion Li \
--output Li3PS4_stability_ecw.json
We also provide a stored record of this example run in examples/li3ps4_stability/.
MACE-MH-1 matpes_r2scan) for better accuracy and consistency with Materials Project.fmax ≤ 0.02 eV/Å for all relaxations. Inconsistent convergence criteria will introduce systematic errors.pymatgen.analysis.phase_diagram.PhaseDiagram automatically calculates formation energies by identifying elemental ground states from the provided entries. Do not pass formation energies directly.relaxed_dir. compute_ehull.py will automatically load all candidates and include them in the PhaseDiagram alongside the Materials Project hull reference. This correctly enables generated candidates to thermodynamically compete against each other.Author: Bowen Deng Contact: GitHub @learningmatter-mit
Kingsbury, R. et al. "Performance comparison of r2SCAN and SCAN metaGGA density functionals for solid materials via an automated, high-throughput computational workflow" Physical Review Materials 6, 013801 (2022). DOI: 10.1103/PhysRevMaterials.6.013801 ↩
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./chem-db-qmofQuery the Quantum MOF (QMOF) database via Materials Project's MPContribs platform for DFT-computed properties (bandgap) and optimized crystal structures of Metal-Organic Frameworks./chem-db-spectraSearch and download experimental InfraRed (IR), Mass spectra, and UV-Vis spectra data (JCAMP-DX format) for molecules./chem-dft-orca-advanced-calculationWrite and run custom ORCA input files for advanced electronic structure methods or settings not available through the SCINE wrapper, including multi-reference methods, excited states, relativistic effects, advanced SCF, NMR/EPR, and more.Other plugins' skills for the same job