Exemple #1
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)
Exemple #2
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)
Exemple #3
0
def test_tensprod_121_chi():
    C121=[1,2,-1,2,1,-2,2,0,-2,2,0,-2,-4,4,-1,-4,2,-4,0,2,-2,0,\
    -1,0,-4,-8,5,4,0,-2,7,-8,0,4,2,-4,3,0,4,0,8,-4,6,0,-2,-2,\
    8,4,-3,-8,-2,-8,-6,10,0,0,0,0,5,-2,-12,14,-4,-8,-4,0,-7,4,\
    1,4,-3,0,-4,6,4,0,0,8,10,-4,1,16,6,-4,2,12,0,0,15,-4,-8,\
    -2,-7,16,0,8,-7,-6,0,-8,-2,-4,-16,0,-2,-12,-18,10,-10,0,-3,\
    -8,9,0,-1,0,8,10,4,0,0,-24,-8,14,-9,-8,-8,0,-6,-8,18,0,0,\
    -14,5,0,-7,2,-10,4,-8,-6,0,8,0,-8,3,6,10,8,-2,0,-4,0,7,8,\
    -7,20,6,-8,-2,2,4,16,0,12,12,0,3,4,0,12,6,0,-8,0,-5,30,\
    -15,-4,7,-16,12,0,3,-14,0,16,10,0,17,8,-4,-14,4,-6,2,0,0,0]
    chi=[1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,\
    1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,\
    -1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,\
    1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,\
    1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,\
    1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,\
    -1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,\
    -1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,\
    -1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1]
    ANS=[1,-2,-1,2,1,2,-2,0,-2,-2,1,-2,4,4,-1,-4,-2,4,0,2,2,-2,\
    -1,0,-4,-8,5,-4,0,2,7,8,-1,4,-2,-4,3,0,-4,0,-8,-4,-6,2,-2,\
    2,8,4,-3,8,2,8,-6,-10,1,0,0,0,5,-2,12,-14,4,-8,4,2,-7,-4,\
    1,4,-3,0,4,-6,4,0,-2,8,-10,-4,1,16,-6,4,-2,12,0,0,15,4,-8,\
    -2,-7,-16,0,-8,-7,6,-2,-8,2,-4,-16,0,2,12,18,10,10,-2,-3,8,\
    9,0,-1,0,-8,-10,4,0,1,-24,8,14,-9,-8,8,0,6,-8,-18,-2,0,14,\
    5,0,-7,-2,10,-4,-8,6,4,8,0,-8,3,6,-10,-8,2,0,4,4,7,-8,-7,\
    20,6,8,2,-2,4,-16,-1,12,-12,0,3,4,0,-12,-6,0,8,-4,-5,-30,\
    -15,-4,7,16,-12,0,3,14,-2,16,-10,0,17,8,4,14,-4,-6,-2,4,0,0]
    R = PowerSeriesRing(ZZ, "T")
    T = R.gens()[0]
    assert ANS == tensor_get_an_deg1(C121, chi, [[11, 1 - T]])
    assert ANS == tensor_get_an(C121, chi, 2, 1, [[11, 1 - T, 1 - T]])
    assert get_euler_factor(ANS, 2) == (1 + 2 * T + 2 * T**2 + O(T**8))
    assert get_euler_factor(ANS, 3) == (1 + T + 3 * T**2 + O(T**5))
    assert get_euler_factor(ANS, 5) == (1 - T + 5 * T**2 + O(T**4))
Exemple #4
0
def get_factor_over_nf(curve, prime_ideal, prime_number, conductor, accuracy):
    """                                                                         
    Returns the inverse of the factor corresponding to the given prime
    ideal in the Euler product expansion of the L-function at
    prime_ideal. Unless the accuracy doesn't need this expansion, and
    then returns 1 in power series ring.
    """
    P = PowerSeriesRing(ZZ, 'T')
    T = P.gen()
    q = prime_ideal.norm()
    inertial_deg = Integer(q).ord(prime_number)
    if inertial_deg > accuracy:
        return P(1)
    if prime_ideal.divides(conductor):
        a = curve.local_data(prime_ideal).bad_reduction_type()
        L = 1 - a * (T**inertial_deg)
    else:
        discriminant = curve.discriminant()
        if prime_ideal.divides(discriminant):
            a = q + 1 - curve.local_minimal_model(prime_ideal).reduction(
                prime_ideal).count_points()
        else:
            a = q + 1 - curve.reduction(prime_ideal).count_points()
        L = 1 - a * (T**inertial_deg) + q * (T**(2 * inertial_deg))
    return L
