• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python lib.finger函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyscf.lib.finger函数的典型用法代码示例。如果您正苦于以下问题:Python finger函数的具体用法?Python finger怎么用?Python finger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了finger函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_rand_ccsd_frozen2

    def test_rand_ccsd_frozen2(self):
        '''Single (eom-)ccsd iteration with random t1/t2 and full occupied frozen
        at a single k-point.'''
        kmf = pbcscf.addons.convert_to_ghf(rand_kmf)
        # Round to make this insensitive to small changes between PySCF versions
        mat_veff = kmf.get_veff().round(4)
        mat_hcore = kmf.get_hcore().round(4)
        kmf.get_veff = lambda *x: mat_veff
        kmf.get_hcore = lambda *x: mat_hcore

        frozen = [[],[0,1,2,3],[]]
        rand_cc = pbcc.KGCCSD(kmf, frozen=frozen)
        eris = rand_cc.ao2mo(rand_cc.mo_coeff)
        eris.mo_energy = [eris.fock[k].diagonal() for k in range(rand_cc.nkpts)]
        t1, t2 = rand_t1_t2(kmf, rand_cc)
        # Manually zero'ing out the frozen elements of the t1/t2
        # N.B. the 0'th element frozen means we are freezing the 1'th
        #      element in the current padding scheme
        t1[1, [0,1,2,3]] = 0.0
        t2[1, :, :, [0,1,2,3], :] = 0.0
        t2[:, 1, :, :, [0,1,2,3]] = 0.0

        Ht1, Ht2 = rand_cc.update_amps(t1, t2, eris)
        self.assertAlmostEqual(finger(Ht1), (-19.2772171332-10.5977304455j), 6)
        self.assertAlmostEqual(finger(Ht2), (227.434582141+298.826965082j), 6)
开发者ID:chrinide,项目名称:pyscf,代码行数:25,代码来源:test_kpoint.py


示例2: test_eris_contract_vvvv_t2

    def test_eris_contract_vvvv_t2(self):
        mol = gto.Mole()
        nocca, noccb, nvira, nvirb = 5, 4, 12, 13
        nvira_pair = nvira*(nvira+1)//2
        nvirb_pair = nvirb*(nvirb+1)//2
        numpy.random.seed(9)
        t2 = numpy.random.random((nocca,noccb,nvira,nvirb))
        eris = uccsd._ChemistsERIs()
        eris.vvVV = numpy.random.random((nvira_pair,nvirb_pair))
        eris.mol = mol
        myucc.max_memory, bak = 0, myucc.max_memory
        vt2 = eris._contract_vvVV_t2(myucc, t2, eris.vvVV)
        myucc.max_memory = bak
        self.assertAlmostEqual(lib.finger(vt2), 12.00904827896089, 11)
        idxa = lib.square_mat_in_trilu_indices(nvira)
        idxb = lib.square_mat_in_trilu_indices(nvirb)
        vvVV = eris.vvVV[:,idxb][idxa]
        ref = lib.einsum('acbd,ijcd->ijab', vvVV, t2)
        self.assertAlmostEqual(abs(vt2 - ref).max(), 0, 11)

        # _contract_VVVV_t2, testing complex and real mixed contraction
        VVVV =(numpy.random.random((nvirb,nvirb,nvirb,nvirb)) +
               numpy.random.random((nvirb,nvirb,nvirb,nvirb))*1j - (.5+.5j))
        VVVV = VVVV + VVVV.transpose(1,0,3,2).conj()
        VVVV = VVVV + VVVV.transpose(2,3,0,1)
        eris.VVVV = VVVV
        t2 = numpy.random.random((noccb,noccb,nvirb,nvirb))
        t2 = t2 - t2.transpose(0,1,3,2)
        t2 = t2 - t2.transpose(1,0,3,2)
        myucc.max_memory, bak = 0, myucc.max_memory
        vt2 = eris._contract_VVVV_t2(myucc, t2, eris.VVVV)
        myucc.max_memory = bak
        self.assertAlmostEqual(lib.finger(vt2), 47.903883794299404-50.501573400833429j, 11)
        ref = lib.einsum('acbd,ijcd->ijab', eris.VVVV, t2)
        self.assertAlmostEqual(abs(vt2 - ref).max(), 0, 11)
