Exemplo n.º 1
0
verbose = 4,
basis = 'ccpvdz',
symmetry = True,
)
mf = scf.RHF(mol)
mf.kernel()
#mf.analyze()

#
# 1. State-average CASSCF to get optimal orbitals
#
mc = mcscf.CASSCF(mf, 6, 6)
solver_ag = fci.direct_spin0_symm.FCI(mol)
solver_b2u = fci.direct_spin0_symm.FCI(mol)
solver_b2u.wfnsym = 'B2u'
mc.fcisolver = mcscf.state_average_mix(mc, [solver_ag,solver_b2u], [.5,.5])
cas_list = [17,20,21,22,23,30]  # 2pz orbitals
mo = mcscf.sort_mo(mc, mf.mo_coeff, cas_list)
mc.kernel(mo)
#mc.analyze()
mc_mo = mc.mo_coeff

#
# 2. Ground state wavefunction.  This step can be passed you approximate it
# with the state-averaged CASSCF wavefunction
#
mc = mcscf.CASCI(mf, 6, 6)
mc.fcisolver.wfnsym = 'Ag'
mc.kernel(mc_mo)
ground_state = mc.ci
Exemplo n.º 2
0
verbose = 4,
basis = 'ccpvdz',
symmetry = True,
)
mf = scf.RHF(mol)
mf.kernel()
#mf.analyze()

#
# 1. State-average CASSCF to get optimal orbitals
#
mc = mcscf.CASSCF(mf, 6, 6)
solver_ag = fci.direct_spin0_symm.FCI(mol)
solver_b2u = fci.direct_spin0_symm.FCI(mol)
solver_b2u.wfnsym = 'B2u'
mc.fcisolver = mcscf.state_average_mix(mc, [solver_ag,solver_b2u], [.5,.5])
cas_list = [17,20,21,22,23,30]  # 2pz orbitals
mo = mcscf.sort_mo(mc, mf.mo_coeff, cas_list)
mc.kernel(mo)
#mc.analyze()
mc_mo = mc.mo_coeff

#
# 2. Ground state wavefunction.  This step can be passed you approximate it
# with the state-averaged CASSCF wavefunction
#
mc = mcscf.CASCI(mf, 6, 6)
mc.fcisolver.wfnsym = 'Ag'
mc.kernel(mc_mo)
ground_state = mc.ci
mol.basis = 'cc-pvdz'
mol.unit = 'B'
mol.symmetry = True
mol.build()
mf = scf.RHF(mol)
mf.irrep_nelec = {'A1g': 4, 'E1gx': 0, 'E1gy': 0, 'A1u': 4,
                  'E1uy': 2, 'E1ux': 2, 'E2gx': 0, 'E2gy': 0, 'E2uy': 0, 'E2ux': 0}
ehf = mf.kernel()
#mf.analyze()

#
# state-average over 1 triplet + 2 singlets
# Note direct_spin1 solver is called here because the CI solver will take
# spin-mix solution as initial guess which may break the spin symmetry
# required by direct_spin0 solver
#
weights = np.ones(3)/3
solver1 = fci.addons.fix_spin(fci.direct_spin1_symm.FCISolver(mol), shift=.2, ss_value=2)
solver1.nroots = 1
solver2 = fci.addons.fix_spin(fci.direct_spin1_symm.FCISolver(mol), ss_value=0)
solver2.nroots = 2

mc = mcscf.CASSCF(mf, 8, 8)
mc.fcisolver = mcscf.state_average_mix(mc, [solver1, solver2], weights)

# Mute warning msgs
mc.check_sanity = lambda *args: None

mc.verbose = 4
mc.kernel()