欠陥・表面・拡散

NEB 法による空孔拡散の障壁

fcc Al の空孔に隣の原子が移動する経路を ASE の NEB 法 (climbing image) で求め、空孔移動の活性化エネルギーを計算します。

カテゴリ
欠陥・表面・拡散
使用する機能
ase.mep.NEBNEBToolsase.optimize.FIREscf_must_conv
スクリプト
neb_diffusion.py

結晶中の原子の拡散は、多くの場合、空孔を介して起こります。隣の原子が空孔に飛び移るときに越えるエネルギー障壁 (空孔移動エネルギー Em) は、拡散係数の温度依存性を決める量です。

障壁の高さは、始状態と終状態を結ぶ最小エネルギー経路上の最大値 (鞍点) から求めます。ここでは ASE の NEB (Nudged Elastic Band) 法を使います。始状態と終状態の間に中間構造 (イメージ) を並べ、ばねでつないだまま同時に最適化して、最小エネルギー経路を求めます。climbing image 法を使うと、最もエネルギーの高いイメージが鞍点に移動するので、障壁の高さを正確に求められます。

計算の流れ

  1. 3×3×3 の基本単位格子 (27 サイト) から原子を 1 つ取り除き、空孔のある始状態をつくる
  2. 空孔の最近接の原子を空孔の位置に移した終状態をつくる
  3. 始状態と終状態をそれぞれ構造最適化する
  4. IDPP 法で中間のイメージを補間し、climbing image NEB で最適化する
  5. エネルギーの最大値から障壁を求め、エネルギー曲線を図にする
neb_diffusion.pyダウンロード
"""
Advance/OF-DFT example: migration barrier of a vacancy in fcc Al with the
nudged elastic band (NEB) method of ASE.

A neighbouring atom hops into the vacancy. The initial and final states are
relaxed first, and the minimum energy path between them is found with the
climbing-image NEB method.

Copyright (C) 2026 AdvanceSoft Corporation, All rights reserved.
"""

import matplotlib.pyplot as plt
import numpy as np
from ase.build import bulk
from ase.mep import NEB, NEBTools
from ase.optimize import BFGS, FIRE

from aofdft.calculator import AOFDFTCalculator

VPS_DIR = "path/to/DFT_DATA19_AS/VPS"  # edit these two paths for your environment
PAO_DIR = "path/to/DFT_DATA19_AS/PAO"

A_LAT    = 4.05  # lattice constant of fcc Al (Angstrom)
N_CELL   = 3     # 3x3x3 primitive cells = 27 sites, 26 atoms with the vacancy
N_IMAGES = 3     # number of intermediate images


def attach_calc(atoms, label):
    atoms.calc = AOFDFTCalculator(
        console       = False,
        logging_file  = f"{label}.log",
        kin_type      = "AS26",
        kin_model     = "Crystal26",
        vps_dir       = VPS_DIR,
        pao_dir       = PAO_DIR,
        scf_must_conv = True,
    )


# 1) initial state: vacancy at site 0
perfect = bulk("Al", "fcc", a=A_LAT).repeat((N_CELL, N_CELL, N_CELL))
dist = perfect.get_distances(0, range(1, len(perfect)), mic=True)
j = 1 + int(np.argmin(dist))  # a nearest neighbour of site 0
hop = perfect.get_distance(j, 0, mic=True, vector=True)  # vector from atom j to the vacancy

initial = perfect.copy()
del initial[0]  # atom j has the index j - 1 from here on

# 2) final state: atom j has moved into the vacancy
final = initial.copy()
final.positions[j - 1] += hop

for atoms, label in ((initial, "initial"), (final, "final")):
    attach_calc(atoms, label)
    BFGS(atoms, logfile=f"{label}_opt.log").run(fmax=0.03)
    print(f"{label:8s} E = {atoms.get_potential_energy():.6f} eV", flush=True)

# 3) NEB: intermediate images by IDPP interpolation, each with its own calculator
images = [initial]
for i in range(N_IMAGES):
    image = initial.copy()
    attach_calc(image, f"image{i + 1}")
    images.append(image)
images.append(final)

neb = NEB(images, climb=True)  # climbing image: the highest image goes to the saddle point
neb.interpolate(method="idpp", mic=True)
FIRE(neb, logfile="neb_opt.log").run(fmax=0.05, steps=300)

# 4) barrier and energy profile
nebtools = NEBTools(images)
barrier, delta_e = nebtools.get_barrier()
print(f"Migration barrier : {barrier:.3f} eV")
print(f"Reaction energy   : {delta_e:.3f} eV")

fig = nebtools.plot_band()
fig.savefig("al_vacancy_neb.png", dpi=150)
print("Saved al_vacancy_neb.png")

実行結果の例

v1.0.0 (Crystal26) の結果です。NEB の最適化は 27 ステップで収束しました。

text
initial  E = -1742.896191 eV
final    E = -1742.892719 eV
Migration barrier : 0.663 eV
Reaction energy   : 0.003 eV
Saved al_vacancy_neb.png
fcc Al の空孔移動の最小エネルギー経路 (v1.0.0、Crystal26)。点は各イメージのエネルギーです。各点の緑色の短い線は、そのイメージで原子に働く力の経路に沿った成分から求めた、エネルギーの傾きです。曲線は、エネルギーとこの傾きを使って点の間を補間したものです。図の上部の E_f と E_r は、それぞれ順方向と逆方向の障壁です。
fcc Al の空孔移動の最小エネルギー経路 (v1.0.0、Crystal26)。点は各イメージのエネルギーです。各点の緑色の短い線は、そのイメージで原子に働く力の経路に沿った成分から求めた、エネルギーの傾きです。曲線は、エネルギーとこの傾きを使って点の間を補間したものです。図の上部の E_f と E_r は、それぞれ順方向と逆方向の障壁です。

空孔移動エネルギーは 0.663 eV です。始状態と終状態は対称的に等価な構造なので、反応エネルギー (0.003 eV) はほぼゼロになっています。

ポイント

  • 中間のイメージには、それぞれ別の Calculator を設定します (ASE の NEB の既定では、Calculator を共有できません)。イメージごとに Calculator を分けると、各イメージの前のステップで収束した電子状態が、次の SCF 計算の初期値として使われます。
  • neb.interpolate(method="idpp", mic=True) は、原子間距離を線形に補間する IDPP 法で初期経路をつくります。単純な線形補間よりも原子どうしが近づきすぎにくく、最適化が安定します。mic=True は周期境界条件で最も近い像を使う指定です。
  • NEB(images, climb=True) で climbing image 法を有効にしています。中間のイメージが少なくても、鞍点のエネルギーを求められます。
  • 最適化には、NEB でよく使われる FIRE を使っています。収束の判定 (fmax) は、NEB の力 (原子に働く力の経路に垂直な成分と、経路に沿ったばねの力) に対して行われます。
  • 空孔どうしの相互作用を小さくするには、スーパーセルを大きくして障壁の収束を確認します。同じ計算を 4×4×4 のセル (64 サイト) で行うと、空孔移動エネルギーは 0.715 eV になり、27 サイトのセルの値より 0.05 eV 大きくなります。空孔形成エネルギー では 27 原子と 64 原子のセルの差は 0.004 eV なので、障壁の方がセルの大きさに敏感です。
  • scf_must_conv=True を指定して、SCF が収束しなかったイメージの力が最適化に使われないようにしています。