开发者ID:sunqm,项目名称:pyscf,代码行数:35,代码来源:test_uccsd.py


示例3: test_aux_e2

    def test_aux_e2(self):
        nao = mol.nao_nr()
        naoaux = auxmol.nao_nr()
        eri0 = numpy.empty((nao,nao,naoaux))
        pi = 0
        for i in range(mol.nbas):
            pj = 0
            for j in range(mol.nbas):
                pk = 0
                for k in range(mol.nbas, mol.nbas+auxmol.nbas):
                    shls = (i, j, k)
                    buf = gto.moleintor.getints_by_shell('int3c2e_sph',
                                                         shls, atm, bas, env)
                    di, dj, dk = buf.shape
                    eri0[pi:pi+di,pj:pj+dj,pk:pk+dk] = buf
                    pk += dk
                pj += dj
            pi += di

        j3c = df.incore.aux_e2(mol, auxmol, intor='int3c2e_sph', aosym='s1')
        self.assertTrue(numpy.allclose(eri0, j3c.reshape(nao,nao,naoaux)))
        self.assertAlmostEqual(lib.finger(j3c), 48.11812978990752, 9)

        idx = numpy.tril_indices(nao)
        j3c = df.incore.aux_e2(mol, auxmol, intor='int3c2e_sph', aosym='s2ij')
        self.assertTrue(numpy.allclose(eri0[idx], j3c))
        self.assertAlmostEqual(lib.finger(j3c), 4.6774743051154459, 9)
开发者ID:chrinide,项目名称:pyscf,代码行数:27,代码来源:test_incore.py


示例4: test_coulG

    def test_coulG(self):
        numpy.random.seed(19)
        kpt = numpy.random.random(3)
        cell = pbcgto.Cell()
        cell.unit = 'A'
        cell.atom = 'C 0.,  0.,  0.; C 0.8917,  0.8917,  0.8917'
        cell.a = numpy.array(((0.    , 1.7834, 1.7834),
                              (1.7834, 0.    , 1.7834),
                              (1.7834, 1.7834, 0.    ),)) + numpy.random.random((3,3)).T
        cell.basis = 'gth-szv'
        cell.pseudo = 'gth-pade'
        cell.mesh = [11,9,7]
        cell.verbose = 5
        cell.output = '/dev/null'
        cell.build()
        coulG = tools.get_coulG(cell, kpt)
        self.assertAlmostEqual(lib.finger(coulG), 62.75448804333378, 9)

        cell.a = numpy.eye(3)
        cell.unit = 'B'
        coulG = tools.get_coulG(cell, numpy.array([0, numpy.pi, 0]))
        self.assertAlmostEqual(lib.finger(coulG), 4.6737453679713905, 9)
        coulG = tools.get_coulG(cell, numpy.array([0, numpy.pi, 0]),
                                wrap_around=False)
        self.assertAlmostEqual(lib.finger(coulG), 4.5757877990664744, 9)
        coulG = tools.get_coulG(cell, exx='ewald')
        self.assertAlmostEqual(lib.finger(coulG), 4.888843468914021, 9)
开发者ID:chrinide,项目名称:pyscf,代码行数:27,代码来源:test_pbc.py


示例5: test_make_rdm1

 def test_make_rdm1(self):
     dm1 = mc.make_rdm1()
     self.assertAlmostEqual(lib.finger(dm1), -5.0290089869374492, 5)
     dm1 = mc.analyze(with_meta_lowdin=False)
     self.assertAlmostEqual(lib.finger(dm1[0]), -5.7326112327013377, 5)
     self.assertAlmostEqual(lib.finger(dm1[1]), 0.70360224576388797, 5)
     self.assertAlmostEqual(lib.finger(dm1[0]+dm1[1]), -5.0290089869374492, 5)
开发者ID:chrinide,项目名称:pyscf,代码行数:7,代码来源:test_ucasci.py


