def test_bas(IDX): mol_s = gto.M(atom = 'He 0 0 0', basis = bases[IDX]) mol_s.verbose = 0 mf_s = scf.RHF(mol_s) mf_s.kernel() xmol_s = mp2f12.xMole(mf_s, name = 'He_' + bases[IDX], CABSbasis = bases[IDX + 1] + 's', CABSp = True) #xmol_s.f12 = (-1.25, -0.8) from mp2f12.F12.As import As f12fix = As(xmol_s) #from mp2f12.F12.C import C #f12fix = C(xmol_s) ef12 = f12fix.EF12() print('# basis ' + bases[IDX] + ' ') print('') print('+ HF Energy ') print('`' + str(f12fix.EHF()) + '`') print('+ MP2 part ') print('`' + str(f12fix.EMP2()) + '`') print('+ F12 part ') print('`' + str(ef12) + '`') print('+ F12 with MP2 ') print('`' + str(ef12 + f12fix.eMP2) + '`') print('+ Total ') print('`' + str(f12fix.eHF + f12fix.eMP2 + f12fix.eF12) + '`') print('+ Compare with MP2 in larger basis: ' + bases[IDX + 2] + ' ') mol = gto.M(atom = 'He 0 0 0', basis = bases[IDX + 2]) mol.build() mol.verbose = 0 mf = scf.RHF(mol) mf.kernel() mp2 = mp.MP2(mf) emp2 = mp2.kernel()[0] print('`' + str(emp2) + '`') print('+ and in total ') print('`' + str(mf.e_tot + emp2) + '`')
from pyscf import gto, scf, mp mol = gto.Mole() mol.atom = [ #[8 , (0. , 0. , 0.)], [1 , (0. , -0.757 , 0.587)], #[1 , (0. , 0.757 , -0.587)], #[1 , (0. , -0.757 , -0.587)], [1 , (0. , 0.757 , 0.587)]] mol.basis = 'cc-pvdz-f12' mol.verbose = 0 mol.build() mf = scf.RHF(mol) mf.kernel() # build a xmole import mp2f12 xmol = mp2f12.xMole(mf, name = 'H2', CABSp = True) # xmol.setf12((-0.9, -1.1)) F12FIX = FIX(xmol) ef12 = F12FIX.EF12() print('HF energy') print(F12FIX.EHF()) print('MP2 correlation energy') print(F12FIX.EMP2()) print('F12 energy') print(ef12) print('total') print(F12FIX.eHF + F12FIX.eMP2 + F12FIX.eF12) print('Compare with cc-pvqz-f12 MP2:') mol.basis = 'cc-pvqz-f12' mol.build()
#! /usr/bin/python import os import pyscf from pyscf import gto, scf, mp import mp2f12 mol = gto.M(atom = 'Ne 0 0 0', basis = 'ccpvdzf12') mol.verbose = 0 mf = scf.RHF(mol) mf.kernel() xmol = mp2f12.xMole(mf, name = 'Ne_VDZ') from mp2f12.F12.As import As f12 = As(xmol) #from mp2f12.F12.C import C #f12 = C(xmol) ef12 = f12.EF12() outstr = '# Ne with cc-pVDZ-F12 ' + os.linesep + 'HF energy' outstr += '`' + str(f12.EHF()) + '` ' + os.linesep outstr += '+ MP2 part ' + os.linesep outstr += '`' + str(f12.EMP2()) + '` ' + os.linesep outstr += '+ F12 part ' + os.linesep outstr += '`' + str(ef12) + '` ' + os.linesep outstr += '+ MP2-F12 ' + os.linesep outstr += '`' + str(f12.eMP2 + ef12) + '` ' + os.linesep ''' outstr += '+ Compare with MP2 in cc-pVTZ: ' + os.linesep
sel = line.strip().split() i0 = int(sel[0]) i1 = int(sel[1]) i2 = int(sel[2]) i3 = int(sel[3]) out[i0, i1, i2, i3] = float(sel[4]) else: fg = False return out # test on int4g if __name__ == '__main__': from pyscf import scf mol = gto.Mole() mol.atom = [ #[8 , (0. , 0. , 0.)], [1 , (0. , -0.757 , 0.587)], [1 , (0. , 0.757 , 0.587)]] mol.basis = 'cc-pvdz-f12' mol.verbose = 0 mol.build() mf = scf.RHF(mol) mf.kernel() import mp2f12 xmol = mp2f12.xMole(mf) print(xmol.no, xmol.nv, xmol.nc) w = int4g(xmol) print(np.shape(w)) ww = int4(xmol, 0) print(np.shape(ww)) print((w - ww).max())
from pyscf import gto, scf, mp mol = gto.Mole() mol.atom = [ #[8 , (0. , 0. , 0.)], [1 , (0. , -0.757 , 0.587)], #[1 , (0. , 0.757 , -0.587)], #[1 , (0. , -0.757 , -0.587)], [1 , (0. , 0.757 , 0.587)]] mol.basis = 'cc-pvdz-f12' mol.verbose = 0 mol.build() mf = scf.RHF(mol) mf.kernel() # build a xmole import mp2f12 xmol = mp2f12.xMole(mf, name = 'H2', CABSp = False) F12FIX = C(xmol) import os curdir = os.path.dirname(os.path.realpath(__file__)) #F12FIX.mat = matrices(xmol, loadAO = curdir + '/../debug/data/3C_H2O/', savedir = curdir + '/../debug/data/3C_H2O/') #F12FIX.loadmat(curdir + '/../debug/data/3C_H2O/matrices.npz') ef12 = F12FIX.EF12() print('HF energy') print(F12FIX.EHF()) print('MP2 correlation energy') print(F12FIX.EMP2()) print('F12 energy') print(ef12) print('total')