Agent skill

Mat Grand Canonical Mc

by learningmatter-mit in learningmatter-mit/AtomisticSkills

Run Grand Canonical Monte Carlo (GCMC) simulations with cluster expansion models to map composition-temperature phase diagrams via chemical potential sweeps.

MITAuto-check passedDevelopment

Install Mat Grand Canonical Mc

skills CLI
$ npx skills add learningmatter-mit/AtomisticSkills --skill mat-grand-canonical-mc -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install learningmatter-mit/AtomisticSkills mat-grand-canonical-mc --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/learningmatter-mit/AtomisticSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mat-grand-canonical-mc .claude/skills/mat-grand-canonical-mc && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mat-grand-canonical-mc
GitHub stars
176
Token cost
~1.8k tokens
SKILL.md length
653 words
Files
8 (incl. scripts)
Skills in repo
129
Repo updated
First seen
Licence
MIT

At a glance

Run Grand Canonical Monte Carlo (GCMC) simulations with cluster expansion models to map composition-temperature phase diagrams via chemical potential sweeps.

  • Works in 3 steps: Load a Trained Cluster Expansion → Run Chemical Potential Sweep → Analyze Results and Generate Phase…
  • Tasks that involve Diagrams
  • SKILL.md covers Goal, Background, Workflow and Examples, plus 3 more sections
  • Runs Python scripts from its folder

What it does

Mat Grand Canonical Mc is an agent skill from learningmatter-mit/AtomisticSkills. Run Grand Canonical Monte Carlo (GCMC) simulations with cluster expansion models to map composition-temperature phase diagrams via chemical potential sweeps.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including scripts (for example `examples/AgPd/README.md`, `examples/CuAg/README.md` and `scripts/analyze_gcmc_results.py`).

It sits in Development, covering Diagrams. The repository describes itself as: Integrating AtomisticSkills into Agentic IDEs (Cursor, Claude Code, Codex, Google Antigravity, Hermes Agent, etc). The licence is MIT.

When your agent uses it

  • Tasks that involve Diagrams

Example prompts

  • “/mat-grand-canonical-mc”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Load a Trained Cluster Expansion
  2. Run Chemical Potential Sweep
  3. Analyze Results and Generate Phase Diagrams

What it can do on your machine

Read from SKILL.md and the folder at commit 6257444. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mat Grand Canonical Mc loads about 1.8k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 653 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from learningmatter-mit/AtomisticSkills at commit 6257444, republished under its MIT licence (© learningmatter-mit). 653 words, ~1,764 tokens.

Download SKILL.mdSave it as .claude/skills/mat-grand-canonical-mc/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
mat-grand-canonical-mc
description
Run Grand Canonical Monte Carlo (GCMC) simulations with cluster expansion models to map composition-temperature phase diagrams via chemical potential sweeps.
metadata.category
materials
metadata.venv
cpu

Grand Canonical Monte Carlo

Goal

To perform Grand Canonical Monte Carlo (GCMC) simulations using cluster expansion models to study composition-dependent thermodynamics and generate temperature-composition (T-x) phase diagrams. GCMC allows the system composition to vary by controlling the chemical potential ($\mu$) instead of fixing composition directly.

Background

In the canonical ensemble (fixed N, V, T), Monte Carlo simulations explore configurational space at a fixed composition. In contrast, the grand canonical (or semigrand canonical) ensemble allows composition to fluctuate in response to specified chemical potentials. This is particularly useful for:

  • Mapping phase diagrams (composition vs. temperature)
  • Identifying miscibility gaps and phase transitions
  • Studying composition-dependent thermodynamics
  • Exploring equilibrium compositions at different chemical potentials

For binary alloys (e.g., Cu-Ag), we typically control the chemical potential difference Δμ = μ_A - μ_B by setting one species to μ = 0 and varying the other.

Workflow

Step 1: Load a Trained Cluster Expansion

