def test_des_des_linkstr(self): norb, nelec = 10, 4 strs = cistring.gen_strings4orblist(range(norb), nelec) numpy.random.seed(11) mask = numpy.random.random(len(strs)) > .4 strs = strs[mask] dd_index0 = des_des_linkstr(strs, norb, nelec) dd_index1 = selected_ci.des_des_linkstr(strs, norb, nelec) self.assertTrue(numpy.all(dd_index0 == dd_index1)) dd_index0 = des_des_linkstr_tril(strs, norb, nelec) dd_index1 = selected_ci.des_des_linkstr_tril(strs, norb, nelec) dd_index1[:, :, 1] = 0 self.assertTrue(numpy.all(dd_index0 == dd_index1))
def test_des_des_linkstr(self): norb, nelec = 10, 4 strs = cistring.make_strings(range(norb), nelec) numpy.random.seed(11) mask = numpy.random.random(len(strs)) > .4 strs = strs[mask] dd_index0 = des_des_linkstr(strs, norb, nelec) dd_index1 = selected_ci.des_des_linkstr(strs, norb, nelec) self.assertTrue(numpy.all(dd_index0 == dd_index1)) dd_index0 = des_des_linkstr_tril(strs, norb, nelec) dd_index1 = selected_ci.des_des_linkstr_tril(strs, norb, nelec) dd_index1[:,:,1] = 0 self.assertTrue(numpy.all(dd_index0 == dd_index1))