yxx554243496的个人博客分享 http://blog.sciencenet.cn/u/yxx554243496

博文

[转载]Phonopy 安装及简单使用说明

已有 21425 次阅读 2017-7-26 16:05 |个人分类:系统运维|系统分类:科研笔记

1.Phonopy 安装 Ubuntu16.04亲测


万能安装:sudo pip install phonopy

或者:

sudo apt-get install python-dev

sudo apt-get install python-numpy
sudo apt-get install pyth
on-matplotlib

sudo apt-get install python-lxml

sudo apt-get install python-yamlhttps://sourceforge.net/projects/phonopy/

tar xvfz phonopy-1.11.2.tar.gz
cd /home/..../p
honopy-1.11.2
sudo python setup.py install

注:若出现如下提示,执行sudo apt-get install python-h5py,后重安装

错误提示:/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
 ^
In file included from /tmp/easy_install-jdGNKr/h5py-2.7.1/h5py/defs.c:561:0:
/tmp/easy_install-jdGNKr/h5py-2.7.1/h5py/api_compat.h:27:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

which phonopy  #安装好后 phonopy 的命令都在 bin 文件夹下

2. 简单实用说明:
一.一般步骤:
1.准备 POSCAR 文件,一般 POSCAR 中为一个单胞,然后运行命令./phonopy -d --dim=”m n l”即可生
成一个 SPOSCAR 文件,其中包含的结构为由指定单胞扩展得到的 m×n×l 的超原胞,此外还会生成 disp.yaml
以及 POSCAR-{number}等文件,前者包含所有的位移信息,后者则表示发生不同位移的超原胞(文件名序号
与 disp.yaml 中指定位移的顺序一致)
2.每一个 POSCAR 都可以进行一次 vasp,分别得到 vasprun.xml-number
3.将 POSCAR 设置为第一步中的单胞 POSCAR,运行命令:./phonopy -f vasprun.xml-00*,得到
FORCE_SET 文件
4.绘制声子谱:./phonopy -p band.conf
5.计算声子态密度:./phonopy -p mesh.conf
6.计算热力学性质:./phonopy -t mesh.conf
二.做完第 6 步后,使用准谐近似计算热力学性质:(需要 phonopy-qha)
1.准备好 v-e 文件作为输入文件,示例:(体积单位:A3,能量单位:ev)
# cell volume energy of cell other than phonon
156.7387309525 -104.5290025375
154.4138492700 -104.6868148175
152.2544070150 -104.8064238800
150.2790355600 -104.8911768625
148.4469296725 -104.9470385875
146.7037426750 -104.9783724075
145.1182305450 -104.9871878600
143.5676103350 -104.9765270775
142.1282086200 -104.9485225225
139.4989658225 -104.8492814250
输入命令:./phonopy-qha v-e.dat thermal_properties-{1..10}.yaml(该命令可以计算某恒定压力下的热力学性质)
输出文件可以有:
体积模量与温度关系;
吉布斯自由能与温度关系;
体积变化与温度关系;
某恒压下的热熔与温度关系。。。。等等
个人心得:看过很多的中文说明,其实最好的老师还是英文 manual,所以
最好下载 phonopy 的 manual 看看,你会很有收获。


手册安装说明:

Prepare the following Python libraries:

  • Python and its header files

  • numpy

  • matplotlib

  • python-yaml (pyyaml)

  • python-h5py (h5py)

By Ubuntu package manager

The most recommended system is Ubuntu linux version 14.04 or later. If you have any installation problem that you may feel difficult to solve, please use a ubuntu virtual machine (seeSet up Ubuntu linux on VirtualBox).

The python libraries are installed by:

%sudoapt-getinstallpython-devpython-numpypython-matplotlibpython-yamlpython-h5py

python-scipy is also required to use phonopy-qha or DEBYE_MODEL tag.

The texlive-fonts-recommended package may be required, if you see the following message in ploting results:

By conda

The python libraries may be also installed using pip or conda. Conda packages are distributed in binary and recommended often more than pip. The installation of necessary libraries is done as follows:

%condainstallnumpyscipyh5pypyyamlmatplotlib

Building using setup.py

If package installation is not possible or you want to compile with special compiler or special options, phonopy is built using setup.py. In this case, manual modification of setup.pymay be needed.

  1. Download the source code at

    https://pypi.python.org/pypi/phonopy

    and extract it:

    %tarxvfzphonopy-1.11.12.31.tar.gz%cdphonopy-1.11.12.31

    The other option is using git to clone the phonopy repository from github:

    %gitclonehttps://github.com/atztogo/phonopy.git%cdphonopy

  2. Set up C-libraries for python C-API and python codes. This can be done as follows:

    Run setup.py script:

    %pythonsetup.pyinstall