示例6: test_rand_ccsd_frozen1

    def test_rand_ccsd_frozen1(self):
        '''Single (eom-)ccsd iteration with random t1/t2 and single frozen occupied
        orbital.'''
        kmf = pbcscf.addons.convert_to_ghf(rand_kmf)
        # Round to make this insensitive to small changes between PySCF versions
        mat_veff = kmf.get_veff().round(4)
        mat_hcore = kmf.get_hcore().round(4)
        kmf.get_veff = lambda *x: mat_veff
        kmf.get_hcore = lambda *x: mat_hcore

        frozen = [[0,],[],[]]
        rand_cc = pbcc.KGCCSD(kmf, frozen=frozen)
        eris = rand_cc.ao2mo(rand_cc.mo_coeff)
        eris.mo_energy = [eris.fock[k].diagonal() for k in range(rand_cc.nkpts)]
        t1, t2 = rand_t1_t2(kmf, rand_cc)
        # Manually zero'ing out the frozen elements of the t1/t2
        # N.B. the 0'th element frozen means we are freezing the 1'th
        #      element in the current padding scheme
        t1[0, 1] = 0.0
        t2[0, :, :, 1, :] = 0.0
        t2[:, 0, :, :, 1] = 0.0

        Ht1, Ht2 = rand_cc.update_amps(t1, t2, eris)
        self.assertAlmostEqual(finger(Ht1), (-15.7950827762+31.0483053388j), 6)
        self.assertAlmostEqual(finger(Ht2), (263.884192539+96.7615664563j), 6)
开发者ID:chrinide,项目名称:pyscf,代码行数:25,代码来源:test_kpoint.py


示例7: test_canonicalize1

    def test_canonicalize1(self):
        numpy.random.seed(1)
        f1 = numpy.random.random(mcr.mo_coeff.shape)
        u1 = numpy.linalg.svd(f1)[0]
        mo1 = numpy.dot(mcr.mo_coeff, u1)
        mo1 = lib.tag_array(mo1, orbsym=mcr.mo_coeff.orbsym)
        mo, ci, mo_e = mcr.canonicalize(mo1)
        e1 = numpy.einsum('ji,jk,ki', mo, f1, mo)
        self.assertAlmostEqual(e1, 44.2658681077, 7)
        self.assertAlmostEqual(lib.finger(mo_e), 5.1364166175063097, 7)

        mo, ci, mo_e = mcr.canonicalize(mo1, eris=mcr.ao2mo(mcr.mo_coeff))
        e1 = numpy.einsum('ji,jk,ki', mo, f1, mo)
        self.assertAlmostEqual(e1, 44.2658681077, 7)
        self.assertAlmostEqual(lib.finger(mo_e), 4.1206025804989173, 7)

        mcr1 = copy.copy(mcr)
        mcr1.frozen = 2
        mo, ci, mo_e = mcr1.canonicalize(mo1)
        self.assertAlmostEqual(lib.finger(mo_e), 6.6030999409178577, 7)

        mcr1.frozen = [0,1]
        mo, ci, mo_e = mcr1.canonicalize(mo1)
        self.assertAlmostEqual(lib.finger(mo_e), 6.6030999409178577, 7)

        mcr1.frozen = [1,12]
        mo, ci, mo_e = mcr1.canonicalize(mo1)
        self.assertAlmostEqual(lib.finger(mo_e), 5.2182584355788162, 7)
开发者ID:chrinide,项目名称:pyscf,代码行数:28,代码来源:test_addons.py


示例8: test_p

 def test_p(self):
     numpy.random.seed(2)
     a = numpy.random.random((3,3,3))
     self.assertAlmostEqual(lib.finger(cc.p('a.c', a)), -1.1768882755852079, 12)
     self.assertAlmostEqual(lib.finger(cc.p('.ab', a)), -1.9344875839983993, 12)
     self.assertAlmostEqual(lib.finger(cc.p('abc', a)), -0.0055534783760265282, 14)
     self.assertAlmostEqual(abs(cc.p('a.a', a) - a).max(), 0, 12)
开发者ID:chrinide,项目名称:pyscf,代码行数:7,代码来源:test.py


