Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
    def __init__(self,G,k=QQ(1)/QQ(2),number=0,ch=None,dual=False,version=1,dimension=1,**kwargs):
        r"""
        Initialize the Eta multiplier system: $\nu_{\eta}^{2(k+r)}$.
        INPUT:

        - G -- Group
        - ch -- character
        - dual -- if we have the dual (in this case conjugate)
        - weight -- Weight (recall that eta has weight 1/2 and eta**2k has weight k. If weight<>k we adjust the power accordingly.
        - number -- we consider eta^power (here power should be an integer so as not to change the weight...)
                
        """
        self._weight=QQ(k)
        if floor(self._weight-QQ(1)/QQ(2))==ceil(self._weight-QQ(1)/QQ(2)):
            self._half_integral_weight=1
        else:
            self._half_integral_weight=0
        MultiplierSystem.__init__(self,G,character=ch,dual=dual,dimension=dimension)
        number = number % 12
        if not is_even(number):
            raise ValueError,"Need to have v_eta^(2(k+r)) with r even!"
        self._pow=QQ((self._weight+number)) ## k+r
        self._k_den=self._pow.denominator()
        self._k_num=self._pow.numerator()
        self._K = CyclotomicField(12*self._k_den)
        self._z = self._K.gen()**self._k_num
        self._i = CyclotomicField(4).gen()
        self._fak = CyclotomicField(2*self._k_den).gen()**-self._k_num
        self._version = version
        
        self.is_consistent(k) # test consistency
Пример #4
0
def _dimension_Gamma0_3_psi_3(wt):
    r"""
    Return the dimensions of subspaces of Siegel modular forms $Gamma0(3)$
    with character $\psi_3$.

    OUTPUT
        ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting")

    REMARK
        Not completely implemented
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    B = 1 / (1 - x**1) / (1 - x**3) / (1 - x**4) / (1 - x**3)
    H_all_odd = B
    H_all_even = B * x**14
    # H_cusp  = ??
    # H_Kl   = ??
    # H_MS = ??
    if is_even(wt):
        a = H_all_even[wt]
        return (a, tbi, tbi, tbi, tbi)
    else:
        a = H_all_odd[wt]
        return (a, tbi, tbi, 0, tbi)
Пример #5
0
def _dimension_Sp6Z(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$.

    OUTPUT
    ("Total", "Miyawaki-Type-1", "Miyawaki-Type-2 (conjectured)", "Interesting")
    Remember, Miywaki type 2 is ONLY CONJECTURED!!
    """
    if not is_even(wt):
        return (0, 0, 0, 0)
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    R = PowerSeriesRing(ZZ, default_prec=2 * wt - 1, names=('y', ))
    (y, ) = R._first_ngens(1)
    H_all = 1 / (
        (1 - x**4) * (1 - x**12)**2 * (1 - x**14) * (1 - x**18) * (1 - x**20) *
        (1 - x**30)) * (1 + x**6 + x**10 + x**12 + 3 * x**16 + 2 * x**18 +
                        2 * x**20 + 5 * x**22 + 4 * x**24 + 5 * x**26 +
                        7 * x**28 + 6 * x**30 + 9 * x**32 + 10 * x**34 +
                        10 * x**36 + 12 * x**38 + 14 * x**40 + 15 * x**42 +
                        16 * x**44 + 18 * x**46 + 18 * x**48 + 19 * x**50 +
                        21 * x**52 + 19 * x**54 + 21 * x**56 + 21 * x**58 +
                        19 * x**60 + 21 * x**62 + 19 * x**64 + 18 * x**66 +
                        18 * x**68 + 16 * x**70 + 15 * x**72 + 14 * x**74 +
                        12 * x**76 + 10 * x**78 + 10 * x**80 + 9 * x**82 +
                        6 * x**84 + 7 * x**86 + 5 * x**88 + 4 * x**90 +
                        5 * x**92 + 2 * x**94 + 2 * x**96 + 3 * x**98 +
                        x**102 + x**104 + x**108 + x**114)
    H_noncusp = 1 / (1 - x**4) / (1 - x**6) / (1 - x**10) / (1 - x**12)
    H_E = y**12 / (1 - y**4) / (1 - y**6)
    H_Miyawaki1 = H_E[wt] * H_E[2 * wt - 4]
    H_Miyawaki2 = H_E[wt - 2] * H_E[2 * wt - 2]
    a, b, c, d = H_all[wt], H_noncusp[wt], H_Miyawaki1, H_Miyawaki2
    return (a, c, d, a - b - c - d)
Пример #6
0
    def _action0(self,a,b,c,d):
        r"""
        Recall that the formula is valid only for c>0. Otherwise we have to use:
        v(A)=v((-I)(-A))=sigma(-I,-A)v(-I)v(-A).
        Then note that by the formula for sigma we have:
        sigma(-I,SL2Z[a, b, c, d])=-1 if (c=0 and d<0) or c>0 and other wise it is =1.
        """

        fak=1
        if c<0:
            a=-a; b=-b; c=-c;  d=-d; fak=-self._fak
        if c==0:
            if a>0:
                res = self._z**b
            else:
                res = self._fak*self._z**b
        else:
            if is_even(c):
                arg = (a+d)*c-b*d*(c*c-1)+3*d-3-3*c*d
                v=kronecker(c,d)
            else:
                arg = (a+d)*c-b*d*(c*c-1)-3*c
                v=kronecker(d,c)
            if not self._half_integral_weight:
                # recall that we can use eta for any real weight
                v=v**(2*self._weight)
            arg=arg*(self._k_num)
            res = v*fak*self._z**arg
            if self._character:
                res = res * self._character(d)
        if self._is_dual:
            res=res**-1
        return res
Пример #7
0
    def _action0(self,a,b,c,d):
        r"""
        Recall that the formula is valid only for c>0. Otherwise we have to use:
        v(A)=v((-I)(-A))=sigma(-I,-A)v(-I)v(-A).
        Then note that by the formula for sigma we have:
        sigma(-I,SL2Z[a, b, c, d])=-1 if (c=0 and d<0) or c>0 and other wise it is =1.
        """

        fak=1
        if c<0:
            a=-a; b=-b; c=-c;  d=-d; fak=-self._fak
        if c==0:
            if a>0:
                res = self._z**b
            else:
                res = self._fak*self._z**b
        else:
            if is_even(c):
                arg = (a+d)*c-b*d*(c*c-1)+3*d-3-3*c*d
                v=kronecker(c,d)
            else:
                arg = (a+d)*c-b*d*(c*c-1)-3*c
                v=kronecker(d,c)
            if not self._half_integral_weight:
                # recall that we can use eta for any real weight
                v=v**(2*self._weight)
            arg=arg*(self._k_num)
            res = v*fak*self._z**arg
            if self._character:
                res = res * self._character(d)
        if self._is_dual:
            res=res**-1
        return res
