目录

Phonopy声子谱

misaraty 更新 | 2023-07-07
前言
Phonopy是声子谱计算软件。

第一版

下载

注意
运行环境为Python2.7.x。

安装

  1. 修改.bashrc
1
2
3
4
5
# python 2
export PATH="/THFS/home/longr/soft/anaconda2/bin:$PATH"
export PYTHONPATH=/THFS/home/longr/soft/anaconda2/lib/python2.7/site-packages
#phonopy
#export PATH=/THFS/home/longr/soft/phonopy-1.12.8.4/scripts:$PATH
  1. 运行,
1
2
python setup.py install --user #not root
python setup.py install #root

Force Calculators方法

1
phonopy -d --dim="2 2 2"

          运行build.py

  1. 提交job.sh

1
phonopy -f {001..072}/vasprun.xml

          生成FORCE_SETS

  1. 修改mesh.conf
1
2
3
ATOM_NAME = C    N    H    Pb   I
DIM = 2 2 2
MP = 1 1 1

          运行,

1
2
phonopy -p mesh.conf #生成total_dos.dat,遇到matplotlib报错正常,依旧生成dat文件。
python phonon_dos_plot.py #plot
  1. 修改band.conf
1
2
3
ATOM_NAME = C    N    H    Pb   I
DIM = 2 2 2
BAND = 0.5 0.5 0.5  0.0 0.0 0.0  0.5 0.5 0.0  0.0 0.5 0.0

          运行,

1
2
phonopy -p band.conf #获得band.yaml
phonopy-bandplot --gnuplot band.yaml > band.dat #将band.yaml转为origin dat数据
注意
Total Time: 38.45 h

DFPT Force Constants方法

1
phonopy -d --dim="2 2 2" -c POSCAR-unitcell
  1. SPOSCARPOSCAR,提交job.sh

1
2
3
4
phonopy --fc vasprun.xml
phonopy --dim="2 2 2" -c POSCAR-unitcell -p mesh.conf
phonopy --dim="2 2 2" -c POSCAR-unitcell -p band.conf
phonopy-bandplot --gnuplot band.yaml > band.dat
注意
Total Time: 41.59 h
报错
1
2
QXcbConnection: Could not connect to display 
Aborted (core dumped)
解决
上述错误信息请直接忽略。

文档

第二版

离线安装

  1. 修改集群/root/.condarc,离线环境使用proxy,
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/main
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/r
  - https://mirrors.bfsu.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.bfsu.edu.cn/anaconda/cloud
  msys2: https://mirrors.bfsu.edu.cn/anaconda/cloud
  bioconda: https://mirrors.bfsu.edu.cn/anaconda/cloud
  menpo: https://mirrors.bfsu.edu.cn/anaconda/cloud
  pytorch: https://mirrors.bfsu.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.bfsu.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.bfsu.edu.cn/anaconda/cloud
  deepmodeling: https://mirrors.bfsu.edu.cn/anaconda/cloud/
proxy_servers:
  http: http://10.81.5.36:7890
  https: http://10.81.5.36:7890
ssl_verify: False
注意
1
  https: http://10.81.5.36:7890

          清理缓存,

1
conda clean -i
  1. 运行
1
2
3
pip install phonopy==2.9.0 --proxy=10.82.0.107:7890
conda install -c conda-forge phonopy
conda install -c conda-forge phono3py
注意
pip phonopyconda phonopy都安装。
报错
1
2
3
[root@master ~]# conda install -c conda-forge phono3py
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
解决

多等几分钟即可。

1
2
3
4
5
6
7
8
[root@master ~]# conda install -c conda-forge phono3py
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: - 
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
  1. 下载Phonopy-Spectroscopy(可计算IR和Raman光谱),解压缩,并修改.bashrc
1
2
3
# Phonopy-Spectroscopy
export PYTHONPATH=${PYTHONPATH}:/opt/ohpc/pub/apps/Phonopy-Spectroscopy-master/lib
export PATH=${PATH}:/opt/ohpc/pub/apps/Phonopy-Spectroscopy-master/scripts

          提升权限,

1
2
3
# Phonopy-Spectroscopy
cd /opt/ohpc/pub/apps/Phonopy-Spectroscopy-master
chmod +x scripts/*

          检查,

1
phonopy-ir -h

参考