Skip to content

12. Reference — 全部命令、资源、flag 速查

把这一页当词典翻。

命令一览(顶层 command,不带 /

命令用途例子
mat0 参数 = 当前 context + 下一步建议mat
mat --help列全部 command 和 resourcemat --help
mat init起 run 目录mat init --label demo -q
mat materials列内置 material 别名mat materials
mat status看 run 进度mat status
mat build <kind|alias>造结构mat build mos2 strain=2%
mat get [target]智能 get(file / mp-id / run-id 自动路由)mat get mp-2815
mat show [target]mat get 的别名mat show foo.vasp
mat list <thing>智能 listmat list motifs
mat ls <thing>mat list 的别名mat ls runs
mat motifs [file]列 motif(默认当前 context)mat motifs center=Mo
mat sites [file]列原子mat sites element=S
mat strain <spec>施应变mat strain a:1%,b:-0.5%
mat vacuum <Å>设真空mat vacuum 20
mat recenterslab 居中mat recenter
mat perturb <ops...>复合编辑mat perturb vacancy=S:1 strain=2%
mat verify <structure> --rules <rules.yaml>校验mat verify mos2.vasp --rules rules.yaml
mat explain <structure> --profile <profile.yaml>profile 解释mat explain mos2.vasp --profile perovskite.yaml
mat reproduce <recipe.yaml>跑 paper recipemat reproduce paper.recipe.yaml --continue

资源一览(mat /<path> <verb>

路径缩写动词典型用法
/structures/sget / create / update / deletemat /s get foo.vasp
/motifs/mlist / getmat /m list center=Mo
/motifs/graphgetmat /motifs/graph get
/lattice/lget / updatemat /l update strain=2% vacuum=20
/sites/siget / update / createmat /si update set=0=z:7.5
/bilayers/bupdatemat /b update shift=top:0.1,0 rotate=top:3
/defects/dcreatemat /d create vacancy=S:1
/adsorbates/siteslistmat /adsorbates/sites list positions=ontop,bridge
/adsorbates/acreatemat /a create molecule=O2 site=hollow
/vasp-inputs/vcreatemat /v create profile=mp-relax-pbe (alias of set=mp-relax)
/runs/rlist / createmat /r list
/runs/<id>get / deletemat /r/001-demo get
/recipes/reclist / get / runmat /rec run path=paper.recipe.yaml
/mplistmat /mp list elements=Mo,S
/mp/<id>getmat /mp/mp-2815 get -o mp2815.vasp

全局 IO flag(所有 verb 都支持)

flag作用例子
--json输出 JSONmat motifs --json
--jq EXPR用 jq 表达式裁剪mat motifs --json --jq '.[].label'
-o PATH写文件mat get --json -o snap.json
-q单行 quietmat build mos2 -q

--jq 是 mini-jq(不依赖系统 jq),支持:

  • .field.a.b.c 字段链
  • .[N] 数组索引
  • .[] 数组扁平
  • EXPR | EXPR 管道(左结果 → 右)
  • {a:.x, b:.y, label} 对象重组(labellabel:.label 简写)
  • select(.x==V) 过滤,支持 == != > < >= <=
  • lengthkeysunique
  • [EXPR] 包成数组

不支持:函数定义、map(...)、字符串处理、//@csv 等高级特性。 高级需求建议 --json 输出再外接系统 jq

全部环境变量

变量默认作用
MAT_STRUCTURE强制当前结构(最高优先)
MAT_RUN_DIR当前 run 目录(auto-out 落在这里)
MAT_NO_ARTIFACTSunset1 = 不出 PNG/summary
MP_API_KEYMaterials Project key

Material 别名

别名实际
mos2, tmdmonolayer prototype=MoS2-2H
graphene, grhoneycomb element=C a=2.46
hbn, h-bnhoneycomb element=B element-b=N a=2.504
bihoneycomb element=Bi a=4.337 buckling=1.74
sbhoneycomb element=Sb a=4.025 buckling=1.65
ashoneycomb element=As a=3.607 buckling=1.40

Build kind 一览

kind关键参数
monolayerprototype=
honeycombelement= element-b= a= buckling=
squareelement= a=
bilayer两个 .vasp 文件 + interlayer= shift-xy=
slabmetal= miller=h,k,l layers= vacuum=
octahedroncenter= ligand=
octa-paircenter= ligand= mode=corner/edge/face
octa-latticecenter= ligand= nx= ny= nz=

Perturb 操作一览

形式例子
shift=<layer-sel>:dx,dyshift=top:0.1,0
rotate=<layer-sel>:degrotate=top:5
interlayer=<Å>interlayer=6.5
vacancy=<el>:kindex:i,jvacancy=S:1, vacancy=index:7,12
substitute=<i>:<el>按 indexsubstitute=5:Se
seed=<int>随机种子(vacancy/substitute)seed=42
substitute=<species>:<el>全替换substitute=Mo:W
substitute=<species>:<k>:<el>随机 k 个substitute=S:2:Se
displace=<index>:dx,dy,dzdisplace=12:0,0,0.2
strain=mat strainstrain=2%, strain=a:1%,b:-0.5%
vacuum=<Å>vacuum=20
recenter=zrecenter=z
set=<index>=<axis>:valset=0=z:7.5
add=<el>:x,y,zadd=O:2.5,1.4,9.0
remove=<i>,<j>,...remove=7,12

Layer 选择器

写法含义
topz 最大的层
bottomz 最小的层
z>5.0所有 z > 5.0
z<3.0所有 z < 3.0
0,3,7-12显式 index 集合

VASP profile 一览

profile描述
mp-relax-pbeMP 风格 PBE 弛豫
mp-static-pbe单点
scanSCAN
hse06HSE06
2d-relax2D 材料弛豫
surface-relaxslab 弛豫

自动 artifacts

每个写结构的命令完成后产出:

<stem>.vasp        ← 主结构
<stem>.png         ← VESTA 风格 3D 渲染
<stem>.summary.md  ← 文本摘要 (formula / lattice / motifs / sites)

详见 Auto-artifacts

配套文件

文件用途
./.mat-context.json当前 context + 操作 history
runs/NNN-label/编号 run 目录
runs/NNN-label/provenance.jsonrecipe 跑过后的完整日志

Builder kinds(mat build <kind> 全参数表)

kind必需参数可选参数说明
monolayerprototype=<id>a= c= vacuum=通用 2D 单层
honeycombelement= a=vacuum=蜂窝单元素层(graphene 等)
squareelement= a=vacuum=正方晶格单层
bilayer<bottom> <top> interlayer=shift-xy=dx,dy vacuum= cell-from=bottom|top两个结构叠成双层
octahedroncenter= ligand= bond= box= passivate=单个八面体团簇
octa-pairmode=corner|edge|face-sharingcenter= ligand= bond= box=两个八面体共享
octa-latticemode= nx= ny= center= ligand= bond= vacuum=周期八面体阵列(钙钛矿)
slabmetal= miller=h,k,llayers= vacuum= supercell=nx,ny fix-bottom-layers= prototype=金属表面 slab

材料别名

mat build <alias> 会自动选 builder + 默认参数。完整列表:

alias→ builder + 默认
mos2, tmdmonolayer prototype=MoS2-2H
graphene, grhoneycomb element=C a=2.46
hbn, h-bnhoneycomb element=B-N a=2.504
bi, sb, asmonolayer prototype=<elem>-2D

退出码

code含义
0成功
2用户错误(参数错 / 结构不存在 / 物理约束失败)
3系统错误(IO / 依赖缺失)
4内部 bug(请报告)

回到 文档首页

AGPL-3.0-or-later · 商用请联系 aiden.novak.ai@gmail.com