计算化学公社

 找回密码 Forget password
 注册 Register
Views: 22868|回复 Reply: 21
打印 Print 上一主题 Last thread 下一主题 Next thread

[综合交流] 升级PySOC使其支持g16(更新calcsoc脚本)

[复制链接 Copy URL]

908

帖子

37

威望

5435

eV
积分
7083

Level 6 (一方通行)

本帖最后由 ggdh 于 2020-12-23 06:33 编辑

1.升级pysoc脚本使其支持g16
PySOC的详细介绍见:使用Gaussian+PySOC在TDDFT下计算旋轨耦合矩阵元
虽然目前还可以用ORCA算SOC,但有时候懒得切换程序了。
原版的PySOC不支持g16,主要是g16和g09的log文件有差别,使其读取的时候出现了一点小问题。需要进行下面的一些修改:
1.修改pysoc.py所在目录下的soc.py的第84行把:
elif 'NFC=' in line:
改成
elif 'NFC=' in line and 'NBasis' in line:
2.把soc.py的103行的
['AO basis set','primitive gaussians']
改成
['AO basis set','Effective','primitive gaussians']
3.然后把sob_PySOC_MolSOC/pysoc/bin/soc.py中164行附近的下面两行中的g09改成g16
cmd0 = g09root+'/g09/bsd/g09.profile'
cmd1 = g09root+'/g09/rwfdump gaussian.rwf'

4.在计算所用的init.py文件中设置g16的路径,比如我的是下面这样,各位根据自己的实际情况设就好。
g16root = '/home/zc'
sys.path.append(g16root+'/g16')


另外也为小白和懒人准备了脚本,附件中的update_pysoc.sh,自动完成升级,以及自动对init.py的设置,具体用法见第三部分

2.快捷计算soc的calcsoc脚本
特性:
1.不需要手动修改文件名
2.在命令行中指定计算的态的数量
3.在命令行中切换不同的molsoc版本
4.自动识别log文件的版本(g09/g16),并据此自动修改程序(注意,如果这里用的是g09的log,但是机器上没有设置g09root环境变量,那就可能会出错)
运行方法:
确保当前目录下有abc.log abc.rwf文件,然后运行:
  1. calcsoc -s 1 -t 2 -p 3 abc.log
复制代码
说明:
-s 1  选择S1态
-t 2 选择T1,T2态
-p 3 选择sob制作的molsoc 3号版本,不同版本的含义见sob的那篇博文,或者运行
  1. calcsoc -h
复制代码
进行快速查看如下图;

运行时,会产生一个abc-soc的文件夹,相关的临时文件都会放在这个文件夹中进行计算。这个文件夹仅仅用于出错了调试,一般不需要进入。
计算完成后会在当前目录下(有abc.log的文件的目录)产生abc_soc.dat文件,其中就包含了所需的SOC的数据。


3.从头开始安装步骤
需求:
1 python 3.7环境
2 设置了g09root(如果需要分析g09的log) 或者g16root (如果需要分析g16的log)的环境变量。
安装步骤:
1.下载sob_PySOC_MolSOC.zip,并解压文件,注意文件中的还有子压缩包pysoc.zip和molsoc_modified.zip, 也需要分别解压。
2. 把文件夹及子文件夹上传到服务器(Linux系统)
3. 把附件中的2个文件:update_pysoc.sh, calcsoc文件拷贝到服务器上的sob_PySOC_MolSOC/pysoc/bin文件夹当中
4. 到sob_PySOC_MolSOC/pysoc/bin下,运行
  1. chmod +x *
复制代码
5.把sob_PySOC_MolSOC/pysoc/bin加入到PATH变量中
6.运行update_pysoc.sh (这里在任意地方运行都可,因为会通过第四步设定的PATH路径找到相应的需要修改的文件位置)
此处会显示一些信息,包括是否成功升级,以及对init.py 的自动设置。
7.运行calcsoc进行分析



calcsoc

3.06 KB, 下载次数 Times of downloads: 240

update_pysoc.sh

2.36 KB, 下载次数 Times of downloads: 222

评分 Rate

参与人数
Participants 7
eV +37 收起 理由
Reason
masc + 4 牛!
tkaray + 5 牛!
幸运兔 + 5 牛!
snljty + 5
冰释之川 + 5 谢谢分享
biogon + 5 GJ!
sobereva + 8