示例9: test_rand_ccsd_frozen0

    def test_rand_ccsd_frozen0(self):
        '''Single (eom-)ccsd iteration with random t1/t2 and lowest lying orbital
        at multiple k-points frozen.'''
        kmf = pbcscf.addons.convert_to_ghf(rand_kmf)
        # Round to make this insensitive to small changes between PySCF versions
        mat_veff = kmf.get_veff().round(4)
        mat_hcore = kmf.get_hcore().round(4)
        kmf.get_veff = lambda *x: mat_veff
        kmf.get_hcore = lambda *x: mat_hcore

        # frozen = 1
        rand_cc = pbcc.KGCCSD(kmf, frozen=1)
        eris = rand_cc.ao2mo(rand_cc.mo_coeff)
        eris.mo_energy = [eris.fock[k].diagonal() for k in range(rand_cc.nkpts)]
        t1, t2 = rand_t1_t2(kmf, rand_cc)

        Ht1, Ht2 = rand_cc.update_amps(t1, t2, eris)
        self.assertAlmostEqual(finger(Ht1), (12.6235870016-0.263432509044j), 6)
        self.assertAlmostEqual(finger(Ht2), (94.8802678168+910.369938369j), 6)

        # frozen = [[0,],[0,],[0,]], should be same as above
        frozen = [[0,],[0,],[0,]]
        rand_cc = pbcc.KGCCSD(kmf, frozen=frozen)
        eris = rand_cc.ao2mo(rand_cc.mo_coeff)
        eris.mo_energy = [eris.fock[k].diagonal() for k in range(rand_cc.nkpts)]
        t1, t2 = rand_t1_t2(rand_kmf, rand_cc)

        Ht1, Ht2 = rand_cc.update_amps(t1, t2, eris)
        self.assertAlmostEqual(finger(Ht1), (12.6235870016-0.263432509044j), 6)
        self.assertAlmostEqual(finger(Ht2), (94.8802678168+910.369938369j), 6)
开发者ID:chrinide,项目名称:pyscf,代码行数:30,代码来源:test_kpoint.py


示例10: test_init_guess_by_1e

    def test_init_guess_by_1e(self):
        dm = mf.get_init_guess(key='1e')
        self.assertAlmostEqual(lib.finger(dm), 0.025922864381755062, 9)

        dm = kmf.get_init_guess(key='1e')
        self.assertEqual(dm.ndim, 3)
        self.assertAlmostEqual(lib.finger(dm), 0.025922864381755062, 9)
开发者ID:chrinide,项目名称:pyscf,代码行数:7,代码来源:test_hf.py


示例11: test_init_guess_minao

    def test_init_guess_minao(self):
        mol = gto.M(
            verbose = 7,
            output = '/dev/null',
            atom = '''
        O     0    0        0
        H1    0    -0.757   0.587
        H2    0    0.757    0.587''',
            basis = 'ccpvdz',
        )
        dm = scf.hf.get_init_guess(mol, key='minao')
        self.assertAlmostEqual(lib.finger(dm), 2.5912875957299684, 9)

        mol1 = gto.M(atom='Mo', basis='lanl2dz', ecp='lanl2dz',
                     verbose=7, output='/dev/null')
        dm = scf.hf.get_init_guess(mol1, key='minao')
        self.assertAlmostEqual(lib.finger(dm), 1.5371195992125495, 9)
        self.assertAlmostEqual(numpy.einsum('ij,ji->', dm, mol1.intor('int1e_ovlp')), 14, 9)

        mol1.basis = 'sto3g'
        mol1.build(0, 0)
        dm = scf.hf.get_init_guess(mol1, key='minao')
        self.assertAlmostEqual(lib.finger(dm), 1.8936729909734513, 9)
        self.assertAlmostEqual(numpy.einsum('ij,ji->', dm, mol1.intor('int1e_ovlp')), 13.4787347477, 7)
        mol1.stdout.close()
开发者ID:sunqm,项目名称:pyscf,代码行数:25,代码来源:test_rhf.py


