def CISD(mf, frozen=0, mo_coeff=None, mo_occ=None): from pyscf import lib from pyscf import scf if isinstance(mf, scf.uhf.UHF): return ucisd.UCISD(mf, frozen, mo_coeff, mo_occ) elif isinstance(mf, scf.rohf.ROHF): lib.logger.warn( mf, 'RCISD method does not support ROHF method. ROHF object ' 'is converted to UHF object and UCISD method is called.') mf = scf.addons.convert_to_uhf(mf) return ucisd.UCISD(mf, frozen, mo_coeff, mo_occ) else: return cisd.CISD(mf, frozen, mo_coeff, mo_occ)
cisd.CISD.Gradients = lib.class_as_method(Gradients) if __name__ == '__main__': from pyscf import gto from pyscf import scf from pyscf import ao2mo from pyscf import grad mol = gto.M(atom=[["O", (0., 0., 0.)], [1, (0., -0.757, 0.587)], [1, (0., 0.757, 0.587)]], basis='631g') mf = scf.RHF(mol) ehf = mf.scf() myci = cisd.CISD(mf) myci.kernel() g1 = myci.Gradients().kernel() # O 0.0000000000 -0.0000000000 0.0065498854 # H -0.0000000000 0.0208760610 -0.0032749427 # H -0.0000000000 -0.0208760610 -0.0032749427 print(lib.finger(g1) - -0.032562200777204092) mcs = myci.as_scanner() mol.set_geom_([["O", (0., 0., 0.001)], [1, (0., -0.757, 0.587)], [1, (0., 0.757, 0.587)]]) e1 = mcs(mol) mol.set_geom_([["O", (0., 0., -0.001)], [1, (0., -0.757, 0.587)], [1, (0., 0.757, 0.587)]]) e2 = mcs(mol) print(g1[0, 2] - (e1 - e2) / 0.002 * lib.param.BOHR)
def CISD(mf, frozen=[], mo_coeff=None, mo_occ=None): from pyscf import scf if isinstance(mf, (scf.uhf.UHF, scf.rohf.ROHF)): raise NotImplementedError('RO-CISD, UCISD are not available in this pyscf version') return cisd.CISD(mf, frozen, mo_coeff, mo_occ)