Exemple #5
0
def test_tensprod_11a_17a():
    C11=[1,-2,-1,2,1,2,-2,0,-2,-2,1,-2,4,4,-1,-4,-2,4,0,2,2,-2,\
    -1,0,-4,-8,5,-4,0,2,7,8,-1,4,-2,-4,3,0,-4,0,-8,-4,-6,2,-2,\
    2,8,4,-3,8,2,8,-6,-10,1,0,0,0,5,-2,12,-14,4,-8,4,2,-7,-4,\
    1,4,-3,0,4,-6,4,0,-2,8,-10,-4,1,16,-6,4,-2,12,0,0,15,4,-8,\
    -2,-7,-16,0,-8,-7,6,-2,-8,2,-4,-16,0,2,12,18,10,10,-2,-3,8,\
    9,0,-1,0,-8,-10,4,0,1,-24,8,14,-9,-8,8,0,6,-8,-18,-2,0,14,\
    5,0,-7,-2,10,-4,-8,6,4,8,0,-8,3,6,-10,-8,2,0,4,4,7,-8,-7,\
    20,6,8,2,-2,4,-16,-1,12,-12,0,3,4,0,-12,-6,0,8,-4,-5,-30,\
    -15,-4,7,16,-12,0,3,14,-2,16,-10,0,17,8,4,14,-4,-6,-2,4,0,0]
    C17=[1,-1,0,-1,-2,0,4,3,-3,2,0,0,-2,-4,0,-1,1,3,-4,2,0,0,4,\
    0,-1,2,0,-4,6,0,4,-5,0,-1,-8,3,-2,4,0,-6,-6,0,4,0,6,-4,0,\
    0,9,1,0,2,6,0,0,12,0,-6,-12,0,-10,-4,-12,7,4,0,4,-1,0,8,\
    -4,-9,-6,2,0,4,0,0,12,2,9,6,-4,0,-2,-4,0,0,10,-6,-8,-4,0,\
    0,8,0,2,-9,0,1,-10,0,8,-6,0,-6,8,0,6,0,0,-4,-14,0,-8,-6,\
    6,12,4,0,-11,10,0,-4,12,12,8,3,0,-4,16,0,-16,-4,0,3,-6,0,\
    -8,8,0,4,0,3,-12,6,0,2,-10,0,-16,-12,-3,0,-8,0,-2,-12,0,10,\
    16,-9,24,6,0,4,-4,0,-9,2,12,-4,22,0,-4,0,0,-10,12,-6,-2,8,\
    0,12,4,0,0,0,0,-8,-16,0,2,-2,0,-9,-18,0,-20,-3]
    ANS=[1,2,0,2,-2,0,-8,8,15,-4,0,0,-8,-16,0,12,-2,30,0,-4,0,0,\
    -4,0,29,-16,0,-16,0,0,28,-8,0,-4,16,30,-6,0,0,-16,48,0,-24,\
    0,-30,-8,0,0,22,58,0,-16,-36,0,0,-64,0,0,-60,0,-120,56,-120,\
    -8,16,0,-28,-4,0,32,12,120,-24,-12,0,0,0,0,-120,-24,144,96,\
    24,0,4,-48,0,0,150,-60,64,-8,0,0,0,0,-14,44,0,58,-20,0,-128,\
    -64,0,-72,144,0,60,0,0,-96,-126,0,8,0,-120,-120,16,0,-11,-240,\
    0,56,-158,-240,64,-32,0,32,-288,0,0,-56,0,-16,42,0,-80,32,0,\
    24,0,180,0,-48,0,-12,100,0,-32,0,-30,0,-56,0,14,-240,0,16,32,\
    288,96,96,0,48,48,0,142,8,0,-48,-132,0,-232,0,0,300,-180,-60,\
    -14,128,0,-32,12,0,0,0,0,0,-272,0,8,-28,0,44,36,0,0,232]
    R = PowerSeriesRing(ZZ, "T")
    T = R.gens()[0]
    B11 = [11, 1 - T, 1 + 11 * T**2]
    B17 = [17, 1 + 2 * T + 17 * T**2, 1 - T]
    assert ANS == tensor_get_an_no_deg1(C11, C17, 2, 2, [B11, B17])
