Command Palette

Search for a command to run...

Назад к скиллам
скилл № 76899

materials-magnet-design-mvp

Run the SAGA-Opt MVP loop for permanent-magnet materials discovery: an evolutionary search that maximizes magnetic density (μB/ų) while minimizing…

БесплатноЗапускает вложенные скрипты
pdl-openairот pdl-openair★ 16 звёзд на GitHub

Установить materials-magnet-design-mvp в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

SAGA Magnet-Materials MVP Skill

This skill runs the MVP version of SAGA-Opt: a fixed two-objective evolutionary search over chemical formulas, with the inner loop wired to remote materials models. The full SAGA outer loop (dynamic objectives, auto-written scorers, over-optimization guards) is out of scope — see skills/materials/magnet_materials_design_MVP.md §0 for the line.

The pipeline:

init formulas (MP) ─▶ LLM crossover ─▶ DiffCSP (formula→CIF)
                  ─▶ MatterSim relax ─▶ ALIGNN (magmom, ehull)
                  ─▶ pymatgen HHI   ─▶ filter + reward + select top-K
                                                       │
                                  ┌─── MatterGen-evaluate (async, agg metrics:
                                  │     novelty / uniqueness / validity / stability,
                                  │     incl. SUN = frac_novel_unique_stable_structures)
                                  │         SUN of the PREVIOUS iter's batch shapes
                                  │         reward at batch scope (constant across pool)
                                           │
                                           ▼
                                      next iteration

The architectural reality

Six remote MCPs do the heavy lifting. Claude is a thin orchestrator that also doubles as the crossover LLM.

Stage Tool Lives at
Formula → CIF mcp__diffcsp-generate__generate_structures <MATERIALS_MCP_BASE_URL>/diffcsp-generate/mcp
CIF relax mcp__mattersim-relax__relax_structure <MATERIALS_MCP_BASE_URL>/mattersim-relax/mcp
Properties mcp__alignn_prediction__predict_alignn_properties <MATERIALS_MCP_BASE_URL>/alignn/mcp
Population health (async) mcp__mattergen-evaluate__evaluate_structures_async <MATERIALS_MCP_BASE_URL>/mattergen-evaluate/mcp
(Optional) Crystal gen mcp__mattergen-generate__generate_crystals <MATERIALS_MCP_BASE_URL>/mattergen-generate/mcp
(Optional) Platform mcp__material-platform__* <MATERIALS_MCP_BASE_URL>/material-platform/mcp
HHI + volume local pymatgen (no MCP) the agent's own python

Claude never imports torch, never runs DiffCSP locally, never SSHes. Everything heavy is a tool call. HHI and CIF volume are cheap, so they run locally via scripts/hhi.py and scripts/mag_density.py.

Fixed objectives (do not evolve)

Two per-candidate objectives, equal weight, min-max normalized inside each batch, plus one batch-level shaping term from mattergen-evaluate:

reward_i = norm(mag_density)_i + (1 - norm(hhi)_i) + w_sun * batch_SUN_prev
  • mag_density = total_magmom_μB / cell_volume_ų — bigger is better.
  • hhi = HHI_production from pymatgen.analysis.hhi.HHIModel — smaller is better.
  • batch_SUN_prev = frac_novel_unique_stable_structures (S∧U∧N) from the prior iteration's mattergen-evaluate job (drained at the start of the current iter). Lagged by one iteration because the current batch's SUN isn't measured until after selection. 0 on iteration 0.
  • w_sun = 0.5 by default (configurable; set to 0 to disable shaping without dropping SUN from reports).
  • Thresholds (informational, not hard gates unless ehull_lt is set):
    • mag_density > 0.2 Å⁻³
    • hhi < 1500
    • ehull < 0.1 eV/atom (hard filter when filter_ehull=True, default on)

The two per-candidate terms decide ranking within the pool. The SUN term is constant across the pool being ranked, so it shifts reported reward magnitude / trends but does not change selection within an iteration — see references/reward_and_filters.md §"How mattergen-eval SUN enters reward" for the precise semantics and the upgrade path to per-candidate SUN via batch_size=1 submission.

Why equal weight and min-max norm: it is the simplest non-trivial aggregation. If one objective dominates the user's actual priority, ask them and rebalance — but for MVP this is fine.

Phase 0 — Bootstrap (do this before any run)

  1. Run python scripts/probe_mcps.py. All five core MCPs (diffcsp, mattersim, alignn, mattergen-evaluate, and the local pymatgen check) must PASS. If any fail, do not start a run — GPU time is expensive.
  2. Confirm MP_API_KEY is available — read from the environment, or from a .env file. scripts/initial_formulas.py auto-loads .env (search order: $OPENAIR_DOTENV, then nearest .env walking up from CWD, then nearest .env walking up from the script). An explicit env var always wins over .env. If neither source has it, ask the user before proceeding — the MP init step will fail without it. (Fallback: scripts/initial_formulas.py --fallback returns a curated 20-formula list of Fe/Co/Ni/Cr/Mn binaries and ternaries so the loop can still run end-to-end. Tell the user when you use the fallback.)
  3. Sanity-check the config against the user's intent — see "Config" below.

Config (the only knob the user

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • adapter/__init__.py
  • adapter/magnet_adapter.py
  • evals/evals.json
  • references/mcp_tools.md
  • references/reward_and_filters.md
  • scripts/hhi.py
  • scripts/initial_formulas.py
  • scripts/mag_density.py
  • scripts/probe_mcps.py
  • skill.yaml

FAQ

Что делает скилл materials-magnet-design-mvp?

Run the SAGA-Opt MVP loop for permanent-magnet materials discovery: an evolutionary search that maximizes magnetic density (μB/ų) while minimizing supply-chain risk (HHI), with an optional E_hull stability filter. Use whenever the user wants to "search for new magnet formulas", "evolve magnetic materials", "run SAGA MVP", "find high-mag-density low-HHI candidates", "do crossover on magnet compositions", mentions NdFeB / SmCo / ferrite alternatives, or asks to iterate formulas → 3D structures → scores. Triggers also on "磁密度", "永磁", "HHI", "magnet MVP", "SAGA-Opt", "DiffCSP + MatterSim + ALIGNN". The skill drives six remote MCPs (diffcsp-generate / mattersim-relax / alignn_prediction / mattergen-generate / mattergen-evaluate / material-platform) — Claude is both the orchestrator and the LLM crossover engine. pymatgen runs locally for HHI and CIF volume.

Как установить скилл materials-magnet-design-mvp?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл materials-magnet-design-mvp запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить materials-magnet-design-mvp с