def DFCASSCF(mf, ncas, nelecas, auxbasis=None, **kwargs): mf = _convert_to_rhf(mf, False) if mf.mol.symmetry: mc = mc1step_symm.CASSCF(mf, ncas, nelecas, **kwargs) else: mc = mc1step.CASSCF(mf, ncas, nelecas, **kwargs) return df.density_fit(mc, auxbasis)
def DFCASSCF(mf, ncas, nelecas, auxbasis=None, **kwargs): from pyscf import scf mf = scf.addons.convert_to_rhf(mf, convert_df=False) if mf.mol.symmetry: mc = mc1step_symm.CASSCF(mf, ncas, nelecas, **kwargs) else: mc = mc1step.CASSCF(mf, ncas, nelecas, **kwargs) return df.density_fit(mc, auxbasis)
def DFCASSCF(mf, ncas, nelecas, auxbasis=None, ncore=None, frozen=None): from pyscf import scf mf = scf.addons.convert_to_rhf(mf, remove_df=False) if mf.mol.symmetry: mc = mc1step_symm.CASSCF(mf, ncas, nelecas, ncore, frozen) else: mc = mc1step.CASSCF(mf, ncas, nelecas, ncore, frozen) return df.density_fit(mc, auxbasis)
def DFCASSCF(mf_or_mol, ncas, nelecas, auxbasis=None, ncore=None, frozen=None): from pyscf import gto from pyscf import scf if isinstance(mf_or_mol, gto.Mole): mf = scf.RHF(mf_or_mol).density_fit() else: mf = mf_or_mol if isinstance(mf, scf.uhf.UHF): mf = scf.addons.convert_to_rhf(mf, remove_df=False) if mf.mol.symmetry: mc = mc1step_symm.CASSCF(mf, ncas, nelecas, ncore, frozen) else: mc = mc1step.CASSCF(mf, ncas, nelecas, ncore, frozen) return df.density_fit(mc, auxbasis)
def CASSCF(mf, ncas, nelecas, **kwargs): from pyscf import gto if isinstance(mf, gto.Mole): raise RuntimeError(''' You see this error message because of the API updates in pyscf v0.10. In the new API, the first argument of CASSCF/CASCI class is HF objects. e.g. mc = mcscf.CASSCF(mf, norb, nelec) Please see http://sunqm.net/pyscf/code-rule.html#api-rules for the details of API conventions''') mf = _convert_to_rhf(mf) if mf.mol.symmetry: mc = mc1step_symm.CASSCF(mf, ncas, nelecas, **kwargs) else: mc = mc1step.CASSCF(mf, ncas, nelecas, **kwargs) return mc
def make_fcasscf(self, casscf_attr={}, fcisolver_attr={}): ''' Make a fake CASSCF object for ostensible single-state calculations ''' if isinstance(self.base, mc1step_symm.CASSCF): fcasscf = mc1step_symm.CASSCF(self.base._scf, self.base.ncas, self.base.nelecas) else: fcasscf = mc1step.CASSCF(self.base._scf, self.base.ncas, self.base.nelecas) fcasscf.__dict__.update(self.base.__dict__) if hasattr(self.base, 'weights'): fcasscf.fcisolver = self.base.fcisolver._base_class(self.base.mol) fcasscf.nroots = 1 fcasscf.fcisolver.__dict__.update(self.base.fcisolver.__dict__) fcasscf.__dict__.update(casscf_attr) fcasscf.fcisolver.__dict__.update(fcisolver_attr) fcasscf.verbose, fcasscf.stdout = self.verbose, self.stdout return fcasscf
def CASSCF(mf_or_mol, ncas, nelecas, ncore=None, frozen=None): from pyscf import gto from pyscf import scf if isinstance(mf_or_mol, gto.Mole): mf = scf.RHF(mf_or_mol) else: mf = mf_or_mol if isinstance(mf, scf.uhf.UHF): mf = scf.addons.convert_to_rhf(mf) if getattr(mf, 'with_df', None): return DFCASSCF(mf, ncas, nelecas, ncore, frozen) if mf.mol.symmetry: mc = mc1step_symm.CASSCF(mf, ncas, nelecas, ncore, frozen) else: mc = mc1step.CASSCF(mf, ncas, nelecas, ncore, frozen) return mc
def CASSCF(mf, ncas, nelecas, ncore=None, frozen=None): from pyscf import gto from pyscf import scf if isinstance(mf, gto.Mole): raise RuntimeError(''' You see this error message because of the API updates in pyscf v0.10. In the new API, the first argument of CASSCF/CASCI class is HF objects. e.g. mc = mcscf.CASSCF(mf, norb, nelec) Please see http://sunqm.net/pyscf/code-rule.html#api-rules for the details of API conventions''') mf = scf.addons.convert_to_rhf(mf) if hasattr(mf, 'with_df') and mf.with_df: return DFCASSCF(mf, ncas, nelecas, ncore, frozen) if mf.mol.symmetry: mc = mc1step_symm.CASSCF(mf, ncas, nelecas, ncore, frozen) else: mc = mc1step.CASSCF(mf, ncas, nelecas, ncore, frozen) return mc