Commit cfb6fc5e authored by hebrewsnabla's avatar hebrewsnabla
Browse files

add scan example

parent c89e5d00
......@@ -2,3 +2,4 @@ __pycache__/
*pyc
/test/
uno.out
/examples/scan/
......@@ -7,7 +7,7 @@ from functools import partial, reduce
from lo import pm
from pyscf.lo.boys import dipole_integral
from auto_pair import pair_by_tdm
from automr import dump_mat, bridge
from automr import dump_mat, bridge, cidump
import sys, os
print = partial(print, flush=True)
......@@ -210,6 +210,7 @@ def cas(mf, act_user=None, crazywfn=False, max_memory=2000, natorb=True, gvb=Fal
if natorb:
print('Natrual Orbs')
dump_mat.dump_mo(mf.mol,mf.mo_coeff[:,ndb:ndb+nacto], ncol=10)
cidump.dump(mc)
return mc
def nevpt2(mc):
......
......@@ -12,5 +12,5 @@ mf = guess.from_frag(xyz, bas, [[0],[1]], [0,0], [3,-3], cycle=50)
mf = guess.check_stab(mf)
mf2 = autocas.cas(mf)
cidump.dump(mf2)
#cidump.dump(mf2)
......@@ -12,5 +12,5 @@ mf = guess.gen(xyz, bas, 0, 0)
#guess.check_stab(mf)
mf2 = autocas.cas(mf)
cidump.dump(mf2)
#cidump.dump(mf2)
from pyscf import lib
from automr import guess, autocas, mcpdft
import os, contextlib
import numpy as np
lib.num_threads(4)
os.system('mkdir -p scan')
for r in np.arange(0.8, 2.55, 0.1):
output = 'scan/n2_%.1f.out' % r
os.system("echo '\n' > %s" % output)
print('scan %.1f' % r)
with open(output, 'a', encoding='utf-8') as f:
with contextlib.redirect_stdout(f):
xyz = '''N 0.0 0.0 0.0; N 0.0 0.0 %f'''%r
bas = 'cc-pvtz'
mf = guess.from_frag(xyz, bas, [[0],[1]], [0,0], [3,-3], cycle=50)
mf = guess.check_stab(mf)
mf2 = autocas.cas(mf, (6,(3,3)), natorb=False)
#mf3 = mcpdft.PDFT(mf2, 'tpbe')
#mf3.kernel()
mf4 = autocas.nevpt2(mf2)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment