def test_q_matrix(self): a, b, c, d = randomElements() q = Quaternion(a, b, c, d) M = np.array([ [a, -b, -c, -d], [b, a, -d, c], [c, d, a, -b], [d, -c, b, a]]) self.assertTrue(np.array_equal(q._q_matrix(), M))