Start with a trained cluster expansion model. You can train one using the ml-cluster-expansion skill or use an existing model.

python
# Load the cluster expansion
from smol.cofe import ClusterExpansion

ce = ClusterExpansion.load("path/to/cluster_expansion.json")
print(f"Loaded CE with {len(ce.cluster_subspace)} clusters")
Step 2: Run Chemical Potential Sweep

Use the run_gcmc_sweep.py script to perform systematic sweeps of chemical potential at different temperatures.

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/run_gcmc_sweep.py \
    --ce_file cluster_expansion.json \
    --supercell 3 3 3 \
    --temperatures 400 600 800 1000 \
    --mu_min -0.4 \
    --mu_max 0.4 \
    --num_mu_points 20 \
    --steps 50000 \
    --equilibration_steps 10000 \
    --element Ag \
    --output_dir gcmc_results/

Key Parameters:

  • --ce_file: Path to the trained cluster expansion JSON file
  • --supercell: Supercell size (e.g., 3 3 3 for a 3×3×3 supercell)
  • --temperatures: List of temperatures (K) to simulate
  • --mu_min, --mu_max: Chemical potential range (eV)
  • --num_mu_points: Number of chemical potential points to sample
  • --steps: Number of MC steps per simulation
  • --equilibration_steps: Initial burn-in steps (discarded)
  • --element: Species to control (the other is set to μ=0)
  • --output_dir: Directory to save results

Output:

  • gcmc_results/results_summary.json: Composition and energy data
  • gcmc_results/T{temp}_mu{mu:.3f}.h5: Trajectory files (HDF5)
  • gcmc_results/T{temp}_mu{mu:.3f}_final.cif: Final structures
Step 3: Analyze Results and Generate Phase Diagrams

Use the analysis script to visualize the results and create phase diagrams.

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/analyze_gcmc_results.py \
    --results_file gcmc_results/results_summary.json \
    --output_dir gcmc_results/ \
    --element Ag

Output:

  • mu_vs_composition.png: Chemical potential vs. composition at each temperature
  • phase_diagram.png: Temperature-composition (T-x) phase diagram
  • energy_vs_mu.png: Energy per atom vs. chemical potential

Examples

Cu-Ag Alloy Phase Diagram

Using the pre-trained Cu-Ag cluster expansion:

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/run_gcmc_sweep.py \
    --ce_file ${CLAUDE_SKILL_DIR}/../ml-cluster-expansion/examples/CuAg_CE/cluster_expansion.json \
    --supercell 4 4 4 \
    --temperatures 300 400 500 600 700 800 900 1000 \
    --mu_min -0.3 \
    --mu_max 0.3 \
    --num_mu_points 15 \
    --steps 30000 \
    --equilibration_steps 5000 \
    --element Ag \
    --output_dir ${CLAUDE_SKILL_DIR}/examples/CuAg/gcmc_results/

Then analyze:

bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/analyze_gcmc_results.py \
    --results_file ${CLAUDE_SKILL_DIR}/examples/CuAg/gcmc_results/results_summary.json \
    --output_dir ${CLAUDE_SKILL_DIR}/examples/CuAg/ \
    --element Ag

Constraints

  • Equilibration: Always include sufficient equilibration steps (typically 10-20% of total steps) to allow the system to reach equilibrium before collecting statistics.
  • Convergence: Monitor composition vs. MC step to ensure equilibration. If composition is still drifting, increase equilibration steps.
  • System Size: Larger supercells reduce finite-size effects but increase computational cost. For phase diagram mapping, 3×3×3 to 5×5×5 is typically sufficient.
  • Temperature Range: Choose temperatures relevant to your system. For alloys, consider the experimental phase diagram temperature range.
  • Chemical Potential Range: The range should span the full composition space (0 to 1 mole fraction). Start with ±0.5 eV and adjust based on results.
  • Environment: Scripts require the cpu environment with smol, pymatgen, matplotlib, and numpy.
  • Cluster Expansion Quality: Ensure your CE has low RMSE (<10 meV/atom) for accurate phase diagram predictions.
