Exemplo n.º 1
0
 def test_eomee_ccsd_matvec_triplet3(self):
     numpy.random.seed(10)
     r1 = numpy.random.random((no, nv)) - .9
     r2 = numpy.random.random((2, no, no, nv, nv)) - .9
     r2[0] = r2[0] - r2[0].transpose(0, 1, 3, 2)
     r2[0] = r2[0] - r2[0].transpose(1, 0, 2, 3)
     r2[1] = r2[1] - r2[1].transpose(1, 0, 3, 2)
     myeom = eom_rccsd.EOMEETriplet(mycc31)
     vec = myeom.amplitudes_to_vector(r1, r2)
     imds = myeom.make_imds(eris31)
     vec1 = myeom.matvec(vec, imds)
     r1, r2 = myeom.vector_to_amplitudes(vec1)
     self.assertAlmostEqual(lib.finger(r1), 3550.5250670914056, 9)
     self.assertAlmostEqual(lib.finger(r2[0]), -237433.03756895234, 8)
     self.assertAlmostEqual(lib.finger(r2[1]), 127680.0182437716, 8)
Exemplo n.º 2
0
 def test_df_eomee_ccsd_matvec_triplet(self):
     numpy.random.seed(10)
     r1 = numpy.random.random((no, nv)) - .9
     r2 = numpy.random.random((2, no, no, nv, nv)) - .9
     r2[0] = r2[0] - r2[0].transpose(0, 1, 3, 2)
     r2[0] = r2[0] - r2[0].transpose(1, 0, 2, 3)
     r2[1] = r2[1] - r2[1].transpose(1, 0, 3, 2)
     myeom = eom_rccsd.EOMEETriplet(mycc1)
     vec = myeom.amplitudes_to_vector(r1, r2)
     imds = myeom.make_imds(eris1)
     vec1 = myeom.matvec(vec, imds)
     r1, r2 = myeom.vector_to_amplitudes(vec1)
     self.assertAlmostEqual(lib.finger(r1), 214.90035498814302, 9)
     self.assertAlmostEqual(lib.finger(r2[0]), 37033.183886562998, 8)
     self.assertAlmostEqual(lib.finger(r2[1]), 4164.1657912277242, 8)