Exemple #6
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
Exemple #7
0
def rings1():
    """
    Return an iterator over random rings.

    Return a list of pairs (f, desc), where f is a function that
    outputs a random ring that takes a ring and possibly
    some other data as constructor.

    RINGS:

    - polynomial ring in one variable over a rings0() ring.
    - polynomial ring over a rings1() ring.
    - multivariate polynomials
    - power series rings in one variable over a rings0() ring.

    EXAMPLES::

        sage: import sage.rings.tests
        sage: type(sage.rings.tests.rings0())
        <... 'list'>
    """
    v = rings0()
    X = random_rings(level=0)
    from sage.all import (PolynomialRing, PowerSeriesRing,
                          LaurentPolynomialRing, ZZ)
    v = [(lambda: PolynomialRing(next(X), names='x'),
          'univariate polynomial ring over level 0 ring'),
         (lambda: PowerSeriesRing(next(X), names='x'),
          'univariate power series ring over level 0 ring'),
         (lambda: LaurentPolynomialRing(next(X), names='x'),
          'univariate Laurent polynomial ring over level 0 ring'),
         (lambda: PolynomialRing(next(X), abs(ZZ.random_element(x=2, y=10)),
                                 names='x'),
          'multivariate polynomial ring in between 2 and 10 variables over a level 0 ring')]
    return v
Exemple #8
0
 def set_from_coefficients(self, coeffs):
     QR = PowerSeriesRing(QQ,name='q',order='neglex')
     q = QR.gen()
     res = 0*q**0
     for n, c in coeffs.iteritems():
         res += c*q**n
     res = res.add_bigoh(len(coeffs.keys())+1)
     self.set_value(res)
Exemple #9
0
 def __init__(self, weight, lattice, character, prec=10):
     self._k = weight
     self._L = lattice
     self._h = character
     self._prec = prec
     # _feparent: this is the ambient space in which the Fourier expansion of self lives
     # we have to think about this...
     self._feparent = PowerSeriesRing(QQbar, 'q,z')
Exemple #10
0
def euler_p_factor(root_list, PREC):
    ''' computes the coefficients of the pth Euler factor expanded as a geometric series
      ax^n is the Dirichlet series coefficient p^(-ns)
    '''
    PREC = floor(PREC)
    # return satake_list
    R = PowerSeriesRing(CF, 'x')
    x = R.gen()
    ep = ~R.prod([1 - a * x for a in root_list])
    return ep.O(PREC + 1)
Exemple #11
0
def euler_factor_to_list(P, prec):
    """
    P a polynomial (or power series)
    returns the list [a_p, a_p^2, ...
    """
    K = P[0].parent()
    R = PowerSeriesRing(K, "T", default_prec=prec+1)
    L = ((1/R(P.truncate().coefficients(sparse=False))).truncate().coefficients(sparse=False))[1:]
    while len(L) < prec: # include zeros at end
        L.append(0)
    return L
Exemple #12
0
def hilbert_series_using_cand_wts(i, parity, prec=None):
    wts = load_cand_wts(i, parity)
    if prec is None:
        prec = max(wts[0])
    ps = PowerSeriesRing(QQ, names='t', default_prec=prec + 1)
    t = ps.gen()
    num = sum(t**a for a in wts[0])
    if len(wts) > 1:
        num -= sum(t**a for a in wts[1])
    dnm = (1 - t**2) * (1 - t**4) * (1 - t**6)
    return num / dnm
