Beispiel #1
0
 def state_average_mix(self, fcisolvers=None, weights=(0.5, 0.5)):
     # This is clumsy and hacky and should be fixed in pyscf.mcscf.addons eventually rather than here
     return sapdft_grad_monkeypatch_(
         state_average_mix(self, fcisolvers, weights))
Beispiel #2
0
def state_average_n_mix(casscf, fcisolvers, weights=(0.5, 0.5)):
    sacasscf = state_average_mix(casscf, fcisolvers, weights=weights)
    sacasscf.fcisolver = get_sanmix_fcisolver(sacasscf.fcisolver)
    return sacasscf
Beispiel #3
0
import numpy as np
from pyscf import lib, gto, scf, dft, fci, mcscf, df
from pyscf.mcscf import newton_casscf
from pyscf.mcscf.addons import state_average_mix
from me2n2_struct import structure as struct
from mrh.my_pyscf.mcscf.lasscf_testing import LASSCF
from mrh.my_pyscf.fci import csf_solver

r_nn = 3.0
mol = struct(3.0, '6-31g')
mol.output = 'test_me2n2_sa.log'
mol.verbose = lib.logger.DEBUG
mol.build()
mf = scf.RHF(mol).run()
mc = state_average_mix(mcscf.CASSCF(
    mf, 4, 4), [csf_solver(mol, smult=m2 + 1).set(spin=m2) for m2 in (0, 2)],
                       [0.5, 0.5]).run()
mf_df = mf.density_fit(auxbasis=df.aug_etb(mol)).run()
mc_df = state_average_mix(mcscf.CASSCF(
    mf_df, 4,
    4), [csf_solver(mol, smult=m2 + 1).set(spin=m2) for m2 in (0, 2)],
                          [0.5, 0.5]).run()


def tearDownModule():
    global mol, mf, mf_df, mc, mc_df
    mol.stdout.close()
    del mol, mf, mf_df, mc, mc_df


class KnownValues(unittest.TestCase):