示例12: test_get_veff

    def test_get_veff(self):
        mf = pscf.RHF(cell)
        numpy.random.seed(1)
        nao = cell.nao_nr()
        dm = numpy.random.random((nao,nao)) + numpy.random.random((nao,nao))*1j
        dm = dm + dm.conj().T
        v11 = mf.get_veff(cell, dm, kpt=cell.get_abs_kpts([.25,.25,.25]))
        v12 = mf.get_veff(cell, dm, kpts_band=cell.get_abs_kpts([.25,.25,.25]))
        v13 = mf.get_veff(cell, dm, kpt=cell.get_abs_kpts([-1./3,1./3,.25]),
                          kpts_band=cell.get_abs_kpts([.25,.25,.25]))
        v14 = mf.get_veff(cell, dm, kpt=cell.get_abs_kpts([-1./3,1./3,.25]),
                          kpts_band=cell.make_kpts([2,1,1]))
        self.assertTrue(v11.dtype == numpy.complex128)
        self.assertTrue(v12.dtype == numpy.complex128)

        mf = pscf.UHF(cell)
        v21 = mf.get_veff(cell, dm, kpt=cell.get_abs_kpts([.25,.25,.25]))
        dm = [dm*.5,dm*.5]
        v22 = mf.get_veff(cell, dm, kpts_band=cell.get_abs_kpts([.25,.25,.25]))
        v23 = mf.get_veff(cell, dm, kpt=cell.get_abs_kpts([-1./3,1./3,.25]),
                          kpts_band=cell.get_abs_kpts([.25,.25,.25]))
        v24 = mf.get_veff(cell, dm, kpt=cell.get_abs_kpts([-1./3,1./3,.25]),
                          kpts_band=cell.make_kpts([2,1,1]))
        self.assertAlmostEqual(abs(v11-v21).max(), 0, 9)
        self.assertAlmostEqual(abs(v12-v22).max(), 0, 9)
        self.assertAlmostEqual(abs(v13-v23).max(), 0, 9)
        self.assertAlmostEqual(abs(v14-v24).max(), 0, 9)
        self.assertAlmostEqual(lib.finger(v11), -0.30110964334164825+0.81409418199767414j, 9)
        self.assertAlmostEqual(lib.finger(v12), -2.1601376488983997-9.4070613374115908j, 9)
开发者ID:chrinide,项目名称:pyscf,代码行数:29,代码来源:test_hf.py


示例13: test_define_xc

    def test_define_xc(self):
        def eval_xc(xc_code, rho, spin=0, relativity=0, deriv=1, verbose=None):
            # A fictitious XC functional to demonstrate the usage
            rho0, dx, dy, dz = rho[:4]
            gamma = (dx**2 + dy**2 + dz**2)
            exc = .01 * rho0**2 + .02 * (gamma+.001)**.5
            vrho = .01 * 2 * rho0
            vgamma = .02 * .5 * (gamma+.001)**(-.5)
            vlapl = None
            vtau = None
            vxc = (vrho, vgamma, vlapl, vtau)
            fxc = None  # 2nd order functional derivative
            kxc = None  # 3rd order functional derivative
            return exc, vxc, fxc, kxc

        mf = dft.RKS(mol)
        ni = dft.libxc.define_xc(mf._numint, eval_xc, 'GGA', hyb=0.2)
        numpy.random.seed(1)
        rho = numpy.random.random((4,10))
        exc, vxc = ni.eval_xc(None, rho, 0, deriv=1)[:2]
        self.assertAlmostEqual(lib.finger(exc), 0.0012441814416833327, 9)
        self.assertAlmostEqual(lib.finger(vxc[0]), 0.0065565189784811129, 9)
        self.assertAlmostEqual(lib.finger(vxc[1]), 0.0049270110162854116, 9)

        mf = mf.define_xc_('0.5*B3LYP+0.5*B3LYP')
        exc0, vxc0 = mf._numint.eval_xc(None, rho, 0, deriv=1)[:2]
        exc1, vxc1 = dft.libxc.eval_xc('0.5*B3LYP+0.5*B3LYP', rho, 0, deriv=1)[:2]
        self.assertAlmostEqual(abs(exc0-exc1).max(), 0, 9)
        self.assertAlmostEqual(abs(vxc0[0]-vxc1[0]).max(), 0, 9)
        self.assertAlmostEqual(abs(vxc0[1]-vxc1[1]).max(), 0, 9)

        self.assertRaises(ValueError, dft.libxc.define_xc, mf._numint, 0.1)
