Skip to content

6. Lattice ops — strain / vacuum / recenter

三个最高频晶格操作

操作顶层快捷资源形式用途
施应变mat strain 2%mat /lattice update strain=2%应力-能量曲线 / heterostructure 适配
改真空层mat vacuum 20mat /lattice update vacuum=202D 材料镜像分离
slab 居中mat recentermat /lattice update recenter=z真空对称 / VASP 输入清理

mat strain

等比双轴

bash
mat strain 2%                             # a, b 各 +2%
mat strain -1%                            # 压 1%
mat strain 0.03                           # 小数 = +3%

各向异性

bash
mat strain a:1%,b:-0.5%                   # a +1%, b -0.5%
mat strain a:3%,b:-1%                     # 经典 uniaxial-like
mat strain c:1%                           # 单 c 轴(少见)

施 (a:+3%, b:-1%) 后的 MoS2:

mos2-aniso

实现细节

  • 应变是 affine 变换:新晶格 = 旧晶格 · diag(1+εa, 1+εb, 1+εc)
  • 原子分数坐标保持不变 → 笛卡尔坐标随晶格缩放
  • 2D 安全:c 轴默认不参与(除非显式 c:N%
  • 保 motif:因为只是 affine,配位拓扑不变(但键长会变)

mat vacuum

bash
mat vacuum 20                             # 真空层调到 20 Å
mat vacuum 12 -q                          # quiet

机制:调整 c 长度,使得 (c - slab_thickness) = vacuum。slab 厚度自动测(最高 atom z − 最低 atom z)。

安全护栏

  • vacuum < 8 Å → 报错(TwoDViolation)。避免 2D 材料镜像间相互作用过强。
  • 强制:mat vacuum 5 force=1

应用大真空(25 Å):

mos2-vac25

mat recenter

bash
mat recenter                              # slab 居中沿 c

机制:把 slab 的几何中心移到 cell c 中点。

复合操作(一条命令搞定 build + 调)

mat build 接受同样的 lattice 参数:

bash
mat build mos2 strain=2% vacuum=22 recenter=z

等价于:

bash
mat build mos2 -q
mat strain 2% -q
mat vacuum 22 -q
mat recenter -q

一条命令一次完成,比链式快很多(不重新读写四次 .vasp)。

/lattice get 看现状

bash
mat /lattice get

输出:

✓ lattice  runs/001-run/mos2.vasp
  a, b, c  3.16    3.16    15.0 Å
  angles   α=90.0  β=90.0  γ=120.0°
  volume   129.7167 ų
  slab z   [5.94, 9.06]  (thickness 3.12 Å)
  vacuum   11.88 Å

含 2D 解读(slab 厚度、真空层)——比单纯打 a/b/c 信息密度高。

JSON:

bash
mat /lattice get --json --jq '.vacuum'
# → 11.88
mat /lattice get --json --jq '{a:.a,b:.b,vac:.vacuum}'
# → {"a": 3.16, "b": 3.16, "vac": 11.88}

2D-aware 字段

/lattice get 在结构看起来像 slab 时(c >> a, b 且有明显空隙),额外报告:

字段含义
slab_zslab 在 c 方向的范围
slab_thickness最高 - 最低 atom z
vacuumc - slab_thickness
is_slab是否判定为 slab
centeredslab 是否近似居中

一个完整的 strain ladder 例子

为应力-应变扫描,agent 一般会跑:

bash
for p in -2 -1 0 1 2 3 4 5; do
  mat build mos2 strain=${p}% out=runs/001-run/mos2-s${p}.vasp -q
done

每个产物自带 PNG + summary,方便逐张看变化。

或者直接生成 supercell + 不同 strain:

bash
mat build mos2 -q
mat /structures update supercell=3,3,1 out=runs/001-run/mos2-3x3.vasp
for p in 1 2 3 4; do
  mat strain ${p}% out=runs/001-run/mos2-3x3-s${p}.vasp
done

下一步: Perturb → 缺陷、掺杂、错位、层间

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