Пример #8
0
def __dimension_Sp6Z(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Sp(6,Z)$.

    OUTPUT
    ("Total", "Miyawaki-Type-1", "Miyawaki-Type-2 (conjectured)", "Interesting")
    Remember, Miywaki type 2 is ONLY CONJECTURED!!
    """
    if not is_even(wt):
        return (0, 0, 0, 0)
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    S = PowerSeriesRing(ZZ, default_prec=max(2 * wt - 1,1), names=('y',))
    (y,) = S._first_ngens(1)
    H_all = 1 / ((1 - x ** 4) * (1 - x ** 12) ** 2 * (1 - x ** 14) * (1 - x ** 18) *
                (1 - x ** 20) * (1 - x ** 30)) * (
                    1 + x ** 6 + x ** 10 + x ** 12 + 3 * x ** 16 + 2 * x ** 18 + 2 * x ** 20 +
                    5 * x ** 22 + 4 * x ** 24 + 5 * x ** 26 + 7 * x ** 28 + 6 * x ** 30 + 9 * x ** 32 +
                    10 * x ** 34 + 10 * x ** 36 + 12 * x ** 38 + 14 * x ** 40 + 15 * x ** 42 + 16 * x ** 44 +
                    18 * x ** 46 + 18 * x ** 48 + 19 * x ** 50 + 21 * x ** 52 + 19 * x ** 54 + 21 * x ** 56 +
                    21 * x ** 58 + 19 * x ** 60 + 21 * x ** 62 + 19 * x ** 64 + 18 * x ** 66 + 18 * x ** 68 +
                    16 * x ** 70 + 15 * x ** 72 + 14 * x ** 74 + 12 * x ** 76 + 10 * x ** 78 + 10 * x ** 80 +
                    9 * x ** 82 + 6 * x ** 84 + 7 * x ** 86 + 5 * x ** 88 + 4 * x ** 90 + 5 * x ** 92 +
                    2 * x ** 94 + 2 * x ** 96 + 3 * x ** 98 + x ** 102 + x ** 104 + x ** 108 + x ** 114)

    H_noncusp = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12)
    H_E = y ** 12 / (1 - y ** 4) / (1 - y ** 6)
    H_Miyawaki1 = H_E[wt] * H_E[2 * wt - 4]
    H_Miyawaki2 = H_E[wt - 2] * H_E[2 * wt - 2]
    a, b, c, d = H_all[wt], H_noncusp[wt], H_Miyawaki1, H_Miyawaki2
    return (a, c, d, a - b - c - d)
Пример #9
0
 def is_consistent(self,k):
     r"""
     Checks that v(-I)=(-1)^k,
     """
     Z=SL2Z([-1,0,0,-1])
     zi=CyclotomicField(4).gen()
     v = self._action(Z)
     if self._verbose>0: 
         print "test consistency for k=",k
         print "v(Z)=",v
     if self._dim==1:
         if isinstance(k,Integer) or k.is_integral():
             if is_even(k):
                 v1 = ZZ(1)
             else:
                 v1 = ZZ(-1)
         elif isinstance(k,Rational) and (k.denominator()==2 or k==0):
             v1 = zi**(-QQ(2*k))
             if self._verbose>0: 
                  print "I**(-2k)=",v1
         else:
             raise ValueError,"Only integral and half-integral weight is currently supported! Got weight:{0} of type:{1}".format(k,type(k))
     else:
         raise NotImplemented,"Override this function for vector-valued multipliers!"
     return v1==v
Пример #10
0
def _dimension_Sp4Z(wt_range):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$.

    OUTPUT
        ("Total", "Eisenstein", "Klingen", "Maass", "Interesting")
    """
    headers = ['Total', 'Eisenstein', 'Klingen', 'Maass', 'Interesting']

    R = PowerSeriesRing(ZZ, default_prec = wt_range[-1] + 1, names = ('x',))
    (x,) = R._first_ngens(1)
    H_all = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12)
    H_Kl = x ** 12 / (1 - x ** 4) / (1 - x ** 6)
    H_MS = (x ** 10 + x ** 12) / (1 - x ** 4) / (1 - x ** 6)

    dct = dict((k,
                 { 'Total': H_all[k], 
                   'Eisenstein': 1 if k >= 4 else 0,
                   'Klingen': H_Kl[k],
                   'Maass': H_MS[k],
                   'Interesting': H_all[k]-(1 if k >= 4 else 0)-H_Kl[k]-H_MS[k]
                   }
                 if is_even(k) else
                 { 'Total': H_all[k-35], 
                   'Eisenstein': 0,
                   'Klingen': 0,
                   'Maass': 0,
                   'Interesting': H_all[k-35]
                   }
                 ) for k in wt_range)

    return headers, dct