开发者ID:chrinide,项目名称:pyscf,代码行数:32,代码来源:test_libxc.py


示例14: test_eris_contract_vvvv_t2

    def test_eris_contract_vvvv_t2(self):
        mol = gto.Mole()
        nocc, nvir = 5, 12
        nvir_pair = nvir*(nvir+1)//2
        numpy.random.seed(9)
        t2 = numpy.random.random((nocc,nocc,nvir,nvir)) - .5
        t2 = t2 + t2.transpose(1,0,3,2)
        eris = ccsd._ChemistsERIs()
        vvvv = numpy.random.random((nvir_pair,nvir_pair)) - .5
        eris.vvvv = vvvv + vvvv.T
        eris.mol = mol
        mycc.max_memory, bak = 0, mycc.max_memory
        vt2 = eris._contract_vvvv_t2(mycc, t2, eris.vvvv)
        mycc.max_memory = bak
        self.assertAlmostEqual(lib.finger(vt2), -39.572579908080087, 11)
        vvvv = ao2mo.restore(1, eris.vvvv, nvir)
        ref = lib.einsum('acbd,ijcd->ijab', vvvv, t2)
        self.assertAlmostEqual(abs(vt2 - ref).max(), 0, 11)

        # _contract_s1vvvv_t2, testing complex and real mixed contraction
        vvvv =(numpy.random.random((nvir,nvir,nvir,nvir)) +
               numpy.random.random((nvir,nvir,nvir,nvir))*1j - (.5+.5j))
        vvvv = vvvv + vvvv.transpose(1,0,3,2).conj()
        vvvv = vvvv + vvvv.transpose(2,3,0,1)
        eris.vvvv = vvvv
        eris.mol = mol
        mycc.max_memory, bak = 0, mycc.max_memory
        vt2 = eris._contract_vvvv_t2(mycc, t2, eris.vvvv)
        mycc.max_memory = bak
        self.assertAlmostEqual(lib.finger(vt2), 23.502736435296871+113.90422480013488j, 11)
        ref = lib.einsum('acbd,ijcd->ijab', eris.vvvv, t2)
        self.assertAlmostEqual(abs(vt2 - ref).max(), 0, 11)
开发者ID:sunqm,项目名称:pyscf,代码行数:32,代码来源:test_rccsd.py


示例15: test_rand_ccsd_frozen3

    def test_rand_ccsd_frozen3(self):
        '''Single (eom-)ccsd iteration with random t1/t2 and single frozen virtual
        orbital.'''
        kconserv = kpts_helper.get_kconserv(rand_kmf.cell, rand_kmf.kpts)

        kmf = pbcscf.addons.convert_to_ghf(rand_kmf)
        # Round to make this insensitive to small changes between PySCF versions
        mat_veff = kmf.get_veff().round(4)
        mat_hcore = kmf.get_hcore().round(4)
        kmf.get_veff = lambda *x: mat_veff
        kmf.get_hcore = lambda *x: mat_hcore

        frozen = [[],[],[5]]  # freezing one virtual
        rand_cc = pbcc.KGCCSD(kmf, frozen=frozen)
        eris = rand_cc.ao2mo(rand_cc.mo_coeff)
        eris.mo_energy = [eris.fock[k].diagonal() for k in range(rand_cc.nkpts)]
        t1, t2 = rand_t1_t2(kmf, rand_cc)
        # Manually zero'ing out the frozen elements of the t1/t2
        t1[2, :, 0] = 0.0
        for ki in range(rand_cc.nkpts):
          for kj in range(rand_cc.nkpts):
            for ka in range(rand_cc.nkpts):
              kb = kconserv[ki, ka, kj]
              if ka == 2:
                  t2[ki, kj, ka, :, :, 0] = 0.0
              if kb == 2:
                  t2[ki, kj, ka, :, :, :, 0] = 0.0

        Ht1, Ht2 = rand_cc.update_amps(t1, t2, eris)
        self.assertAlmostEqual(finger(Ht1), (-19.6637196882-16.2773841431j), 6)
        self.assertAlmostEqual(finger(Ht2), (881.655146297+1283.71020059j), 6)
