Ejemplo n.º 1
0
 def _action(self,A):
     #if A not in self._group:
     #    raise ValueError,"Action is only defined for {0}!".format(self._group) 
     a,b,c,d=A
     [z,n,l]=factor_matrix_in_sl2z(int(a),int(b),int(c),int(d))
     #l,ep = factor_matrix_in_sl2z_in_S_and_T(A_in)
     res = copy(self.T.parent().one())
     if z==-1 and self.v<>None:
         tmp = self.v(SL2Z([-1,0,0,-1]))
         for j in range(self._dim):
             res[j,j]=tmp
     if n<>0:
         res = self.T**n
     for i in range(len(l)):
         res = res*self.S*self.T**l[i]
     return res
Ejemplo n.º 2
0
 def _action(self,A):
     #if A not in self._group:
     #    raise ValueError,"Action is only defined for {0}!".format(self._group) 
     a,b,c,d=A
     if self._group==SL2Z:
         [z,n,l]=factor_matrix_in_sl2z(int(a),int(b),int(c),int(d))
         # l,ep = factor_matrix_in_sl2z_in_S_and_T(A_in)
         res = self.T.parent().one()
         if z==-1 and self.Z<>None:
             res = self.Z #v(SL2Z[-1,0,0,-1])
             # for j in range(self.dim):
             #    res[j,j]=tmp
         if n<>0:
             res = self.T**n
         for i in range(len(l)):
             res = res*self.S*self.T**l[i]
     elif A in self.vals.keys():
         res = self.vals[A]
     else:
         raise NotImplementedError,"Can not write as word in generators of {0}".format(self._group)
     return res