def __repr__(self): s="Multiplier system defined by action on the generators:" if self._group==SL2Z: S,T=SL2Z.gens() Z=S*S s+="r(S)=",self.vals[S] s+="r(T)=",self.vals[T] s+="r(Z)=",self.vals[Z] else: for g in self.vals.keys(): s+="r(",g,")=",self.vals[g] return s
def __repr__(self): s = "Multiplier system defined by action on the generators:" if self._group == SL2Z: S, T = SL2Z.gens() Z = S * S s += "r(S)=", self.vals[S] s += "r(T)=", self.vals[T] s += "r(Z)=", self.vals[Z] else: for g in self.vals.keys(): s += "r(", g, ")=", self.vals[g] return s
def get_rk(self, n, k): r""" Compute the coefficient r_k((f|A_n)) """ if not self._rks.has_key((n, k)): S, T = SL2Z.gens() nstar = self._get_shifted_coset_m(n, S) kstar = self._k - 2 - k i1 = self.get_integral_from_1_to_oo(n, k) i2 = self.get_integral_from_1_to_oo(nstar, kstar) if self._verbose > 0: print "i1=", i1 print "i2=", i2 self._rks[(n, k)] = i1 + i2 * (-1)**(k + 1) return self._rks[(n, k)]
def get_rk(self, n, k): r""" Compute the coefficient r_k((f|A_n)) """ if (n, k) not in self._rks: S, T = SL2Z.gens() nstar = self._get_shifted_coset_m(n, S) kstar = self._k - 2 - k i1 = self.get_integral_from_1_to_oo(n, k) i2 = self.get_integral_from_1_to_oo(nstar, kstar) if self._verbose > 0: print("i1={0}".format(i1)) print("i2={0}".format(i2)) self._rks[(n, k)] = i1 + i2 * (-1)**(k + 1) return self._rks[(n, k)]
def get_rk(self,n,k): r""" Compute the coefficient r_k((f|A_n)) """ if not self._rks.has_key((n,k)): S,T = SL2Z.gens() nstar = self._get_shifted_coset_m(n,S) kstar = self._k-2-k i1 = self.get_integral_from_1_to_oo(n,k) i2 = self.get_integral_from_1_to_oo(nstar,kstar) if self._verbose>0: print "i1=",i1 print "i2=",i2 self._rks[(n,k)] = i1+i2*(-1)**(k+1) return self._rks[(n,k)]
def __init__(self,G,v=None,**kwargs): r""" G should be a subgroup of PSL(2,Z). EXAMPLE:: sage: te=TestMultiplier(Gamma0(2),weight=1/2) sage: r=InducedRepresentation(Gamma0(2),v=te) """ dim = len(list(G.coset_reps())) MultiplierSystem.__init__(self,Gamma0(1),dimension=dim) self._induced_from=G # setup the action on S and T (should be faster...) self.v = v if v<>None: k = v.order() if k>2: K = CyclotomicField(k) else: K=ZZ self.S=matrix(K,dim,dim) self.T=matrix(K,dim,dim) else: self.S=matrix(dim,dim) self.T=matrix(dim,dim) S,T=SL2Z.gens() if hasattr(G,"coset_reps"): if isinstance(G.coset_reps(),list): Vl=G.coset_reps() else: Vl=list(G.coset_reps()) elif hasattr(G,"_G"): Vl=list(G._G.coset_reps()) else: raise ValueError,"Could not get coset representatives from {0}!".format(G) self.repsT=dict() self.repsS=dict() for i in range(dim): Vi=Vl[i] for j in range(dim): Vj=Vl[j] BS = Vi*S*Vj**-1 BT = Vi*T*Vj**-1 #print "i,j #print "ViSVj^-1=",BS #print "ViTVj^-1=",BT if BS in G: if v<>None: vS=v(BS) else: vS=1 self.S[i,j]=vS self.repsS[(i,j)]=BS if BT in G: if v<>None: vT=v(BT) else: vT=1 self.T[i,j]=vT self.repsT[(i,j)]=BT
def nice_coset_reps(G): r""" Compute a better/nicer list of right coset representatives [V_j] i.e. SL2Z = \cup G V_j Use this routine for known congruence subgroups. EXAMPLES:: sage: G=MySubgroup(Gamma0(5)) sage: G._get_coset_reps_from_G(Gamma0(5)) [[1 0] [0 1], [ 0 -1] [ 1 0], [ 0 -1] [ 1 1], [ 0 -1] [ 1 -1], [ 0 -1] [ 1 2], [ 0 -1] [ 1 -2]] """ cl=list() S,T=SL2Z.gens() lvl=G.generalised_level() # Start with identity rep. cl.append(SL2Z([1 ,0 ,0 ,1 ])) if(not S in G): cl.append(S) # If the original group is given as a Gamma0 then # the reps are not the one we want # I.e. we like to have a fundamental domain in # -1/2 <=x <= 1/2 for Gamma0, Gamma1, Gamma for j in range(1 , ZZ( ceil(RR(lvl/2.0))+2)): for ep in [1 ,-1 ]: if(len(cl)>=G.index()): break # The ones about 0 are all of this form A=SL2Z([0 ,-1 ,1 ,ep*j]) # just make sure they are inequivalent try: for V in cl: if((A<>V and A*V**-1 in G) or cl.count(A)>0 ): raise StopIteration() cl.append(A) except StopIteration: pass # We now addd the rest of the "flips" of these reps. # So that we end up with a connected domain i=1 while(True): lold=len(cl) for V in cl: for A in [S,T,T**-1 ]: B=V*A try: for W in cl: if( (B*W**-1 in G) or cl.count(B)>0 ): raise StopIteration() cl.append(B) except StopIteration: pass if(len(cl)>=G.index() or lold>=len(cl)): # If we either did not addd anything or if we addded enough # we exit break # If we missed something (which is unlikely) if(len(cl)<>G.index()): print "cl=",cl raise ValueError,"Problem getting coset reps! Need %s and got %s" %(G.index(),len(cl)) return cl
def nice_coset_reps(G): r""" Compute a better/nicer list of right coset representatives [V_j] i.e. SL2Z = \cup G V_j Use this routine for known congruence subgroups. EXAMPLES:: sage: G=MySubgroup(Gamma0(5)) sage: G._get_coset_reps_from_G(Gamma0(5)) [[1 0] [0 1], [ 0 -1] [ 1 0], [ 0 -1] [ 1 1], [ 0 -1] [ 1 -1], [ 0 -1] [ 1 2], [ 0 -1] [ 1 -2]] """ cl = list() S, T = SL2Z.gens() lvl = G.generalised_level() # Start with identity rep. cl.append(SL2Z([1, 0, 0, 1])) if (not S in G): cl.append(S) # If the original group is given as a Gamma0 then # the reps are not the one we want # I.e. we like to have a fundamental domain in # -1/2 <=x <= 1/2 for Gamma0, Gamma1, Gamma for j in range(1, ZZ(ceil(RR(lvl / 2.0)) + 2)): for ep in [1, -1]: if (len(cl) >= G.index()): break # The ones about 0 are all of this form A = SL2Z([0, -1, 1, ep * j]) # just make sure they are inequivalent try: for V in cl: if ((A <> V and A * V**-1 in G) or cl.count(A) > 0): raise StopIteration() cl.append(A) except StopIteration: pass # We now addd the rest of the "flips" of these reps. # So that we end up with a connected domain i = 1 while (True): lold = len(cl) for V in cl: for A in [S, T, T**-1]: B = V * A try: for W in cl: if ((B * W**-1 in G) or cl.count(B) > 0): raise StopIteration() cl.append(B) except StopIteration: pass if (len(cl) >= G.index() or lold >= len(cl)): # If we either did not addd anything or if we addded enough # we exit break # If we missed something (which is unlikely) if (len(cl) <> G.index()): print "cl=", cl raise ValueError, "Problem getting coset reps! Need %s and got %s" % ( G.index(), len(cl)) return cl
def __init__(self, G, v=None, **kwargs): r""" G should be a subgroup of PSL(2,Z). EXAMPLE:: sage: te=TestMultiplier(Gamma0(2),weight=1/2) sage: r=InducedRepresentation(Gamma0(2),v=te) """ dim = len(list(G.coset_reps())) MultiplierSystem.__init__(self, Gamma0(1), dimension=dim) self._induced_from = G # setup the action on S and T (should be faster...) self.v = v if v != None: k = v.order() if k > 2: K = CyclotomicField(k) else: K = ZZ self.S = matrix(K, dim, dim) self.T = matrix(K, dim, dim) else: self.S = matrix(dim, dim) self.T = matrix(dim, dim) S, T = SL2Z.gens() if hasattr(G, "coset_reps"): if isinstance(G.coset_reps(), list): Vl = G.coset_reps() else: Vl = list(G.coset_reps()) elif hasattr(G, "_G"): Vl = list(G._G.coset_reps()) else: raise ValueError( "Could not get coset representatives from {0}!".format(G)) self.repsT = dict() self.repsS = dict() for i in range(dim): Vi = Vl[i] for j in range(dim): Vj = Vl[j] BS = Vi * S * Vj**-1 BT = Vi * T * Vj**-1 #print "i,j #print "ViSVj^-1=",BS #print "ViTVj^-1=",BT if BS in G: if v != None: vS = v(BS) else: vS = 1 self.S[i, j] = vS self.repsS[(i, j)] = BS if BT in G: if v != None: vT = v(BT) else: vT = 1 self.T[i, j] = vT self.repsT[(i, j)] = BT