
# q-expansion of newform 225.5.g.l, downloaded from the LMFDB on 25 June 2026.

# 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 = 225
weight = 5
poly_data = [9, 0, 0, 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, 0], 1], [[0, 0, 1, 0], 3], [[0, 0, 0, 1], 3]]

hecke_ring_character_values = [[101, [1, 0, 0, 0]], [127, [0, 0, -1, 0]]]
aps_data = [[3, 0, -3, 2], [0, 0, 0, 0], [0, 0, 0, 0], [18, 0, -18, 1], [6, 78, 0, -78], [-36, -69, -36, 0], [150, 0, -150, -2], [0, 114, 139, 114], [222, 326, 222, 0], [0, 282, 102, 282], [811, -246, 0, 246], [-612, 0, 612, -124], [-1716, -294, 0, 294], [1386, 595, 1386, 0], [1404, 0, -1404, -1230], [462, 676, 462, 0], [0, 1584, -1926, 1584], [3755, -1032, 0, 1032], [3330, 0, -3330, 1767], [5388, -930, 0, 930], [-4932, 1204, -4932, 0], [0, 3180, 2090, 3180], [2148, 938, 2148, 0], [0, -1884, -1524, -1884], [2880, 0, -2880, 1757], [2256, -2262, 0, 2262], [-6444, -280, -6444, 0], [-7326, 0, 7326, -4800], [0, -2256, -8401, -2256], [-10872, -5232, -10872, 0], [-11340, 0, 11340, -1188], [16740, 882, 0, -882], [4668, 0, -4668, 2242], [0, -1944, -7274, -1944], [0, -3432, 11238, -3432], [-3353, -3330, 0, 3330], [-2088, 0, 2088, -15467], [-2430, -15237, -2430, 0], [-78, 0, 78, 11864], [19578, -11342, 19578, 0], [0, -6000, -4110, -6000], [1, -14556, 0, 14556], [45126, 5418, 0, -5418], [252, 10147, 252, 0], [-564, 0, 564, -17134], [0, -9738, 22817, -9738], [-22399, 18174, 0, -18174], [1134, -25519, 1134, 0], [22242, 0, -22242, -21256], [0, 7296, -14579, 7296], [11394, -21300, 11394, 0], [0, 12246, 3156, 12246], [23639, 35472, 0, -35472], [26688, -11760, 0, 11760], [-2136, 0, 2136, -65180], [53010, 2172, 53010, 0], [0, 13206, 73506, 13206], [-66766, -13128, 0, 13128], [-44316, 0, 44316, 15959], [-40398, 3414, 0, -3414], [14634, -64159, 14634, 0], [23880, -30818, 23880, 0], [-46494, 0, 46494, 39115], [64146, 9768, 0, -9768], [-81180, -6087, -81180, 0], [-38256, 0, 38256, 1580], [-2758, 2520, 0, -2520], [79884, 0, -79884, -35661], [41940, 0, -41940, 11178], [0, -47352, 10618, -47352], [-120834, -486, -120834, 0], [0, 4194, -210816, 4194], [23814, 0, -23814, 369], [-80964, -1675, -80964, 0], [0, -8670, -137285, -8670], [-91860, -61088, -91860, 0], [0, -59646, 137184, -59646], [-191124, 0, 191124, 23195], [-166020, -45798, 0, 45798], [0, -17364, 11221, -17364], [0, 32586, 3336, 32586], [70738, -27084, 0, 27084], [23934, -49434, 0, 49434], [34020, 96983, 34020, 0], [0, 50070, -153475, 50070], [-68964, -47036, -68964, 0], [0, 77808, -55572, 77808], [57888, 0, -57888, 42336], [175308, -86250, 0, 86250], [-204444, 39580, -204444, 0], [-149226, 0, 149226, 10670], [0, -77580, 41310, -77580], [-87570, 0, 87570, 87027], [58380, 61512, 0, -61512], [0, 35274, -15391, 35274], [123306, -75256, 123306, 0], [0, 14604, 187494, 14604], [-59826, 60666, 0, -60666], [-154854, 73595, -154854, 0], [-361909, -6156, 0, 6156], [100188, 0, -100188, -2744], [181620, 0, -181620, 7938], [-31302, -79842, -31302, 0], [0, 19926, 210726, 19926], [382229, 87942, 0, -87942], [-116640, 0, 116640, 178937], [116394, 0, -116394, 249820], [-121206, 223640, -121206, 0], [0, 55908, -369072, 55908], [61189, -138468, 0, 138468], [-124200, 0, 124200, -33028], [201672, -27868, 201672, 0], [-93882, 0, 93882, -157448], [0, -47394, -274639, -47394], [270917, -91230, 0, 91230], [-142836, -130164, 0, 130164], [120996, -60060, 120996, 0], [-362220, 0, 362220, 96248], [33240, 184342, 33240, 0], [0, -109590, -79260, -109590], [-656318, 33840, 0, -33840], [6228, -356276, 6228, 0], [323046, 0, -323046, 74106], [15060, -262448, 15060, 0], [412114, 63672, 0, -63672], [100950, 274722, 0, -274722], [0, -173016, 127489, -173016], [0, -44742, -510762, -44742], [225702, 0, -225702, 206863], [-382104, 91980, -382104, 0], [0, 258756, 38926, 258756], [-131796, -230340, -131796, 0], [164854, 63672, 0, -63672], [155232, 0, -155232, -228857], [52992, -217476, 0, 217476], [0, -83868, 887627, -83868], [-427710, 132872, -427710, 0], [173106, 0, -173106, 7705], [-422376, 0, 422376, 72680], [0, -51030, -848700, -51030], [-130553, 227430, 0, -227430], [400002, -55776, 0, 55776], [651042, 43707, 651042, 0], [-448410, 0, 448410, -281612], [0, -3240, -567530, -3240], [0, 152370, 702990, 152370], [-75240, 78783, -75240, 0], [-100956, 0, 100956, -217340], [0, -278880, 433790, -278880], [36444, -295280, 36444, 0], [57168, 0, -57168, -425789], [150552, 388764, 0, -388764], [419706, -14425, 419706, 0], [514104, 0, -514104, -172250], [-253944, 0, 253944, -110860], [515898, -329760, 0, 329760], [0, 397170, -484865, 397170], [0, -366294, 416886, -366294], [-21636, 0, 21636, -576821], [946434, 99156, 0, -99156], [694338, 0, -694338, 368722], [-117324, 790884, -117324, 0], [-284040, 0, 284040, 131132], [680274, 397116, 0, -397116], [36360, 0, -36360, -573702], [284352, -30724, 284352, 0], [393377, -104910, 0, 104910], [277632, 0, -277632, -702012]]
