Ejemplo n.º 1
0
    def setUp(self):
        self.N = 17 # Number of rows to create -- esssentially arbitrary

        # Random complex matrix of unit-length vectors
        self.psi = random_array((self.N, 2), iscomplex=True)
        self.psi = normalize(self.psi)

        # Random real matrix of unit length vectors
        self.X = random_array((self.N, 3))
        self.X = normalize(self.X)
Ejemplo n.º 2
0
    def test_su_to_SU(self):
        """Test that the image of generic Cayley map ends up in SU(2)."""

        N = 16
        a = random_array((N, 3))
        A = hatmap(a)
        U = cayley(A)

        self.assertTrue(is_SU(U).all())
Ejemplo n.º 3
0
    def testCayleyKlein(self):
        """Test whether generic Cayley and Cayley-Klein agree on su(2)."""

        N = 16
        a = random_array((N, 3))
        A = hatmap(a)
     
        U1 = cayley(A)
        U2 = cayley_klein(a)

        self.assertTrue(is_float_equal(U1, U2))
Ejemplo n.º 4
0
 def setUp(self):
     self.N = 5
     self.a = random_array((self.N, 3))
     self.A = hatmap(self.a)