lammps

A guide for using LAMMPS, software that simulates how atoms and materials behave over time. It covers classical molecular-dynamics work for materials such as metals, ceramics, semiconductors, and nanomaterials.

In plain words
What is it for?
Use it to build crystal models, choose interaction models, simulate deformation or shock, study defects and phase changes, analyze structures, and visualize results with tools such as OVITO.
Why use it?
It helps choose simulation methods, avoid common setup and parallel-computing mistakes, and follow a sensible workflow when running material simulations.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/zimoliao/scholaraio/lammps
Any agent
npx skills add ZimoLiao/scholaraio --skill lammps
Clone the repo
git clone --depth 1 https://github.com/ZimoLiao/scholaraio

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,547 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.02547
Opus 5 $0.00020 $0.01273
Sonnet 5 $0.00008 $0.00509
Haiku 4.5 $0.00004 $0.00255

Measured yesterday against content hash baa4d7911490, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lammps scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/lammps/SKILL.md · 200 lines

How it starts

The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LAMMPS 材料科学模拟

用 LAMMPS 做材料科学分子动力学模拟:晶体构建、势函数选择、形变/冲击、结构分析、可视化。

本 skill 故意保持轻量

  • 它负责告诉 agent 什么时候该用 LAMMPS、该遵守什么科学规范、完整工作流长什么样
  • 承担完整接口手册的职责
  • 具体命令、参数、语法、package 限制,统一去查 scholaraio toolref

Agent 默认协议(toolref-first)

对 LAMMPS 问题,agent 默认按这个顺序工作:

  1. 先判断问题属于哪类对象:pair_stylefixcomputedumpregionboundaryrun 流程
  2. 写输入脚本前,优先查高风险命令页,而不是凭记忆拼装
  3. 命令名和用户说法不一致时,优先用 search 找主入口,再用 show
  4. 如果 toolref 已能回答,就不要在 skill 里重复写手册
  5. 如果 toolref 命中不好或某个 package 页面缺失,agent 应先完成任务,再把它标记为维护层缺口,而不是让用户自己补

这意味着:

  • 用户不该自己去打磨 fix / pair_style 的映射关系
  • agent 应自己消化 fix npt -> fix_nhpair style eam -> pair_eam 这类入口差异
  • 只有反复出现的缺口才进入正式 onboarding

前置条件

# 安装(含 GPU 支持)
conda install -c conda-forge lammps
# 可视化
pip install ovito

验证:lmp -h 应显示已安装的 packages(需包含 GPU、MANYBODY、EXTRA-COMPUTE)。

GPU 加速:package gpu 4 在输入脚本开头启用,suffix gpu 自动为支持的 pair_style 加 /gpu 后缀。

并行运行约束:

  • 启动 MPI 作业时,优先使用 LAMMPS 所在环境自带的 mpirun/mpiexec
  • 不要默认混用系统里的另一套 MPI launcher;如果 lmp 链接的 libmpi 与 launcher 不一致,可能出现“进程活着但无日志输出”的假启动挂起
  • 需要绑核或做 rank pinning 时,先用小规模 MPI 诊断确认启动和绑定语法,再放大到正式规模

何时使用

适合:

  • 金属、陶瓷、半导体、纳米材料的经典 MD
  • 力学性质、相变、位错/缺陷演化、冲击波、热输运
  • 已有合适经验势函数的体系

不适合:

  • 需要显式电子结构精度时,优先考虑 DFT / Quantum ESPRESSO
  • 势函数没有可靠文献依据时,不要直接开算

Toolref 优先

当 agent 不确定命令、参数、限制、输出字段时,先查 toolref,再写输入脚本

常用查法:

scholaraio toolref search lammps "nose hoover thermostat"
scholaraio toolref show lammps fix_nh
scholaraio toolref show lammps pair_eam
scholaraio toolref show lammps compute_cna_atom
scholaraio toolref show lammps fix_deform

推荐习惯:

  • 写脚本前先查 pair_style / fix / compute / dump
  • 遇到 package 依赖时先用 toolref show 看 Restrictions
  • 遇到模糊概念先用 toolref search,确定候选命令后再 show

如果遇到覆盖缺口:

  • 先用官方 LAMMPS 文档继续完成任务
  • 明确说明这里是 toolref 覆盖/排序缺口,不是用户操作错误
  • 不要让用户为了当前任务先停下来维护文档层
  • 如果官方手册没有解释清楚实际运行异常、MPI 启动问题、版本兼容或绑定语法,继续上网检索官方文档、社区讨论和已知问题,不要猜

核心流程

知识库协作模式

  1. scholaraio usearch "<材料/现象>" 检索相关论文
  2. 从论文提取:势函数选择、晶格常数、实验基准值(相变压力、弹性常数等)
  3. 在输入脚本注释中标注参数来源
  4. 计算完成后与文献数据定量对比

Read the full file on GitHub · 200 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 200 lines · 40 tokens per session scan A baa4d7911490

Subscribe to this mod's changes

lammps is a skill published in the GitHub repository ZimoLiao/scholaraio (566 stars, last pushed yesterday), licensed MIT. It adds 40 tokens to every session and 2,547 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.