开发者ID:chrinide,项目名称:pyscf,代码行数:31,代码来源:test_kpoint.py


示例16: test_analyze

 def test_analyze(self):
     f = td_hf.oscillator_strength(gauge='length')
     self.assertAlmostEqual(lib.finger(f), -0.13908774016795605, 7)
     f = td_hf.oscillator_strength(gauge='velocity', order=2)
     self.assertAlmostEqual(lib.finger(f), -0.096991134490587522, 7)
     td_hf.analyze()
     self.assertEqual(td_hf.nroots, td_hf.nstates)
     self.assertAlmostEqual(lib.finger(td_hf.e_tot-mf.e_tot), 0.41508325757603637, 6)
开发者ID:chrinide,项目名称:pyscf,代码行数:8,代码来源:test_tdrks.py


示例17: test_nr_s8

    def test_nr_s8(self):
        mol = gto.M(atom="He 0 0 0; Ne 3 0 0", basis='ccpvdz')
        eri0 = mol.intor('int2e_sph', aosym='s8')
        self.assertAlmostEqual(lib.finger(eri0), -10.685918926843847, 9)

        eri1 = mol.intor('int2e_yp_sph', aosym=8)
        self.assertAlmostEqual(lib.finger(eri1), -10.685918926843847, 9)
        self.assertAlmostEqual(abs(eri0-eri1).max(), 0, 9)
开发者ID:chrinide,项目名称:pyscf,代码行数:8,代码来源:test_moleintor.py


示例18: test_khf_stability

    def test_khf_stability(self):
        kmf = pscf.KRHF(cell, kpts, exxdiv='ewald').run(conv_tol=1e-12)
        mo_i, mo_e = kmf.stability(internal=True, external=True)
        self.assertAlmostEqual(abs(kmf.mo_coeff[0]-mo_i[0]).max(), 0, 9)

        hop2, hdiag2 = stability._gen_hop_rhf_external(kmf)
        self.assertAlmostEqual(lib.finger(hdiag2), 18.528134783454508, 7)
        self.assertAlmostEqual(lib.finger(hop2(hdiag2)), 108.99683506471919, 5)
开发者ID:chrinide,项目名称:pyscf,代码行数:8,代码来源:test_stability.py


示例19: test_bands

    def test_bands(self):
        np.random.seed(1)
        kpts_bands = np.random.random((1,3))

        e = mf.get_bands(kpts_bands)[0]
        self.assertAlmostEqual(lib.finger(e), 0.9038555558945438, 6)

        e = kmf.get_bands(kpts_bands)[0]
        self.assertAlmostEqual(lib.finger(e), -0.3020614, 6)
开发者ID:chrinide,项目名称:pyscf,代码行数:9,代码来源:test_uhf.py


示例20: test_fast_iao_mulliken_pop

    def test_fast_iao_mulliken_pop(self):
        mf = scf.RHF(mol).run()
        a = iao.iao(mol, mf.mo_coeff[:,mf.mo_occ>0])
        p,chg = iao.fast_iao_mullikan_pop(mol, mf.make_rdm1(), a)
        self.assertAlmostEqual(lib.finger(p), 0.56812564587009806, 5)

        mf = scf.UHF(mol).run()
        p,chg = iao.fast_iao_mullikan_pop(mol, mf.make_rdm1(), a)
        self.assertAlmostEqual(lib.finger(p[0]+p[1]), 0.56812564587009806, 5)
开发者ID:chrinide,项目名称:pyscf,代码行数:9,代码来源:test_iao.py



注:本文中的pyscf.lib.finger函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python lib.load_library函数代码示例发布时间:2022-05-27
下一篇:
Python lib.einsum函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap