Пример #1
0
def test_reiher_sf_lambda():
    """ Reproduce Reiher et al orbital SF lambda from paper """

    RANK = 200

    NAME = path.join(path.dirname(__file__), '../integrals/eri_reiher.h5')
    _, reiher_mf = load_casfile_to_pyscf(NAME, num_alpha=27, num_beta=27)
    eri_rr, sf_factors = sf.factorize(reiher_mf._eri, RANK)
    lambda_tot = sf.compute_lambda(reiher_mf, sf_factors)
    assert eri_rr.shape[0] * 2 == 108
    assert np.isclose(lambda_tot, 4258.0)
Пример #2
0
def test_reiher_df_lambda():
    """ Reproduce Reiher et al orbital DF lambda from paper """

    THRESH = 0.00125
    NAME = path.join(path.dirname(__file__), '../integrals/eri_reiher.h5')
    _, mf = load_casfile_to_pyscf(NAME, num_alpha=27, num_beta=27)
    eri_rr, LR, L, Lxi = df.factorize(mf._eri, thresh=THRESH)
    total_lambda = df.compute_lambda(mf, LR)
    assert eri_rr.shape[0] * 2 == 108
    assert L == 360
    assert Lxi == 13031
    assert np.isclose(np.round(total_lambda, decimals=1), 294.8)
Пример #3
0
def test_lambda():
    integral_path = int_folder.__file__.replace('__init__.py', '')
    thc_factor_file = os.path.join(integral_path, 'M_250_beta_16_eta_10.h5')
    eri_file = os.path.join(integral_path, 'eri_reiher.h5')
    with h5py.File(thc_factor_file, 'r') as fid:
        MPQ = fid['MPQ'][...]
        etaPp = fid['etaPp'][...]

    _, mf = load_casfile_to_pyscf(eri_file, num_alpha=27, num_beta=27)

    lambda_tot, nthc, _, _, _, _  = \
        thc.compute_lambda(mf, etaPp=etaPp, MPQ=MPQ)
    assert nthc == 250
    assert np.isclose(np.round(lambda_tot), 294)
Пример #4
0
    def test_reiher_sf_ccsd_t(self):
        """ Reproduce Reiher et al FeMoco SF CCSD(T) errors from paper """

        NAME = path.join(path.dirname(__file__), '../integrals/eri_reiher.h5')
        _, mf = load_casfile_to_pyscf(NAME, num_alpha=27, num_beta=27)
        _, ecorr, _ = factorized_ccsd_t(
            mf, eri_rr=None)  # use full (local) ERIs for 2-body
        exact_energy = ecorr
        rank = 100
        eri_rr, _ = sf.factorize(mf._eri, rank)
        _, ecorr, _ = factorized_ccsd_t(mf, eri_rr)
        appx_energy = ecorr

        error = (appx_energy - exact_energy) * 1E3  # mEh

        assert np.isclose(np.round(error, decimals=2), 1.55)