
# q-expansion of newform 45.10.a.f, downloaded from the LMFDB on 16 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 = 45
weight = 10
poly_data = [-252, -1, 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], 1], [[-1, 2], 1]]

hecke_ring_character_values = None
aps_data = [[5, -1], [0, 0], [-625, 0], [850, -214], [-11992, -1900], [57510, -1352], [-206410, -12856], [-148260, -2840], [524610, -19398], [1833490, 106960], [806572, 154700], [-10560970, 205296], [13478638, 155800], [26444850, 25798], [-29206090, 523334], [19517570, -1137448], [27497780, 1544720], [-137289858, -692000], [-159290, 2416706], [3565468, 6278500], [60429090, -8830952], [3438760, 18775640], [-701174370, 2748402], [-415044330, 13381680], [319197290, 2622216], [976995498, 10201200], [354029030, -18863202], [162986250, -36853386], [1350842270, -18348720], [36160190, -29533648], [-10639830, -39729974], [-1359826872, 27413100], [1434897270, -77983296], [1541880380, -3181680], [520250650, -183095600], [4640560452, -32719700], [-609149650, 114185136], [-228757990, -276824202], [-1678047210, 132204894], [-1926905790, 405724752], [-6210451060, -8038240], [5062684022, -163956000], [7979350588, 317280700], [8431290650, 879397848], [16104185010, 708101784], [6746065800, -203619200], [12881245592, 340539300], [-25863718210, -311819202], [-21350968070, 858809374], [-29628471290, 1063519040], [-47279101170, -716232648], [79707693320, 47193080], [-5730071238, -2256059000], [-5991679752, 388492500], [-49431889650, 463250064], [26337148690, 1524558202], [-78646100590, -23800960], [-100741400268, -222710300], [-111198496730, -1152407824], [16830909678, -2957374200], [46041187570, -3087770602], [26427269850, -3545108448], [129315122550, 4926579586], [-94633517292, 114180300], [-146432755990, 1132190448], [146927234890, -176181656], [302722753072, -3315643900], [-110595320670, 4341842896], [-327740797990, 536074934], [196401016350, -7190444000], [116956709070, 8515912752], [100501085880, -6557554080], [92303932210, 6889607906], [149149221990, 3788740048], [111412986660, -12925053560], [252781164930, 7399492002], [15584297370, -157504320], [-581594714010, 8369505016], [288670199598, 233505600], [40557647570, 22985732280], [592845389260, 3650985040], [414305454582, -21013662800], [347318902428, 349673100], [918852886170, -10921440152], [690222193080, 14917299520], [790665170550, 14304454002], [-502371543850, 28356051800], [502122359850, -24123517664], [-595121601342, -29998414800], [513085379710, 27888077198], [1222755871090, -2650742906], [-12270738360, 801230760], [248443108730, -51773943054], [585657925288, -5419993100], [1524252119100, 35707613800], [-606898425830, -29962963598], [891598573730, -13867238080], [1895557838518, 18325676800], [499688809890, -34849266602], [-49147358738, 36911572400], [-435613918410, -18914572334], [-2044346893950, 44259544464], [391567244190, 26145672402], [1530438889710, -15748259160], [1805967445232, 17328086100], [-1039896164830, 13098324576], [1798748134770, 32968782654], [2334492681550, 12015096352], [1153367838400, -118819961000], [-3705529803598, 20760423000], [-1903117352550, -12727695014], [-37979740290, 99312185848], [-2615159282610, -132122030856], [1026816711140, -47567206440], [-923046624828, 180654772300], [121540402038, -192069049800], [3188524038250, 114709210598], [4080486924710, 49695568334], [-1263959199830, 71810009752], [-1106186840020, 152128025120], [-3220493030058, 109122167200], [4079918372890, -137086434952], [-9369336481470, 3512367624], [4200732261630, -182709810198], [1976679522912, -113798323700], [3402924345298, -94943517200], [1323557560470, -20760315920], [7526269205160, -63339348360], [-6559924642030, -186678243174], [2113582005470, -21316169952], [10442753344980, 99958754320], [4600318843850, -144504428398], [4263843944652, 150641340700], [7704992505750, -119857979264], [-2221219914042, 381883843200], [2053143251090, 298328130960], [1923902124210, 244032904152], [10909819942830, 320789049946], [-7696370660390, 42139092184], [15680814897430, -240546942080], [9904451685592, -54526174900], [-4097505101382, -560075074800], [114251846990, -252497677002], [-10934050095670, -44252520826], [6569380461310, -537915724960], [12834240453520, 358923715480], [16086545075230, -132888315352], [11740232048150, 330848230064], [-14648799414180, 73834883680], [-6424707504710, -323862118598], [3856773988270, 229808996576], [-8628413327722, 474763257800], [-20700276223630, 316772326398], [-3537720939330, -550547810346], [188913401950, -288743952814], [8548555347908, 463500046100], [-4256999817360, -259730708840], [-13103130515210, 168187529560], [-19499654750270, -333640798504], [31872115705138, 486011113600], [-18722461643190, 751830431934], [12693295616870, 510480611552], [-4995308032990, 897017819706], [8420057165568, -922158402900], [793415651030, -1234956559576], [-35693460996270, -81345054198], [-24977396400388, -846333713700], [1664516457790, 723043205816], [38878259273570, 565346922480], [-26861546275310, -1087100777048], [-27999962980740, -74512781160], [-8533096659618, -1080184241600], [-31852893448572, -310780163700], [-8045591262830, -245927050552], [-6362704825920, -899726563280], [9834452714550, 1020090070800], [34537772976352, -1293968422300], [14181769836858, -1440940200000], [20240737228910, 1869136135398], [-14971447668210, 692993532160], [-6130554459070, 1343555894946], [-12250644111512, 393928314700], [-3543734654850, -2385015579752], [15390641560510, -490752533816], [-61727973437430, 629944555002], [22449081590330, 901394497520], [-1632797319890, 1817855167856], [-98670465029910, -150565409402], [-24856835299390, 708716702040], [24360672250148, -672899273500], [75815795057730, -1109281583552], [74513342713190, 735136954802], [57645646390432, 1431704667500], [-65494997214622, -83252336800], [57754445093970, 707335900854], [14133942497950, 331442754952], [2360863054602, -557497994600], [-13420103217290, 1274258719448], [-77458461690210, -890452945056], [-14312926016390, 2488325626402], [8149799591490, 1510856800560], [-63876477416828, -118376629900], [80688131107630, 2242880739896], [15121911070050, 2252020950400], [108111351218580, -1701461213280], [83701084188930, -281900748576], [-148805353548640, -280405688160], [-1258287399370, 206119270202], [-43429199706330, -420959352720], [78126054295712, 2510192536500], [65568778726490, -4142908851384], [8401052987098, -3037397039600], [18141996931630, 3879611999798], [19995361584050, -5132978740786], [-93426487680240, -1821895082760], [-18542041668718, -769763007000], [-57341722882230, -131424450374], [-17181384964242, 1504499380800], [214549485312790, -383822561906], [75946071347610, -1313192494248], [-61912715047578, -152392311200], [-43998895787200, 2569128568200], [11309811498030, 1336889945520], [20463766272390, -8793611788202], [18201132928930, 5270192211574], [-199643835060490, 573898635840], [-44402822968770, 2441837603352], [-5544811490480, 5361392439280], [-39082880719710, 4412112251866], [52247547045648, 3287646227100], [-60571900360970, -1462742451352], [246003518991420, 2847362240680], [21528709841732, -3061615184700], [-317800925745922, 1512318403400], [-168797609889430, -3677560218402], [-45745566425130, -2479084657146], [-7940510836070, 1162555254920], [17293690803250, -1274223871448], [-79929791836500, 3536024025000], [152587773390708, -720782907300], [157692402446910, -3910115809998], [259259742383272, -2468792859700], [-195058976603850, -2458646074802], [43529758521550, 8846689604000], [-133232970250530, 2633398768752], [-109800537792520, 1947123354320], [-67859697263590, -9417218366694], [143775488850368, -9603028354300], [-169146490590340, -3301914494160], [-25278830243470, -4537140398398], [-32342845457610, 8521201989016], [60221682553598, 13129353224000], [-30156956686650, 6808699722414], [-185183561688830, -8610280104520], [-99705955984910, 7091071291552], [-10140977228940, 8264389712040], [-116963004181818, 9209737555600], [387180611267270, -1207554897174], [116937682220970, -1372477839696], [-220474189260550, -3491519456064], [411245394621510, 3647804485798], [53214063918490, -11459219385506], [69559630786790, -6516825536640], [-86326265463650, -4717380787552], [472675032807510, -5006938734216], [138613091623500, -12588325724600], [-45485898376270, -10194723172480], [-412792877821082, 6891696210400], [577677554106890, 192607235598], [174461350817930, 10428205431152], [-247287215093938, -8544173133600], [199397403998190, 5757120578266], [216620313395330, 469542895848], [-631490109178880, 4673639086880], [-344064566747630, 12970405810976], [81351334519670, 11697095655198], [-111893196216030, 14730031175454], [356776751902030, 4030048134320], [161194295381602, -11200085621800], [533742508507608, 4080537727500], [-202040978833190, -16795448218598], [105732798338172, 7909420258900], [-392492109060290, -6424081759466], [-114673983196058, -7329011579200], [354674520248110, 1073734891106], [-181942569135132, -19038478130700], [-40004287225110, -22565002587752], [-294847037827470, 8049726910824], [-22755430968640, -19785579807960], [37590513100470, 8780957547480], [-334567625403902, -16559056564400], [-92767792623950, -12176524652186], [11254269034590, 12258654217752], [-53770182252072, -10662406659900], [475323401379470, 9820298905248], [-126355783332750, 32920719807600], [-188396872696948, -21285961948500], [248860934405610, 5110616089152], [715733222705340, 9825167742360], [-181558271382370, 14157284389146], [-207311959042550, 12630411410048], [-480114102672190, 29384361599984], [-357418590472200, 18593890191400], [103125713663670, -6499514756598], [-161665662505608, 11277959847100], [-735893197828390, -14549750657544], [138385602365730, 32680419986574], [-35181399773890, 16057641153840], [-605366344024680, 7741297926480], [1045348382450230, -3086537063152], [-631792375464510, 28788672098802], [339423838316010, -23854264601760], [320650004977278, -4186640584800], [571952276986370, 6426707669598], [-1068493124110730, -8047238257346], [-654727512437670, -33308045073680], [-272027189265900, -31756811453400], [608357888617908, 18218100424500], [-233057443872590, -5269771393552], [1527528667257990, -175980075240], [782760854925872, -6626510300100], [323882459150330, 36947933472096], [-502597970780062, -8204705413600], [134243227619550, -4521921300002], [698063038558470, -8027956912848], [-1069788350365158, -17102986136600], [820593191628860, -16331853480360], [58628378163930, 23251307193598], [131183118632550, 27772144528614], [750071749435490, 12473086890152], [1453517460494782, -10730456366800], [442072955496770, -42488882353696], [-553570737494920, -13741374791880], [-1668986249604050, -2889153715598], [143892458992952, 27280121369100], [1251714798330490, -27259059332906], [800996392558190, 41493904115760], [813131948452510, -34910228488448], [158481935457122, 6324048804600], [-479990057680670, 42353198812946], [19331029132950, -2705263857152], [-412797659026490, 18132024832384], [936601110938730, 16516189570320], [697908161021092, 18297680611100], [791158085789330, 14963634900752], [-965106438557580, 36701210578680], [-252590598341338, 59209072860000], [1726462405830390, -7601375367734], [-696051684035052, 35847906231300], [-135375624017150, -24541573943336], [717250947703432, -20433828343900], [913096801173370, -32493364996624], [-164093026682222, 55547021924800], [-2355947578065930, -2243015403002], [962713848688630, 43901773056320], [2160722026995150, -9346940682648], [-388173713064200, -53218611151400], [1196223307931808, 17934258840300], [-1827019129683210, -36292308920856], [-523547088958390, 22004824999202], [-811383391583970, 32157809627896], [182776434104438, -29436270424000], [-1778492569242690, -28281704730066], [845406219567380, 30605248592720], [-390184721780290, -29140562582694], [392565888772290, -66677011942952], [-376841859194070, 34961573853624], [-1819970536404770, -703199184202], [-507250801007518, 29133400312200], [803710496690328, -63986067574500], [303723574620580, -74518729218280], [-185182669342750, 45111758166002], [1035812187593850, -23542194802800], [-373570275694748, -15543634974100], [-202263419997450, -4334340802664], [2312862343068740, -33522831645640], [-2313460312266012, -39297439578300], [-1152282558929950, -25520076351552], [-2350392970392570, -11410316908680], [352179700124010, -16442259324944], [1377005597515618, 67780097156800], [1674905890165830, -9220231728048], [2608878860374290, 20561471536666], [3043173550889950, 3037021747264], [-1194309179679380, -41276291231320], [-3504642153410110, -35508006900598], [-1710343694627068, 82705263964500], [1387481922428870, -22390785305424], [-1706754893561030, 47743595151998], [1466984577954870, 7934781372054], [569189659698730, 40109942591720], [-1096702177674550, 64292240755952], [-2348405014031500, 41375819213600], [-2806513585798450, -78585102263814], [-899481562299892, -10001984868700], [953198613494810, 93525128605248], [-2802010494423160, 20698768608360], [-2810017626404010, -65026067701440], [3051496147008072, -31225882933700], [-1956526553843862, 42208434043200], [1833340821007950, -70817821288400], [-1393000467900330, 88698483808152], [-203122662837390, 30083433024706], [-2245943929556570, -26321421248576], [-1273403304211430, -129237357991520], [1375699810426212, -148815467562500], [-4133635004796010, 3009315884616], [-3656492580094802, 66465475463200], [-727924079726270, -5123766964402], [4087992322495260, -46862632181760], [2705602636131970, 54087666257648], [-1982473854978630, -678972817296], [-3007655638155250, -74659402027798], [-396213980691848, -15543328007500], [-3759410229812350, -22889527490664], [-1640121257024542, -125416109803600], [2397947637835840, 151514528978560], [5324698436490330, 35393679711346], [-1004949887289690, 178187431275384], [-137961510847430, -24422723030798], [1114362960655330, -128716543914080], [7698199146017310, -3476786634344], [2735563263781830, 103033076058774], [-887622464048380, 179711742978080], [331450293802730, 107133928297248], [-871333923781150, 40942823117264], [-4293661435278410, 94166124288202], [-370424960554290, 190094936984040], [5628290687209232, -34513372382700], [868620625327400, -122032675496800]]
