Skip to content
GitLab
菜单
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
Shirong Wang
pyAutoMR
提交
26487447
提交
26487447
编辑于
7月 03, 2021
作者:
hebrewsnabla
浏览文件
update frag
上级
2f43babd
变更
4
Hide whitespace changes
Inline
Side-by-side
examples/frag.py
浏览文件 @
26487447
import
frag_sol
xyz
=
'''H 0.0 0.0 0.0
xyz
=
'''
H 0.0 0.0 0.0
O 0.0 0.0 1.0
O 0.0 0.0 2.0
H 0.0 0.0 3.0
...
...
@@ -34,7 +35,8 @@ wfnpath = 'D:\\xxx\\yyy\\frag'
## the optput wfn will be frag0.wfn, frag1.wfn, ...
# frags charges spins
frag_sol
.
from_frag
(
xyz
,
[[
1
,
2
],[
3
,
4
]],
[
0
,
0
],[
1
,
-
1
],
gjfhead
,
scrfhead
,
'frag'
,
basis
,
wfnpath
)
#frag_sol.from_frag(xyz, [[1,2],[3,4]], [0,0],[1,-1], gjfhead, scrfhead, 'frag', basis, wfnpath)
frag_sol
.
from_frag
(
xyz
,
[
'1-2,4'
,
'3'
],
[
0
,
0
],[
0
,
0
],
gjfhead
,
scrfhead
,
'frag'
,
basis
,
wfnpath
)
# spin = 0 for singlet, 1 for doublet, ...
# please ensure sum of spins equals spin of the total system
examples/frag0.gjf
浏览文件 @
26487447
...
...
@@ -4,9 +4,10 @@
title
0
2
0
0
H 0.00000 0.00000 0.00000
O 0.00000 0.00000 1.00000
H 0.00000 0.00000 3.00000
-O -H
TZVP
...
...
@@ -20,10 +21,9 @@ SDD
eps=1.0
epsinf=1.0
ExtraSph=
2
ExtraSph=
1
0.00000 0.00000 2.00000 1.75000
0.00000 0.00000 3.00000 1.44300
D:\xxx\yyy\frag0.wfn
examples/frag1.gjf
浏览文件 @
26487447
...
...
@@ -4,9 +4,8 @@
title
0
-2
0
0
O 0.00000 0.00000 2.00000
H 0.00000 0.00000 3.00000
-O -H
TZVP
...
...
@@ -20,10 +19,11 @@ SDD
eps=1.0
epsinf=1.0
ExtraSph=
2
ExtraSph=
3
0.00000 0.00000 0.00000 1.44300
0.00000 0.00000 1.00000 1.75000
0.00000 0.00000 3.00000 1.44300
D:\xxx\yyy\frag1.wfn
frag_sol.py
浏览文件 @
26487447
...
...
@@ -8,6 +8,8 @@ def from_frag(xyz, frags, chgs, spins, gjfhead='', scrfhead='', gjfname='', basi
# mol.verbose = 1
# mol.build()
#
if
isinstance
(
frags
[
0
],
str
):
frags
=
str2list
(
frags
)
guess_frag
(
xyz
,
frags
,
chgs
,
spins
,
gjfhead
.
lstrip
(
'
\n
'
),
scrfhead
,
gjfname
,
basis
,
wfnpath
)
def
spin_p2g
(
spin
):
...
...
@@ -17,6 +19,20 @@ def spin_p2g(spin):
spin
=
spin
-
1
return
spin
def
str2list
(
frags
):
flist
=
[]
for
frag
in
frags
:
alist
=
[]
for
s
in
frag
.
split
(
','
):
if
'-'
in
s
:
start
=
int
(
s
.
split
(
'-'
)[
0
])
end
=
int
(
s
.
split
(
'-'
)[
1
])
else
:
start
=
int
(
s
)
end
=
int
(
s
)
alist
+=
range
(
start
,
end
+
1
)
flist
.
append
(
alist
)
return
flist
def
guess_frag
(
xyz
,
frags
,
chgs
,
spins
,
gjfhead
,
scrfhead
,
gjfname
,
basis
,
wfnpath
):
...
...
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录