Exemplo n.º 1
0
 def test_ea_matvec1(self):
     numpy.random.seed(12)
     r1 = numpy.random.random((nv)) - .9 + numpy.random.random((nv)) * .2j
     r2 = (numpy.random.random((no, nv, nv)) - .9 + numpy.random.random(
         (no, nv, nv)) * .2j)
     myeom = eom_rccsd.EOMEA(mycci)
     vec = myeom.amplitudes_to_vector(r1, r2)
     r1, r2 = myeom.vector_to_amplitudes(vec)
     imds = myeom.make_imds(erisi)
     vec1 = myeom.matvec(vec, imds)
     self.assertAlmostEqual(lib.finger(vec1),
                            -105083.60825558871 + 25155.909195554908j, 8)
     self.assertAlmostEqual(lib.finger(myeom.get_diag()),
                            4688.9122122011895, 9)
Exemplo n.º 2
0
    def test_eaccsd2(self):
        e, v = mycc2.eaccsd(nroots=1)
        self.assertAlmostEqual(e, 0.16737886338859731, 6)

        e, v = mycc2.eaccsd(nroots=3)
        self.assertAlmostEqual(e[0], 0.16737886338859731, 6)
        self.assertAlmostEqual(e[1], 0.24027613852009164, 6)
        self.assertAlmostEqual(e[2], 0.51006797826488071, 6)

        myeom = eom_rccsd.EOMEA(mycc2)
        lv = myeom.eaccsd(nroots=3, left=True)[1]
        e = myeom.eaccsd_star(e, v, lv)
        self.assertAlmostEqual(e[0], 0.16656250872624662, 6)
        self.assertAlmostEqual(e[1], 0.2394414445283693, 6)
        self.assertAlmostEqual(e[2], 0.41399434356202935, 6)
Exemplo n.º 3
0
    def test_df_eaccsd(self):
        self.assertAlmostEqual(mycc.e_tot, -76.118403942938741, 7)
        e, v = mycc.eaccsd(nroots=1)
        self.assertAlmostEqual(e, 0.1903885587959659, 6)

        e, v = mycc.eaccsd(nroots=3)
        self.assertAlmostEqual(e[0], 0.1903885587959659, 6)
        self.assertAlmostEqual(e[1], 0.2833972143749155, 6)
        self.assertAlmostEqual(e[2], 0.5222497886685452, 6)

        myeom = eom_rccsd.EOMEA(mycc)
        lv = myeom.eaccsd(nroots=3, left=True)[1]
        e = myeom.eaccsd_star_contract(e, v, lv)
        self.assertAlmostEqual(e[0], 0.18931289565459147, 6)
        self.assertAlmostEqual(e[1], 0.28204643613789027, 6)
        self.assertAlmostEqual(e[2], 0.457836723621172, 6)
Exemplo n.º 4
0
    def test_eaccsd(self):
        eom = mycc.eomea_method()
        e, v = eom.kernel(nroots=1, left=False, koopmans=False)
        e = eom.eea
        self.assertAlmostEqual(e, 0.16737886338859731, 6)

        e, v = mycc.eaccsd(nroots=3)
        self.assertAlmostEqual(e[0], 0.16737886338859731, 6)
        self.assertAlmostEqual(e[1], 0.24027613852009164, 6)
        self.assertAlmostEqual(e[2], 0.51006797826488071, 6)

        myeom = eom_rccsd.EOMEA(mycc)
        lv = myeom.eaccsd(nroots=3, left=True)[1]
        e = myeom.eaccsd_star(e, v, lv)
        self.assertAlmostEqual(e[0], 0.16656250872624662, 6)
        self.assertAlmostEqual(e[1], 0.2394414445283693, 6)
        self.assertAlmostEqual(e[2], 0.41399434356202935, 6)
Exemplo n.º 5
0
    def test_h2o_star(self):
        mol_h2o = gto.Mole()
        mol_h2o.atom = [
            [8, [0.000000000000000, -0.000000000000000, -0.124143731294022]],
            [1, [0.000000000000000, -1.430522735894536, 0.985125550040314]],
            [1, [0.000000000000000, 1.430522735894536, 0.985125550040314]]
        ]
        mol_h2o.unit = 'B'
        mol_h2o.basis = {
            'H': [[0, [5.4471780, 0.156285], [0.8245472, 0.904691]],
                  [0, [0.1831916, 1.0]]],
            'O':
            '3-21G'
        }
        mol_h2o.verbose = 7
        mol_h2o.output = '/dev/null'
        mol_h2o.build()
        mol.conv_tol = 1e-12
        mf_h2o = scf.RHF(mol_h2o)
        mf_h2o.conv_tol_grad = 1e-12
        mf_h2o.kernel()
        mycc_h2o = cc.RCCSD(mf_h2o).run()
        mycc_h2o.conv_tol_normt = 1e-12
        mycc_h2o.conv_tol = 1e-12
        mycc_h2o.kernel()

        myeom = eom_rccsd.EOMIP(mycc_h2o)
        e = myeom.ipccsd_star(nroots=3)
        self.assertAlmostEqual(e[0], 0.410661965883, 6)

        myeom = eom_rccsd.EOMIP_Ta(mycc_h2o)
        e = myeom.ipccsd_star(nroots=3)
        self.assertAlmostEqual(e[0], 0.411695647736, 6)

        myeom = eom_rccsd.EOMEA(mycc_h2o)
        e = myeom.eaccsd_star(nroots=3)
        self.assertAlmostEqual(e[0], 0.250589854185, 6)

        myeom = eom_rccsd.EOMEA_Ta(mycc_h2o)
        e = myeom.eaccsd_star(nroots=3)
        self.assertAlmostEqual(e[0], 0.250720295150, 6)
Exemplo n.º 6
0
    def test_ea_matvec2(self):
        numpy.random.seed(12)
        r1 = numpy.random.random((nv)) - .9
        r2 = numpy.random.random((no, nv, nv)) - .9
        myeom = eom_rccsd.EOMEA(mycc21)
        vec = myeom.amplitudes_to_vector(r1, r2)
        r1, r2 = myeom.vector_to_amplitudes(vec)
        myeom.partition = 'mp'
        self.assertAlmostEqual(lib.finger(r1), 1.4488291275539353, 12)
        self.assertAlmostEqual(lib.finger(r2), 0.97080165032287469, 12)
        imds = myeom.make_imds(eris21)
        vec1 = myeom.matvec(vec, imds)
        self.assertAlmostEqual(lib.finger(vec1), -34426.363943760276, 9)
        self.assertAlmostEqual(lib.finger(myeom.get_diag()),
                               2724.8239646679217, 9)

        myeom.partition = 'full'
        imds = myeom.make_imds(eris21)
        diag = myeom.get_diag(imds)
        vec1 = myeom.matvec(vec, imds, diag=diag)
        self.assertAlmostEqual(lib.finger(vec1), -17030.363405297598, 9)
        self.assertAlmostEqual(lib.finger(diag), 4688.9122122011922, 9)