
# q-expansion of newform 2352.3.m.m, downloaded from the LMFDB on 01 May 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 = 2352
weight = 3
poly_data = [2883, 0, 784, 0, 56, 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, 0, 0], 1], [[0, 2, 0, 0, 0, 0], 1], [[0, 28, 0, 1, 0, 0], 31], [[589, 0, 59, 0, 1, 0], 31], [[-1147, 0, -174, 0, -4, 0], 31], [[0, 377, 0, 47, 0, 1], 31]]

hecke_ring_character_values = [[1471, [-1, 0, 0, 0, 0, 0]], [1765, [1, 0, 0, 0, 0, 0]], [785, [1, 0, 0, 0, 0, 0]], [2257, [1, 0, 0, 0, 0, 0]]]
aps_data = [[0, 0, 0, 0, 0, 0], [0, 0, -1, 0, 0, 0], [-1, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 1], [-1, 0, 0, -1, -1, 0], [-10, 0, 0, 0, 2, 0], [0, 2, -6, 0, 0, 1], [0, 2, -4, 0, 0, 0], [-7, 0, 0, 3, 2, 0], [0, 1, 1, 0, 0, 4], [-9, 0, 0, -5, -1, 0], [-30, 0, 0, -2, -2, 0], [0, -4, 12, 0, 0, -3], [0, 2, -14, 0, 0, 8], [17, 0, 0, 3, 2, 0], [0, 8, 11, 0, 0, -3], [-20, 0, 0, -4, 2, 0], [0, 6, 40, 0, 0, 3], [0, 2, 38, 0, 0, 0], [-15, 0, 0, 13, -1, 0], [0, -1, 11, 0, 0, 2], [0, -4, -1, 0, 0, -9], [-86, 0, 0, 2, 0, 0], [-60, 0, 0, -3, 7, 0], [20, 0, 0, -12, -10, 0], [0, 0, -66, 0, 0, -7], [0, 4, 19, 0, 0, -15], [7, 0, 0, -5, 13, 0], [50, 0, 0, 6, -10, 0], [0, 9, 41, 0, 0, 10], [0, -24, -41, 0, 0, -5], [-46, 0, 0, -6, -4, 0], [0, -10, 52, 0, 0, -5], [-22, 0, 0, 10, -12, 0], [0, -5, 89, 0, 0, -19], [46, 0, 0, 14, 2, 0], [0, -10, 52, 0, 0, 4], [0, -4, 98, 0, 0, 12], [-106, 0, 0, 2, 4, 0], [0, 4, 120, 0, 0, 2], [149, 0, 0, -17, -11, 0], [0, -12, -12, 0, 0, 6], [-29, 0, 0, 6, -10, 0], [150, 0, 0, 18, 12, 0], [0, 8, 4, 0, 0, -24], [0, 4, 86, 0, 0, -18], [0, 27, 49, 0, 0, -11], [0, -16, 117, 0, 0, 13], [153, 0, 0, 27, 13, 0], [-24, 0, 0, -34, -4, 0], [0, 10, 0, 0, 0, -22], [32, 0, 0, 9, 3, 0], [0, 12, 3, 0, 0, -15], [-156, 0, 0, 16, -14, 0], [0, 26, 102, 0, 0, -14], [-83, 0, 0, -1, 0, 0], [0, 5, -105, 0, 0, 27], [171, 0, 0, -27, -25, 0], [154, 0, 0, -18, 16, 0], [0, 28, 28, 0, 0, 7], [195, 0, 0, -19, -10, 0], [0, -34, -34, 0, 0, 11], [0, -28, -32, 0, 0, 14], [113, 0, 0, -6, 22, 0], [-223, 0, 0, 23, 34, 0], [0, -8, 202, 0, 0, -3], [-215, 0, 0, 48, -24, 0], [0, 20, 124, 0, 0, -4], [14, 0, 0, 20, 24, 0], [-158, 0, 0, 14, -30, 0], [0, -20, -86, 0, 0, 42], [0, -1, 75, 0, 0, 52], [45, 0, 0, 31, -19, 0], [0, 32, 50, 0, 0, -19], [0, 32, -66, 0, 0, -26], [-264, 0, 0, 32, 26, 0], [131, 0, 0, 17, -45, 0], [20, 0, 0, 52, -12, 0], [-9, 0, 0, -58, -30, 0], [0, 16, -132, 0, 0, -34], [-287, 0, 0, 31, -5, 0], [0, 28, -140, 0, 0, 42], [-13, 0, 0, 83, 21, 0], [0, -43, -53, 0, 0, -25], [0, 4, 209, 0, 0, 7], [212, 0, 0, -82, -8, 0], [-111, 0, 0, 58, 6, 0], [-206, 0, 0, -22, 12, 0], [0, 20, -154, 0, 0, 33], [0, -32, 112, 0, 0, -30], [0, 10, -194, 0, 0, -30], [0, -43, -147, 0, 0, 40], [0, 16, 57, 0, 0, 47], [0, 14, -12, 0, 0, 9], [0, -46, 112, 0, 0, -58], [-627, 0, 0, -5, -8, 0], [-568, 0, 0, -54, -10, 0], [0, 6, 322, 0, 0, -25], [-139, 0, 0, 7, 35, 0], [0, -30, -192, 0, 0, 56], [-231, 0, 0, -85, -52, 0], [0, -24, 207, 0, 0, -33], [-420, 0, 0, -54, -36, 0], [0, -4, -16, 0, 0, -3], [161, 0, 0, 28, 56, 0], [0, -16, -291, 0, 0, 55], [-644, 0, 0, -6, 4, 0], [0, 8, -494, 0, 0, 26], [237, 0, 0, -16, -68, 0], [0, -25, 111, 0, 0, -44], [676, 0, 0, 10, -12, 0], [570, 0, 0, 44, 20, 0], [0, -64, 44, 0, 0, 73], [0, 41, -153, 0, 0, -85], [20, 0, 0, -30, -34, 0], [0, -18, -372, 0, 0, 19], [0, -18, -194, 0, 0, -44], [-459, 0, 0, 95, -16, 0], [0, 24, -248, 0, 0, 52], [-331, 0, 0, -9, 19, 0], [15, 0, 0, 6, -38, 0], [-159, 0, 0, -9, -42, 0], [0, -72, -1, 0, 0, 65], [0, 12, 166, 0, 0, -57], [593, 0, 0, -17, -30, 0], [338, 0, 0, 0, -56, 0], [0, -4, 182, 0, 0, 12], [0, 33, 141, 0, 0, -106], [-149, 0, 0, -19, 49, 0], [0, -22, -180, 0, 0, 21], [0, -52, 2, 0, 0, 24], [0, -67, -211, 0, 0, 54], [-100, 0, 0, -60, -26, 0], [-862, 0, 0, 72, -10, 0], [325, 0, 0, 54, 18, 0], [100, 0, 0, -144, -50, 0], [0, 12, 46, 0, 0, -78], [441, 0, 0, -113, 10, 0], [-90, 0, 0, -98, 70, 0], [0, -46, -326, 0, 0, 26], [691, 0, 0, 65, -36, 0], [0, 56, -384, 0, 0, 92], [0, 48, -99, 0, 0, -87], [103, 0, 0, 19, -93, 0], [0, -18, 392, 0, 0, -16], [835, 0, 0, -17, -11, 0], [-380, 0, 0, 26, 54, 0], [0, 8, 266, 0, 0, 46], [0, -48, -278, 0, 0, -80], [834, 0, 0, -90, 10, 0], [-542, 0, 0, 130, 32, 0], [0, 40, -214, 0, 0, -71], [0, 38, 24, 0, 0, -2], [0, 58, -238, 0, 0, -87], [0, -74, -90, 0, 0, 14], [0, 12, -674, 0, 0, -55], [-526, 0, 0, 52, 36, 0], [157, 0, 0, -108, 84, 0], [-495, 0, 0, 51, -54, 0], [0, -80, 308, 0, 0, 106], [780, 0, 0, 42, 42, 0], [0, 43, 7, 0, 0, 2], [0, -48, 529, 0, 0, -17], [-238, 0, 0, 76, -24, 0], [0, -84, -152, 0, 0, 28], [0, -33, -149, 0, 0, 128], [159, 0, 0, 99, 17, 0], [97, 0, 0, -94, 26, 0], [37, 0, 0, 99, 82, 0], [0, 136, 3, 0, 0, 65], [-748, 0, 0, 68, -18, 0], [0, 122, 68, 0, 0, 60], [-355, 0, 0, 32, 12, 0], [0, -13, 131, 0, 0, 74], [-280, 0, 0, -132, -52, 0], [0, -32, 284, 0, 0, 143], [73, 0, 0, -129, -44, 0], [0, -100, -88, 0, 0, 20], [1, 0, 0, -73, -1, 0], [0, 71, -281, 0, 0, 8], [0, 36, -287, 0, 0, -101], [-853, 0, 0, -5, 41, 0], [-238, 0, 0, -54, -76, 0], [0, -76, 286, 0, 0, -76], [-423, 0, 0, -77, 58, 0], [232, 0, 0, -36, -66, 0], [0, -18, 676, 0, 0, 61], [473, 0, 0, 22, -46, 0], [0, -46, 416, 0, 0, -30], [783, 0, 0, 48, -8, 0], [0, 124, 207, 0, 0, -49], [0, -98, 196, 0, 0, -112], [194, 0, 0, 134, -32, 0], [0, 196, 381, 0, 0, 59], [782, 0, 0, -2, -72, 0], [25, 0, 0, -39, 23, 0], [-972, 0, 0, -104, -18, 0], [-374, 0, 0, -156, -104, 0], [0, -46, -402, 0, 0, -86], [-431, 0, 0, 91, -28, 0], [0, 12, 450, 0, 0, 55], [-298, 0, 0, -12, -36, 0], [978, 0, 0, -152, -28, 0], [0, -128, 572, 0, 0, 118], [-11, 0, 0, -97, -12, 0], [0, -60, -400, 0, 0, 124], [0, -16, 419, 0, 0, 135], [-90, 0, 0, -188, -158, 0], [0, 18, -70, 0, 0, -26], [593, 0, 0, -67, -61, 0], [-259, 0, 0, -93, 146, 0], [0, -37, 545, 0, 0, -47], [0, 140, -11, 0, 0, -133], [0, -46, -116, 0, 0, 68], [-1057, 0, 0, 51, 85, 0], [0, -47, 415, 0, 0, -141], [-426, 0, 0, 40, -74, 0], [0, 36, 262, 0, 0, 166], [224, 0, 0, -108, 110, 0], [543, 0, 0, 281, 115, 0], [0, -24, 702, 0, 0, 37], [-362, 0, 0, 164, -96, 0], [0, 99, -47, 0, 0, 109], [0, -116, 529, 0, 0, 33], [-66, 0, 0, 214, -58, 0], [-290, 0, 0, -206, -52, 0], [0, -8, 24, 0, 0, 50], [0, 53, -659, 0, 0, -82], [0, -8, 416, 0, 0, -230], [305, 0, 0, 179, 75, 0], [0, -12, 164, 0, 0, 8], [0, -85, -133, 0, 0, -170], [220, 0, 0, 124, 134, 0], [0, 62, -32, 0, 0, -137], [0, 114, 196, 0, 0, 22], [-745, 0, 0, -46, 98, 0], [865, 0, 0, -237, 52, 0], [0, -48, 788, 0, 0, -232], [0, 170, 40, 0, 0, -118], [0, -8, 928, 0, 0, 30], [0, 188, -366, 0, 0, -11], [0, -49, 115, 0, 0, 14], [-578, 0, 0, 16, -36, 0], [-782, 0, 0, -24, 94, 0], [0, -20, -272, 0, 0, 60], [0, 49, 29, 0, 0, -70], [0, 164, 520, 0, 0, 110], [0, 104, 64, 0, 0, 104], [0, -104, 580, 0, 0, -132], [-57, 0, 0, 299, 1, 0], [400, 0, 0, -34, 78, 0], [0, 96, 654, 0, 0, 132], [473, 0, 0, 105, 135, 0], [1195, 0, 0, -75, 70, 0], [0, 12, -791, 0, 0, -53], [-1211, 0, 0, 163, -29, 0], [0, 44, 66, 0, 0, 15], [773, 0, 0, 47, 4, 0], [-408, 0, 0, 291, 29, 0], [0, 28, 798, 0, 0, -91], [0, -96, 125, 0, 0, -193], [-1423, 0, 0, 121, 91, 0], [547, 0, 0, 65, -121, 0], [-390, 0, 0, 24, 48, 0], [0, 78, -688, 0, 0, 207], [-3, 0, 0, -45, 12, 0], [-528, 0, 0, -122, -164, 0], [0, 16, 664, 0, 0, -60], [885, 0, 0, -165, -96, 0], [-545, 0, 0, -51, -165, 0], [0, 82, 286, 0, 0, -166], [203, 0, 0, 32, 212, 0], [0, 9, -487, 0, 0, 112], [-424, 0, 0, 219, -15, 0], [0, -72, 288, 0, 0, -8], [0, -216, 407, 0, 0, -25], [931, 0, 0, 103, -153, 0], [581, 0, 0, 125, 11, 0], [0, -256, -808, 0, 0, -72], [0, -18, 1230, 0, 0, -114], [0, 211, 923, 0, 0, 50], [0, -106, -12, 0, 0, -74], [-541, 0, 0, -31, 183, 0], [0, -194, -78, 0, 0, -90], [0, 270, 4, 0, 0, -2], [-1435, 0, 0, -182, 14, 0], [-91, 0, 0, -165, -40, 0], [0, 47, -1161, 0, 0, -78], [-1238, 0, 0, -86, -130, 0], [-294, 0, 0, 50, -4, 0], [0, -28, 641, 0, 0, 63], [-1370, 0, 0, 90, 130, 0], [0, 56, -732, 0, 0, -224], [1323, 0, 0, 147, 91, 0], [1991, 0, 0, 113, 16, 0], [0, -84, 662, 0, 0, -203], [2182, 0, 0, 38, 60, 0], [0, 132, -416, 0, 0, 10], [0, -60, -332, 0, 0, 173], [-6, 0, 0, -280, -248, 0], [589, 0, 0, 11, 12, 0], [0, 93, -565, 0, 0, 83]]
