コード例 #1
0
    def make_t3p2_ea(self, cc):
        cput0 = (logger.process_clock(), logger.perf_counter())

        t1, t2, eris = cc.t1, cc.t2, self.eris
        delta_E_corr, pt1, pt2, Wovoo, Wvvvo = \
            imd.get_t3p2_imds_slow(cc, t1, t2, eris)
        self.t1 = pt1
        self.t2 = pt2

        self._made_shared = False  # Force update
        self.make_ea()  # Make after t1/t2 updated
        self.Wvvvo = self.Wvvvo + Wvvvo

        self.made_ea_imds = True
        logger.timer_debug1(self, 'EOM-CCSD(T)a EA intermediates', *cput0)
        return self
コード例 #2
0
    def make_t3p2_ip(self, cc):
        cput0 = (time.clock(), time.time())

        t1, t2, eris = cc.t1, cc.t2, self.eris
        delta_E_corr, pt1, pt2, Wovoo, Wvvvo = \
            imd.get_t3p2_imds_slow(cc, t1, t2, eris)
        self.t1 = pt1
        self.t2 = pt2

        self._made_shared = False  # Force update
        self.make_ip()  # Make after t1/t2 updated
        self.Wovoo = self.Wovoo + Wovoo

        self.made_ip_imds = True
        logger.timer_debug1(self, 'EOM-CCSD(T)a IP intermediates', *cput0)
        return self
コード例 #3
0
 def test_t3p2_intermediates_complex(self):
     '''Although this has not been tested strictly for complex values, it
     was written to be correct for complex values and differences in the complex
     values between versions should be taken into account and corrected.'''
     myt1 = mycc1.t1.copy()
     myt2 = mycc1.t2.copy()
     e, pt1, pt2, Wmcik, Wacek = gintermediates.get_t3p2_imds_slow(
         mycc1, myt1, myt2, eris=eris1)
     self.assertAlmostEqual(lib.finger(e), -13810450.064880637, 3)
     self.assertAlmostEqual(lib.finger(pt1),
                            (14525.466845738476 + 1145.7490899866602j), 4)
     self.assertAlmostEqual(lib.finger(pt2),
                            (-34943.95360794282 + 29728.34747703709j), 4)
     self.assertAlmostEqual(lib.finger(Wmcik),
                            (271010.439304044 - 201703.96483952703j), 4)
     self.assertAlmostEqual(lib.finger(Wacek),
                            (316710.3913587458 + 99554.48507036189j), 4)
コード例 #4
0
    def test_t3p2_intermediates_against_so(self):
        from pyscf.cc.addons import convert_to_gccsd
        myt1 = mycc1.t1.copy()
        myt2 = mycc1.t2.copy()
        e, pt1, pt2, Wmcik, Wacek = rintermediates.get_t3p2_imds_slow(
            mycc1, myt1, myt2)

        mygcc = convert_to_gccsd(mycc1)
        mygt1 = mygcc.t1.copy()
        mygt2 = mygcc.t2.copy()
        ge, gpt1, gpt2, gWmcik, gWacek = gintermediates.get_t3p2_imds_slow(
            mygcc, mygt1, mygt2)
        self.assertAlmostEqual(lib.finger(pt1), -2.6094405706617727, 6)
        self.assertAlmostEqual(lib.finger(pt2), 23.097562049844235, 6)
        self.assertAlmostEqual(lib.finger(pt1), lib.finger(gpt1[::2, ::2]), 6)
        self.assertAlmostEqual(lib.finger(pt2),
                               lib.finger(gpt2[::2, 1::2, ::2, 1::2]), 6)
コード例 #5
0
 def test_t3p2_intermediates_real(self):
     myt1 = mycc1.t1.real.copy()
     myt2 = mycc1.t2.real.copy()
     new_eris = mycc1.ao2mo()
     new_eris.oooo = eris1.oooo.real
     new_eris.oooo = eris1.oooo.real
     new_eris.ooov = eris1.ooov.real
     new_eris.oovv = eris1.oovv.real
     new_eris.ovov = eris1.ovov.real
     new_eris.ovvv = eris1.ovvv.real
     new_eris.vvvv = eris1.vvvv.real
     new_eris.vvvv = eris1.vvvv.real
     new_eris.fock = eris1.fock.real
     new_eris.mo_energy = new_eris.fock.diagonal()
     e, pt1, pt2, Wmcik, Wacek = gintermediates.get_t3p2_imds_slow(
         mycc1, myt1, myt2, eris=new_eris)
     self.assertAlmostEqual(lib.finger(e), 8588977.565611511, 4)
     self.assertAlmostEqual(lib.finger(pt1), 14407.896043949795, 5)
     self.assertAlmostEqual(lib.finger(pt2), -34967.36031768824, 5)
     self.assertAlmostEqual(lib.finger(Wmcik), 271029.6000933048, 5)
     self.assertAlmostEqual(lib.finger(Wacek), 316110.05463216535, 5)