1 from . import MatrixLinearSpace, contract
2 from abc import abstractmethod
6 ''' This is the base class for Matrix Lie Algebra.
7
8 It is understood that it is composed by square matrices.
9
10 The only function that *has* to be implemented is the
11 :py:func:`project` function that projects a square matrix
12 onto the algebra. This function is used both for checking
13 that a vector is in the algebra (see :py:func:`belongs`)
14 and to mitigate the numerical errors.
15
16 You probably also want to implement :py:func:`norm` if
17 the default is not what you want.
18 '''
19
24
25 @abstractmethod
26 @contract(a='belongs', returns='array[K]')
28 ''' Isomorphism from elements of the algebra to vectors.
29 (For example, so(3) <==> R^3).
30 '''
31
32
33 @abstractmethod
34 @contract(returns='belongs', v='array[K]')
36 ''' Isomorphism from elements of the algebra to vectors.
37 (For example, so(3) <==> R^3).
38 '''
39
40
41
42