查看全部评分 View all ratings

1

帖子

0

威望

39

eV
积分
40

Level 2 能力者

22#
发表于 Post on 2025-6-27 11:11:01 | 只看该作者 Only view this author
大佬,使用了最新版本,g16还是会报错NameError: name 'mo_ene' is not defined,不知道该咋解决,折腾了半天也跑不通

1

帖子

0

威望

17

eV
积分
18

Level 1 能力者

21#
发表于 Post on 2022-6-18 12:51:04 | 只看该作者 Only view this author
ggdh 发表于 2020-12-22 18:49
有赝势的log文件,由于g16和g09的输出有差异,导致错误
之前的脚本没有注意到赝势的情况。现在的船新版 ...

您好,我刚刚尝试下载了您附件中的两个脚本,运行后还是会在mo_ene的地方出错,不知道应该做如何修改呢?

23

帖子

0

威望

2739

eV
积分
2762

Level 5 (御坂)

20#
发表于 Post on 2022-4-18 22:16:45 | 只看该作者 Only view this author
ggdh 发表于 2022-4-18 19:12
如果能出结果 应该是没有影响的  
这些报错就是设g16环境变量的报错

谢谢钟老师

908

帖子

37

威望

5435

eV
积分
7083

Level 6 (一方通行)

19#
 楼主 Author| 发表于 Post on 2022-4-18 19:12:15 | 只看该作者 Only view this author
leebo 发表于 2022-4-18 16:40
钟老师好,我使用calcsoc -s 1 -t 3 -p 3 gaussian.log的时候,出现以下提示,请问这对结果有啥影响吗? ...

如果能出结果 应该是没有影响的  
这些报错就是设g16环境变量的报错

2407

帖子

1

威望

5948

eV
积分
8375

Level 6 (一方通行)

18#
发表于 Post on 2022-4-18 18:04:41 | 只看该作者 Only view this author
用ORCA搞吧……

我记得这个方案需要rwf 文件,
实际操作起来比较费事,我指拷贝文件方面……

【ORCA旋轨耦合矩阵元 OLED TADF相关 (spin-orbit coupling matrix elements)-哔哩哔哩】 https://b23.tv/vw7XSwg
High-Performance Computing for You
为您专属定制的高性能计算解决方案

更多讯息,请访问:
https://labitc.top
http://tophpc.top:8080
电邮: ask@hpc4you.top

23

帖子

0

威望

2739

eV
积分
2762

Level 5 (御坂)

17#
发表于 Post on 2022-4-18 16:40:26 | 只看该作者 Only view this author
ggdh 发表于 2020-12-9 18:12
有没有啥出错提示没?

钟老师好,我使用calcsoc -s 1 -t 3 -p 3 gaussian.log的时候,出现以下提示,请问这对结果有啥影响吗?谢谢。


open file gaussian.rwf
MOA_coeffs 524R
/share/apps/g16.b01/g16/bsd/g16.profile: 85: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 86: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 87: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 88: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 89: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 90: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 91: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 92: ulimit: Illegal option -u
AO_overlap 514R
/share/apps/g16.b01/g16/bsd/g16.profile: 85: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 86: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 87: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 88: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 89: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 90: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 91: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 92: ulimit: Illegal option -u
XY_coeffs 635R
/share/apps/g16.b01/g16/bsd/g16.profile: 85: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 86: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 87: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 88: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 89: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 90: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 91: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 92: ulimit: Illegal option -u
MOB_coeffs 526R
/share/apps/g16.b01/g16/bsd/g16.profile: 85: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 86: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 87: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 88: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 89: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 90: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 91: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 92: ulimit: Illegal option -u
MO_energy 522R
/share/apps/g16.b01/g16/bsd/g16.profile: 85: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 86: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 87: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 88: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 89: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 90: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 91: ulimit: bad number
/share/apps/g16.b01/g16/bsd/g16.profile: 92: ulimit: Illegal option -u

9

帖子

0

威望

354

eV
积分
363

Level 3 能力者

16#
发表于 Post on 2021-1-2 21:23:38 | 只看该作者 Only view this author

多谢卢老师

