Beispiel #1
0
 def test_cre_des_linkstr(self):
     norb, nelec = 10, 4
     strs = cistring.gen_strings4orblist(range(norb), nelec)
     numpy.random.seed(11)
     mask = numpy.random.random(len(strs)) > .5
     strs = strs[mask]
     cd_index0 = cre_des_linkstr(strs, norb, nelec)
     cd_index1 = selected_ci.cre_des_linkstr(strs, norb, nelec)
     self.assertTrue(numpy.all(cd_index0 == cd_index1))
     cd_index0 = cre_des_linkstr_tril(strs, norb, nelec)
     cd_index1 = selected_ci.cre_des_linkstr_tril(strs, norb, nelec)
     cd_index1[:, :, 1] = 0
     self.assertTrue(numpy.all(cd_index0 == cd_index1))
Beispiel #2
0
 def test_cre_des_linkstr(self):
     norb, nelec = 10, 4
     strs = cistring.make_strings(range(norb), nelec)
     numpy.random.seed(11)
     mask = numpy.random.random(len(strs)) > .5
     strs = strs[mask]
     cd_index0 = cre_des_linkstr(strs, norb, nelec)
     cd_index1 = selected_ci.cre_des_linkstr(strs, norb, nelec)
     self.assertTrue(numpy.all(cd_index0 == cd_index1))
     cd_index0 = cre_des_linkstr_tril(strs, norb, nelec)
     cd_index1 = selected_ci.cre_des_linkstr_tril(strs, norb, nelec)
     cd_index1[:,:,1] = 0
     self.assertTrue(numpy.all(cd_index0 == cd_index1))