Exemple #13
0
def hilbert_series_using_dimension_formula(i, prec=10):
    '''
    This assumes dimension formula is true for weight (2, k) where k > 2
    and the dimesion for (1, k) k > 2 is zero.
    If one believes magma, the assumption for (2, k) can be checked for some cases.
    And the assumption for (1, k) can be checked by the construction.
    '''
    ps = PowerSeriesRing(QQ, names='t', default_prec=prec + 1)
    t = ps.gen()
    return (sum(dimension_cuspforms_sqrt5(a, a + 2 * i) * t**a for a in range(2, prec + 1)) +
            O(t**(prec + 1)))
    def zeta_function(self, var_name='T'):
        r""" Return the Zeta function of the curve.

        For any scheme `X` of finite type over `\mathbb{Z}`, the **arithmetic
        zeta funtion** of `X` is defined as the product

        .. MATH::

             \zeta(X,s) := \prod_x \frac{1}{1-N(x)^{-s}},

        where `x` runs over over all closed points of `X` and `N(x)`
        denotes the cardinality of the residue field of `x`.

        If `X` is a smooth projective curve over a field with
        `q` elements, then `\zeta(X,s) = Z(X,q^{-s})`,
        where `Z(X,T)` is a rational function in `T` of the form

        .. MATH::

               Z(X,T) =  \frac{P(T)}{(1-T)(1-qT)},

        for a polynomial `P` of degree `2g`, with some extra properties
        reflecting the Weil conjectures. See:

        - Hartshorn, *Algebraic Geometry*, Appendix C, Section 1.

        Note that that this makes only sense if the constant base
        field of self is finite, and that `Z(X,T)` depends on the
        choice of the constant base field (unlike the function
        `\zeta(X,s)`!).

        """
        if hasattr(self,"_zeta_function"):
            return self._zeta_function

        K = self._constant_base_field
        q = K.order()
        g = self.genus()
        S = PowerSeriesRing(ZZ, var_name, g+1)
        N = self.count_points(g)
        Z_series = S(1)
        for k in range(1,g+1):
            Z_series *= (1-S.gen()**k)**(-N[k])
        P = (Z_series*(1-S.gen())*(1-q*S.gen())).polynomial()
        c = range(2*g+1)
        for k in range(g+1):
            c[k] = P[k]
        for k in range(g+1,2*g+1):
            c[k] = c[2*g-k]*q**(k-g)
        R = P.parent()
        zeta = R(c)/(1-R.gen())/(1-q*R.gen())
        self._zeta_function = zeta
        return zeta
Exemple #15
0
def dirichlet(R, euler_factors):
    PS = PowerSeriesRing(R)
    pef = zip(primes_first_n(len(euler_factors)), euler_factors)
    an_list_bound = next_prime(pef[-1][0])
    res = [1]*an_list_bound
    for p, ef in pef:
        k = RR(an_list_bound).log(p).floor()+1
        foo = (1/PS(ef)).padded_list(k)
        for i in range(1, k):
            res[p**i] = foo[i]
    extend_multiplicatively(res)
    return res
Exemple #16
0
def tensor_get_an_no_deg1(L1, L2, d1, d2, BadPrimeInfo):
    """
    Same as the above in the case no dimension is 1
    """
    if d1 == 1 or d2 == 1:
        raise ValueError('min(d1,d2) should not be 1, use direct method then')
    s1 = len(L1)
    s2 = len(L2)
    if s1 < s2:
        S = s1
    if s2 <= s1:
        S = s2
    BadPrimes = []
    for bpi in BadPrimeInfo:
        BadPrimes.append(bpi[0])
    P = prime_range(S + 1)
    Z = S * [1]
    S = RealField()(S)
    for p in P:
        f = S.log(base=p).floor()
        q = 1
        E1 = []
        E2 = []
        if not p in BadPrimes:
            for i in range(f):
                q = q * p
                E1.append(L1[q - 1])
                E2.append(L2[q - 1])
            e1 = list_to_euler_factor(E1, f + 1)
            e2 = list_to_euler_factor(E2, f + 1)
            # ld1 = d1 # not used
            # ld2 = d2 # not used
        else:  # either convolve, or have one input be the answer and other 1-t
            i = BadPrimes.index(p)
            e1 = BadPrimeInfo[i][1]
            e2 = BadPrimeInfo[i][2]
            # ld1 = e1.degree() # not used
            # ld2 = e2.degree() # not used
            F = e1.list()[0].parent().fraction_field()
            R = PowerSeriesRing(F, "T", default_prec=f + 1)
            e1 = R(e1)
            e2 = R(e2)
        E = tensor_local_factors(e1, e2, f)
        A = euler_factor_to_list(E, f)
        while len(A) < f:
            A.append(0)
        q = 1
        for i in range(f):
            q = q * p
            Z[q - 1] = A[i]
    all_an_from_prime_powers(Z)
    return Z
