基于ed的rixs谱模拟开源工具包
edrixs的Python项目详细描述
基于精确对角化(ed)的强相关材料rixs谱模拟开源工具包。 It is developed作为布鲁克海文国家实验室计算材料光谱与设计中心COMSCOPE project的一部分
- 自由软件:GNU通用公共许可第3版
- 文档:https://nsls-ii.github.io/edrixs。
功能
- ED解算器
- xas光谱
- 里克斯谱
安装
所需的工具和库
- Fortran compiler: gfortran and ifort are supported
- MPI environment: openmpi and mpich are tested
- mpif90 (binding with gfortran or ifort) and mpicc (binding with gcc)
- Python3
- BLAS and LAPACK: gfortran+OpenBLAS or ifort+MKL
- arpack-ng (with mpi enabled)
- Numpy
- Scipy
- Sympy
- Matplotlib
- mpi4py
- Sphinx
- Numpydoc
请确保使用相同的(MPI)Fortran编译器编译openblas、arpack ng、mpi4py和edrix。
安装edrix的fortran部分
$ cd src $ make F90=mpif90 LIBS="-L/usr/local/lib -lopenblas -lparpack -larpack" $ make install
其中,您可能需要根据您的特定环境更改F90和LIBS。在mkl中使用gfortran时会出现问题,因此建议使用gfortran+OpenBLAS或ifort+MKL。libedrixsfortran.a将被生成,这将在构建python接口时使用。可执行文件.x将安装在edrixs/bin目录中,并在.bashrc或.bash_profile文件中添加以下行,
exportPATH=/root_dir_of_edrixs/edrixs/bin:$PATH
安装edrix的python部分
确保首先在src中生成libedrixsfortran.a。
$ python setup.py config_fc --f77exec=mpif90 --f90exec=mpif90 build_ext \ --libraries=openblas,parpack,arpack --library-dirs=/usr/lib:/usr/local/lib:/opt/local/lib \ --link-objects=./src/libedrixsfortran.a $ pip install .
其中,--library-dirs是搜索--libraries的路径,请根据您的环境进行设置。
在Docker中运行edrix
为了让生活更容易,我们已经为edrix构建了一个基于ubuntu linux(18.04)的docker镜像,这样你就不需要再为安装而纠结了。 只要docker应用程序可用,docker映像就可以在任何操作系统上使用。 按照以下步骤使用Docker图像:
在系统和learn how to use it上安装docker应用程序。
Docker运行后,创建一个目录以将数据存储在主机操作系统中,并启动一个容器以运行EDRIX
$ mkdir /dir/on/your/host/os # A directory on your host OS $ docker pull edrixs/edrixs # pull latest version $ docker run -it -p 8888:8888 -u rixs -w /home/rixs -v /dir/on/your/host/os:/home/rixs/data edrixs/edrixs
第一次从Docker Hub中提取图像需要一段时间,而下一次它将非常快地启动本地图像。
- -p 8888:8888将容器的端口8888映射到主机端口8888。
- -u rix表示使用默认用户rixs登录ubuntu linux,密码是rixs。
- -v/dir/on/your/host/os:/home/rixs/dat意味着将目录/dir/on/your/host/os从主机操作系统装载到容器中的ubuntu linux上的/home/rixs/data。
启动容器后,您将在/home/rixs目录中看到data和edrixs_examples。如果要将来自edrixs计算的数据保存到主机系统,则需要在/home/rixs/data目录中工作。
$ cd /home/rixs/data $ cp -r ../edrixs_examples . $ Play with edrixs ...
请注意,当此容器停止时,/home/rixs/data之外的任何更改都将丢失。您只能使用主机操作系统制作交互式绘图。如果需要,请使用sudo apt-get install安装软件。
您可以通过
$ docker rmi edrixs/edrixs
$ docker rm $(docker ps -a -q)
如何引用
如果您正在使用edrixs代码进行一些研究,并希望发表您的伟大作品,如果您能引用以下文章,将不胜感激
EDRIXS: An open source toolkit for simulating spectra of resonant inelastic x-ray scattering Y.L. Wang, G. Fabbris, M.P.M. Dean and G. Kotliar, arXiv:1812.05735. Accepted as publication in CPC.