1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

pymatgen を用いて結晶中原子の対称位置を特定する方法

Last updated at Posted at 2023-05-28

概要

 pippymatgen のアップデートを行ったら、従来の方法で結晶中原子の identical な位置の検索ができなくなっていたので、その時の備忘録的に対処法を書く。

環境

  • pymatgen: 2023.5.10
  • pymatgen-analysis-defects: 2023.5.8
  • Python: 3.10.9

実装

POSCAR_data_extract.py
# This is the code for detecting identical atoms in a unitcell
import numpy as np
import pymatgen as mg
from pymatgen.io.vasp import Poscar
from pymatgen.core.sites import PeriodicSite
from pymatgen.analysis.defects.generators import VacancyGenerator

# from pymatgen.symmetry.analyzer import PointGroupAnalyzer
poscar = Poscar.from_file("POSCAR", check_for_POTCAR=False) # Read the POSCAR file in the same folder
structure = poscar.structure # Read the structure in the file
sp = structure.species # Detect species as list type
interstitial_gen = VacancyGenerator()
interstitial = interstitial_gen.generate(structure)
list1 = []
for i, vac in enumerate(interstitial):
    int_site = vac.site # Output as lists of coordinates and atoms
    list1.append(int_site)

# Save output into text file. 
with open('identicalList.txt','w') as f:
	f.write(str(list1))

出力

  • $ZrO_2$ (cubic, $2\times2\times2$) で行った結果は以下の通り
[PeriodicSite: Zr (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000], PeriodicSite: O (3.8176, 1.2725, 3.8176) [0.3750, 0.1250, 0.3750]]

(x, y, z): 格子定数を考慮した原子位置(=格子定数×相対座標)
[x, y, z]: 原子の相対座標(POSCARで書かれている原子座標はこっち)

注意点

  • 実行コードと同じディレクトリ内に POSCARが必要
  • 構造を拡大したりした場合は、POSCARの読み込みの際にcheck_for_POTCAR=Falseとしておいた方が良い(実行時に怒られが発生するため)

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?