電子密度の解析

分子の双極子モーメント

電子密度と擬原子の価電荷から、孤立分子の双極子モーメントを計算します。

カテゴリ
電子密度の解析
使用する機能
calc.rhocalc.aofdft.atomic_data.species().zvalkin_model="Molecule26"
スクリプト
dipole_moment.py

双極子モーメントは、イオン (擬原子の芯) の寄与と電子の寄与の和として計算できます。

μ=∑AZARA−∫rρ(r)dr

ここで ZA は擬ポテンシャルの価電荷、RA は原子位置、ρ は電子密度です。ここでは、プロピン (CH3–C≡CH) を例に計算します。

dipole_moment.pyダウンロード
"""
Advance/OF-DFT example: dipole moment of a molecule from the electron density.

    mu = sum_A Z_A R_A - integral r rho(r) dr

Z_A is the valence charge of the pseudo-atom A.

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

import numpy as np
from ase.build import molecule
from ase.units import Bohr, Debye

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"

# isolated molecule at the centre of a box: propyne (CH3-CCH), with the molecular axis along z
atoms = molecule("C3H4_C3v")
atoms.center(vacuum=4.0)

atoms.calc = AOFDFTCalculator(
    console      = False,
    logging_file = "propyne.log",
    kin_type     = "AS26",
    kin_model    = "Molecule26",
    vps_dir      = VPS_DIR,
    pao_dir      = PAO_DIR,
    scf_style    = "molecule",
)
atoms.get_potential_energy()

calc    = atoms.calc
density = calc.rho[0].detach().cpu().numpy()  # e/Bohr^3

# Cartesian coordinates of the grid points (Angstrom)
grids = [np.arange(n) / n for n in density.shape]
frac  = np.stack(np.meshgrid(*grids, indexing="ij"), axis=-1)
r     = frac @ atoms.cell.array

dv = atoms.get_volume() / Bohr**3 / density.size  # volume of a grid cell (Bohr^3)

# valence charge of each pseudo-atom
species = calc.aofdft.atomic_data.species
zval    = np.array([float(species(symbol).zval) for symbol in atoms.get_chemical_symbols()])

n_elec     = density.sum() * dv
mu_ion     = (zval[:, None] * atoms.positions).sum(axis=0)
mu_elec    = -(density[..., None] * r).sum(axis=(0, 1, 2)) * dv
mu         = mu_ion + mu_elec  # e * Angstrom

print(f"Valence charges      : {dict(zip(atoms.get_chemical_symbols(), zval.tolist()))}")
print(f"Number of electrons  : {n_elec:.6f}")
print(f"Dipole vector (Debye): {np.round(mu / Debye, 3)}")
print(f"Dipole moment        : {np.linalg.norm(mu) / Debye:.3f} Debye")

実行結果の例

v1.0.0 (Molecule26) の結果です。

text
Valence charges      : {'C': 4.0, 'H': 1.0}
Number of electrons  : 16.000000
Dipole vector (Debye): [-0.001  0.005 -0.886]
Dipole moment        : 0.886 Debye

双極子モーメントは 0.886 Debye で、ベクトルは分子軸 (z 軸) に沿っています。この構造ではメチル基が −z 側にあるので、メチル基の側が正、アセチレンの側が負です。

ポイント

  • 分子の計算では kin_model="Molecule26" と scf_style="molecule" を指定します。
  • 擬原子の価電荷は calc.aofdft.atomic_data.species(元素記号).zval で取得できます。
  • 電子密度は周期的なグリッド上で定義されています。分子をセルの中央に置き (atoms.center)、セルの端で電子密度が十分に小さくなるだけの真空層を確保してください。
  • 中性分子の双極子モーメントは原点の取り方に依存しません。
  • 電子密度の単位は Bohr⁻³ なので、グリッド 1 点あたりの体積を Bohr³ で求めて積分しています。ase.units.Debye で e·Å から Debye へ換算します。
  • molecule("C3H4_C3v") は、ASE に登録されているプロピンの構造です。分子軸が z 軸を向いています。

Molecule26 モデルは非局所項を含むため、Crystal26 よりも 1 回の SCF ステップに時間がかかります。GPU の利用をおすすめします。

孤立電子対をもつ分子 (H2O、NH3 など) の双極子モーメントは、v1.0 の Molecule26 では再現できません (Molecule26-large でも同様です)。運動エネルギー汎関数の性能向上は開発ロードマップ に含まれており、今後のモデルの更新で改善する余地があります。