Package geometry :: Package manifolds :: Module matrix_lie_group_tangent
[hide private]
[frames] | no frames]

Source Code for Module geometry.manifolds.matrix_lie_group_tangent

 1  from . import DifferentiableManifold, MatrixLieGroup, contract 
2 3 4 -class MatrixLieGroupTangent(DifferentiableManifold):
5 ''' This class represents the tangent bundle of a matrix Lie group 6 using a tuble (base, v0), where v0 is in the algebra. 7 8 Compare with the generic TangentBundle that uses the representation 9 (base, vel) where vel is tangent at base (it holds that vel=base*v0). 10 11 (MatrixLieGroup has different representation) 12 ''' 13 # TODO: the tangent bundle of a matrix Lie group has more properties than 14 # this. 15 # TODO: create tests for all of this 16
17 - def __init__(self, base_group):
18 assert isinstance(base_group, MatrixLieGroup) 19 self.base = base_group 20 dimension = 2 * base_group.get_dimension() 21 DifferentiableManifold.__init__(self, dimension=dimension)
22
23 - def __str__(self):
24 return "T%se" % self.base
25 26 @contract(x='tuple[2]')
27 - def belongs(self, x):
28 self.base.belongs(x[0]) 29 self.base.get_algebra().belongs(x[1])
30
31 - def belongs_ts(self, bv):
32 # TODO: implement 33 raise ValueError('Not supported')
34
35 - def project_ts(self, bv): # TODO: test
36 # TODO: implement 37 raise ValueError('Not supported')
38 39 @contract(a='belongs', b='belongs', returns='>=0')
40 - def distance(self, a, b):
41 # TODO: implement 42 raise ValueError('Not supported')
43 44 @contract(base='belongs', p='belongs', returns='belongs_ts')
45 - def logmap(self, base, p):
46 raise ValueError('Not supported')
47 48 @contract(bv='belongs_ts', returns='belongs')
49 - def expmap(self, bv):
50 raise ValueError('Not supported')
51 52 @contract(returns='list(belongs)')
53 - def interesting_points(self):
54 # TODO: write this 55 return []
56 57 @contract(a='belongs')
58 - def friendly(self, a):
59 ''' 60 Returns a friendly description string for a point on the manifold. 61 ''' 62 v = self.base.get_algebra().vector_from_algebra(a[1]) 63 return "V(%s,%s)" % (self.base.friendly(a[0]), v.tolist())
64