Show full SKILL.md (202 more words)Show less

Theory Notes

Semigrand Canonical Ensemble

In the semigrand canonical ensemble for a binary alloy A-B:

  • Temperature T is fixed
  • Volume V is fixed
  • Total number of sites N is fixed
  • Chemical potential difference Δμ = μ_A - μ_B is controlled

The probability of a configuration depends on: $$P(\sigma) \propto \exp\left[-\frac{E(\sigma) - \Delta\mu \cdot N_A}{k_B T}\right]$$

where $N_A$ is the number of A atoms in configuration $\sigma$.

Composition-Chemical Potential Relationship

At equilibrium, the composition $x_A$ (mole fraction of A) is related to Δμ through the free energy: $$\Delta\mu = \frac{\partial F}{\partial N_A}\bigg|_{T,V}$$

By sweeping Δμ, we can map out the entire compositional range and identify:

  • Single-phase regions: Smooth variation of x vs. Δμ
  • Two-phase regions: Discontinuous jumps in composition (phase coexistence)
  • Spinodal points: Inflection points in free energy

Tips for Success

  1. Start with a quick test: Run a single temperature with coarse Δμ spacing to verify the setup.
  2. Check for equilibration: Plot composition vs. MC step for a few representative points.
  3. Refine Δμ spacing: Near phase transitions, use finer spacing to resolve phase boundaries.
  4. Compare with experiments: If available, validate against experimental phase diagrams.
  5. Multiple runs: For critical regions, run multiple independent simulations to check reproducibility.

Author: Bowen Deng Contact: GitHub @learningmatter-mit

© learningmatter-mit, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts) in skills/mat-grand-canonical-mc of learningmatter-mit/AtomisticSkills.

  • SKILL.md
  • examples/AgPd/README.md
  • examples/AgPd/mu_vs_composition.png
  • examples/AgPd/phase_diagram.png
  • examples/CuAg/README.md
  • examples/CuAg/gcmc_sweep_analysis.png
  • scripts/analyze_gcmc_results.py
  • scripts/run_gcmc_sweep.py

Open the folder on GitHubat commit 6257444

Compare with similar skills

Mat Grand Canonical Mc next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mat Grand Canonical Mc compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mat Grand Canonical Mc this skilllearningmatter-mit/AtomisticSkills176—~1.8kAutomated safety check: PassMIT
Archify Diagramstt-a1i/archify81k—~2.9kAutomated safety check: PassMIT
JSON Canvasheyitsnoah/claudesidian2.6k18 repos~3.5kAutomated safety check: PassMIT
Diagram Designcathrynlavery/diagram-design47k1 repos~7.5kAutomated safety check: PassMIT
Fireworks Tech Graphtisfeng/Easydict15k1 repos~1.4kAutomated safety check: PassMIT
Excalidraw Diagramcoleam00/excalidraw-diagram-skill5k2 repos~6.1kAutomated safety check: PassNone

Similar skills

  • Archify Diagrams

    tt-a1i/archify

    Creates interactive architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone HTML with inline SVG, themes and image or video export.

    81k GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • JSON Canvas

    heyitsnoah/claudesidian

    Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections.

    2.6k GitHub starsUsed in 18 repos~3.5k tokens
    DevelopmentAuto-check passed
  • Diagram Design

    cathrynlavery/diagram-design

    Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.

    47k GitHub starsUsed in 1 repo~7.5k tokens
    DevelopmentAuto-check passed
  • Fireworks Tech Graph

    tisfeng/Easydict

    Create precise SVG technical diagrams, export PNG or offline HTML, and animate supported semantic SVGs to GIF.

    15k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Excalidraw Diagram

    coleam00/excalidraw-diagram-skill

    Create Excalidraw diagram JSON files that make visual arguments.

    5k GitHub starsUsed in 2 repos~6.1k tokens
    DevelopmentAuto-check passed
  • Draw.io Diagram Studio

    Agents365-ai/drawio-skill

    Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.

    10k GitHub stars~2.4k tokensUpdated 7 days ago
    DevelopmentAuto-check: notes