phonopy使用过程中可能会出现报错:

解决方式:

sudo apt-get install dvipngtexlive-latex-extra texlive-fonts-recommended

转数据:

bandplot –gnuplotband.yaml >1.dat  

报错信息:

Traceback (mostrecent call last):

 File"/usr/local/bin/bandplot", line 175, in <module>

   labels) =read_band_yaml(filename)

 File"/usr/local/bin/bandplot", line 69, in read_band_yaml

  data['segment_nqpoint'],

KeyError:'segment_nqpoint'



表横坐标:

xxyu@xxyu-ThinkPad-T460p:~/2-usual/scp/3-phonon/342-phonon$phonopy -p band.conf

       _

 _ __ | |__   ___ _ __   ___   _ __  _   _

| '_ \| '_ \ / _ \|'_ \ / _ \ | '_ \| | | |

| |_) | | | | (_) || | | (_) || |_) | |_| |

| .__/|_||_|\___/|_| |_|\___(_) .__/ \__, |

|_|                           |_|    |___/

                                    1.11.2


Python version2.7.12

Spglib version 1.9.7

Band structure mode

Settings:

 Supercell: [3 4 2]

Spacegroup: P2_1/m(11)

Computing forceconstants...

Force constants arewritten into FORCE_CONSTANTS.

Reciprocal spacepaths in reduced coordinates:

[ 0.00  0.00  0.00]--> [ 0.50  0.00  0.00]

[ 0.50  0.00  0.00]--> [ 0.50  0.50  0.00]

[ 0.50  0.50  0.00]--> [-0.00 -0.00  0.00]

[ 0.00  0.00  0.00]--> [ 0.00  0.50  0.00]

[ 0.00  0.50  0.00]--> [ 0.00  0.50  0.50]

[ 0.00  0.50  0.50]--> [ 0.00 -0.00 -0.00]

[ 0.00  0.00  0.00]--> [ 0.00  0.00  0.50]

报错信息:

sh: 1: latex: notfound

Exception in Tkintercallback

Traceback (mostrecent call last):

 File"/usr/lib/python2.7/lib-tk/Tkinter.py", line 1540, in__call__

   returnself.func(*args)

 File"/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py",line 283, in resize

   self.show()

 File"/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py",line 354, in draw

  FigureCanvasAgg.draw(self)

 File"/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_agg.py",line 474, in draw

  self.figure.draw(self.renderer)

 File"/usr/lib/python2.7/dist-packages/matplotlib/artist.py",line 61, in draw_wrapper

   draw(artist,renderer, *args, **kwargs)

 File"/usr/lib/python2.7/dist-packages/matplotlib/figure.py",line 1159, in draw

   func(*args)

 File"/usr/lib/python2.7/dist-packages/matplotlib/artist.py",line 61, in draw_wrapper

   draw(artist,renderer, *args, **kwargs)

 File"/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py",line 2324, in draw

   a.draw(renderer)

 File"/usr/lib/python2.7/dist-packages/matplotlib/artist.py",line 61, in draw_wrapper

   draw(artist,renderer, *args, **kwargs)

 File"/usr/lib/python2.7/dist-packages/matplotlib/axis.py", line1108, in draw

   renderer)

 File"/usr/lib/python2.7/dist-packages/matplotlib/axis.py", line1058, in _get_tick_bboxes

   extent =tick.label1.get_window_extent(renderer)

 File"/usr/lib/python2.7/dist-packages/matplotlib/text.py", line961, in get_window_extent

   bbox, info,descent = self._get_layout(self._renderer)

 File"/usr/lib/python2.7/dist-packages/matplotlib/text.py", line352, in _get_layout

   ismath=False)

 File"/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_agg.py",line 229, in get_text_width_height_descent

   renderer=self)

 File"/usr/lib/python2.7/dist-packages/matplotlib/texmanager.py",line 675, in get_text_width_height_descent

   dvifile =self.make_dvi(tex, fontsize)

 File"/usr/lib/python2.7/dist-packages/matplotlib/texmanager.py",line 422, in make_dvi

   report))

RuntimeError: LaTeXwas not able to process the following string:

'lp'

Here is the fullreport generated by LaTeX:





https://blog.sciencenet.cn/blog-3222255-1068177.html

上一篇:优化无故中断 “ZBRENT: fatal error in bracketing”
下一篇:ubuntu16.04 软件安装系列
收藏 IP: 114.247.56.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-25 05:23

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部