def test_write_basic(self): comm = MPI.COMM_WORLD hcore = mf.get_hcore() X, nmo_pk = get_ortho_ao(cell, kpts) # Fake some data qk = numpy.zeros((8, 8)) km = numpy.ones((8, )) h5file = kp.FileHandler(comm, 'ham.h5') kp.write_basic(comm, cell, kpts, hcore, h5file, X, nmo_pk, qk, km) hcore_k3 = h5file.grp['H1_kp3'][:] self.assertEqual(hcore_k3.shape, (8, 8, 2)) self.assertAlmostEqual(numpy.max(hcore_k3), 1.27436250577, places=8) h5file.close()
def test_file_handler(self): comm = MPI.COMM_WORLD handler = kp.FileHandler(comm, 'ham.h5') self.assertFalse(handler.error) handler.close()
def test_kpchol_solution(self): h5file = kp.FileHandler(self.comm, 'test.h5') self.chol.run(self.comm, self.X, h5file) h5file.close()