More from learningmatter-mit/AtomisticSkills

All 129 skills in this repo
  • Drug Binding Site Definition

    learningmatter-mit/AtomisticSkills

    Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.

    176 GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check passed
  • Drug Complex System Builder

    learningmatter-mit/AtomisticSkills

    Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation.

    176 GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • Drug Pocket Detection

    learningmatter-mit/AtomisticSkills

    Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).

    176 GitHub stars~4k tokensUpdated 2 days ago
    Auto-check passed
  • Chem Bond Dissociation

    learningmatter-mit/AtomisticSkills

    Calculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation.

    176 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Chem Conformer Search

    learningmatter-mit/AtomisticSkills

    Generate molecular conformers with RDKit ETKDG, relax with MLIPs, and rank by energy with Boltzmann weighting.

    176 GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Chem DB Mof

    learningmatter-mit/AtomisticSkills

    Query multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al.

    176 GitHub stars~1.9k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Mat Grand Canonical Mc

What does Mat Grand Canonical Mc do?

Run Grand Canonical Monte Carlo (GCMC) simulations with cluster expansion models to map composition-temperature phase diagrams via chemical potential sweeps. Mat Grand Canonical Mc is an agent skill from learningmatter-mit/AtomisticSkills. Run Grand Canonical Monte Carlo (GCMC) simulations with cluster expansion models to map composition-temperature phase diagrams via chemical potential sweeps.

When should I use Mat Grand Canonical Mc?

Mat Grand Canonical Mc fits situations like: tasks that involve Diagrams.

How do I install Mat Grand Canonical Mc in Claude Code?

Run `npx skills add learningmatter-mit/AtomisticSkills --skill mat-grand-canonical-mc -a claude-code`. Or copy the skill folder (skills/mat-grand-canonical-mc in learningmatter-mit/AtomisticSkills) into .claude/skills/mat-grand-canonical-mc in your project. Claude Code loads it when a task matches its description.

How do I install Mat Grand Canonical Mc in Codex?

Run `npx skills add learningmatter-mit/AtomisticSkills --skill mat-grand-canonical-mc -a codex`. Or copy the skill folder (skills/mat-grand-canonical-mc in learningmatter-mit/AtomisticSkills) into .agents/skills/mat-grand-canonical-mc in your project. Codex loads it when a task matches its description.

Can I use Mat Grand Canonical Mc in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add learningmatter-mit/AtomisticSkills --skill mat-grand-canonical-mc -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mat-grand-canonical-mc, .gemini/skills/mat-grand-canonical-mc, .github/skills/mat-grand-canonical-mc and .opencode/skills/mat-grand-canonical-mc in your project.

What does Mat Grand Canonical Mc need to run?

Going by SKILL.md and its folder, Mat Grand Canonical Mc needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Mat Grand Canonical Mc access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Mat Grand Canonical Mc safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Mat Grand Canonical Mc use?

Mat Grand Canonical Mc is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mat Grand Canonical Mc use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mat Grand Canonical Mc?

Skills that share tags, products or a category with Mat Grand Canonical Mc: Archify Diagrams (tt-a1i/archify, 81k stars), JSON Canvas (heyitsnoah/claudesidian, 2.6k stars), Diagram Design (cathrynlavery/diagram-design, 47k stars) and Fireworks Tech Graph (tisfeng/Easydict, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mat Grand Canonical Mc?

learningmatter-mit (a GitHub organization) maintains it in learningmatter-mit/AtomisticSkills, which has 176 GitHub stars. The repository holds 129 skills in this directory. The repository was last updated on October 7, 2026.

Source: learningmatter-mit/AtomisticSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.