def test_3D(self): res1 = gg.genJ1(self.elements) res2 = gg.gen3D(self.elements) #res_theo = np.asarray([[1,0,0],[0,1,0],[0,0,1]],dtype=complex) res_theo = np.identity(3, dtype=complex) self.assertEqual(res1[0], res_theo) self.assertEqual(res2[0], res_theo) for i in range(res1.shape[0]): tmpmsg = "element %d failed:\n%r\n\n%r" % (i, res1[i], res2[i])
def __init__(self, elements, U=None): TOhRep.__init__(self, 3) self.name = "TOh3D" self.mx = gg.gen3D(elements, U=U)
def test_3D_inversion(self): res = gg.gen3D(self.elements, inv=True) for i in res: self.assertFalse(utils._eq(i))