def test_multigrid_roks(self): mf = dft.ROKS(cell_he) mf.xc = 'lda,' mo = dm_he[0] nao = cell_he.nao mo_occ = numpy.ones(nao) dm1 = numpy.einsum('pi,i,qi->pq', mo, mo_occ, mo) dm1 = lib.tag_array(numpy.array([dm1, dm1]), mo_coeff=mo, mo_occ=mo_occ * 2) ref = mf.get_veff(cell_he, dm1) out = multigrid.multigrid(mf).get_veff(cell_he, dm1) self.assertAlmostEqual(float(abs(ref - out).max()), 0, 9) self.assertAlmostEqual(abs(ref.exc - out.exc).max(), 0, 9) self.assertAlmostEqual(abs(ref.ecoul - out.ecoul).max(), 0, 8)
def ROKS(cell, *args): from pyscf.pbc import dft return dft.ROKS(cell, *args)