6万

帖子

99

威望

5万

eV
积分
120081

管理员

公社社长

15#
发表于 Post on 2021-1-2 20:26:41 | 只看该作者 Only view this author
yinhang 发表于 2020-12-25 13:51
请教老师,Gaussian中的QMMM结果是否适用于pysoc。

没法用
北京科音自然科学研究中心http://www.keinsci.com)致力于计算化学的发展和传播,长期开办极高质量的各种计算化学类培训:初级量子化学培训班中级量子化学培训班高级量子化学培训班量子化学波函数分析与Multiwfn程序培训班分子动力学与GROMACS培训班CP2K第一性原理计算培训班,内容介绍以及往届资料购买请点击相应链接查看。这些培训是计算化学从零快速入门以及进一步全面系统性提升研究水平的高速路!培训各种常见问题见《北京科音办的培训班FAQ》
欢迎加入北京科音微信公众号获取北京科音培训的最新消息,并避免错过网上有价值的计算化学文章!
欢迎加入人气极高、专业性特别强的理论与计算化学综合交流群思想家公社QQ群(群号见此链接),合计达一万多人。北京科音培训班的学员在群中可申请VIP头衔,提问将得到群主Sobereva的最优先解答。
思想家公社的门口Blog:http://sobereva.com(发布大量原创计算化学相关博文)
Multiwfn主页:http://sobereva.com/multiwfn(十分强大、极为流行的量子化学波函数分析程序)
Google Scholar:https://scholar.google.com/citations?user=tiKE0qkAAAAJ
ResearchGate:https://www.researchgate.net/profile/Tian_Lu

9

帖子

0

威望

354

eV
积分
363

Level 3 能力者

14#
发表于 Post on 2020-12-25 13:51:20 | 只看该作者 Only view this author
请教老师,Gaussian中的QMMM结果是否适用于pysoc。

1187

帖子

5

威望

2859

eV
积分
4146

Level 6 (一方通行)

13#
发表于 Post on 2020-12-22 19:51:40 | 只看该作者 Only view this author
ggdh 发表于 2020-12-22 18:49
有赝势的log文件,由于g16和g09的输出有差异,导致错误
之前的脚本没有注意到赝势的情况。现在的船新版 ...

谢谢您!刚试了一下,计算没有报错(除了卢老师删了跃迁偶极矩部分导致的那个报错。)数值上和g09的结果有一定差别(加了g09defaults),我再看看。

908

帖子

37

威望

5435

eV
积分
7083

Level 6 (一方通行)

12#
 楼主 Author| 发表于 Post on 2020-12-22 18:50:37 | 只看该作者 Only view this author
pwzhou 发表于 2020-12-2 21:18
试了一下并不好用,还是无法正确读取,用的16的A03版本

再试试新版的。另外附送了calcsoc 也欢迎尝试

908

帖子

37

威望

5435

eV
积分
7083

Level 6 (一方通行)

11#
 楼主 Author| 发表于 Post on 2020-12-22 18:49:35 | 只看该作者 Only view this author
snljty 发表于 2020-12-11 14:13
补充:抱歉忘了说了。所有g09都替换成g16了,包括二进制文件。还是不行。
刚拿g16试着跑了一下,用的http:/ ...

有赝势的log文件,由于g16和g09的输出有差异,导致错误
之前的脚本没有注意到赝势的情况。现在的船新版本ok了。

908

帖子

37

威望

5435

eV
积分
7083

Level 6 (一方通行)

10#
 楼主 Author| 发表于 Post on 2020-12-22 18:47:04 | 只看该作者 Only view this author
tiandikuoyuan 发表于 2020-12-14 17:19
尝试了一下,还需要将soc.py中g09全部修改为g16,init.py中也是一样要修改

新的脚本可以自动进行这些设置了。

197

帖子

0

威望

4408

eV
积分
4605

Level 6 (一方通行)

9#
发表于 Post on 2020-12-14 18:31:47 | 只看该作者 Only view this author
snljty 发表于 2020-12-14 17:44
我上面的都改过了,还是不行。

试了Os配合物的例子,加了赝势确实会报错,还是用G09或者orca吧

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2025-8-13 05:33 , Processed in 0.228670 second(s), 31 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list