Ejemplo n.º 1
0
 def test_dist(self, dim, point_a, point_b, expected):
     metric = HermitianMetric(dim)
     result = metric.dist(point_a, point_b)
     self.assertAllClose(result, gs.array(expected))
Ejemplo n.º 2
0
 def test_metric_matrix(self, dim, expected):
     self.assertAllClose(HermitianMetric(dim).metric_matrix(), gs.array(expected))
Ejemplo n.º 3
0
 def test_norm(self, dim, vec, expected):
     metric = HermitianMetric(dim)
     self.assertAllClose(metric.norm(gs.array(vec)), gs.array(expected))
Ejemplo n.º 4
0
 def test_inner_product(self, dim, tangent_vec_a, tangent_vec_b, expected):
     metric = HermitianMetric(dim)
     self.assertAllClose(
         metric.inner_product(gs.array(tangent_vec_a), gs.array(tangent_vec_b)),
         gs.array(expected),
     )
Ejemplo n.º 5
0
 def test_log(self, dim, point, base_point, expected):
     metric = HermitianMetric(dim)
     self.assertAllClose(
         metric.log(gs.array(point), gs.array(base_point)), gs.array(expected)
     )
Ejemplo n.º 6
0
 def test_exp(self, dim, tangent_vec, base_point, expected):
     metric = HermitianMetric(dim)
     self.assertAllClose(
         metric.exp(gs.array(tangent_vec), gs.array(base_point)), gs.array(expected)
     )