|
KirariNto是对Marco Campetella和Juan Sanz Garcia在10.1002/jcc.26162中提出的算法的实现,但相比而言使用的近似程度更低。原文作者虽然也开发了实现这一算法的程序,但并不公开。
KirariNto用于在激发态构型优化过程中尽可能维持激发态成分不变。其思想是在除第一步外的每一步,都先进行一个TD-DFT单点计算,对每个激发态分别进行NTO分析,与前一步选定的感兴趣的激发态的NTO轨道计算重叠积分,选取重叠程度最大的,作为下一步感兴趣的激发态并得到受力。在KirariNto中,这些过程均借助Multiwfn完成。为了适配Multiwfn的功能,计算两个电子态A和B之间的NTO重叠积分的具体做法如下:
1. 对连续两步的分子的几何结构进行对齐;
2. 对A和B分别得到NTO轨道和本征值;
3. 取出A和B各自的NTO-hole轨道和NTO-electron轨道,设置占据数为本征值的四次方根,共计保存成4个fchk文件;
4. 分别对这4个fchk文件计算电子密度,然后以hole-hole,electron-electron的方式得到重叠积分并相加。
KirariNto调用PySCF和geomeTRIC作为优化器,通过对Gaussian或ORCA的输出信息进行处理,得到每一步的能量和梯度并输入到优化器中。因此它需要如下依赖:
Linux操作系统;
PySCF;
geomeTRIC(可通过pip3 install geometric安装)
Numpy。
在运行前,需要指定与Multiwfn、ORCA、Gaussian相关的环境变量:
- export KIRARINTO_MULTIWFN=~/Multiwfn_3.8_dev_bin_Linux_noGUI/Multiwfn
- export KIRARINTO_GAUSSIAN=~/g16/g16
- export KIRARINTO_FORMCHK=~/g16/formchk
- export KIRARINTO_ORCA=/opt/orca5/orca
- export KIRARINTO_ORCA2MKL=/opt/orca5/orca_2mkl
复制代码 运行方式如下:
- usage: kirariNto.py [-h] [-c CONSTRAINTS] [-p PROGRAM] [-d DELETE] [-g GRID] input
- positional arguments:
- input An input file for the TD-DFT calculation of your initial geometry.
- optional arguments:
- -h, --help show this help message and exit
- -c CONSTRAINTS, --constraints CONSTRAINTS (optional) An external geometry constraint file that follows the
- format requirement of PySCF.
- -p PROGRAM, --program PROGRAM The program you are using (Gaussian or ORCA; case insensitive). Default: Gaussian if input file contains .gjf, and ORCA if input file contains .inp
- -d DELETE, --delete DELETE (optional) If the .chk or .gbw files to be deleted after each step. yes (default) or no.
- -g GRID, --grid GRID (optional) 1, 2 (default) or 3. The accuracy of integral grid for overlap evaluation. Denser for a large value.
复制代码 需要首先准备一个用于对初始结构进行TD-DFT单点计算的输入文件,并指定nstates和nroot。例如(以下仅以展示格式为目的,请忽视其中计算水平):
Gaussian:
- %mem=8GB
- %nprocshared=8
- %chk=u_td_1.chk
- # td=(<b>nstates=3,root=1</b>) b3lyp em=gd3bj iop(9/40=4) gen
- TC
- 0 1
- C 1.49653099 -0.03970163 0.25798558
- C 0.96661422 1.10990407 -0.32719382
- C -0.29560541 1.04203217 -0.91629061
- H 2.46280152 -0.01555637 0.71693905
- H 1.51812645 2.02681494 -0.32424024
- C -0.42910744 -1.21052831 -0.33465934
- O -1.07773001 -2.28888230 -0.33812694
- N -0.96370843 -0.11703076 -0.90600943
- N 0.78578354 -1.17302439 0.24032710
- H 1.16155785 -1.99994675 0.65864886
- N -0.88665177 2.23323444 -1.54286970
- H -1.88298815 2.18859514 -1.46992353
- H -0.55480592 3.05391114 -1.07771587
- -c -h -o -n 0
- sto-3g
- ****
复制代码 ORCA:
- ! blyp def2-sv(p) def2/j
- %pal nprocs 8 end
- %tddft nroots 5 iroot 1 end
- * xyz 0 1
- C 1.49653098 -0.03970163 0.25798558
- C 0.96661422 1.10990407 -0.32719382
- C -0.29560541 1.04203217 -0.91629061
- H 2.46280151 -0.01555637 0.71693905
- H 1.51812644 2.02681493 -0.32424024
- C -0.42910744 -1.21052830 -0.33465934
- O -1.07773001 -2.28888229 -0.33812694
- N -0.96370843 -0.11703076 -0.90600943
- N 0.78578354 -1.17302438 0.24032710
- H 1.16155784 -1.99994674 0.65864886
- N -0.88665177 2.23323443 -1.54286969
- H -1.88298814 2.18859513 -1.46992352
- H -0.55480592 3.05391113 -1.07771587
- *
复制代码 假如叫做task.gjf,接下来执行:
- python3 kirariNto.py task.gjf
复制代码 程序会自动在当前目录创建一个JOBS目录,构型优化每一步的文件都会保存在其中。运行过程中,会不断输出类似如下的信息,可以看到每个态与前一个态之间的NTO重叠积分,以及最终选择了哪个态来走下一步:
- Step 0 : Gradient = 9.646e-02/1.700e-01 (rms/max) Energy = -389.6216215640
- Hessian Eigenvalues: 2.30000e-02 2.30000e-02 2.30000e-02 ... 5.66572e-01 5.76846e-01 8.02088e-01
- NTO overlap between the state 1 and the previous TES is 0.10911
- NTO overlap between the state 2 and the previous TES is 0.08976
- NTO overlap between the state 3 and the previous TES is 0.10217
- Now the state with largest overlap is determined to be 1
复制代码 以上述gjf文件为例,走10步后到达收敛(收敛限与Gaussian默认收敛限相同):
- Step 10 : Displace = 6.239e-04/1.256e-03 (rms/max) Trust = 1.141e-02 (=) Grad = 6.950e-05/1.542e-04 (rms/max) E (change) = -389.6852923380 (-8.480e-07) Quality = 1.256
- Hessian Eigenvalues: 1.50842e-02 2.29339e-02 2.30019e-02 ... 6.85113e-01 7.31987e-01 7.87066e-01
- Converged! =D
复制代码 程序地址:
https://github.com/RimoAccelerator/KirariNto/tree/main
|
评分 Rate
-
查看全部评分 View all ratings
|