1. To plot the Wannier orbitals, add two options LOCPROJ & LWRITE_UNK in INCAR file.
2. Run an SCF calculation.
3. After that, you can get UNK#### files that you put the orbital characters of LOCPROJ in INCAR.
4. After finishing the SCF, add four lines in case.win file.
write_xyz = true
wannier_plot = true
wannier_plot_format=xcrysden
wannier_plot_supercell = 3 3 3
5. Run wannier90.x wannier90
6. Finally you will get wannier90_###.xsf files. With these files, open these files using VESTA or Xcrysden program.
실용적인 DIPOL 설정 방법
방법 1 — 슬랩 원자 z좌표 평균 (가장 일반적)
import numpy as np
from pymatgen.core import Structure
st = Structure.from_file("POSCAR")
c = st.lattice.c
# 원자들의 절대 z좌표
z_coords = [site.coords[2] for site in st]
# fractional z 평균
z_frac_mean = np.mean([site.frac_coords[2] for site in st])
print(f"DIPOL = 0.5 0.5 {z_frac_mean:.4f}")
방법 2 — (z_min + z_max) / 2
z_frac = [site.frac_coords[2] for site in st]
z_mid = (max(z_frac) + min(z_frac)) / 2
print(f"DIPOL = 0.5 0.5 {z_mid:.4f}")
방법 3 — vacuum 중앙에 배치 (더 안전한 방법)
z_frac = [site.frac_coords[2] for site in st]
z_min, z_max = min(z_frac), max(z_frac)
# 슬랩 위 vacuum의 중앙
z_dipol = (z_max + 1.0) / 2 # 위쪽 vacuum 중앙
# 또는 아래 vacuum 중앙
# z_dipol = z_min / 2
print(f"DIPOL = 0.5 0.5 {z_dipol:.4f}")
**주의해야 할 경우
슬랩이 cell 경계(z=0 또는 z=1) 근처에 걸쳐 있을 때
→ 원자가 z=0.95와 z=0.05에 동시에 있으면 단순 평균이 0.5가 되어버려 슬랩 중앙에 DIPOL이 박힘 (위험!)
→ 해결: 구조를 center_slab으로 슬랩을 cell 중앙으로 이동 후 설정
# pymatgen으로 슬랩 중앙 정렬
from pymatgen.core.surface import center_slab
st_centered = center_slab(st)
st_centered.to("POSCAR_centered")
**결론: DIPOL은 "슬랩의 대칭 중심"이 아니라 "vacuum 내 임의의 기준점" 입니다.
슬랩 원자 z좌표의 평균이나 vacuum 중앙 어느 쪽을 써도 결과는 동일합니다. 단, 슬랩 원자와 겹치면 안 됩니다.