
# q-expansion of newform 3600.3.l.m, downloaded from the LMFDB on 27 April 2024.

# We generate the q-expansion using the Hecke eigenvalues a_p at the primes.
# Each a_p is given as a linear combination
# of the following basis for the coefficient ring.

def make_data():

    from sage.all import prod, floor, prime_powers, gcd, QQ, primes_first_n, next_prime, RR

    def discrete_log(elts, gens, mod):
        # algorithm 2.2, page 16 of https://arxiv.org/abs/0903.2785
        def table_gens(gens, mod):
            T = [1]
            n = len(gens)
            r = [None]*n
            s = [None]*n
            for i in range(n):
                beta = gens[i]
                r[i] = 1
                N = len(T)
                while beta not in T:
                    for Tj in T[:N]:
                        T.append((beta*Tj) % mod)
                    beta = (beta*gens[i]) % mod
                    r[i] += 1
                s[i] = T.index(beta)
            return T, r, s
        T, r, s = table_gens(gens, mod)
        n = len(gens)
        N = [ prod(r[:j]) for j in range(n) ]
        Z = lambda s: [ (floor(s/N[j]) % r[j]) for j in range(n)]
        return [Z(T.index(elt % mod)) for elt in elts]
    def extend_multiplicatively(an):
        for pp in prime_powers(len(an)-1):
            for k in range(1, (len(an) - 1)//pp + 1):
                if gcd(k, pp) == 1:
                    an[pp*k] = an[pp]*an[k]
    from sage.all import PolynomialRing, NumberField, ZZ
    R = PolynomialRing(QQ, "x")
    f = R(poly_data)
    K = NumberField(f, "a")
    betas = [K([c/ZZ(den) for c in num]) for num, den in basis_data]
    convert_elt_to_field = lambda elt: sum(c*beta for c, beta in zip(elt, betas))
    # convert aps to K elements
    primes = primes_first_n(len(aps_data))
    good_primes = [p for p in primes if not p.divides(level)]
    aps = map(convert_elt_to_field, aps_data)
    if not hecke_ring_character_values:
        # trivial character
        char_values = dict(zip(good_primes, [1]*len(good_primes)))
    else:
        gens = [elt[0] for elt in hecke_ring_character_values]
        gens_values = [convert_elt_to_field(elt[1]) for elt in hecke_ring_character_values]
        char_values = dict([(
            p,prod(g**k for g, k in zip(gens_values, elt)))
            for p, elt in zip(good_primes, discrete_log(good_primes, gens, level))
            ])
    an_list_bound = next_prime(primes[-1])
    an = [0]*an_list_bound
    an[1] = 1
    
    from sage.all import PowerSeriesRing
    PS = PowerSeriesRing(K, "q")
    for p, ap in zip(primes, aps):
        if p.divides(level):
            euler_factor = [1, -ap]
        else:
            euler_factor = [1, -ap, p**(weight - 1) * char_values[p]]
        k = RR(an_list_bound).log(p).floor() + 1
        foo = (1/PS(euler_factor)).padded_list(k)
        for i in range(1, k):
            an[p**i] = foo[i]
    extend_multiplicatively(an)
    return PS(an)
level = 3600
weight = 3
poly_data = [9, 0, -4, 0, 1]

# The entries in the following list give a basis for the
# coefficient ring in terms of a root of the defining polynomial above.
# Each line consists of the coefficients of the numerator, and a denominator.
basis_data  = [[[1, 0, 0, 0], 1], [[0, -1, 0, 1], 3], [[0, 7, 0, -1], 3], [[-4, 0, 2, 0], 1]]

hecke_ring_character_values = [[3151, [1, 0, 0, 0]], [901, [1, 0, 0, 0]], [2801, [-1, 0, 0, 0]], [577, [1, 0, 0, 0]]]
aps_data = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-8, 0, 1, 0], [0, 1, 0, 3], [-2, 0, 7, 0], [0, -8, 0, 4], [-24, 0, 2, 0], [0, -2, 0, -5], [0, -24, 0, -1], [14, 0, 6, 0], [10, 0, 11, 0], [0, 15, 0, 0], [-28, 0, 14, 0], [0, 2, 0, -6], [0, -30, 0, 0], [0, 1, 0, 19], [6, 0, -14, 0], [12, 0, 8, 0], [0, 20, 0, -2], [90, 0, 6, 0], [-50, 0, -22, 0], [0, 62, 0, 8], [0, -25, 0, 22], [-78, 0, -10, 0], [0, 90, 0, 3], [-64, 0, -25, 0], [0, -50, 0, -4], [106, 0, 34, 0], [0, 30, 0, -12], [-40, 0, 1, 0], [0, -5, 0, -1], [0, -122, 0, 6], [-170, 0, -4, 0], [0, -66, 0, -11], [66, 0, 52, 0], [142, 0, 7, 0], [52, 0, 54, 0], [0, 50, 0, 37], [0, 138, 0, 2], [0, 181, 0, 13], [134, 0, 54, 0], [0, 34, 0, -8], [218, 0, 24, 0], [0, 28, 0, 27], [-106, 0, 80, 0], [146, 0, 80, 0], [68, 0, -93, 0], [0, -20, 0, -28], [174, 0, -32, 0], [0, -40, 0, 16], [0, 150, 0, -6], [-156, 0, 92, 0], [0, 145, 0, 41], [0, -50, 0, 74], [0, 30, 0, 45], [0, -76, 0, 23], [270, 0, 12, 0], [-222, 0, -35, 0], [0, -1, 0, -72], [8, 0, -60, 0], [0, 132, 0, 43], [-72, 0, 28, 0], [0, 114, 0, -76], [42, 0, -56, 0], [0, -100, 0, -53], [-100, 0, -86, 0], [-78, 0, 86, 0], [0, -352, 0, -34], [-350, 0, 2, 0], [0, 168, 0, 50], [0, -90, 0, 84], [-108, 0, 53, 0], [-82, 0, -9, 0], [-334, 0, -96, 0], [0, -30, 0, 138], [0, 60, 0, -3], [-78, 0, -91, 0], [0, 275, 0, 76], [-186, 0, -68, 0], [0, -15, 0, -75], [-170, 0, 140, 0], [0, 174, 0, 50], [-178, 0, -58, 0], [326, 0, -24, 0], [0, -20, 0, 86], [0, 105, 0, 30], [66, 0, 110, 0], [0, -350, 0, 71], [460, 0, -61, 0], [0, -102, 0, -26], [0, 264, 0, -50], [88, 0, 171, 0], [0, -75, 0, 111], [564, 0, -98, 0], [0, -290, 0, -94], [0, 366, 0, 65], [0, 349, 0, 22], [612, 0, -26, 0], [-154, 0, -82, 0], [-344, 0, -110, 0], [0, 22, 0, -32], [0, 168, 0, -142], [0, 329, 0, -28], [364, 0, 58, 0], [-122, 0, -6, 0], [0, -410, 0, 80], [0, 690, 0, -6], [0, -130, 0, 34], [36, 0, -176, 0], [920, 0, -77, 0], [-230, 0, -79, 0], [0, 560, 0, -62], [34, 0, 252, 0], [-246, 0, 230, 0], [0, -135, 0, -198], [800, 0, 70, 0], [0, 90, 0, -246], [0, 108, 0, 35], [0, -395, 0, 59], [-90, 0, 102, 0], [70, 0, -34, 0], [0, -392, 0, 99], [0, -430, 0, 154], [-312, 0, 10, 0], [0, 26, 0, -49], [-574, 0, 168, 0], [0, 554, 0, -4], [72, 0, 41, 0], [-410, 0, -25, 0], [-220, 0, 310, 0], [0, -590, 0, 14], [-70, 0, -410, 0], [138, 0, -47, 0], [0, 55, 0, -22], [224, 0, 320, 0], [0, 180, 0, -69], [-168, 0, 62, 0], [0, 10, 0, -190], [0, -255, 0, 258], [-374, 0, 24, 0], [0, -856, 0, 15], [-628, 0, 53, 0], [0, -120, 0, -18], [682, 0, -270, 0], [0, -154, 0, -156], [-398, 0, -267, 0], [0, 20, 0, 154], [-678, 0, 40, 0], [0, -1010, 0, -19], [842, 0, 33, 0], [0, 415, 0, 146], [-252, 0, -286, 0], [0, -98, 0, 277], [-640, 0, 22, 0], [0, 416, 0, 164], [-1046, 0, -222, 0], [0, -359, 0, 238], [-578, 0, 220, 0], [0, 684, 0, 167], [0, -128, 0, 298], [0, -830, 0, -22], [780, 0, 183, 0], [0, -701, 0, -185], [0, 212, 0, 66], [0, -710, 0, -46], [186, 0, 16, 0], [-510, 0, -33, 0], [-504, 0, -388, 0], [0, -782, 0, 34], [0, -1129, 0, 57], [-434, 0, 276, 0], [0, -536, 0, -122], [22, 0, 540, 0], [854, 0, -94, 0], [0, -425, 0, -118], [74, 0, 144, 0], [0, 46, 0, -321], [-1128, 0, 67, 0], [-446, 0, 108, 0], [1292, 0, 63, 0], [0, 65, 0, -17], [-918, 0, 151, 0], [0, 278, 0, -124], [0, 262, 0, 6], [0, 404, 0, -187], [198, 0, 469, 0], [68, 0, -240, 0], [1256, 0, -264, 0], [0, -974, 0, 162], [1182, 0, 112, 0], [0, -300, 0, -378], [86, 0, -52, 0], [0, -374, 0, 57], [0, -1478, 0, -32], [0, -22, 0, -108], [-1490, 0, -52, 0], [-70, 0, 529, 0], [0, -738, 0, -52], [0, 242, 0, -82], [0, -400, 0, 157], [822, 0, -70, 0], [894, 0, -425, 0], [1320, 0, 36, 0], [0, 585, 0, -339], [0, 672, 0, 77], [26, 0, 90, 0], [0, 148, 0, -356], [0, 555, 0, 6], [-264, 0, 178, 0], [-1558, 0, 120, 0], [0, 326, 0, -97], [-1072, 0, -147, 0], [0, 1400, 0, 4], [0, 764, 0, -4], [-390, 0, -300, 0], [828, 0, 19, 0], [0, -849, 0, -104], [0, 1530, 0, -18], [0, 662, 0, -64], [-826, 0, -60, 0], [386, 0, -264, 0], [0, -309, 0, 344], [620, 0, 253, 0], [0, -710, 0, -310], [-946, 0, -388, 0], [0, -962, 0, -176], [0, 886, 0, 70], [372, 0, 539, 0], [0, -461, 0, 319], [138, 0, -79, 0], [-1390, 0, -68, 0], [-1274, 0, 372, 0], [0, 549, 0, 344], [-980, 0, 62, 0], [0, 750, 0, 159], [1810, 0, 212, 0], [0, -760, 0, -161], [0, -611, 0, 189], [0, -20, 0, -40], [0, 188, 0, 444], [644, 0, -354, 0], [252, 0, -647, 0], [114, 0, -362, 0], [0, 288, 0, -502], [0, -104, 0, 70], [-932, 0, 543, 0], [0, -791, 0, 307], [836, 0, 42, 0], [0, -18, 0, -77], [-1230, 0, 159, 0], [0, -221, 0, -56], [0, 450, 0, 159], [-354, 0, 56, 0], [0, 678, 0, 56], [0, -1575, 0, -45], [-646, 0, 78, 0], [580, 0, -568, 0], [0, 730, 0, -4], [-650, 0, -118, 0], [652, 0, 141, 0], [0, 608, 0, -292], [-1630, 0, 340, 0], [542, 0, -103, 0], [0, 1342, 0, -44], [-1012, 0, 90, 0], [0, 616, 0, -299], [0, -1335, 0, 162], [1000, 0, 446, 0], [0, -628, 0, 227], [2674, 0, -20, 0], [664, 0, 180, 0], [490, 0, -388, 0], [2034, 0, 334, 0], [1158, 0, 40, 0], [-1192, 0, 141, 0], [0, -1148, 0, -278], [-2434, 0, 318, 0], [-726, 0, -532, 0], [0, 1455, 0, -321], [0, -990, 0, -237], [1550, 0, 208, 0], [0, 938, 0, -370], [546, 0, -104, 0], [-1712, 0, -570, 0], [0, 726, 0, -302], [-1078, 0, 356, 0], [0, -120, 0, 405], [2250, 0, -264, 0], [0, 385, 0, 62], [0, 284, 0, -297], [0, 710, 0, -272], [0, -300, 0, 174], [0, -705, 0, 363], [438, 0, 257, 0], [0, -30, 0, -327], [186, 0, 490, 0], [0, 1350, 0, -18], [0, -1111, 0, 197], [-460, 0, 874, 0], [-1970, 0, -100, 0], [0, 0, 0, 441], [-1726, 0, 452, 0], [0, 182, 0, -196], [1360, 0, 110, 0], [1922, 0, -528, 0], [0, -770, 0, -280], [174, 0, -128, 0], [0, 1980, 0, -102], [1306, 0, -75, 0], [0, -602, 0, 373], [0, -700, 0, -149], [0, 1925, 0, 4], [1072, 0, -558, 0], [0, -702, 0, -446], [-1876, 0, -508, 0], [0, -1261, 0, 95], [0, -640, 0, -38], [-202, 0, -42, 0], [0, 771, 0, -322], [1148, 0, -370, 0], [818, 0, -496, 0], [0, 830, 0, 211], [2832, 0, -389, 0], [0, 152, 0, 2], [2720, 0, 136, 0]]