Exemple #17
0
    def computation_roots(self):
        # Write these as p-adic series.  Start with helper
        self.lowered = self.lower_precision()

        def help_padic(n, p, prec):
            """
              Take an integer n, prime p, and precision prec, and return a 
              prec-tuple of the p-adic coefficients of j
            """
            n = ZZ(n)
            res = [0 for j in range(prec)]
            while n < 0:
                n += p**prec
            for k in range(prec):
                res[k] = n % p
                n = (n - res[k]) / p
            return res

        # Second helper, in case some arrays are not extended by 0
        def getel(li, j):
            if j < len(li):
                return li[j]
            return 0

        myroots = self._data["QpRts"]
        p = self._data['QpRts-p']
        prec = self._data['QpRts-prec']
        myroots = [[help_padic(z, p, prec) for z in t] for t in myroots]
        myroots = [[[
            getel(root[j], r)
            for j in range(len(self._data['QpRts-minpoly']) - 1)
        ] for r in range(prec)] for root in myroots]
        myroots = [[coeff_to_poly(x, var='a') for x in root]
                   for root in myroots]
        # Use power series so degrees increase
        # Use formal p so we can make a power series
        PR = PowerSeriesRing(PolynomialRing(QQ, 'a'), 'p')
        rawrts = [str(PR(x)) + r'+O(p^{})'.format(prec) for x in myroots]
        rawrts = [z.replace('p', str(p)) for z in rawrts]
        myroots = [
            web_latex(PR(x), enclose=False) + r'+O(p^{' + str(prec) + r'})'
            for x in myroots
        ]
        # change p into its value
        myroots = [r'\({}\)'.format(z) for z in myroots]
        myroots = [
            re.sub(r'([a)\d]) *p', r'\1\\cdot ' + str(p), z) for z in myroots
        ]
        typesetrts = [z.replace('p', str(p)) for z in myroots]
        return [raw_typeset(z[0], z[1]) for z in zip(rawrts, typesetrts)]
Exemple #18
0
def _dimension_Gamma0_4(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Gamma0(4)$.

    OUTPUT
        ("Total",)

    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)
    return (H_all[wt], )
Exemple #19
0
def list_to_euler_factor(L, d):
    """
    takes a list [a_p, a_p^2,...
    and returns the euler factor
    """
    if isinstance(L[0], int):
        K = QQ
    else:
        K = L[0].parent()
    R = PowerSeriesRing(K, "T")
    # T = R.gens()[0]
    f = 1 / R([1] + L)
    f = f.add_bigoh(d + 1)
    return f
Exemple #20
0
def _dimension_Gamma0_4(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Gamma0(4)$.

    OUTPUT
        ("Total",)

    REMARK
        Not completely implemented
    """
    R = PowerSeriesRing(ZZ, 'x')
    x = R.gen().O(wt + 1)
    H_all = (1 + x**4) * (1 + x**11) / (1 - x**2)**3 / (1 - x**6)
    return (H_all[wt], )
Exemple #21
0
def _dimension_Gamma0_3(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Gamma0(3)$.

    OUTPUT
        ("Total")

    REMARK
        Only total dimension implemented.
    """
    R = PowerSeriesRing(ZZ, default_prec=wt + 1, names=('x', ))
    (x, ) = R._first_ngens(1)
    H_all = (1 + 2 * x**4 + x**6 + x**15 *
             (1 + 2 * x**2 + x**6)) / (1 - x**2) / (1 - x**4) / (1 - x**6)**2
    return (H_all[wt], )
Exemple #22
0
def _dimension_Gamma0_3(wt):
    """
    Return the dimensions of subspaces of Siegel modular forms on $Gamma0(3)$.

    OUTPUT
        ("Total")

    REMARK
        Only total dimension implemented.
    """
    R = PowerSeriesRing(ZZ, 'x')
    x = R.gen().O(wt + 1)
    H_all = (1 + 2 * x**4 + x**6 + x**15 *
             (1 + 2 * x**2 + x**6)) / (1 - x**2) / (1 - x**4) / (1 - x**6)**2
    return (H_all[wt], )
Exemple #23
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)
Exemple #24
0
def tensor_local_factors(f1, f2, d):
    """
    takes two euler factors f1, f2 and a prec and
    returns the euler factor for the tensor
    product (with respect to that precision d
    """
    # base rings are either QQ or CC
    K1 = f1.base_ring()
    K2 = f2.base_ring()
    if K1 == ComplexField() or K2 == ComplexField():
        K = ComplexField()
    else:
        K = QQ
    R = PowerSeriesRing(K, "T")
    if not f1.parent().is_exact():  # ideally f1,f2 should already be in PSR
        if f1.prec() < d:
            raise ValueError
    if not f2.parent().is_exact():  # but the user might give them as polys...
        if f2.prec() < d:
            raise ValueError
    f1 = R(f1)
    f2 = R(f2)
    if f1 == 1 or f2 == 1:
        f = R(1)
        f = f.add_bigoh(d + 1)
        return f
    l1 = f1.log().derivative()
    p1 = l1.prec()
    c1 = l1.list()
    while len(c1) < p1:
        c1.append(0)
    l2 = f2.log().derivative()
    p2 = l2.prec()
    c2 = l2.list()
    while len(c2) < p2:
        c2.append(0)
    C = [0] * len(c1)
    for i in range(len(c1)):
        C[i] = c1[i] * c2[i]
    E = -R(C).integral()
    E = E.add_bigoh(d + 1)
    E = E.exp()  # coerce to R
    return E
