def __init__(self,WR,weight=QQ(1)/QQ(2),use_symmetry=True,group=SL2Z,dual=False,**kwargs): r""" WR should be a Weil representation. INPUT: - weight -- weight (should be consistent with the signature of self) - use_symmetry -- if False we do not symmetrize the functions with respect to Z -- if True we need a compatible weight - 'group' -- Group to act on. """ if isinstance(WR,(Integer,int)): #self.WR=WeilRepDiscriminantForm(WR) #self.WR=WeilModule(WR) self._weil_module = WeilModule(WR) elif hasattr(WR,"signature"): self._weil_module=WR else: raise ValueError,"{0} is not a Weil module!".format(WR) self._sym_type = 0 if group.level() <>1: raise NotImplementedError,"Only Weil representations of SL2Z implemented!" self._group = MySubgroup(Gamma0(1)) self._dual = int(dual) self._sgn = (-1)**self._dual self.Qv=[] self._weight = weight self._use_symmetry = use_symmetry self._kwargs = kwargs self._sgn = (-1)**int(dual) half = QQ(1)/QQ(2) threehalf = QQ(3)/QQ(2) if use_symmetry: ## First find weight mod 2: twok= QQ(2)*QQ(weight) if not twok.is_integral(): raise ValueError,"Only integral or half-integral weights implemented!" kmod2 = QQ(twok % 4)/QQ(2) if dual: sig_mod_4 = -self._weil_module.signature() % 4 else: sig_mod_4 = self._weil_module.signature() % 4 sym_type = 0 if (kmod2,sig_mod_4) in [(half,1),(threehalf,3),(0,0),(1,2)]: sym_type = 1 elif (kmod2,sig_mod_4) in [(half,3),(threehalf,1),(0,2),(1,0)]: sym_type = -1 else: raise ValueError,"The Weil module with signature {0} is incompatible with the weight {1}!".format( self._weil_module.signature(),weight) ## Deven and Dodd contains the indices for the even and odd basis Deven=[]; Dodd=[] if sym_type==1: self._D = self._weil_module.even_submodule(indices=1) else: #sym_type==-1: self._D = self._weil_module.odd_submodule(indices=1) self._sym_type=sym_type dim = len(self._D) #Dfinish-Dstart+1 else: dim = len(self._weil_module.finite_quadratic_module().list()) self._D = range(dim) self._sym_type=0 if hasattr(self._weil_module,"finite_quadratic_module"): # for x in list(self._weil_module.finite_quadratic_module()): for x in self._weil_module.finite_quadratic_module(): self.Qv.append(self._weil_module.finite_quadratic_module().Q(x)) else: self.Qv=self._weil_module.Qv ambient_rank = self._weil_module.rank() MultiplierSystem.__init__(self,self._group,dual=dual,dimension=dim,ambient_rank=ambient_rank)
class WeilRepMultiplier(MultiplierSystem): def __init__(self,WR,weight=QQ(1)/QQ(2),use_symmetry=True,group=SL2Z,dual=False,**kwargs): r""" WR should be a Weil representation. INPUT: - weight -- weight (should be consistent with the signature of self) - use_symmetry -- if False we do not symmetrize the functions with respect to Z -- if True we need a compatible weight - 'group' -- Group to act on. """ if isinstance(WR,(Integer,int)): #self.WR=WeilRepDiscriminantForm(WR) #self.WR=WeilModule(WR) self._weil_module = WeilModule(WR) elif hasattr(WR,"signature"): self._weil_module=WR else: raise ValueError,"{0} is not a Weil module!".format(WR) self._sym_type = 0 if group.level() <>1: raise NotImplementedError,"Only Weil representations of SL2Z implemented!" self._group = MySubgroup(Gamma0(1)) self._dual = int(dual) self._sgn = (-1)**self._dual self.Qv=[] self._weight = weight self._use_symmetry = use_symmetry self._kwargs = kwargs self._sgn = (-1)**int(dual) half = QQ(1)/QQ(2) threehalf = QQ(3)/QQ(2) if use_symmetry: ## First find weight mod 2: twok= QQ(2)*QQ(weight) if not twok.is_integral(): raise ValueError,"Only integral or half-integral weights implemented!" kmod2 = QQ(twok % 4)/QQ(2) if dual: sig_mod_4 = -self._weil_module.signature() % 4 else: sig_mod_4 = self._weil_module.signature() % 4 sym_type = 0 if (kmod2,sig_mod_4) in [(half,1),(threehalf,3),(0,0),(1,2)]: sym_type = 1 elif (kmod2,sig_mod_4) in [(half,3),(threehalf,1),(0,2),(1,0)]: sym_type = -1 else: raise ValueError,"The Weil module with signature {0} is incompatible with the weight {1}!".format( self._weil_module.signature(),weight) ## Deven and Dodd contains the indices for the even and odd basis Deven=[]; Dodd=[] if sym_type==1: self._D = self._weil_module.even_submodule(indices=1) else: #sym_type==-1: self._D = self._weil_module.odd_submodule(indices=1) self._sym_type=sym_type dim = len(self._D) #Dfinish-Dstart+1 else: dim = len(self._weil_module.finite_quadratic_module().list()) self._D = range(dim) self._sym_type=0 if hasattr(self._weil_module,"finite_quadratic_module"): # for x in list(self._weil_module.finite_quadratic_module()): for x in self._weil_module.finite_quadratic_module(): self.Qv.append(self._weil_module.finite_quadratic_module().Q(x)) else: self.Qv=self._weil_module.Qv ambient_rank = self._weil_module.rank() MultiplierSystem.__init__(self,self._group,dual=dual,dimension=dim,ambient_rank=ambient_rank) def __repr__(self): s="Weil representation corresponding to "+str(self._weil_module) return s def _action(self,A): #return self._weil_module.rho(A) return self._weil_module.matrix(A) def sym_type(self): return self._sym_type def dual_multiplier(self): r""" Returns the dual multiplier of self. """ weight = QQ(2) - QQ(self._weight) dual = int(not self._is_dual) m = WeilRepMultiplier(self._weil_module,weight,use_symmetry,self._group,dual=dual,**self._kwargs) return m def D(self): r""" Returns the indices of a basis of the (symmetrized) discriminant form of self. """ return self._D @cached_method def neg_index(self,a): r""" The index of -a in self._D """ return self.weil_module()._neg_index(a) def is_consistent(self,k): r""" Return True if the Weil representation is a multiplier of weight k. """ if self._verbose>0: print "is_consistent at wr! k={0}".format(k) twok =QQ(2)*QQ(k) if not twok.is_integral(): return False if self._sym_type <>0: if self.is_dual(): sig_mod_4 = -self._weil_module.signature() % 4 else: sig_mod_4 = self._weil_module.signature() % 4 if is_odd(self._weil_module.signature()): return (twok % 4 == (self._sym_type*sig_mod_4 %4)) else: if sig_mod_4 == (1 - self._sym_type) % 4: return twok % 4 == 0 else: return twok % 4 == 2 if is_even(twok) and is_even(self._weil_module.signature()): return True if is_odd(twok) and is_odd(self._weil_module.signature()): return True return False def dimension_cusp_forms(self,k,eps=0): r""" Compute the dimension of the space of cusp forms of weight k with respect to the weil module of self if eps=1 and its dual if eps=-1 """ if eps==0: eps = self._sgn return self._weil_module.dimension_cusp_forms(k,eps) def dimension_modular_forms(self,k,eps=0): r""" Compute the dimension of the space of holomorphic modular forms of weight k with respect to the weil module of self if eps=1 and its dual if eps=-1 """ if eps==0: eps = self._sgn return self._weil_module.dimension_modular_forms(k,eps)
def __init__(self, WR, weight=QQ(1) / QQ(2), use_symmetry=True, group=SL2Z, dual=False, **kwargs): r""" WR should be a Weil representation. INPUT: - weight -- weight (should be consistent with the signature of self) - use_symmetry -- if False we do not symmetrize the functions with respect to Z -- if True we need a compatible weight - 'group' -- Group to act on. """ if isinstance(WR, (Integer, int)): #self.WR=WeilRepDiscriminantForm(WR) #self.WR=WeilModule(WR) self._weil_module = WeilModule(WR) elif hasattr(WR, "signature"): self._weil_module = WR else: raise ValueError("{0} is not a Weil module!".format(WR)) self._sym_type = 0 if group.level() != 1: raise NotImplementedError( "Only Weil representations of SL2Z implemented!") self._group = MySubgroup(Gamma0(1)) self._dual = int(dual) self._sgn = (-1)**self._dual self.Qv = [] self._weight = weight self._use_symmetry = use_symmetry self._kwargs = kwargs self._sgn = (-1)**int(dual) half = QQ(1) / QQ(2) threehalf = QQ(3) / QQ(2) if use_symmetry: ## First find weight mod 2: twok = QQ(2) * QQ(weight) if not twok.is_integral(): raise ValueError( "Only integral or half-integral weights implemented!") kmod2 = QQ(twok % 4) / QQ(2) if dual: sig_mod_4 = -self._weil_module.signature() % 4 else: sig_mod_4 = self._weil_module.signature() % 4 sym_type = 0 if (kmod2, sig_mod_4) in [(half, 1), (threehalf, 3), (0, 0), (1, 2)]: sym_type = 1 elif (kmod2, sig_mod_4) in [(half, 3), (threehalf, 1), (0, 2), (1, 0)]: sym_type = -1 else: raise ValueError( "The Weil module with signature {0} is incompatible with the weight {1}!" .format(self._weil_module.signature(), weight)) ## Deven and Dodd contains the indices for the even and odd basis Deven = [] Dodd = [] if sym_type == 1: self._D = self._weil_module.even_submodule(indices=1) else: #sym_type==-1: self._D = self._weil_module.odd_submodule(indices=1) self._sym_type = sym_type dim = len(self._D) #Dfinish-Dstart+1 else: dim = len(self._weil_module.finite_quadratic_module().list()) self._D = list(range(dim)) self._sym_type = 0 if hasattr(self._weil_module, "finite_quadratic_module"): # for x in list(self._weil_module.finite_quadratic_module()): for x in self._weil_module.finite_quadratic_module(): self.Qv.append( self._weil_module.finite_quadratic_module().Q(x)) else: self.Qv = self._weil_module.Qv ambient_rank = self._weil_module.rank() MultiplierSystem.__init__(self, self._group, dual=dual, dimension=dim, ambient_rank=ambient_rank)
class WeilRepMultiplier(MultiplierSystem): def __init__(self, WR, weight=QQ(1) / QQ(2), use_symmetry=True, group=SL2Z, dual=False, **kwargs): r""" WR should be a Weil representation. INPUT: - weight -- weight (should be consistent with the signature of self) - use_symmetry -- if False we do not symmetrize the functions with respect to Z -- if True we need a compatible weight - 'group' -- Group to act on. """ if isinstance(WR, (Integer, int)): #self.WR=WeilRepDiscriminantForm(WR) #self.WR=WeilModule(WR) self._weil_module = WeilModule(WR) elif hasattr(WR, "signature"): self._weil_module = WR else: raise ValueError("{0} is not a Weil module!".format(WR)) self._sym_type = 0 if group.level() != 1: raise NotImplementedError( "Only Weil representations of SL2Z implemented!") self._group = MySubgroup(Gamma0(1)) self._dual = int(dual) self._sgn = (-1)**self._dual self.Qv = [] self._weight = weight self._use_symmetry = use_symmetry self._kwargs = kwargs self._sgn = (-1)**int(dual) half = QQ(1) / QQ(2) threehalf = QQ(3) / QQ(2) if use_symmetry: ## First find weight mod 2: twok = QQ(2) * QQ(weight) if not twok.is_integral(): raise ValueError( "Only integral or half-integral weights implemented!") kmod2 = QQ(twok % 4) / QQ(2) if dual: sig_mod_4 = -self._weil_module.signature() % 4 else: sig_mod_4 = self._weil_module.signature() % 4 sym_type = 0 if (kmod2, sig_mod_4) in [(half, 1), (threehalf, 3), (0, 0), (1, 2)]: sym_type = 1 elif (kmod2, sig_mod_4) in [(half, 3), (threehalf, 1), (0, 2), (1, 0)]: sym_type = -1 else: raise ValueError( "The Weil module with signature {0} is incompatible with the weight {1}!" .format(self._weil_module.signature(), weight)) ## Deven and Dodd contains the indices for the even and odd basis Deven = [] Dodd = [] if sym_type == 1: self._D = self._weil_module.even_submodule(indices=1) else: #sym_type==-1: self._D = self._weil_module.odd_submodule(indices=1) self._sym_type = sym_type dim = len(self._D) #Dfinish-Dstart+1 else: dim = len(self._weil_module.finite_quadratic_module().list()) self._D = list(range(dim)) self._sym_type = 0 if hasattr(self._weil_module, "finite_quadratic_module"): # for x in list(self._weil_module.finite_quadratic_module()): for x in self._weil_module.finite_quadratic_module(): self.Qv.append( self._weil_module.finite_quadratic_module().Q(x)) else: self.Qv = self._weil_module.Qv ambient_rank = self._weil_module.rank() MultiplierSystem.__init__(self, self._group, dual=dual, dimension=dim, ambient_rank=ambient_rank) def __repr__(self): s = "Weil representation corresponding to " + str(self._weil_module) return s def _action(self, A): #return self._weil_module.rho(A) return self._weil_module.matrix(A) def sym_type(self): return self._sym_type def dual_multiplier(self): r""" Returns the dual multiplier of self. """ weight = QQ(2) - QQ(self._weight) dual = int(not self._is_dual) m = WeilRepMultiplier(self._weil_module, weight, self._use_symmetry, self._group, dual=dual, **self._kwargs) return m def D(self): r""" Returns the indices of a basis of the (symmetrized) discriminant form of self. """ return self._D @cached_method def neg_index(self, a): r""" The index of -a in self._D """ return self.weil_module()._neg_index(a) def is_consistent(self, k): r""" Return True if the Weil representation is a multiplier of weight k. """ if self._verbose > 0: print("is_consistent at wr! k={0}".format(k)) twok = QQ(2) * QQ(k) if not twok.is_integral(): return False if self._sym_type != 0: if self.is_dual(): sig_mod_4 = -self._weil_module.signature() % 4 else: sig_mod_4 = self._weil_module.signature() % 4 if is_odd(self._weil_module.signature()): return (twok % 4 == (self._sym_type * sig_mod_4 % 4)) else: if sig_mod_4 == (1 - self._sym_type) % 4: return twok % 4 == 0 else: return twok % 4 == 2 if is_even(twok) and is_even(self._weil_module.signature()): return True if is_odd(twok) and is_odd(self._weil_module.signature()): return True return False def dimension_cusp_forms(self, k, eps=0): r""" Compute the dimension of the space of cusp forms of weight k with respect to the weil module of self if eps=1 and its dual if eps=-1 """ if eps == 0: eps = self._sgn return self._weil_module.dimension_cusp_forms(k, eps) def dimension_modular_forms(self, k, eps=0): r""" Compute the dimension of the space of holomorphic modular forms of weight k with respect to the weil module of self if eps=1 and its dual if eps=-1 """ if eps == 0: eps = self._sgn return self._weil_module.dimension_modular_forms(k, eps)
def __init__(self,WR,weight=QQ(1)/QQ(2),use_symmetry=True,group=SL2Z,dual=False,**kwargs): r""" WR should be a Weil representation. INPUT: - weight -- weight (should be consistent with the signature of self) - use_symmetry -- if False we do not symmetrize the functions with respect to Z -- if True we need a compatible weight - 'group' -- Group to act on. """ if isinstance(WR,(Integer,int)): #self.WR=WeilRepDiscriminantForm(WR) #self.WR=WeilModule(WR) self._weil_module = WeilModule(WR) elif hasattr(WR,"signature"): self._weil_module=WR else: raise ValueError,"{0} is not a Weil module!".format(WR) self._sym_type = 0 if group <>SL2Z: raise NotImplementedError,"Only Weil representations of SL2Z implemented!" self._group = MySubgroup(1) self._dual = int(dual) self._sgn = (-1)**self._dual self.Qv=[] self._weight = weight if use_symmetry: t=2*weight try: Integer(t) except: raise ValueError, "Need half-integral value of weight! Got k=%s" %(weight) ti=Integer(float(t)) if (ti % 4) == 1: if (self._sgn*self._weil_module.signature()) % 4 == 1: sym_type = 1 else: sym_type= -1 else: if (self._sgn*self._weil_module.signature()) % 4 == 3: sym_type = 1 else: sym_type= -1 N = QQ(self._weil_module.rank())/QQ(2) ## Deven and Dodd contains the indices for the even and odd basis Deven=[]; Dodd=[] if sym_type==1: self._D = self._weil_module.even_submodule(indices=1) else: #sym_type==-1: self._D = self._weil_module.odd_submodule(indices=1) self._sym_type=sym_type dim = len(self._D) #Dfinish-Dstart+1 else: dim = len(self._weil_module.D) if hasattr(self._weil_module,"finite_quadratic_module"): for x in self._weil_module.finite_quadratic_module().list(): self.Qv.append(self._weil_module.finite_quadratic_module().Q(x)) else: self.Qv=self._weil_module.Qv ambient_rank = self._weil_module.rank() MultiplierSystem.__init__(self,self._group,dimension=dim,ambient_rank=ambient_rank)
class WeilRepMultiplier(MultiplierSystem): def __init__(self,WR,weight=QQ(1)/QQ(2),use_symmetry=True,group=SL2Z,dual=False,**kwargs): r""" WR should be a Weil representation. INPUT: - weight -- weight (should be consistent with the signature of self) - use_symmetry -- if False we do not symmetrize the functions with respect to Z -- if True we need a compatible weight - 'group' -- Group to act on. """ if isinstance(WR,(Integer,int)): #self.WR=WeilRepDiscriminantForm(WR) #self.WR=WeilModule(WR) self._weil_module = WeilModule(WR) elif hasattr(WR,"signature"): self._weil_module=WR else: raise ValueError,"{0} is not a Weil module!".format(WR) self._sym_type = 0 if group <>SL2Z: raise NotImplementedError,"Only Weil representations of SL2Z implemented!" self._group = MySubgroup(1) self._dual = int(dual) self._sgn = (-1)**self._dual self.Qv=[] self._weight = weight if use_symmetry: t=2*weight try: Integer(t) except: raise ValueError, "Need half-integral value of weight! Got k=%s" %(weight) ti=Integer(float(t)) if (ti % 4) == 1: if (self._sgn*self._weil_module.signature()) % 4 == 1: sym_type = 1 else: sym_type= -1 else: if (self._sgn*self._weil_module.signature()) % 4 == 3: sym_type = 1 else: sym_type= -1 N = QQ(self._weil_module.rank())/QQ(2) ## Deven and Dodd contains the indices for the even and odd basis Deven=[]; Dodd=[] if sym_type==1: self._D = self._weil_module.even_submodule(indices=1) else: #sym_type==-1: self._D = self._weil_module.odd_submodule(indices=1) self._sym_type=sym_type dim = len(self._D) #Dfinish-Dstart+1 else: dim = len(self._weil_module.D) if hasattr(self._weil_module,"finite_quadratic_module"): for x in self._weil_module.finite_quadratic_module().list(): self.Qv.append(self._weil_module.finite_quadratic_module().Q(x)) else: self.Qv=self._weil_module.Qv ambient_rank = self._weil_module.rank() MultiplierSystem.__init__(self,self._group,dimension=dim,ambient_rank=ambient_rank) def __repr__(self): s="Weil representation corresponding to "+str(self._weil_module) return s def _action(self,A): #return self._weil_module.rho(A) return self._weil_module.matrix(A) def D(self): r""" Returns the indices of a basis of the (symmetrized) discriminant form of self. """ return self._D @cached_method def neg_index(self,a): r""" The index of -a in self._D """ return self.weil_module()._neg_index(a) def is_consistent(self,k): r""" Return True if the Weil representation is a multiplier of weight k. """ if self._verbose>0: print "is_consistent at wr! k={0}".format(k) twok = 2*k if not twok.is_integral(): return False if self._sym_type <>0: if is_odd(self._weil_module.signature()): return (twok % 4 == (self._sym_type*self._weil_module.signature()) % 4) else: if self._weil_module.signature() % 4 == (1 - self._sym_type) % 4: return twok % 4 == 0 else: return twok % 4 == 1 if is_even(twok) and is_even(self._weil_module.signature()): return True if is_odd(twok) and is_odd(self._weil_module.signature()): return True return False def dimension_cusp_forms(self,k,eps=0): r""" Compute the dimension of the space of cusp forms of weight k with respect to the weil module of self if eps=1 and its dual if eps=-1 """ if eps==0: eps = self._sgn return self._weil_module.dimension_cusp_forms(k,eps) def dimension_modular_forms(self,k,eps=0): r""" Compute the dimension of the space of holomorphic modular forms of weight k with respect to the weil module of self if eps=1 and its dual if eps=-1 """ if eps==0: eps = self._sgn return self._weil_module.dimension_modular_forms(k,eps)