本文整理汇总了Python中pyscf.scf.density_fit函数的典型用法代码示例。如果您正苦于以下问题:Python density_fit函数的具体用法?Python density_fit怎么用?Python density_fit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了density_fit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_rohf
def test_rohf(self):
pmol = mol.copy()
pmol.charge = 1
pmol.spin = 1
pmol.build(False, False)
mf = scf.density_fit(scf.ROHF(pmol))
self.assertAlmostEqual(mf.scf(), -75.626515724371814, 9)
示例2: test_uhf_veff
def test_uhf_veff(self):
mf = scf.density_fit(scf.UHF(mol), auxbasis='weigend')
nao = mol.nao_nr()
numpy.random.seed(1)
dm = numpy.random.random((2,4,nao,nao))
vhf = mf.get_veff(mol, dm, hermi=0)
self.assertAlmostEqual(numpy.linalg.norm(vhf), 413.82341595365853, 9)
示例3: test_uhf_veff
def test_uhf_veff(self):
mf = scf.density_fit(scf.UHF(mol))
nao = mol.nao_nr()
numpy.random.seed(1)
dm = numpy.random.random((4,nao,nao))
vhf = mf.get_veff(mol, dm, hermi=0)
self.assertAlmostEqual(numpy.linalg.norm(vhf), 188.34081056589872, 9)
示例4: test_rohf_symm
def test_rohf_symm(self):
pmol = mol.copy()
pmol.charge = 1
pmol.spin = 1
pmol.symmetry = 1
pmol.build(False, False)
mf = scf.density_fit(scf.ROHF(pmol), auxbasis='weigend')
self.assertAlmostEqual(mf.scf(), -75.626515724371814, 9)
示例5: test_assign_cderi
def test_assign_cderi(self):
nao = mol.nao_nr()
w, u = scipy.linalg.eigh(mol.intor('int2e_sph', aosym='s4'))
idx = w > 1e-9
mf = scf.density_fit(scf.UHF(mol), auxbasis='weigend')
mf._cderi = (u[:,idx] * numpy.sqrt(w[idx])).T.copy()
self.assertAlmostEqual(mf.kernel(), -76.026765673110447, 9)
示例6: test_gto2sv_df
def test_gto2sv_df(self):
from pyscf import scf
""" Test import of density-fitting Gaussian functions ... hm """
mf = scf.density_fit(scf.RHF(mol))
self.assertAlmostEqual(mf.scf(), -76.025936299702536, 2)
sv = nao(gto=mol)
prod_log = prod_log_c().init_prod_log_df(mf.with_df.auxmol, sv)
self.assertEqual(prod_log.rr[0], sv.ao_log.rr[0])
self.assertEqual(prod_log.pp[0], sv.ao_log.pp[0])
self.assertEqual(prod_log.nspecies, sv.ao_log.nspecies)
self.assertEqual(prod_log.sp2charge, sv.ao_log.sp2charge)
示例7: test_assign_cderi
def test_assign_cderi(self):
nao = molsym.nao_nr()
w, u = scipy.linalg.eigh(mol.intor('cint2e_sph', aosym='s4'))
idx = w > 1e-9
mf = scf.density_fit(scf.RHF(molsym))
mf._cderi = (u[:,idx] * numpy.sqrt(w[idx])).T.copy()
mf.kernel()
mc = mcscf.DFCASSCF(mf, 6, 6)
mc.kernel()
self.assertAlmostEqual(mc.e_tot, -108.98010545803884, 7)
示例8: test_df_ao2mo
def test_df_ao2mo(self):
mf = scf.density_fit(msym)
mf.max_memory = 100
mf.kernel()
mc = mcscf.DFCASSCF(mf, 4, 4)
eri0 = numpy.dot(mf._cderi.T, mf._cderi)
nmo = mc.mo_coeff.shape[1]
ncore = mc.ncore
nocc = ncore + mc.ncas
eri0 = ao2mo.restore(1, ao2mo.kernel(eri0, mc.mo_coeff), nmo)
eris = mc.ao2mo(mc.mo_coeff)
self.assertTrue(numpy.allclose(eri0[:,:,ncore:nocc,ncore:nocc], eris.ppaa))
self.assertTrue(numpy.allclose(eri0[:,ncore:nocc,:,ncore:nocc], eris.papa))
示例9: test_nr_df_rohf
def test_nr_df_rohf(self):
mol = gto.Mole()
mol.build(
verbose = 0,
atom = [
["O" , (0. , 0. , 0.)],
[1 , (0. , -0.757 , 0.587)],
[1 , (0. , 0.757 , 0.587)] ],
basis = 'cc-pvdz',
charge = 1,
spin = 1,
)
mf = scf.density_fit(scf.ROHF(mol))
mf.conv_tol = 1e-11
self.assertAlmostEqual(mf.scf(), -75.626515724371899, 9)
示例10: test_nr_df_rohf
def test_nr_df_rohf(self):
mol = gto.Mole()
mol.build(
verbose = 0,
atom = [
["O" , (0. , 0. , 0.)],
[1 , (0. , -0.757 , 0.587)],
[1 , (0. , 0.757 , 0.587)] ],
basis = {"H": '6-31g',
"O": '6-31g',},
charge = 1,
spin = 1,
)
mf = scf.density_fit(scf.ROHF(mol))
mf.conv_tol = 1e-11
self.assertAlmostEqual(mf.scf(), -75.5775921401438, 9)
示例11: test_rhf_veff
def test_rhf_veff(self):
nao = mol.nao_nr()
numpy.random.seed(1)
dm = numpy.random.random((2,nao,nao))
mf = scf.density_fit(scf.RHF(mol))
vhf1 = mf.get_veff(mol, dm, hermi=0)
naux = mf._cderi.shape[0]
cderi = numpy.empty((naux,nao,nao))
for i in range(naux):
cderi[i] = lib.unpack_tril(mf._cderi[i])
vj0 = []
vk0 = []
for dmi in dm:
v1 = numpy.einsum('kij,ij->k', cderi, dmi)
vj0.append(numpy.einsum('kij,k->ij', cderi, v1))
v1 = numpy.einsum('pij,jk->pki', cderi, dmi.T)
vk0.append(numpy.einsum('pki,pkj->ij', cderi, v1))
vj1, vk1 = scf.dfhf.get_jk_(mf, mol, dm, 0)
self.assertTrue(numpy.allclose(vj0, vj1))
self.assertTrue(numpy.allclose(numpy.array(vk0), vk1))
vhf0 = vj1 - vk1 * .5
self.assertTrue(numpy.allclose(vhf0, vhf1))
示例12: test_dhf
def test_dhf(self):
pmol = mol.copy()
pmol.build(False, False)
mf = scf.density_fit(scf.DHF(pmol))
self.assertAlmostEqual(mf.scf(), -76.080738685142961, 9)
示例13: test_uhf_symm
def test_uhf_symm(self):
mf = scf.density_fit(scf.UHF(symol))
self.assertAlmostEqual(mf.scf(), -76.025936299702536, 9)
示例14: test_rhf
def test_rhf(self):
mf = scf.density_fit(scf.RHF(mol))
self.assertAlmostEqual(mf.scf(), -76.025936299702536, 9)
示例15: test_rhf_symm
def test_rhf_symm(self):
mf = scf.density_fit(scf.RHF(symol), auxbasis='weigend')
self.assertAlmostEqual(mf.scf(), -76.025936299702536, 9)