
# q-expansion of newform 90.7.g.f, downloaded from the LMFDB on 26 September 2025.

# 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 = 90
weight = 7
poly_data = [7638760000, 0, 140305200, 0, 816401, 0, 1602, 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, 0, 0], 1], [[0, -1070524600, 0, -11615221, 0, -29042, 0, -21], 664240000], [[4480431648000, -46836455400, 38450244480, -1283225239, 43182960, -3497878, -5520, -2439], 7306640000], [[-1251567650400, 33635027400, -12889587964, 314249787, -26770528, 647574, -15364, 387], 730664000], [[-16362057860000, 111144417800, -177619829900, 599740443, -434115800, 1290686, -305900, 843], 3653320000], [[4737691800, 12020923800, -54524007, 124659171, -248814, 273942, -207, 171], 182666000], [[4737691800, -12020923800, -54524007, -124659171, -248814, -273942, -207, -171], 182666000], [[-12071133884000, 33342260200, -136988625140, 1244128527, -380980280, 3191254, -303140, 2127], 3653320000]]

hecke_ring_character_values = [[11, [1, 0, 0, 0, 0, 0, 0, 0]], [37, [0, 1, 0, 0, 0, 0, 0, 0]]]
aps_data = [[4, 4, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [-7, 23, 0, -1, 0, 0, 0, 0], [49, 49, -1, -1, -1, 1, 0, 0], [522, -2, 4, 4, 4, -5, 0, 5], [988, -980, -11, -5, 2, 33, 1, -7], [174, 166, 11, -5, 13, -5, 40, 2], [8, -2198, -42, -16, -9, -43, 81, 13], [-1858, 1902, -82, -6, 11, -86, 27, -17], [62, 144, -146, -124, 20, 290, -175, 11], [280, 4, -8, 0, -4, -158, -160, -6], [-8756, -8748, -3, 13, -5, -3, 193, -2], [-21250, 40, -80, 234, 77, 287, 501, 57], [20558, -20518, 2, -82, 10, 1157, -52, -92], [13664, 13644, 24, -16, 29, -9, -442, 5], [60106, -60006, -173, -27, 25, -1787, 48, -52], [-162, -7426, -348, 324, -417, 1441, -1012, 336], [33514, -480, 960, -506, 227, 462, 196, 467], [12478, 11606, -90, -1834, 128, 744, 2389, 218], [316436, -320, 640, -1364, -362, -117, -1321, -202], [40235, -41859, 2602, 646, -406, 1302, -572, 1052], [-84, -266756, 388, 168, 68, 95, -441, -110], [-26776, 23932, 5452, 236, -711, -354, -1897, 947], [-884, 110450, 4234, 1768, 791, 2319, -6111, -1233], [-108333, -106309, -1066, 2982, -1572, -452, -7154, -506], [374820, -1746, 3492, -3640, -74, -7472, -10239, 799], [-214789, 215301, 1399, -2423, 128, -3262, -2039, -2551], [-196592, -195564, 508, 2564, 251, -1279, 18286, -257], [-2036, -507558, 3376, 4072, -1366, -9702, 7344, 348], [473268, -469812, -3965, -2947, 864, 19874, -355, -3811], [894529, 890881, 3251, -4045, 4163, -515, -20938, 912], [1549982, 4214, -8428, 8544, 58, -9185, -2748, -2049], [1005248, 1004288, -3313, -5233, -3073, 4033, 30234, 240], [7948, -1979354, -16930, -15896, 3457, 17507, -4551, 517], [2254, -327804, -3120, -4508, 1821, -23751, 25744, -694], [496278, 7500, -15000, 14474, -263, 30118, 40842, -4013], [1279502, 1282302, -7743, -2143, -8443, 5643, -4677, -700], [-140400, 149464, -24432, 6304, 2266, -47719, 13102, 4038], [1168118, 1165410, 3602, -1814, 4279, -1571, -13640, 677], [-1831148, 1818948, 30857, -6457, -3050, 16736, -15607, -3407], [226, -5327378, 6888, -452, 3783, -21887, 14886, -3670], [840234, 8596, -17192, 9748, -3722, -15104, -9654, -8020], [-661696, -9244, 18488, -41276, -11394, 2833, -33821, -6772], [-3046865, 3031745, 42872, -12632, -3780, 64828, -23972, -8852], [2475110, 2493146, 11189, 47261, 6680, -24716, -25721, -4509], [-4588, -4817886, -17442, 9176, -15603, -17403, 37139, 13309], [6468250, -22588, 45176, -43798, 689, 5544, -26960, 11983], [-5432765, 5438901, -21969, 9697, 1534, 113890, 14299, 8163], [1609996, 1584788, 8944, -41472, 15246, 9962, -117245, 6302], [10068, -12960822, -13686, -20136, 8259, -26084, 34736, -3225], [-4396702, 4377958, 20305, 17183, -4686, -217116, 3125, 21869], [15784, -201944, -63680, -31568, -8164, 61794, -6006, 16056], [-769520, 14736, -29472, 21984, -3744, -191074, -176458, -11112], [11647438, 5214, -10428, -8504, -9466, 87951, 76840, -12073], [-1412920, -1391240, -65271, -21911, -70691, 49011, 96546, -5420], [-7110086, 7159242, -101162, 2850, 12289, 14068, 39717, -9439], [3934, -6821184, 72100, -7868, 41951, -4071, -69996, -39984], [8565602, -27620, 55240, 24662, 39951, -74258, -35786, 53761], [-651224, -557336, 13543, 201319, -9929, -83959, -88453, -23472], [13209242, 44376, -88752, 50126, -19313, 150917, 178855, -41501], [2912058, -2925658, -49370, 76570, -3400, 48573, 66370, 79970], [-9356778, 9360686, -187, -7629, 977, -130545, -4698, -8606], [-23194674, -23224482, -25038, -84654, -17586, 47394, 92141, 7452], [-2708988, -46896, 93792, -19396, 37198, -158835, -154783, 60646], [-2705423, 2686103, 81698, -43058, -4830, -352424, -57548, -38228], [-2247176, -2287816, 138317, 57037, 148477, -107837, -49428, 10160], [6900794, 73800, -147600, 57046, -45277, 159464, 179610, -82177], [-5277195, -5381003, 35188, -172428, 61140, 42668, -282094, 25952], [-20792704, -20823600, -42956, -104748, -35232, 66128, 130301, 7724], [-107664, 30656002, 190926, 215328, -66033, -171088, 33994, 12201], [-2134990, 2178942, 34515, -122419, 10988, 255594, -89455, -133407], [-52212, 9057592, 170844, 104424, 7104, -158160, 13422, -33210], [-20021919, -19943895, 64591, 220639, 45085, -123109, 145474, -19506], [36880786, -36979578, 98017, 99567, -24698, -33817, 25473, 124265], [57748, 10666226, 98890, -115496, 136067, -29883, -97881, -107193], [28697908, -28726432, 8636, 48412, -7131, 364716, 27019, 55543], [-25998, -10010160, 22332, 51996, -27831, 445615, -454948, 14832], [-20443874, -20286402, -27541, 287403, -66909, -90563, -655203, -39368], [9310938, 38920, -77840, -54132, -65986, 115668, 42076, -85446], [-34700, 43350848, 9086, 69400, -47507, -826974, 835238, 30157], [56782, 45228098, -184576, -113564, -7115, 24749, 131436, 35506], [-23581906, 196364, -392728, 374214, -9257, -412748, -136716, -107439], [21493396, 2356, -4712, 258536, 126912, -437527, -180169, 125734], [-53965095, 54033599, -66872, -70136, 17126, 419946, -18758, -87262], [-7188, 27966678, -38030, 14376, -29797, 33847, 7777, 26203], [-53144720, 53301960, -345444, 30964, 39310, -866617, 148894, -8346], [-91012, -6793442, -78784, 182024, -175910, 403782, -279492, 130404], [-51215377, -51100737, -6024, 223256, -34684, -79956, 241598, -28660], [-39437244, 1946, -3892, 261916, 129012, 145888, 406831, 128039], [4862495, -4751495, -112209, -109791, 27750, -131614, -26541, -137541], [26793564, 26826824, 103908, 170428, 95593, -128853, -1589000, -8315], [235584, -59556940, -150492, -471168, 278130, 75212, -42512, -160338], [13639077, 13555893, 53895, -112473, 74691, 8493, 1992650, 20796], [-33039394, 149466, -298932, 32812, -133060, -33991, -75912, -207793], [-70024, 98587254, -8246, 140048, -109159, 380473, -337215, 74147], [5963436, -5899824, 356208, -483432, 15903, 288598, -435723, -499335], [216822, 62419076, -354990, -433644, 147738, 764960, -518381, -39327], [-12080350, 8220, -16440, -195340, -105890, -333112, -532562, -110000], [-4276930, 4025882, 455774, 46322, -62762, -1270575, -141964, 109084], [-28247950, -41660, 83320, -765608, -341144, 57244, -687534, -320314], [-18767554, -18715010, 167926, 273014, 154790, -207334, -922131, -13136], [73941466, 74337982, -100079, 692953, -199208, -197308, 1823953, -99129], [-65404572, 65205612, 500424, -102504, -49740, 1792783, -251724, -52764], [-186376, -129173974, 308272, 372752, -125428, 1321240, -1536324, 32240], [-86938802, 51024, -102048, 598946, 248449, -590010, -16576, 222937], [31922485, 31767733, -388110, -697614, -349422, 504174, -3288130, 38688], [-32401636, -32389368, -103824, -79288, -106891, 94623, -1794782, -3067], [-54690372, 54360388, 1019661, -359693, -82496, -723574, -607181, -277197], [-68172, -88717052, -192208, 136344, -198362, -1823080, 2049374, 164276], [94546234, -528308, 1056616, -982318, 37149, 644230, -73934, 301303], [79654821, 80165973, -223749, 798555, -351537, -159615, -904562, -127788], [-145568726, 145417126, 115147, 188053, -37900, -1220025, 74353, 225953], [110485226, 110267938, -174929, -609505, -120607, 337895, 857776, 54322], [-305948, 21573370, -492662, 611896, -705253, 1000333, -354697, 552279], [114040796, -150668, 301336, -352508, -25586, -322442, -599616, 49748], [28280746, -158868, 317736, -511014, -96639, 1887273, 1455693, -17205], [52346560, -51841120, -518824, -492056, 126360, 360441, -112976, -618416], [-164684996, -164474104, 339964, 761748, 287241, -498133, -303516, -52723], [93227284, -92582444, -1554599, 264919, 161210, -1942470, 748549, 103709], [-57826, 92718438, -58612, 115652, -116045, -3694355, 3781880, 87132], [81274674, 697424, -1394848, 2045038, 325095, -1834394, -138068, -23617], [7177551, -6169471, -1952562, -63598, 252020, -436282, 692462, -315618], [39583852, 38811868, 375695, -1168273, 568691, 203293, 1554428, 192996], [-36731360, 36957764, -857980, 405172, 56601, -2524228, 574975, 348571], [203110814, 377768, -755536, -474862, -615199, 982136, 318390, -804083], [96537228, 746866, -1493732, 1703218, 104743, -47287, 1282498, -268690], [673956, -80295746, -1680762, -1347912, 170553, 2864600, -1520816, 166425], [-433808, 302069460, 363580, 867616, -468922, -443186, 296510, 252018], [126772805, 126159733, 235495, -990649, 388763, 224309, -2672290, 153268], [36446384, -36308016, -814121, 537385, 34592, 974881, 641161, 502793], [404112, -148141946, 865538, -808224, 1038937, -594153, -473441, -836881], [74341400, -74108580, -1030016, 564376, 58205, -4782276, 738991, 506171], [-129020120, 247964, -495928, 189232, -153348, -3152796, -3087546, -277330], [-42634352, -43215048, 1297887, 136495, 1443061, -862365, 2770333, 145174], [-179963434, -231460, 462920, -162372, 150274, 2969240, 2922598, 266004], [-731452, 142368466, 1136042, 1462904, -529157, -6537662, 5767346, 163431], [-31744144, 32256632, 406187, -1431163, 128122, 1933090, -1046797, -1559285], [37731774, 39753998, 555346, 4599794, 49790, -2072014, 3738993, -505556], [220051412, 219860524, -781751, -1163527, -734029, 924917, 376308, 47722], [-843468, -83160054, 3903386, 1686936, 686491, -1889807, -1591845, -1108225], [419403158, 228148, -456296, 1814142, 678923, -4630314, -2930246, 564849], [-695923568, 127838, -255676, 562466, 153395, -2067703, -1569156, 89476], [199059911, -199671039, 1229651, -7395, -152782, 890772, -465741, 145387], [57075492, 57927892, 1046380, 2751180, 833280, -1685680, 3298155, -213100], [-58676, 62808586, 259604, 117352, 41788, -4683574, 4453308, -71126], [-198556, 141348168, 1700876, 397112, 552604, 4341784, -5943382, -651882], [313452354, -314092842, 1601659, -320683, -160122, 3544097, -801049, -160561], [197838974, 196764518, 134513, -2014399, 403127, 671329, 2009292, 268614], [-293612, 15702494, 756534, 587224, -62151, 1912097, -2521825, -84655], [12850794, -16006598, 5065086, 1246522, -788951, -2310506, -1120331, 2035473], [319715930, 320301674, 1253093, 2424581, 1106657, -1692401, -5223093, -146436], [99136650, -979748, 1959496, -1841558, 58969, -6969285, -8320969, 548843], [-160961076, 162410108, -2935500, 37436, 362258, -5640491, 1124210, -324822], [-75401310, -77274122, -752714, -4498338, -284511, 2157323, -1548244, 468203], [-69784348, -69922220, 813264, 537520, 847732, -709860, -1006927, 34468], [-727124548, 670196, -1340392, 494872, -422760, 4505153, 4664927, -757858], [-873004, -23635136, -1286080, 1746008, -1952546, -2250929, 3973511, 1516044], [-301020, 326642326, 1101980, 602040, 99460, -1190614, 239144, -249970], [-116854899, -116259147, 468866, 1660370, 319928, -915680, -2787892, -148938], [213533992, 735694, -1471388, 1890256, 209434, -3254808, -1732399, -158413], [85286060, 86895028, 754812, 3972748, 352570, -1961538, 12079599, -402242], [-228575792, 228403472, -1525825, 1870465, -43080, 11964930, 1741225, 1913545], [267346265, 265827025, 315747, -2722733, 695557, 823683, 1631442, 379810], [138931706, 113098, -226196, 434992, 104398, -8642921, -8264478, 47849], [569249794, 568341634, 1661797, -154523, 1888837, -980677, 1565142, 227040], [475207224, -473222900, -3289696, -678952, 496081, 10388392, 809291, -1175033], [79665814, -1334412, 2668824, -5382822, -1356999, 1060626, -3654990, -689793], [-447714576, -447168048, -414817, 678239, -551449, 4921, 854481, -136632]]
