H 1.7834 0. 1.7834 H 2.6751 0.8917 2.6751 H 0. 1.7834 1.7834 H 0.8917 2.6751 2.6751''', basis = 'sto3g', gs = [7]*3, verbose = 4, ) mf = scf.RHF(cell) mf.with_df = mpidf.FFTDF(cell) mf.kernel() mycc = cc.CCSD(mf) mycc.kernel() mf.with_df = mpidf.AFTDF(cell) mf.with_df.gs = [5]*3 mf.kernel() mycc = cc.CCSD(mf) mycc.kernel() mf.with_df = mpidf.DF(cell) mf.with_df.gs = [3]*3 mf.kernel() mycc = cc.CCSD(mf) mycc.kernel() mf.with_df = mpidf.MDF(cell) mf.with_df.gs = [3]*3 mf.kernel() mycc = cc.CCSD(mf)
from pyscf.pbc import gto as pbcgto from pyscf.pbc import tools e = [] L = 4 cell = pbcgto.Cell() cell.build(unit='B', a=[[L, 0, 0], [0, L, 0], [0, 0, 8.]], mesh=[10, 10, 20], atom='H 0 0 0; H 0 0 1.8', dimension=2, verbose=4, basis='sto3g') mf = pbchf.KRHF(cell) mf.with_df = pdf.AFTDF(cell) mf.kpts = cell.make_kpts([4, 4, 1]) e.append(mf.kernel()) mf = pbchf.KRHF(cell, cell.make_kpts([4, 4, 1])) mf = mf.density_fit(auxbasis='weigend', with_df=pdf.GDF(cell)) e.append(mf.kernel()) mf = pbchf.KRHF(cell, cell.make_kpts([4, 4, 1])) mf = mf.mix_density_fit(auxbasis='weigend', with_df=pdf.MDF(cell)) e.append(mf.kernel()) mol = tools.super_cell(cell, [4, 4, 1]).to_mol() mf = scf.RHF(mol) e.append(mf.kernel() / 16)
from pyscf.pbc import gto as pgto from mpi4pyscf.pbc import df cell = pgto.Cell() cell.atom = 'He 1. .5 .5; C .1 1.3 2.1' cell.basis = { 'He': [(0, (2.5, 1)), (0, (1., 1))], 'C': 'gth-szv', } cell.pseudo = {'C': 'gth-pade'} cell.a = numpy.eye(3) * 2.5 cell.mesh = [11] * 3 cell.build() numpy.random.seed(19) kpts = numpy.random.random((5, 3)) mydf = df.AFTDF(cell) v = mydf.get_nuc() print(v.shape) v = mydf.get_pp(kpts) print(v.shape) cell = pgto.M(atom='He 0 0 0; He 0 0 1', a=numpy.eye(3) * 4, mesh=[11] * 3) mydf = df.AFTDF(cell) nao = cell.nao_nr() dm = numpy.ones((nao, nao)) vj, vk = mydf.get_jk(dm) print(vj.shape) print(vk.shape) dm_kpts = [dm] * 5 vj, vk = mydf.get_jk(dm_kpts, kpts=kpts)
L = 5. n = 11 cell = pgto.Cell() cell.a = numpy.diag([L,L,L]) cell.mesh = numpy.array([n,n,n]) cell.atom = '''He 3. 2. 3. He 1. 1. 1.''' #cell.basis = {'He': [[0, (1.0, 1.0)]]} #cell.basis = '631g' #cell.basis = {'He': [[0, (2.4, 1)], [1, (1.1, 1)]]} cell.basis = 'ccpvdz' cell.verbose = 0 cell.build(0,0) nao = cell.nao_nr() numpy.random.seed(1) kpts = numpy.random.random((4,3)) kpts[3] = -numpy.einsum('ij->j', kpts[:3]) with_df = df.AFTDF(cell) with_df.kpts = kpts mo =(numpy.random.random((nao,nao)) + numpy.random.random((nao,nao))*1j) eri = with_df.get_eri(kpts).reshape((nao,)*4) eri0 = numpy.einsum('pjkl,pi->ijkl', eri , mo.conj()) eri0 = numpy.einsum('ipkl,pj->ijkl', eri0, mo ) eri0 = numpy.einsum('ijpl,pk->ijkl', eri0, mo.conj()) eri0 = numpy.einsum('ijkp,pl->ijkl', eri0, mo ) eri1 = with_df.ao2mo(mo, kpts) print(abs(eri1.reshape(eri0.shape)-eri0).sum())