Exemple #25
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)
Exemple #26
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], )
Exemple #27
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'
        )
Exemple #28
0
def tensor_get_an_deg1(L, D, BadPrimeInfo):
    """
    Same as above, except that the BadPrimeInfo
    is now a list of lists of the form
    [p,f] where f is a polynomial.
    """
    s1 = len(L)
    s2 = len(D)
    if s1 < s2:
        S = s1
    if s2 <= s1:
        S = s2
    BadPrimes = []
    for bpi in BadPrimeInfo:
        BadPrimes.append(bpi[0])
    P = prime_range(S + 1)
    Z = S * [1]
    S = RealField()(S)  # fix bug
    for p in P:
        f = S.log(base=p).floor()
        q = 1
        u = 1
        e = D[p - 1]
        if not p in BadPrimes:
            for i in range(f):
                q = q * p
                u = u * e
                Z[q - 1] = u * L[q - 1]
        else:
            i = BadPrimes.index(p)
            e = BadPrimeInfo[i][1]
            F = e.list()[0].parent().fraction_field()
            R = PowerSeriesRing(F, "T", default_prec=f + 1)
            e = R(e)
            A = euler_factor_to_list(e, f)
            for i in range(f):
                q = q * p
                Z[q - 1] = A[i]
    all_an_from_prime_powers(Z)
    return Z
Exemple #29
0
def an_list(euler_factor_polynomial_fn,
            upperbound=100000, base_field=QQ):
    """
    Takes a fn that gives for each prime the Euler polynomial of the associated
    with the prime, given as a list, with independent coefficient first. This
    list is of length the degree+1.
    Output the first `upperbound` coefficients built from the Euler polys.

    Example:
    The `euler_factor_polynomial_fn` should in practice come from an L-function
    or data. For a simple example, we construct just the 2 and 3 factors of the
    Riemann zeta function, which have Euler factors (1 - 1*2^(-s))^(-1) and
    (1 - 1*3^(-s))^(-1).
    >>> euler = lambda p: [1, -1] if p <= 3 else [1, 0]
    >>> an_list(euler)[:20]
    [1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0]
    """
    from math import ceil, log
    PP = PowerSeriesRing(base_field, 'x', 1 + ceil(log(upperbound) / log(2.)))

    prime_l = prime_range(upperbound + 1)
    result = [1 for i in range(upperbound)]
    for p in prime_l:
        euler_factor = (1 / (PP(euler_factor_polynomial_fn(p)))).padded_list()
        if len(euler_factor) == 1:
            for j in range(1, 1 + upperbound // p):
                result[j * p - 1] = 0
            continue

        k = 1
        while True:
            if p ** k > upperbound:
                break
            for j in range(1, 1 + upperbound // (p ** k)):
                if j % p == 0:
                    continue
                result[j * p ** k - 1] *= euler_factor[k]
            k += 1
    return result
Exemple #30
0
def _dimension_Gamma0_4_half(k):
    """
    Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$
    of half integral weight  k - 1/2.

    INPUT
        The realweight is k-1/2

    OUTPUT
        ('Total', 'Non cusp', 'Cusp')

    REMARK
        Note that formula from Hayashida's and Ibukiyama's paper has formula
        that coefficient of x^w is for weight (w+1/2). So here w=k-1.
    """
    R = PowerSeriesRing(ZZ, default_prec=k, names=('x', ))
    (x, ) = R._first_ngens(1)
    H_all = 1 / (1 - x) / (1 - x**2)**2 / (1 - x**3)
    H_cusp = (2 * x**5 + x**7 + x**9 - 2 * x**11 + 4 * x**6 - x**8 + x**10 -
              3 * x**12 + x**14) / (1 - x**2)**2 / (1 - x**6)
    a, c = H_all[k - 1], H_cusp[k - 1]
    return (a, a - c, c)