def x2c1e(self): from pyscf.x2c import x2c x2chf = x2c.UHF(self.mol) x2c_keys = x2chf._keys x2chf.__dict__.update(self.__dict__) x2chf._keys = self._keys.union(x2c_keys) return x2chf
def test_picture_change(self): c = lib.param.LIGHT_SPEED myx2c = x2c.UHF(mol) myx2c.with_x2c.xuncontract = False def tv(with_x2c): xmol = with_x2c.get_xmol()[0] t = xmol.intor_symmetric('int1e_spsp_spinor') * .5 #v = xmol.intor_symmetric('int1e_nuc_spinor') w = xmol.intor_symmetric('int1e_spnucsp_spinor') return t, 'int1e_nuc_spinor', w t, v, w = tv(myx2c.with_x2c) h1 = myx2c.with_x2c.picture_change((v, w * (.5 / c)**2 - t), t) href = myx2c.with_x2c.get_hcore() self.assertAlmostEqual(abs(href - h1).max(), 0, 10) myx2c.with_x2c.xuncontract = True t, v, w = tv(myx2c.with_x2c) h1 = myx2c.with_x2c.picture_change((v, w * (.5 / c)**2 - t), t) href = myx2c.with_x2c.get_hcore() self.assertAlmostEqual(abs(href - h1).max(), 0, 10) myx2c.with_x2c.basis = 'unc-sto3g' t, v, w = tv(myx2c.with_x2c) h1 = myx2c.with_x2c.picture_change((v, w * (.5 / c)**2 - t), t) href = myx2c.with_x2c.get_hcore() self.assertAlmostEqual(abs(href - h1).max(), 0, 10)
def X2C(mol, *args): '''X2C Hartree-Fock''' from pyscf.x2c import x2c if dhf.zquatev and mol.spin == 0: return x2c.RHF(mol, *args) else: return x2c.UHF(mol, *args)
def test_x2c1e(self): myx2c = x2c.UHF(mol) myx2c.with_x2c.xuncontract = False e = myx2c.kernel() self.assertAlmostEqual(e, -76.08176796102066, 9) myx2c.with_x2c.xuncontract = True e = myx2c.kernel() self.assertAlmostEqual(e, -76.075431226329414, 9) myx2c.with_x2c.approx = 'ATOM1E' e = myx2c.kernel() self.assertAlmostEqual(e, -76.07543183416206, 9)
def UHF(mol, *args): return x2c.UHF(mol, *args)
def X2C(mol, *args): '''X2C UHF (in testing)''' from pyscf.x2c import x2c return x2c.UHF(mol, *args)