|
本帖最后由 Accelerator 于 2024-10-25 09:12 编辑
Centos下Dice的安装
在DOI: 10.1021/acs.jctc.7b00900中,J Smith等介绍了用于处理巨大活性空间的HCISCF方法,号称能够在极短的时间内做到(44, 44)大小的活性空间。它需要借助Dice程序和PySCF结合完成。Dice程序可在https://github.com/sanshar/Dice下载;以下安装过程全程使用Intel编译器。
安装hdf5在https://www.hdfgroup.org/download-hdf5/source-code/#下载HDF5源码。
解压并进入后,执行:
- ./configure --prefix=/data/home/drwg/hdf5
- make -j
- make install
复制代码 安装boost- cd /data/home/drwg/boost_1_71_0/
- ./bootstrap.sh
复制代码 vi project-config.jam,在最后加入using mpi ;
./b2 -j6 --target=shared,static
安装Dice
cd Dice-master/
vi Makefile,将开头改为:
- USE_INTEL = yes
- HAS_AVX2 = yes
- BOOST=/data/home/drwg/boost_1_71_0
- EIGEN=./eigen/
- HDF5=/data/home/drwg/hdf5
- MKL=/data/app/intel/oneapi/mkl/latest
- INCLUDE_MKL = -I$(MKL)/include
- #LIB_MKL = -lblas -llapack #-L$(MKL)/lib/intel64/ -lmkl_intel_ilp64 -lmkl_gnu_thread -lmkl_core
- LIB_MKL = -L$(MKL)/lib/intel64/ -lmkl_intel_ilp64 -lmkl_gnu_thread -lmkl_core
- #INCLUDE_BOOST = -I$(BOOST)/include -I$(BOOST)
- INCLUDE_BOOST = -I$(BOOST)/
- #LIB_BOOST = -L$(BOOST)/lib -L$(BOOST)/stage/lib
- LIB_BOOST = -L$(BOOST)/stage/lib
- INCLUDE_HDF5 = -I$(HDF5)/include
- LIB_HDF5 = -L$(HDF5)/lib -lhdf5
复制代码 运行:make -j
运行测试- cd tests
- sed -i 's/python2/python3/g' *sh
- sed -i 's/np 4/np 28/g' *sh
- sh runTests.sh
复制代码 会发现FCIQMC文件不存在,也无法通过make FCIQMC -j编译出来。另外有两个测试结果不对,其余均通过:
- ...running hubbard_1x10 ghf
- test failed
- eRef = -5.42482593
- eTest = -5.43914066
- ...running hubbard_1x10 agp
- test failed
- eRef = -3.83213158
- eTest = -3.87729611
复制代码 由于主要用SHCI功能,似乎可以不管它。
SHCI单独测试:
- cd SHCI
- sed -i 's/python/python3/g' *sh
- sed -i 's/np 4/np 28/g' *sh
- sh runTests.sh
复制代码 测试通过。
安装PySCF略
安装pyscf-shciscf
pip3 install git+https://github.com/pyscf/shciscf --user
进入安装位置:cd /data/home/drwg/.local/lib/python3.12/site-packages/pyscf/shciscf
vi settings.py(pip3安装的不会带着这个文件,需要新建):
- import os
- SHCIEXE = '/data/home/drwg/Dice-master/bin/Dice'
- SHCISCRATCHDIR = "."
- SHCIRUNTIMEDIR = '.'
- MPIPREFIX = 'mpirun -np 28' #'mpirun -np 2' # change to srun for SLURM job system
复制代码 设置环境变量
- source /data/app/intel/oneapi/setvars.sh
- export PATH=$PATH:/data/home/drwg/boost_1_71_0
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/home/drwg/boost_1_71_0/stage/lib
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/home/drwg/hdf5/lib
复制代码 运行python3 test.py,这是一个C2分子的CASSCF计算,测试通过,用2核大概花了15 s.它是从Dice的documentation(https://sanshar.github.io/Dice/u ... l?highlight=shciscf)上扒下来的,但官方给的包名字不对,应该是pyscf.shciscf而不是pyscf.future.shciscf。
- from pyscf import gto, scf
- from pyscf.shciscf import shci
- # Initialize O2 molecule
- b = 1.243
- mol = gto.Mole()
- mol.build(
- verbose = 5,
- output = None,
- atom = [
- ['C',( 0.000000, 0.000000, -b/2)],
- ['C',( 0.000000, 0.000000, b/2)], ],
- basis = {'C': 'ccpvdz', },
- symmetry = True,
- symmetry_subgroup = 'D2h',
- spin = 0
- )
- # Create HF molecule
- mf = scf.RHF( mol )
- mf.conv_tol = 1e-9
- mf.scf()
- # Number of orbital and electrons
- norb = 26
- nelec = 8
- # Create SHCI molecule for just variational opt.
- # Active spaces chosen to reflect valence active space.
- mch = shci.SHCISCF( mf, norb, nelec )
- mch.fcisolver.mpiprefix = 'mpirun -np 2'
- mch.fcisolver.stochastic = True
- mch.fcisolver.nPTiter = 0
- mch.fcisolver.sweep_iter = [ 0, 3 ]
- mch.fcisolver.DoRDM = True
- mch.fcisolver.sweep_epsilon = [ 5e-3, 1e-3 ]
- e_shci = mch.mc1step()[0]
复制代码
|
评分 Rate
-
查看全部评分 View all ratings
|