Exemplo n.º 1
0
    def test_connection(self):
        group = self.matrix_so3
        metric = InvariantMetric(group=group)
        x, y, z = metric.normal_basis(group.lie_algebra.basis)
        result = metric.connection(x, y)
        expected = 1.0 / 2**0.5 / 2.0 * z
        self.assertAllClose(result, expected)

        point = group.random_uniform()
        translation_map = group.tangent_translation_map(point)
        tan_a = translation_map(x)
        tan_b = translation_map(y)
        result = metric.connection(tan_a, tan_b, point)
        expected = translation_map(expected)
        self.assertAllClose(result, expected)
Exemplo n.º 2
0
    def test_connection(self):
        group = self.matrix_so3
        lie_algebra = SkewSymmetricMatrices(3)
        metric = InvariantMetric(group=group, algebra=lie_algebra)
        x, y, z = lie_algebra.orthonormal_basis(metric.metric_mat_at_identity)
        result = metric.connection(-z, y)
        expected = -1. / 2**.5 / 2. * x
        self.assertAllClose(result, expected)

        point = group.random_uniform()
        translation_map = group.tangent_translation_map(point)
        tan_a = translation_map(-z)
        tan_b = translation_map(y)
        result = metric.connection(tan_a, tan_b, point)
        expected = translation_map(expected)
        self.assertAllClose(result, expected)
Exemplo n.º 3
0
 def test_connection_translation_map(self, group, tangent_vec_a,
                                     tangent_vec_b, point, expected):
     metric = InvariantMetric(group)
     translation_map = group.tangent_translation_map(point)
     tan_a = translation_map(tangent_vec_a)
     tan_b = translation_map(tangent_vec_b)
     result = metric.connection(tan_a, tan_b, point)
     expected = translation_map(expected)
     self.assertAllClose(result, expected, rtol=1e-3, atol=1e-3)
Exemplo n.º 4
0
 def test_connection(self, group, tangent_vec_a, tangent_vec_b, expected):
     metric = InvariantMetric(group)
     self.assertAllClose(metric.connection(tangent_vec_a, tangent_vec_b),
                         expected)