Beispiel #1
0
def UCASSCF(mf, ncas, nelecas, **kwargs):
    from pyscf import scf
    if isinstance(mf, scf.uhf.UHF):
        mc = mc1step_uhf.CASSCF(mf, ncas, nelecas, **kwargs)
    else:
        raise RuntimeError('First argument needs to be UHF object')
    return mc
Beispiel #2
0
        ['H', (0., -0., -1.)],
        ['H', (1., -0.5, 0.)],
        ['H', (0., 1., 1.)],
    ]

    mol.basis = {
        'H': 'sto-3g',
        'O': '6-31g',
    }
    mol.charge = 1
    mol.spin = 1
    mol.build()

    m = scf.UHF(mol)
    ehf = m.scf()
    emc = kernel(mc1step_uhf.CASSCF(m, 4, (2, 1)), m.mo_coeff, verbose=4)[1]
    print(ehf, emc, emc - ehf)
    print(emc - -2.9782774463926618)

    mol.atom = [
        ['O', (0., 0., 0.)],
        ['H', (0., -0.757, 0.587)],
        ['H', (0., 0.757, 0.587)],
    ]
    mol.basis = {
        'H': 'cc-pvdz',
        'O': 'cc-pvdz',
    }
    mol.charge = 1
    mol.spin = 1
    mol.build()
Beispiel #3
0
        ['O', (0., 0., 0.)],
        ['H', (0., -0.757, 0.587)],
        ['H', (0., 0.757, 0.587)],
    ]
    mol.basis = {
        'H': 'sto-3g',
        'O': 'sto-3g',
    }
    mol.charge = 1
    mol.spin = 1
    mol.build()

    m = scf.UHF(mol)
    ehf = m.scf()

    mc = mc1step_uhf.CASSCF(m, 4, 4)
    mc.verbose = 4
    mo = m.mo_coeff

    eris0 = _ERIS(mc, mo, 'incore')
    eris1 = _ERIS(mc, mo, 'outcore')
    print('jkcpp', numpy.allclose(eris1.jkcpp, eris0.jkcpp))
    print('jkcPP', numpy.allclose(eris1.jkcPP, eris0.jkcPP))
    print('jC_pp', numpy.allclose(eris1.jC_pp, eris0.jC_pp))
    print('jc_PP', numpy.allclose(eris1.jc_PP, eris0.jc_PP))
    print('aapp ', numpy.allclose(eris1.aapp, eris0.aapp))
    print('aaPP ', numpy.allclose(eris1.aaPP, eris0.aaPP))
    print('AApp ', numpy.allclose(eris1.AApp, eris0.AApp))
    print('AAPP ', numpy.allclose(eris1.AAPP, eris0.AAPP))
    print('appa ', numpy.allclose(eris1.appa, eris0.appa))
    print('apPA ', numpy.allclose(eris1.apPA, eris0.apPA))