Skip to content

Commit

Permalink
Merge pull request MatthewRHermes#76 from cjknight/gpudev
Browse files Browse the repository at this point in the history
GPU update
  • Loading branch information
MatthewRHermes authored Mar 21, 2024
2 parents 707e139 + b8f1b68 commit 654d614
Show file tree
Hide file tree
Showing 38 changed files with 1,958 additions and 532 deletions.
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Let's see how complicated this has to get
from mrh.lib import patch_pyscf_sys_info

6 changes: 3 additions & 3 deletions examples/gpu/polymer_async/1_6-31g_inp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
nfrags=1
basis='6-31g'
outputfile='1_6-31g_out.log'
mol=gto.M(atom=generator(nfrags),basis=basis,verbose=5,output=outputfile)
#mol.max_memory = 8000
mol=gto.M(atom=generator(nfrags),basis=basis,verbose=4,output=outputfile)
mol.max_memory = 16000

mf=scf.RHF(mol)
mf=mf.density_fit()
Expand All @@ -20,7 +20,7 @@
ncas,nelecas,guess_mo_coeff = avas.kernel(mf, ['C 2pz'])

las=LASSCF(mf, list((2,)*nfrags),list((2,)*nfrags))
#las.max_cycle_macro = 1
#las.max_cycle_macro = 10

frag_atom_list=[list(range(1+4*nfrag,3+4*nfrag)) for nfrag in range(nfrags)]
#print(frag_atom_list)
Expand Down
27 changes: 19 additions & 8 deletions examples/laspdft/c2h4n4_si_laspdft.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pyscf import gto, scf, lib, mcscf
from mrh.my_pyscf.fci import csf_solver
from mrh.my_pyscf.mcscf.lasscf_o0 import LASSCF
from mrh.my_pyscf.mcscf import lassi
from mrh.my_pyscf import lassi
from mrh.my_pyscf import mcpdft
from mrh.my_pyscf.tools.molden import from_lasscf
from c2h4n4_struct import structure as struct
Expand All @@ -22,16 +22,27 @@
guess_mo = las.sort_mo([16,18,22,23,24,26])
mo0 = las.localize_init_guess((list(range (5)), list(range (5,10))), guess_mo)
las.kernel(mo0)


las = lassi.states.all_single_excitations (las)
las.lasci ()

lsi = lassi.LASSI(las)
lsi.kernel()

# LASSI-PDFT
mc = mcpdft.LASSI(las, 'tPBE', (3, 3), ((2,1),(1,2)))
mc = all_single_excitations(mc) # Level of charge transfer
mc.kernel(las.mo_coeff) # SA-LAS orbitals
mc = mcpdft.LASSI(lsi, 'tPBE', (3, 3), ((2,1),(1,2)))
mc.kernel()

# CASCI-PDFT in las orbitals
from pyscf import mcpdft
mc_ci = mcpdft.CASCI(mf, 'tPBE', 6, 6)
mc_ci.kernel(las.mo_coeff)

# Results
print("\n----Results-------\n")
#print("State",' \t', "LASSCF Energy",'\t\t',"LASSI Energy",'\t\t', "LASSI-PDFT Energy")
#[print(sn,'\t',x,'\t', y,'\t', z) for sn, x, y, z in zip(list(range(mc.nroots)), mc.e_mcscf, mc.e_lassi, mc.e_tot)]
print("LASSI state-0 =", mc.e_mcscf[0])
print("CASCI state-0 =", mc_ci.e_mcscf)
print("LASSI state-0 =", lsi.e_roots[0])

print("CASCI-PDFT state-0 =", mc_ci.e_tot)
print("LASSI-PDFT state-0 =", mc.e_tot[0])

Loading

0 comments on commit 654d614

Please sign in to comment.