Example #1
0
 def test_evals(self, ham1, which, k, ls, sigma):
     lk = eigs_numpy(ham1,
                     k=k,
                     which=which,
                     return_vecs=False,
                     sigma=sigma,
                     sort=False)
     assert_allclose(lk, ls)
Example #2
0
 def test_evecs(self, ham1, which, k, sigma):
     lk, vk = eigs_numpy(ham1,
                         k=k,
                         which=which,
                         return_vecs=True,
                         sigma=sigma,
                         sort=False)
     assert isinstance(vk, np.matrix)
     assert_allclose(dot(vk, ldmul(lk, vk.H)), ham1)