Esempio n. 1
0
    def test_n3_diffuse_Ta(self):
        nk = (1, 1, 2)
        ehf_bench = -6.1870676561720721
        ecc_bench = -0.06764836939412185

        cc = pbcc.kccsd_rhf.RCCSD(kmf)
        cc.conv_tol = 1e-8
        eris = cc.ao2mo()
        eris.mo_energy = [
            eris.fock[ikpt].diagonal() for ikpt in range(cc.nkpts)
        ]
        ecc, t1, t2 = cc.kernel(eris=eris)
        ehf = kmf.e_tot
        self.assertAlmostEqual(ehf, ehf_bench, 6)
        self.assertAlmostEqual(ecc, ecc_bench, 6)

        eom = EOMIP_Ta(cc)
        e, v = eom.ipccsd(nroots=2, koopmans=True, kptlist=(0, ), eris=eris)
        self.assertAlmostEqual(e[0][0], -1.146351230068405, 6)
        self.assertAlmostEqual(e[0][1], -1.10725570884212, 6)

        eom = EOMEA_Ta(cc)
        e, v = eom.eaccsd(nroots=2, koopmans=True, kptlist=[0], eris=eris)
        self.assertAlmostEqual(e[0][0], 1.267728933294929, 6)
        self.assertAlmostEqual(e[0][1], 1.280954973687476, 6)

        eom = EOMEA_Ta(cc)
        e, v = eom.eaccsd(nroots=2, koopmans=True, kptlist=[1], eris=eris)
        self.assertAlmostEqual(e[0][0], 1.229047959680129, 6)
        self.assertAlmostEqual(e[0][1], 1.384154370672317, 6)
Esempio n. 2
0
    def test_n3_diffuse_Ta_against_so(self):
        ehf_bench = -6.1870676561720721
        ecc_bench = -0.06764836939412185

        cc = pbcc.kccsd_rhf.RCCSD(kmf)
        cc.conv_tol = 1e-10
        eris = cc.ao2mo()
        eris.mo_energy = [
            eris.fock[ikpt].diagonal() for ikpt in range(cc.nkpts)
        ]
        ecc, t1, t2 = cc.kernel(eris=eris)
        ehf = kmf.e_tot
        self.assertAlmostEqual(ehf, ehf_bench, 6)
        self.assertAlmostEqual(ecc, ecc_bench, 6)

        eom = EOMEA_Ta(cc)
        eea_rccsd = eom.eaccsd_star(nroots=1,
                                    koopmans=True,
                                    kptlist=(0, ),
                                    eris=eris)
        eom = EOMIP_Ta(cc)
        eip_rccsd = eom.ipccsd_star(nroots=1,
                                    koopmans=True,
                                    kptlist=(0, ),
                                    eris=eris)
        self.assertAlmostEqual(eea_rccsd[0][0], 1.2610123166324307, 6)
        self.assertAlmostEqual(eip_rccsd[0][0], -1.1435100754903331, 6)

        from pyscf.pbc.cc import kccsd
        cc = pbcc.KGCCSD(kmf)
        cc.conv_tol = 1e-10
        eris = cc.ao2mo()
        eris.mo_energy = [
            eris.fock[ikpt].diagonal() for ikpt in range(cc.nkpts)
        ]
        ecc, t1, t2 = cc.kernel(eris=eris)
        ehf = kmf.e_tot
        self.assertAlmostEqual(ehf, ehf_bench, 6)
        self.assertAlmostEqual(ecc, ecc_bench, 6)

        from pyscf.pbc.cc import eom_kccsd_ghf
        eom = eom_kccsd_ghf.EOMEA_Ta(cc)
        eea_gccsd = eom.eaccsd_star(nroots=1,
                                    koopmans=True,
                                    kptlist=(0, ),
                                    eris=eris)
        eom = eom_kccsd_ghf.EOMIP_Ta(cc)
        eip_gccsd = eom.ipccsd_star(nroots=1,
                                    koopmans=True,
                                    kptlist=(0, ),
                                    eris=eris)
        self.assertAlmostEqual(eea_gccsd[0][0], 1.2610123166324307, 6)
        self.assertAlmostEqual(eip_gccsd[0][0], -1.1435100754903331, 6)

        # Usually slightly higher agreement when comparing directly against one another
        self.assertAlmostEqual(eea_gccsd[0][0], eea_rccsd[0][0], 9)
        self.assertAlmostEqual(eip_gccsd[0][0], eip_rccsd[0][0], 9)
Esempio n. 3
0
kmf = pbchf.KRHF(cell, kpts, exxdiv=None)#, conv_tol=1e-10)
kpoint_energy = kmf.kernel()

# Perform our ground state ccsd calculation
mykcc = pbccc.KRCCSD(kmf)
eris = mykcc.ao2mo()
kccsd_energy = mykcc.ccsd(eris=eris)[0]
ekcc = mykcc.ecc

# To run an EOM-CCSD(T)*a calculation, you need to use the EOMIP_Ta/
# /EOMEA_Ta classes that will add in the contribution of T3[2] to
# T1/T2 as well as any other relevant EOM-CCSD intermediates.
myeom = EOMIP_Ta(mykcc)
# We then call the ip-ccsd* function that will find both the right
# and left eigenvectors of EOM-CCSD (with perturbed intermediates)
# and run EOM-CCSD*
myeom.ipccsd_star(nroots=2, kptlist=[0], eris=eris)

# If we need to run both an IP and EA calculation, the t3[2] intermediates
# would need to be created two times. Because creating the t3[2] intermediates
# is fairly expensive, we can reduce the computational cost by creating
# the intermediates directly and passing them in.
from pyscf.pbc.cc import eom_kccsd_rhf
imds = eom_kccsd_rhf._IMDS(mykcc, eris=eris)
imds = imds.make_t3p2_ip_ea(mykcc)
# Now call EOMIP_Ta/EOMEA_Ta directly using these intermediates
myeom = EOMIP_Ta(mykcc)
myeom.ipccsd_star(nroots=2, kptlist=[0], imds=imds)
myeom = EOMEA_Ta(mykcc)
myeom.eaccsd_star(nroots=2, kptlist=[0], imds=imds)