Example #1
0
a = scf.UHF(mol)
ehf = a.scf()

####### This can be removed ######
frozen = [[0], [0]]  # 1sa and 1sb
mcc = cc.UCCSD(a)
mcc.frozen = frozen
mcc.diis_space = 10
mcc.conv_tol = 1e-6
mcc.conv_tol_normt = 1e-6
mcc.max_cycle = 150
ecc = mcc.kernel()[0]
eris = mcc.ao2mo()
e3 = uccsd_t.kernel(mcc, eris, mcc.t1, mcc.t2)
lib.logger.info(mcc, "* CCSD(T) energy : %12.6f" % (ehf + ecc + e3))
l1, l2 = uccsd_t_lambda.kernel(mcc, eris, mcc.t1, mcc.t2)[1:]

rdm1a, rdm1b = uccsd_t_rdm.make_rdm1(mcc, mcc.t1, mcc.t2, l1, l2, eris=eris)
rdm2aa, rdm2ab, rdm2bb = uccsd_t_rdm.make_rdm2(mcc,
                                               mcc.t1,
                                               mcc.t2,
                                               l1,
                                               l2,
                                               eris=eris)

mo_a = a.mo_coeff[0]
mo_b = a.mo_coeff[1]
nmoa = mo_a.shape[1]
nmob = mo_b.shape[1]
eriaa = ao2mo.kernel(a._eri, mo_a, compact=False).reshape([nmoa] * 4)
eribb = ao2mo.kernel(a._eri, mo_b, compact=False).reshape([nmob] * 4)
Example #2
0
              [1, (0., 0.757, -0.587)]],
        basis='631g',
        spin=2,
    )
    mf = scf.UHF(mol)
    mf.conv_tol = 1e-14
    ehf = mf.scf()

    mycc = cc.UCCSD(mf)
    mycc.conv_tol = 1e-10
    mycc.conv_tol_normt = 1e-10
    ecc, t1, t2 = mycc.kernel()
    eris = mycc.ao2mo()
    e3ref = uccsd_t.kernel(mycc, eris, t1, t2)
    print(ehf + ecc + e3ref)
    conv, l1, l2 = uccsd_t_lambda.kernel(mycc, eris, t1, t2)
    g1 = kernel(mycc, t1, t2, l1, l2, eris=eris)
    print(g1)

    myccs = mycc.as_scanner()
    mol.atom[0] = ["O", (0., 0., 0.001)]
    mol.build(0, 0)
    e1 = myccs(mol)
    e1 += myccs.ccsd_t()
    mol.atom[0] = ["O", (0., 0., -0.001)]
    mol.build(0, 0)
    e2 = myccs(mol)
    e2 += myccs.ccsd_t()
    print(g1[0, 2], (e1 - e2) / 0.002 * lib.param.BOHR)
    #O      0.            0.0000000           -0.1480942
    #H      0.            0.1122898            0.0740461
Example #3
0
            [1   , (0. , 0.757  ,-0.587)]],
        basis = '631g',
        spin=2,
    )
    mf = scf.UHF(mol)
    mf.conv_tol = 1e-14
    ehf = mf.scf()

    mycc = cc.UCCSD(mf)
    mycc.conv_tol = 1e-10
    mycc.conv_tol_normt = 1e-10
    ecc, t1, t2 = mycc.kernel()
    eris = mycc.ao2mo()
    e3ref = uccsd_t.kernel(mycc, eris, t1, t2)
    print(ehf+ecc+e3ref)
    conv, l1, l2 = uccsd_t_lambda.kernel(mycc, eris, t1, t2)
    g1 = kernel(mycc, t1, t2, l1, l2, eris=eris)
    print(g1)

    myccs = mycc.as_scanner()
    mol.atom[0] = ["O" , (0., 0., 0.001)]
    mol.build(0, 0)
    e1 = myccs(mol)
    e1 += myccs.ccsd_t()
    mol.atom[0] = ["O" , (0., 0.,-0.001)]
    mol.build(0, 0)
    e2 = myccs(mol)
    e2 += myccs.ccsd_t()
    print(g1[0,2], (e1-e2)/0.002*lib.param.BOHR)
#O      0.            0.0000000           -0.1480942
#H      0.            0.1122898            0.0740461