Пример #11
0
def _dimension_Sp4Z(wt_range):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$.

    OUTPUT
        ("Total", "Eisenstein", "Klingen", "Maass", "Interesting")
    """
    headers = ['Total', 'Eisenstein', 'Klingen', 'Maass', 'Interesting']

    R = PowerSeriesRing(ZZ, default_prec=wt_range[-1] + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    H_all = 1 / (1 - x**4) / (1 - x**6) / (1 - x**10) / (1 - x**12)
    H_Kl = x**12 / (1 - x**4) / (1 - x**6)
    H_MS = (x**10 + x**12) / (1 - x**4) / (1 - x**6)

    dct = dict(
        (k, {
            'Total': H_all[k],
            'Eisenstein': 1 if k >= 4 else 0,
            'Klingen': H_Kl[k],
            'Maass': H_MS[k],
            'Interesting': H_all[k] - (1 if k >= 4 else 0) - H_Kl[k] - H_MS[k]
        } if is_even(k) else {
            'Total': H_all[k - 35],
            'Eisenstein': 0,
            'Klingen': 0,
            'Maass': 0,
            'Interesting': H_all[k - 35]
        }) for k in wt_range)

    return headers, dct
Пример #12
0
 def is_consistent(self, k):
     r"""
     Checks that v(-I)=(-1)^k,
     """
     Z = SL2Z([-1, 0, 0, -1])
     zi = CyclotomicField(4).gen()
     v = self._action(Z)
     if self._verbose > 0:
         print("test consistency for k={0}".format(k))
         print("v(Z)={0}".format(v))
     if self._dim == 1:
         if isinstance(k, Integer) or k.is_integral():
             if is_even(k):
                 v1 = ZZ(1)
             else:
                 v1 = ZZ(-1)
         elif isinstance(k, Rational) and (k.denominator() == 2 or k == 0):
             v1 = zi**(-QQ(2 * k))
             if self._verbose > 0:
                 print("I**(-2k)={0}".format(v1))
         else:
             raise ValueError(
                 "Only integral and half-integral weight is currently supported! Got weight:{0} of type:{1}"
                 .format(k, type(k)))
     else:
         raise NotImplementedError(
             "Override this function for vector-valued multipliers!")
     return v1 == v
Пример #13
0
    def __init__(self,G,k=QQ(1)/QQ(2),number=0,ch=None,dual=False,version=1,dimension=1,**kwargs):
        r"""
        Initialize the Eta multiplier system: $\nu_{\eta}^{2(k+r)}$.
        INPUT:

        - G -- Group
        - ch -- character
        - dual -- if we have the dual (in this case conjugate)
        - weight -- Weight (recall that eta has weight 1/2 and eta**2k has weight k. If weight<>k we adjust the power accordingly.
        - number -- we consider eta^power (here power should be an integer so as not to change the weight...)
                
        """
        self._weight=QQ(k)
        if floor(self._weight-QQ(1)/QQ(2))==ceil(self._weight-QQ(1)/QQ(2)):
            self._half_integral_weight=1
        else:
            self._half_integral_weight=0
        MultiplierSystem.__init__(self,G,character=ch,dual=dual,dimension=dimension)
        number = number % 12
        if not is_even(number):
            raise ValueError,"Need to have v_eta^(2(k+r)) with r even!"
        self._pow=QQ((self._weight+number)) ## k+r
        self._k_den=self._pow.denominator()
        self._k_num=self._pow.numerator()
        self._K = CyclotomicField(12*self._k_den)
        self._z = self._K.gen()**self._k_num
        self._i = CyclotomicField(4).gen()
        self._fak = CyclotomicField(2*self._k_den).gen()**-self._k_num
        self._version = version
        
        self.is_consistent(k) # test consistency
Пример #14
0
def _dimension_Gamma0_3_psi_3(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms$Gamma0(3)$
    with character $\psi_3$.

    OUTPUT
        ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting")

    REMARK
        Not completely implemented
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    B = 1 / (1 - x ** 1) / (1 - x ** 3) / (1 - x ** 4) / (1 - x ** 3)
    H_all_odd = B
    H_all_even = B * x ** 14
    # H_cusp  = ??
    # H_Kl   = ??
    # H_MS = ??
    if is_even(wt):
        a = H_all_even[wt]
        return (a, tbi, tbi, tbi, tbi)
    else:
        a = H_all_odd[wt]
        return (a, tbi, tbi, 0, tbi)
Пример #15
0
    def sparse(ls, is_max_plus):
        """
        Parse the result from
        'compute_ext_rays_polar' in TPLib into proper lambda format

        Examples:

        sage: var('x,y,z,d')
        (x, y, z, d)

        #TODO: (may be bug) any diff btw is_max_plus=True vs False ???

        sage: IeqMPP.sparse([x-oo,y+0,z-oo,SR(0)-oo,x-6,y-oo,z-oo,SR(0)-oo], is_max_plus=True)
        ('lambda x,y: -x + y + 6 >= 0', 'y >= x - 6')

        sage: IeqMPP.sparse([x-oo,y-oo,z-oo,d+9,x-6,y-oo,z-oo,d+20], is_max_plus=True)
        ('lambda d,x: d + 9 - max(x - 6,d + 20) >= 0', 'If(x - 6 >= d + 20, d + 9 >= x - 6, d + 9 >= d + 20)')

        sage: IeqMPP.sparse([x-1,SR(0)-oo,x-oo,SR(0)+0], is_max_plus=True)
        ('lambda x: x - 1 >= 0', 'x - 1 >= 0')

        sage: IeqMPP.sparse([x+0,SR(0)-oo,x-oo,SR(0)+1], is_max_plus=True)
        ('lambda x: x - 1 >= 0', 'x >= 1')

        sage: IeqMPP.sparse([x-oo,y+0,z-oo,SR(0)-oo,x-6,y-oo,z-oo,SR(0)-oo], is_max_plus=False)
        ('lambda x,y: -x + y + 6 >= 0', 'y >= x - 6')

        sage: IeqMPP.sparse([x-oo,y-oo,z-oo,d+9,x-6,y-oo,z-oo,d+20], is_max_plus=False)
        ('lambda d,x: d + 9 - min(x - 6,d + 20) >= 0', 'If(x - 6 <= d + 20, d + 9 >= x - 6, d + 9 >= d + 20)')

        sage: IeqMPP.sparse([x-1,SR(0)-oo,x-oo,SR(0)+0], is_max_plus=False)
        ('lambda x: x - 1 >= 0', 'x - 1 >= 0')

        sage: IeqMPP.sparse([x+0,SR(0)-oo,x-oo,SR(0)+1], is_max_plus=False)
        ('lambda x: x - 1 >= 0', 'x >= 1')

        """

        if __debug__:
            assert is_list(ls) and is_even(len(ls)), ls
            assert is_bool(is_max_plus), is_max_plus

        mp = len(ls) / 2

        lhs = [l for l in ls[:mp] if not is_sage_inf(l)]
        rhs = [l for l in ls[mp:] if not is_sage_inf(l)]

        # if lhs contains the same exact elems as rhs then remove
        # b/c it's a tautology, e.g. max(x,y) >= max(y,x)
        if set(lhs) == set(rhs):
            return None

        # if one of these is empty, i.e. contain only +/-Inf originally
        if not lhs or not rhs:
            return None

        return IeqMPP.gen_lambda_disj(lhs, rhs, is_max_plus, is_eq=False)
Пример #16
0
    def sparse(ls, is_max_plus):
        """
        Parse the result from
        'compute_ext_rays_polar' in TPLib into proper lambda format

        Examples:

        sage: var('x,y,z,d')
        (x, y, z, d)

        sage: IeqMPP.sparse([-oo,0,-oo,-oo,-6,-oo,-oo,-oo],[x,y,z,SR(0)], IeqMPP.opt_max_plus)
        ('lambda x,y: -x + y + 6 >= 0', 'y >= x - 6')

        sage: IeqMPP.sparse([-oo,-oo,-oo,9,-6,-oo,-oo,20],[x,y,z,d], IeqMPP.opt_max_plus)
        ('lambda d,x: d + 9 - max(x - 6,d + 20) >= 0', 'If(x - 6 >= d + 20, d + 9 >= x - 6, d + 9 >= d + 20)')

        sage: IeqMPP.sparse([-1,-oo,-oo,0],[x,SR(0)],IeqMPP.opt_max_plus)
        ('lambda x: x - 1 >= 0', 'x - 1 >= 0')

        sage: IeqMPP.sparse([0,-oo,-oo,1],[x,SR(0)],IeqMPP.opt_max_plus)
        ('lambda x: x - 1 >= 0', 'x >= 1')


        sage: IeqMPP.sparse([-oo,0,-oo,-oo,-6,-oo,-oo,-oo],[x,y,z,SR(0)], IeqMPP.opt_min_plus)
        ('lambda x,y: -x + y + 6 >= 0', 'y >= x - 6')

        sage: IeqMPP.sparse([-oo,-oo,-oo,9,-6,-oo,-oo,20],[x,y,z,d], IeqMPP.opt_min_plus)
        ('lambda d,x: d + 9 - min(x - 6,d + 20) >= 0', 'If(x - 6 <= d + 20, d + 9 >= x - 6, d + 9 >= d + 20)')

        sage: IeqMPP.sparse([-1,-oo,-oo,0],[x,SR(0)],IeqMPP.opt_min_plus)
        ('lambda x: x - 1 >= 0', 'x - 1 >= 0')

        sage: IeqMPP.sparse([0,-oo,-oo,1],[x,SR(0)],IeqMPP.opt_min_plus)
        ('lambda x: x - 1 >= 0', 'x >= 1')

        """

        if __debug__:
            assert is_list(ls) and is_even(len(ls)), ls
            assert is_bool(is_max_plus), is_max_plus

        mp = len(ls)/2
        lhs = [l for l in ls[:mp] if not l.is_infinity()] 
        rhs = [l for l in ls[mp:] if not l.is_infinity()]

        #if lhs contains the same exact elems as rhs then remove
        #b/c it's a tautology, e.g. max(x,y) >= max(y,x)
        if set(lhs) == set(rhs): 
            return None

        #if one of these is empty, i.e. contain only +/-Inf originally
        if not lhs or not rhs: 
            return None
        
        
        return IeqMPP.gen_lambda_disj(lhs, rhs, is_max_plus,is_eq=False)
Пример #17
0
    def sparse(ls, is_max_plus):
        """
        Parse the result from
        'compute_ext_rays_polar' in TPLib into proper lambda format

        Examples:

        sage: var('x,y,z,d')
        (x, y, z, d)

        sage: IeqMPP.sparse([-oo,0,-oo,-oo,-6,-oo,-oo,-oo],[x,y,z,SR(0)], IeqMPP.opt_max_plus)
        ('lambda x,y: -x + y + 6 >= 0', 'y >= x - 6')

        sage: IeqMPP.sparse([-oo,-oo,-oo,9,-6,-oo,-oo,20],[x,y,z,d], IeqMPP.opt_max_plus)
        ('lambda d,x: d + 9 - max(x - 6,d + 20) >= 0', 'If(x - 6 >= d + 20, d + 9 >= x - 6, d + 9 >= d + 20)')

        sage: IeqMPP.sparse([-1,-oo,-oo,0],[x,SR(0)],IeqMPP.opt_max_plus)
        ('lambda x: x - 1 >= 0', 'x - 1 >= 0')

        sage: IeqMPP.sparse([0,-oo,-oo,1],[x,SR(0)],IeqMPP.opt_max_plus)
        ('lambda x: x - 1 >= 0', 'x >= 1')


        sage: IeqMPP.sparse([-oo,0,-oo,-oo,-6,-oo,-oo,-oo],[x,y,z,SR(0)], IeqMPP.opt_min_plus)
        ('lambda x,y: -x + y + 6 >= 0', 'y >= x - 6')

        sage: IeqMPP.sparse([-oo,-oo,-oo,9,-6,-oo,-oo,20],[x,y,z,d], IeqMPP.opt_min_plus)
        ('lambda d,x: d + 9 - min(x - 6,d + 20) >= 0', 'If(x - 6 <= d + 20, d + 9 >= x - 6, d + 9 >= d + 20)')

        sage: IeqMPP.sparse([-1,-oo,-oo,0],[x,SR(0)],IeqMPP.opt_min_plus)
        ('lambda x: x - 1 >= 0', 'x - 1 >= 0')

        sage: IeqMPP.sparse([0,-oo,-oo,1],[x,SR(0)],IeqMPP.opt_min_plus)
        ('lambda x: x - 1 >= 0', 'x >= 1')

        """

        if __debug__:
            assert is_list(ls) and is_even(len(ls)), ls
            assert is_bool(is_max_plus), is_max_plus

        mp = len(ls) / 2
        lhs = [l for l in ls[:mp] if not l.is_infinity()]
        rhs = [l for l in ls[mp:] if not l.is_infinity()]

        #if lhs contains the same exact elems as rhs then remove
        #b/c it's a tautology, e.g. max(x,y) >= max(y,x)
        if set(lhs) == set(rhs):
            return None

        #if one of these is empty, i.e. contain only +/-Inf originally
        if not lhs or not rhs:
            return None

        return IeqMPP.gen_lambda_disj(lhs, rhs, is_max_plus, is_eq=False)
Пример #18
0
def _dimension_Sp4Z(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$.

    OUTPUT
        ("Total", "Eisenstein", "Klingen", "Maass", "Interesting")
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    H_all = 1 / (1 - x**4) / (1 - x**6) / (1 - x**10) / (1 - x**12)
    H_Kl = x**12 / (1 - x**4) / (1 - x**6)
    H_MS = (x**10 + x**12) / (1 - x**4) / (1 - x**6)
    if is_even(wt):
        a, b, c, d = H_all[wt], 1 if wt >= 4 else 0, H_Kl[wt], H_MS[wt]
        return (a, b, c, d, a - b - c - d)
    else:
        a = H_all[wt - 35]
        return (a, 0, 0, 0, a)
Пример #19
0
def _dimension_Sp4Z(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$.

    OUTPUT
        ("Total", "Eisenstein", "Klingen", "Maass", "Interesting")
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    H_all = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12)
    H_Kl = x ** 12 / (1 - x ** 4) / (1 - x ** 6)
    H_MS = (x ** 10 + x ** 12) / (1 - x ** 4) / (1 - x ** 6)
    if is_even(wt):
        a, b, c, d = H_all[wt], 1 if wt >= 4 else 0, H_Kl[wt], H_MS[wt]
        return (a, b, c, d, a - b - c - d)
    else:
        a = H_all[wt - 35]
        return (a, 0, 0, 0, a)
Пример #20
0
def _dimension_Gamma0_4_psi_4(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms
    on $Gamma_0(4)$
    with character $\psi_4$.

    OUTPUT
        ("Total")

    REMARK
        The formula for odd weights is unknown or not obvious from the paper.
    """
    R = PowerSeriesRing(ZZ, default_prec = wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    H_all_even = (x ** 12 + x ** 14) / (1 - x ** 2) ** 3 / (1 - x ** 6)
    if is_even(wt):
        return (H_all_even[wt],)
    else:
        raise NotImplementedError('Dimensions of $M_{k}(\Gamma_0(4), \psi_4)$ for odd $k$ not implemented')
Пример #21
0
def _dimension_Gamma0_3_psi_3(wt):
    """
    Return the dimensions of the space of Siegel modular forms
    on $Gamma_0(3)$ with character $\psi_3$.

    OUTPUT
        ("Total")

    REMARK
        Not completely implemented
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    B = 1 / (1 - x**1) / (1 - x**3) / (1 - x**4) / (1 - x**3)
    H_all_odd = B
    H_all_even = B * x**14
    if is_even(wt):
        return (H_all_even[wt], )
    else:
        return (H_all_odd[wt], )
Пример #22
0
def _dimension_Sp4Z_2(wt):
    """
    Return the dimensions of subspaces of vector-valued Siegel modular forms on $Sp(4,Z)$
    of weight integral,2.

    OUTPUT
        ("Total", "Non-cusp", "Cusp")

    REMARK
        Satoh's paper does not have a description of the cusp forms.
    """
    if not is_even(wt):
        return (uk, uk, uk)
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    H = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12)
    V = 1 / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12)
    # W = 1 / (1 - x ** 10) / (1 - x ** 12)
    a = H[wt - 10] + H[wt - 14] + H[wt - 16] + V[wt - 16] + V[wt - 18] + V[wt - 22]
    return (a, uk, uk)
Пример #23
0
def _dimension_Gamma0_3_psi_3(wt):
    """
    Return the dimensions of the space of Siegel modular forms
    on $Gamma_0(3)$ with character $\psi_3$.

    OUTPUT
        ("Total")

    REMARK
        Not completely implemented
    """
    R = PowerSeriesRing(ZZ, default_prec = wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    B = 1 / (1 - x ** 1) / (1 - x ** 3) / (1 - x ** 4) / (1 - x ** 3)
    H_all_odd = B
    H_all_even = B * x ** 14
    if is_even(wt):
        return (H_all_even[wt],)
    else:
        return (H_all_odd[wt],)
Пример #24
0
def _dimension_Gamma0_4_psi_4(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms
    on $Gamma_0(4)$
    with character $\psi_4$.

    OUTPUT
        ("Total")

    REMARK
        The formula for odd weights is unknown or not obvious from the paper.
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    H_all_even = (x**12 + x**14) / (1 - x**2)**3 / (1 - x**6)
    if is_even(wt):
        return (H_all_even[wt], )
    else:
        raise NotImplementedError(
            'Dimensions of $M_{k}(\Gamma_0(4), \psi_4)$ for odd $k$ not implemented'
        )
Пример #25
0
    def dirichlet_group(self, prime_bound=10000):
        f = self.conductor()
        if f == 1:  # To make the trivial case work correctly
            return [1]
        if euler_phi(f) > dir_group_size_bound:
            return []
        # Can do quadratic fields directly
        if self.degree() == 2:
            if is_odd(f):
                return [1, f - 1]
            f1 = f / 4
            if is_odd(f1):
                return [1, f - 1]
            # we now want f with all powers of 2 removed
            f1 = f1 / 2
            if is_even(f1):
                raise Exception('Invalid conductor')
            if (self.disc() / 8) % 4 == 3:
                return [1, 4 * f1 - 1]
            # Finally we want congruent to 5 mod 8 and -1 mod f1
            if (f1 % 4) == 3:
                return [1, 2 * f1 - 1]
            return [1, 6 * f1 - 1]

        from dirichlet_conrey import DirichletGroup_conrey
        G = DirichletGroup_conrey(f)
        K = self.K()
        S = Set(G[1].kernel())  # trivial character, kernel is whole group

        for P in K.primes_of_bounded_norm_iter(ZZ(prime_bound)):
            a = P.norm() % f
            if gcd(a, f) > 1:
                continue
            S = S.intersection(Set(G[a].kernel()))
            if len(S) == self.degree():
                return list(S)

        raise Exception(
            'Failure in dirichlet group for K=%s using prime bound %s' %
            (K, prime_bound))
Пример #26
0
def _dimension_Gamma0_4_psi_4(wt):
    r"""
    Return the dimensions of subspaces of Siegel modular forms $Gamma0(4)$
    with character $\psi_4$.

    OUTPUT
        ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting")

    REMARK
        The formula for odd weights is unknown or not obvious from the paper.
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    H_all_even = (x**12 + x**14) / (1 - x**2)**3 / (1 - x**6)
    # H_cusp  = ??
    # H_Kl   = ??
    # H_MS = ??
    if is_even(wt):
        a = H_all_even[wt]
        return (a, tbi, tbi, tbi, tbi)
    else:
        return (uk, uk, uk, uk, uk)
Пример #27
0
def _dimension_Gamma0_4(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$.

    OUTPUT
        ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting")

    REMARK
        Not completely implemented
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    H_all = (1 + x**4)(1 + x**11) / (1 - x**2)**3 / (1 - x**6)
    # H_cusp  = ??
    # H_Kl   = ??
    # H_MS = ??
    if is_even(wt):
        a = H_all[wt]
        return (a, tbi, tbi, tbi, tbi)
    else:
        a = H_all[wt]
        return (a, tbi, tbi, 0, tbi)
Пример #28
0
def _dimension_Gamma0_2(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms$Gamma0(2)$.

    OUTPUT
        ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting")

    REMARK
        Only total dimension implemented.
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    H_all = 1 / (1 - x**2) / (1 - x**4) / (1 - x**4) / (1 - x**6)
    # H_cusp  = ??
    # H_Kl   = ??
    # H_MS = ??
    if is_even(wt):
        a = H_all[wt]
        return (a, tbi, tbi, tbi, tbi)
    else:
        a = H_all[wt - 19]
        return (a, 0, 0, 0, a)
Пример #29
0
def _dimension_Gamma0_2(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms$Gamma0(2)$.

    OUTPUT
        ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting")

    REMARK
        Only total dimension implemented.
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    H_all = 1 / (1 - x ** 2) / (1 - x ** 4) / (1 - x ** 4) / (1 - x ** 6)
    # H_cusp  = ??
    # H_Kl   = ??
    # H_MS = ??
    if is_even(wt):
        a = H_all[wt]
        return (a, tbi, tbi, tbi, tbi)
    else:
        a = H_all[wt - 19]
        return (a, 0, 0, 0, a)
Пример #30
0
def _dimension_Gamma0_4(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$.

    OUTPUT
        ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting")

    REMARK
        Not completely implemented
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    H_all = (1 + x ** 4)(1 + x ** 11) / (1 - x ** 2) ** 3 / (1 - x ** 6)
    # H_cusp  = ??
    # H_Kl   = ??
    # H_MS = ??
    if is_even(wt):
        a = H_all[wt]
        return (a, tbi, tbi, tbi, tbi)
    else:
        a = H_all[wt]
        return (a, tbi, tbi, 0, tbi)
Пример #31
0
def _dimension_Gamma0_4_psi_4(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$
    with character $\psi_4$.

    OUTPUT
        ( "Total", "Eisenstein", "Klingen", "Maass", "Interesting")

    REMARK
        The formula for odd weights is unknown or not obvious from the paper.
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x',))
    (x,) = R._first_ngens(1)
    H_all_even = (x ** 12 + x ** 14) / (1 - x ** 2) ** 3 / (1 - x ** 6)
    # H_cusp  = ??
    # H_Kl   = ??
    # H_MS = ??
    if is_even(wt):
        a = H_all_even[wt]
        return (a, tbi, tbi, tbi, tbi)
    else:
        return (uk, uk, uk, uk, uk)
Пример #32
0
def compare_vv_scalar(V, k):
    dv = V.dimension_cusp_forms(k)
    N = V._level
    m = V._M.order()
    if k in ZZ:
        D = DirichletGroup(N)
        if is_even(k):
            chi = D(kronecker_character(m))
        else:
            chi = D(kronecker_character(-m))
        S = CuspForms(chi, k)
        N = Newforms(chi, k, names='a')
        ds = S.dimension()
        B = N
    else:
        D = magma.DirichletGroup(V._level)
        chi = magma.D(magma.KroneckerCharacter(2 * m))
        M = magma.HalfIntegralWeightForms(chi, k)
        S = M.CuspidalSubspace()
        ds = S.Dimension()
        B = S.Basis()
    return dv, ds, S, B
Пример #33
0
    def dirichlet_group(self, prime_bound=10000):
        f = self.conductor()
        if f == 1:  # To make the trivial case work correctly
            return [1]
        if euler_phi(f) > dir_group_size_bound:
            return []
        # Can do quadratic fields directly
        if self.degree() == 2:
            if is_odd(f):
                return [1, f-1]
            f1 = f/4
            if is_odd(f1):
                return [1, f-1]
            # we now want f with all powers of 2 removed
            f1 = f1/2
            if is_even(f1):
                raise Exception('Invalid conductor')
            if (self.disc()/8) % 4 == 3:
                return [1, 4*f1-1]
            # Finally we want congruent to 5 mod 8 and -1 mod f1
            if (f1 % 4) == 3:
                return [1, 2*f1-1]
            return [1, 6*f1-1]

        from dirichlet_conrey import DirichletGroup_conrey
        G = DirichletGroup_conrey(f)
        K = self.K()
        S = Set(G[1].kernel()) # trivial character, kernel is whole group

        for P in K.primes_of_bounded_norm_iter(ZZ(prime_bound)):
            a = P.norm() % f
            if gcd(a,f)>1:
                continue
            S = S.intersection(Set(G[a].kernel()))
            if len(S) == self.degree():
                return list(S)

        raise Exception('Failure in dirichlet group for K=%s using prime bound %s' % (K,prime_bound))
Пример #34
0
 def _dimension_formula(self,k,eps=1,cuspidal=1):
     ep = 0
     N = self._N
     if (2*k) % 4 == 1: ep = 1
     if (2*k) % 4 == 3: ep = -1
     if ep==0: return 0,0
     if eps==-1:
         ep = -ep
     twok = ZZ(2*k)
     K0 = 1
     sqf = ZZ(N).divide_knowing_divisible_by(squarefree_part(N))
     if sqf>12:
         b2 = max(sqf.divisors())
     else:
         b2 = 1
     b = sqrt(b2)
     if ep==1:
         K0 = floor(QQ(b+2)/QQ(2))
     else:
         # print "b=",b
         K0 = floor(QQ(b-1)/QQ(2))
     if is_even(N):
         e2 = ep*kronecker(2,twok)/QQ(4)
     else:
         e2 = 0
     N2 = odd_part(N)
     N22 = ZZ(N).divide_knowing_divisible_by(N2)
     k3 = kronecker(3,twok)
     if gcd(3,N)>1:
         if eps==1:
             e3 = -ep*kronecker(-3,4*k+ep-1)/QQ(3)
         else:
             e3 = -1*ep*kronecker(-3,4*k+ep+1)/QQ(3)
         #e3 = -1/3*ep
     else:
         f1 = kronecker(3,2*N22)*kronecker(-12,N2) - ep
         f2 = kronecker(-3,twok+1)
         e3 = f1*f2/QQ(6)
     ID = QQ(N+ep)*(k-1)/QQ(12)
     P = 0
     for d in ZZ(4*N).divisors():
         dm4=d % 4
         if dm4== 2 or dm4 == 1:
             h = 0
         elif d == 3:
             h = QQ(1)/QQ(3)
         elif d == 4:
             h = QQ(1)/QQ(2)
         else:
             h = class_nr_pos_def_qf(-d)
         if self._verbose>1:
             print "h({0})={1}".format(d,h)
         if h<>0:
             P= P + h
     P = QQ(P)/QQ(4)
     if self._verbose>0:
         print "P=",P
     P=P + QQ(ep)*kronecker(-4,N)/QQ(8)
     if eps==-1:
         P = -P
     if self._verbose>0:
         print "P=",P
     # P = -2*N**2 + N*(twok+10-ep*3) +(twok+10)*ep-1
     if self._verbose>0:
         print "ID=",ID
     P =  P - QQ(1)/QQ(2*K0)
     # P = QQ(P)/QQ(24) - K0
     # P = P - K0
     res = ID + P + e2 + e3
     if self._verbose>1:
         print "twok=",twok
         print "K0=",K0
         print "ep=",ep
         print "e2=",e2
         print "e3=",e3
         print "P=",P
     if cuspidal==0:
         res = res + K0
     return res   #,ep
Пример #35
0
 def set_table_browsing(self,
                        skip=[0, 0],
                        limit=[(2, 16), (1, 50)],
                        keys=['Weight', 'Level'],
                        character=0,
                        dimension_fun=dimension_new_cusp_forms,
                        title='Dimension of newforms'):
     r"""
     Table of Holomorphic modular forms spaces.
     Skip tells you how many chunks of data you want to skip (from the geginning) and limit tells you how large each chunk is.
     INPUT:
     - dimension_fun should be a function which gives you the desired dimensions, as functions of level N and weight k
     - character = 0 for trivial character and 1 for Kronecker symbol.
       set to 'all' for all characters.
     """
     self._keys = keys
     self._skip = skip
     self._limit = limit
     self._metadata = []
     self._title = ''
     self._cols = []
     self.table = {}
     self._character = character
     emf_logger.debug("skip= {0}".format(self._skip))
     emf_logger.debug("limit= {0}".format(self._limit))
     il = self._keys.index('Level')
     iwt = self._keys.index('Weight')
     level_len = self._limit[il][1] - self._limit[il][0] + 1
     level_ll = self._skip[il] * level_len + self._limit[il][0]
     level_ul = self._skip[il] * level_len + self._limit[il][1]
     wt_len = self._limit[iwt][1] - self._limit[iwt][0] + 1
     wt_ll = self._skip[iwt] * wt_len + self._limit[iwt][0]
     wt_ul = self._skip[iwt] * wt_len + self._limit[iwt][1]
     if level_ll < 1: level_l = 1
     self._table = {}
     self._table['rows'] = []
     self._table['col_heads'] = []  #range(wt_ll,wt_ul+1)
     self._table['row_heads'] = []  #range(level_ll,level_ul+1)
     emf_logger.debug("wt_range: {0} -- {1}".format(wt_ll, wt_ul))
     emf_logger.debug("level_range: {0} -- {1}".format(level_ll, level_ul))
     if character in [0, 1]:
         if level_ll == level_ul:
             N = level_ll
             self._table['rowhead'] = 'Weight'
             if character == 0:
                 self._table['row_heads'] = ['Trivial character']
             else:
                 self._table['row_heads'] = ['\( \\( \frac{\cdot}{N} \\)\)']
             row = []
             for k in range(wt_ll, wt_ul + 1):
                 if character == 0 and is_odd(k):
                     continue
                 try:
                     if character == 0:
                         d = dimension_fun(N, k)
                     elif character == 1:
                         x = kronecker_character_upside_down(N)
                         d = dimension_fun(x, k)
                 except Exception as ex:
                     emf_logger.critical(
                         "Exception: {0}. \n Could not compute the dimension with function {0}"
                         .format(ex, dimension_fun))
                 url = url_for('emf.render_elliptic_modular_form_browsing',
                               level=N,
                               weight=k)
                 if not k in self._table['col_heads']:
                     self._table['col_heads'].append(k)
                 row.append({'N': N, 'k': k, 'url': url, 'dim': d})
             self._table['rows'].append(row)
         else:
             for N in range(level_ll, level_ul + 1):
                 if not N in self._table['row_heads']:
                     self._table['row_heads'].append(N)
                 row = []
                 for k in range(wt_ll, wt_ul + 1):
                     if character == 0 and is_odd(k):
                         continue
                     try:
                         if character == 0:
                             d = dimension_fun(N, k)
                         elif character == 1:
                             x = kronecker_character_upside_down(N)
                             d = dimension_fun(x, k)
                     except Exception as ex:
                         emf_logger.critical(
                             "Exception: {0}. \n Could not compute the dimension with function {0}"
                             .format(ex, dimension_fun))
                     url = url_for(
                         'emf.render_elliptic_modular_form_browsing',
                         level=N,
                         weight=k)
                     if not k in self._table['col_heads']:
                         self._table['col_heads'].append(k)
                     row.append({'N': N, 'k': k, 'url': url, 'dim': d})
                 self._table['rows'].append(row)
     elif character == 'all':
         # make table with all characters.
         self._table['characters'] = dict()
         if level_ll == level_ul:
             N = level_ll
             D = DirichletGroup(N)
             emf_logger.debug("I am here!")
             self._table['rowhead'] = 'Character&nbsp;\&nbspWeight'
             for x in D:
                 xi = D.list().index(x)
                 row = []
                 self._table['row_heads'].append(xi)
                 for k in range(wt_ll, wt_ul + 1):
                     if not k in self._table['col_heads']:
                         self._table['col_heads'].append(k)
                     try:
                         d = dimension_fun(x, k)
                     except Exception as ex:
                         emf_logger.critical(
                             "Exception: {0} \n Could not compute the dimension with function {0}"
                             .format(ex, dimension_fun))
                         d = -1
                     url = url_for('emf.render_elliptic_modular_form_space',
                                   level=N,
                                   weight=k,
                                   character=xi)
                     row.append({
                         'N': N,
                         'k': k,
                         'chi': xi,
                         'url': url,
                         'dim': d
                     })
                 self._table['rows'].append(row)
         else:
             for N in range(level_ll, level_ul + 1):
                 self._table['row_heads'].append(N)
                 self._table['characters'][N] = list()
                 row = []
                 if N == 0: continue
                 D = DirichletGroup(N)
                 for k in range(wt_ll, wt_ul + 1):
                     tbl = []
                     for x in D:
                         xi = D.list().index(x)
                         if not N in self._table['characters'][N]:
                             self._table['characters'][N].append(xi)
                         if x.is_even() and is_odd(k):
                             continue
                         if x.is_odd() and is_even(k):
                             continue
                         try:
                             d = dimension_fun(x, k)
                         except Exception as ex:
                             emf_logger.critical(
                                 "Exception: {0} \n Could not compute the dimension with function {0}"
                                 .format(ex, dimension_fun))
                         url = url_for(
                             'emf.render_elliptic_modular_form_browsing',
                             level=N,
                             weight=k)
                     if not k in self._table['col_heads']:
                         self._table['col_heads'].append(k)
                     tbl.append({
                         'N': N,
                         'k': k,
                         'chi': xi,
                         'url': url,
                         'dim': d
                     })
                     row.append(tbl)
                 self._table['rows'].append(row)
Пример #36
0
 def _dimension_formula(self,k,eps=1,cuspidal=1):
     ep = 0
     N = self._N
     if (2*k) % 4 == 1: ep = 1
     if (2*k) % 4 == 3: ep = -1
     if ep==0: return 0,0
     if eps==-1:
         ep = -ep
     twok = ZZ(2*k)
     K0 = 1
     sqf = ZZ(N).divide_knowing_divisible_by(squarefree_part(N))
     if sqf>12:
         b2 = max(sqf.divisors())
     else:
         b2 = 1
     b = sqrt(b2)
     if ep==1:
         K0 = floor(QQ(b+2)/QQ(2))
     else:
         # print "b=",b
         K0 = floor(QQ(b-1)/QQ(2))
     if is_even(N):
         e2 = ep*kronecker(2,twok)/QQ(4)
     else:
         e2 = 0
     N2 = odd_part(N)
     N22 = ZZ(N).divide_knowing_divisible_by(N2)
     k3 = kronecker(3,twok)
     if gcd(3,N)>1:
         if eps==1:
             e3 = -ep*kronecker(-3,4*k+ep-1)/QQ(3)
         else:
             e3 = -1*ep*kronecker(-3,4*k+ep+1)/QQ(3)
         #e3 = -1/3*ep
     else:
         f1 = kronecker(3,2*N22)*kronecker(-12,N2) - ep
         f2 = kronecker(-3,twok+1)
         e3 = f1*f2/QQ(6)
     ID = QQ(N+ep)*(k-1)/QQ(12)
     P = 0
     for d in ZZ(4*N).divisors():
         dm4=d % 4
         if dm4== 2 or dm4 == 1:
             h = 0
         elif d == 3:
             h = QQ(1)/QQ(3)
         elif d == 4:
             h = QQ(1)/QQ(2)
         else:
             h = class_nr_pos_def_qf(-d)
         if self._verbose>1:
             print("h({0})={1}".format(d,h))
         if h!=0:
             P= P + h
     P = QQ(P)/QQ(4)
     if self._verbose>0:
         print("P={0}".format(P))
     P=P + QQ(ep)*kronecker(-4,N)/QQ(8)
     if eps==-1:
         P = -P
     if self._verbose>0:
         print("P={0}".format(P))
     # P = -2*N**2 + N*(twok+10-ep*3) +(twok+10)*ep-1
     if self._verbose>0:
         print("ID={0}".format(ID))
     P =  P - QQ(1)/QQ(2*K0)
     # P = QQ(P)/QQ(24) - K0
     # P = P - K0
     res = ID + P + e2 + e3
     if self._verbose>1:
         print("twok={0}".format(twok))
         print("K0={0}".format(K0))
         print("ep={0}".format(ep))
         print("e2={0}".format(e2))
         print("e3={0}".format(e3))
         print("P={0}".format(P))
     if cuspidal==0:
         res = res + K0
     return res   #,ep
Пример #37
0
 def set_table_browsing(self,skip=[0,0],limit=[(2,16),(1,50)],keys=['Weight','Level'],character=0,dimension_fun=dimension_new_cusp_forms,title='Dimension of newforms'):
     r"""
     Table of Holomorphic modular forms spaces.
     Skip tells you how many chunks of data you want to skip (from the geginning) and limit tells you how large each chunk is.
     INPUT:
     - dimension_fun should be a function which gives you the desired dimensions, as functions of level N and weight k
     - character = 0 for trivial character and 1 for Kronecker symbol.
       set to 'all' for all characters.
     """
     self._keys=keys
     self._skip=skip
     self._limit=limit
     self._metadata=[]
     self._title=''
     self._cols=[]
     self.table={}
     self._character = character
     emf_logger.debug("skip= {0}".format(self._skip))
     emf_logger.debug("limit= {0}".format(self._limit))
     il  = self._keys.index('Level')
     iwt = self._keys.index('Weight')
     level_len = self._limit[il][1]-self._limit[il][0]+1
     level_ll=self._skip[il]*level_len+self._limit[il][0];   level_ul=self._skip[il]*level_len+self._limit[il][1]
     wt_len = self._limit[iwt][1]-self._limit[iwt][0]+1
     wt_ll=self._skip[iwt]*wt_len+self._limit[iwt][0]; wt_ul=self._skip[iwt]*wt_len+self._limit[iwt][1]
     if level_ll<1: level_l=1
     self._table={}
     self._table['rows']=[]
     self._table['col_heads']=[] #range(wt_ll,wt_ul+1)
     self._table['row_heads']=[] #range(level_ll,level_ul+1)
     emf_logger.debug("wt_range: {0} -- {1}".format(wt_ll,wt_ul))
     emf_logger.debug("level_range: {0} -- {1}".format(level_ll,level_ul))
     if character in [0,1]:
         if level_ll == level_ul:
             N=level_ll
             self._table['rowhead']='Weight'
             if character==0:
                 self._table['row_heads']=['Trivial character']
             else:
                 self._table['row_heads']=['\( \\( \frac{\cdot}{N} \\)\)']
             row=[]
             for k in range(wt_ll,wt_ul+1):
                 if character == 0 and is_odd(k):
                     continue
                 try:
                     if character==0:
                         d = dimension_fun(N,k)
                     elif character==1:
                         x = kronecker_character_upside_down(N)
                         d = dimension_fun(x,k)
                 except Exception as ex:
                     emf_logger.critical("Exception: {0}. \n Could not compute the dimension with function {0}".format(ex,dimension_fun))
                 url = url_for('emf.render_elliptic_modular_form_browsing',level=N,weight=k)
                 if not k in self._table['col_heads']:
                     self._table['col_heads'].append(k)
                 row.append({'N':N,'k':k,'url':url,'dim':d})
             self._table['rows'].append(row)                
         else:
             for N in range(level_ll,level_ul+1):
                 if not N in self._table['row_heads']:
                     self._table['row_heads'].append(N)
                 row=[]
                 for k in range(wt_ll,wt_ul+1):
                     if character == 0 and is_odd(k):
                         continue
                     try:
                         if character==0:
                             d = dimension_fun(N,k)
                         elif character==1:
                             x = kronecker_character_upside_down(N)
                             d = dimension_fun(x,k)
                     except Exception as ex:
                         emf_logger.critical("Exception: {0}. \n Could not compute the dimension with function {0}".format(ex,dimension_fun))
                     url = url_for('emf.render_elliptic_modular_form_browsing',level=N,weight=k)
                     if not k in self._table['col_heads']:
                         self._table['col_heads'].append(k)
                     row.append({'N':N,'k':k,'url':url,'dim':d})
                 self._table['rows'].append(row)
     elif character=='all':
         # make table with all characters.
         self._table['characters']=dict()
         if level_ll == level_ul:
             N = level_ll
             D = DirichletGroup(N)
             emf_logger.debug("I am here!")
             self._table['rowhead']='Character&nbsp;\&nbspWeight'
             for x in D:
                 xi = D.list().index(x)
                 row=[]
                 self._table['row_heads'].append(xi)
                 for k in range(wt_ll,wt_ul+1):
                     if not k in self._table['col_heads']:              
                         self._table['col_heads'].append(k)
                     try:
                         d = dimension_fun(x,k)
                     except Exception as ex:
                         emf_logger.critical("Exception: {0} \n Could not compute the dimension with function {0}".format(ex,dimension_fun))
                         d = -1
                     url = url_for('emf.render_elliptic_modular_form_space',level=N,weight=k,character=xi)
                     row.append({'N':N,'k':k,'chi':xi,'url':url,'dim':d})
                 self._table['rows'].append(row)                            
         else:
             for N in range(level_ll,level_ul+1):
                 self._table['row_heads'].append(N)
                 self._table['characters'][N]=list()
                 row=[]
                 if N==0: continue
                 D = DirichletGroup(N)
                 for k in range(wt_ll,wt_ul+1):
                     tbl=[]
                     for x in D:
                         xi = D.list().index(x)
                         if not N in self._table['characters'][N]:              
                             self._table['characters'][N].append(xi)
                         if x.is_even() and is_odd(k):
                             continue
                         if x.is_odd() and is_even(k):
                             continue
                         try:
                             d = dimension_fun(x,k)
                         except Exception as ex:
                             emf_logger.critical("Exception: {0} \n Could not compute the dimension with function {0}".format(ex,dimension_fun))
                         url = url_for('emf.render_elliptic_modular_form_browsing',level=N,weight=k)
                     if not k in self._table['col_heads']:
                         self._table['col_heads'].append(k)
                     tbl.append({'N':N,'k':k,'chi':xi,'url':url,'dim':d})
                     row.append(tbl)
                 self._table['rows'].append(row)            
Пример #38
0
def hilbert_series_using_dimension_formula(i, parity, prec=10):
    ps = PowerSeriesRing(QQ, names='t', default_prec=prec + 1)
    t = ps.gen()
    return (sum(
        cuspforms_dimension((a, a + 2 * i)) * t**a
        for a in range(2, prec + 1) if is_even(a + parity)) + O(t**(prec + 1)))