ASE 모듈로 결정 수퍼셀(Super Cell) 만들기

By | 2022년 01월 18일

수퍼셀 (supercell) 만들기

결정의 구조는 나타내는 단위셀 내에는 보통 수개 ~ 십여개의 원자가 포함된다. 고체 내에 생성된 결정결함의 생성 에너지를 계산하기 위해서는 원자가 수십 \~ 수백 개가 포함되어 있는 셀에 대해 에너지를 계산해야 할 필요가 있는데 이렇게 많은 수의 원자가 포함하는 셀을 수퍼셀(super cell)이라고 한다. 수퍼셀은 기본적으로 unit cell을 이동벡터 방향으로 적층하려 만들 수가 있는데 여기서는 ase 모듈을 이용하여 수퍼셀은 만드는 법을 정리하였다.

1. 단위셀 만들기

단위셀을 만들기 위해 ase 모듈을 import 한다.

# numpy
import numpy as np
# ASE system
import ase
from ase import io
from ase import Atom, Atoms
from ase.spacegroup import crystal
# Spacegroup/symmetry library
from pyspglib import spglib
# iPython utility function
from IPython.core.display import Image

먼저 단위셀을 만든다. 단사정계 HfO2 결정의 cif (crystallographic information file)인 HfO2_mono.cif 파일이 현재 디렉토리에 있다고 가정하자.

m_HfO2=io.read("HfO2_mono.cif")
print(m_HfO2)
     Atoms(symbols='Hf4O8', pbc=True, cell=[[5.142319, 0.0, 0.0], [0.0, 5.195148, 0.0], [-0.895046999148182, 0.0, 5.250292996273162]], spacegroup_kinds=...)

이렇게 만들어진 monoclinic HfO2 결정 객체는 단위격자가

  a=[5.1423, 0.0, 0.0], 
  b=[0.0, 5.1951, 0.0], 
  c=[-0.8950, 0.0, 5.2503]

이고 단위셀 내에 Hf 원자 4개, O 원자 8 개가 있는 구조이다
이 구조를 그림의 그려보면

#
ase.io.write('HfO2-m111.png',         # The file name of the picture 
             m_HfO2,                  # The object holding the crystal definition
             format='png',            # Format of the file
             show_unit_cell=2,        # With the unit cell boundaries
             rotation='120y,20x',     # Rotate the scene by 120 deg around Y axis and 20 deg around X axis
             scale=30)                # Scale of the picture

# Display the image
Image(filename='HfO2-m111.png')

#
print('Space group:', spglib.get_spacegroup(m_HfO2))
     Space group: P2_1/c (14)

2. 수퍼셀 (Supercell) 만들기

수퍼셀은 단위셀을 x,y,z 방향으로 확장하여 만드는데 먼저 확장 메트릭스인 multiplier를 정의한다. 단위셀을 x,y,z 방향으로 2배 확장하고자 하는 경우의 multiplier는 다음과 같이 만든다.

#
import numpy
multiplier = numpy.identity(3) * 2
print(multiplier)
    [[2. 0. 0.]
     [0. 2. 0.]
     [0. 0. 2.]]

단위셀을 x,y,z 방향으로 각각 2,3,4 배 확장하여 새로운 셀을 만들고자 한다면 multiplier를 다음과 같이 만든다.

#
import numpy
multiplier = numpy.identity(3) * [[2], [3], [4]]
print(multiplier)
     [[2. 0. 0.]
     [0. 3. 0.]
     [0. 0. 4.]]

단사정계(monoclinic) HfO2를 x,y,z 방향으로 2배씩 확장한 supercell 객체를 HfO2_m222 라고 한다면

# import supercell function
from ase.build import make_supercell
#
HfO2_m222 = make_supercell(m_HfO2, multiplier)

# cell의 zmrl 
HfO2_m222.cell
     Cell([[10.284638, 0.0, 0.0], [0.0, 15.585443999999999, 0.0], [-3.580187996592728, 0.0, 21.001171985092647]])

HfO2_m222 수퍼셀을 그려보자.

ase.io.write('HfO2-m222.png',       # The file where the picture get stored
             HfO2_m222,               # The object holding the crystal definition
             format='png',        # Format of the file
             show_unit_cell=2,    # Draw the unit cell boundaries
             rotation='115y,15x', # Rotate the scene by 115deg around Y axis and 15deg around X axis
             scale=50)            # Scale of the picture

# Display the image
Image(filename='HfO2-m222.png')

print('Space group:', spglib.get_spacegroup(HfO2_m222))
     Space group: P2_1/c (14)

3. 수퍼셀 (Supercell) 로부터 primative unit cell 찾기

# import spglib
primUnitCell=spglib.find_primitive(HfO2_m222)
# 
primUnitCell[0]
     array([[ 5.142319,  0.      ,  0.      ],
            [ 0.      ,  5.195148,  0.      ],
            [-0.895047,  0.      ,  5.250293]])
primUnitCell[1]
    array([[0.224041, 0.457319, 0.792109],
           [0.775959, 0.957319, 0.707891],
           [0.775959, 0.542681, 0.207891],
           [0.224041, 0.042681, 0.292109],
           [0.051113, 0.742603, 0.522292],
           [0.948887, 0.242603, 0.977708],
           [0.948887, 0.257397, 0.477708],
           [0.051113, 0.757397, 0.022292],
           [0.432151, 0.330122, 0.152906],
           [0.567849, 0.830122, 0.347094],
           [0.567849, 0.669878, 0.847094],
           [0.432151, 0.169878, 0.652906]])
pUC = ase.Atoms(cell=primUnitCell[0], scaled_positions=primUnitCell[1], numbers=primUnitCell[2])
ase.io.write('pri-m-HfO2.png',       # The file where the picture get stored
             pUC,               # The object holding the crystal definition
             format='png',        # Format of the file
             show_unit_cell=2,    # Draw the unit cell boundaries
             rotation='115y,15x', # Rotate the scene by 115deg around Y axis and 15deg around X axis
             scale=30)            # Scale of the picture

# Display the image
Image(filename='pri-m-HfO2.png')

답글 남기기