
# q-expansion of newform 225.10.a.f, downloaded from the LMFDB on 19 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
    R = PolynomialRing(QQ, "x")
    f = R(poly_data)
    K = NumberField(f, "a")
    betas = [K.gens()[0]**i for i in range(len(poly_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 = 10
poly_data = [0, 1]

# The basis for the coefficient ring is just the power basis
# in the root of the defining polynomial above.
hecke_ring_character_values = None
aps_data = [[22], [0], [0], [5988], [14648], [-37906], [-441098], [441820], [2264136], [1049350], [-7910568], [20992558], [-13285562], [23130764], [-13873688], [-57635174], [32042120], [110664022], [118568268], [-276679712], [264023294], [448202760], [851015796], [-189894930], [1014149278], [1315368558], [1827972724], [185367372], [1978689590], [1578746686], [-2400005332], [1968395208], [-2029094538], [-1136729140], [4738537510], [2262162472], [11788859278], [-11460793796], [-13370656008], [10626363186], [-26125435120], [2346889262], [-22406421032], [36595949974], [-5415455718], [262713880], [13449310292], [26646265564], [33631791932], [50045292150], [-32962559874], [7954217240], [-75247743998], [98463127008], [8523991422], [5906543816], [71596101350], [-124754651888], [-112824180402], [-87020807922], [-3276964236], [-149860164294], [184569910148], [-90464979072], [-10793038946], [41831934962], [-12330976908], [21797581958], [-84361290188], [-1232948810], [173387723766], [-63815917320], [-112241606052], [-721003873546], [-204331000340], [-547180000584], [346262180070], [-256757692282], [-20167945242], [-43340521510], [-510680461160], [321228183382], [-447617411472], [141185768294], [-850497697160], [303187912836], [1403278417670], [-335353598362], [-1042749631842], [974083754244], [-197850678508], [908731105320], [-1169629218932], [2491486068688], [-557571087620], [1801366855856], [2401096873670], [-1030077035282], [-1066369079836], [2517486023382], [1103529331028], [-1090720039758], [1030805225676], [4066175272590], [986144387492], [2869473138238], [1141694898732], [-2971762606354], [-1772617523720], [1258381908842], [-174534604492], [-4630369457746], [2505177639342], [544227615740], [-6519747334448], [3362965780158], [-1180819220676], [6631762482592], [825189215186], [440214037640], [9777884642542], [-4225910364186], [-7569770190918], [-1920285453924], [-3998388906788], [-11273616080282], [11267900052070], [9052470846240], [-1344083568692], [-657401165786], [2155870422700], [-7735942623584], [-11244801937688], [11854438840718], [2247651763758], [-14450525662270], [5190224051466], [13993847295788], [20126878481762], [8957747618710], [-1764457434948], [-14808178742322], [3396507315724], [18834421634452], [11894665629990], [12288146871880], [4613545257054], [-4293628278338], [-6404282426420], [-3244207905184], [-28971147004722], [-7504473544522], [-28714133607236], [9998251603512], [-4708461943572], [-26966252086912], [-3966177723440], [-19691225561210], [21130483382598], [-5410718200082], [3442590745932], [-4184403332234], [-14980025803772], [28246046905488], [-46224186526778], [48036293325216], [23121091830512], [13536183450678], [-41987845907710], [-1167615577654], [46523027825880], [367060316782], [41474087908728], [33508800446094], [70346149493560], [52860830823150], [-34661808711348], [-62238513689322], [9398819829724], [28580327680270], [-71531991771452], [-28015218825512], [2939985051614], [-10077896652298], [-75356904130824], [-6257545039930], [82273327426158], [14889847412204], [-46893024564070], [-13042516444552], [-43257136599946], [-10840442879804], [-118601692274268], [-46126852237762], [23917755596052], [72033402706166], [-158865736718], [83065379938974], [132056053534062], [48459354819296], [13339860479790], [-4798093648008], [13784340796998], [-86364229545710], [-49311660661560], [-91650785988318], [-29974559449000], [-140644672891124], [-103673485819170], [89768078333972], [-64356387277802], [-136555186848842], [116840844400164], [-158626634880188], [-71110565286720], [139927069249562], [-81915325688212], [208739652856038], [182183272270112], [-9003952231614], [-82375966495658], [-190930423838200], [94411316392350], [10974971735924], [-241238710064668], [-45976273968250], [215889255582006], [-152272787114720], [-142199752260292], [143206993696488], [236543936294574], [258235934072740], [-58682903434768], [-158019490958962], [-256323984443756], [-145462109989728], [293265229677810], [132706976807306], [141906852830520], [214007320678608], [343383606232476], [248554130611332], [296888764553084], [-91718882836890], [-134351725029834], [-22019431679680], [140026129122748], [-176274133569952], [-221675710145020], [215122827985936], [-443382792756442], [68191185798398], [-408105772689528], [-392360745882150], [-248276606211454], [-30888014916600], [-297213402929858], [517726004334148], [-454868763466518], [543566323416478], [-220480326303556], [235236315224732], [-542265239112250], [-290702731505706], [-15344499280578], [-244941067585940], [134849523663710], [536047897053238], [578362636464004], [-356714523611174], [-358815581200258], [376311542883428], [-333027078264146], [-267986194162440], [-472417645390842], [-345412130151836], [300265118998212], [183152409453030], [172485262105962], [-173489029931352], [261082164530576], [50480761307512], [-307283989728448], [-474021218090538], [889854246476988], [283187390877768], [-6715192961266], [-11210264579478], [430019292135800], [672570398149470], [-413915447358722], [-1031047379657068], [-642895372600434], [252739644217368], [-551214855740906], [-845185232536050], [-272349564569848], [590856010357866], [203551868522760], [54962912722228], [726051717136494], [470318815412242], [1271189367452800], [95512964340276], [391920144638452], [951557215984078], [-172580308238388], [841575353380430], [-258689357399520], [221598197065734], [-1384435463478864], [784267786451070], [348759918748758], [526996236033604], [-445449447101728], [-28916912231270], [277855582824720], [1415451086497608], [-1751871157045146], [-1129027850048130], [953379202162172], [-1113605926526882], [501284686184918], [-1163601531793276], [-1207943400185394], [696342397523842], [231125059431620], [236426209710524], [-319893108748488], [1335989379653626], [-258374703224418], [1198287427746082], [-755139802836760], [-627672437276284], [438607517559692], [2216024620249052], [-1825798832064610], [623858784250886], [-522772646818678], [-1217375618279892], [2063409132125894], [-1225745225329378], [278837276995950], [2053709208008472], [-1172859895684334], [951055370046000], [-1929591201661498], [246489945016508], [-618739089156792], [1246125800977802], [600217425759252], [1169402598146118], [-2752873428297482], [798680090927084], [911888374241550], [589431287521806], [862101490432240], [-787961436179832], [910337769518862], [2423801795971576], [739929215472278], [-3404691083276362], [-2881259263043928], [-1559377311548440], [773976503171788], [-149086016961226], [-1030359881297598], [-2964659572284156], [1193227097864282], [3071726045597808], [2038868830017180], [3874951231958536], [-3607010707044690], [2522218508572632], [1774005964606118], [943162837271120], [1399517652151488], [-919358064863186], [2903766502691670], [4703635600624358], [-1740255847662482], [-3292556819078154], [-4425473832836572], [3833287677350342], [-3303193228237740], [1210997653061176], [-3052167227613928], [-1232475112619282], [739986049990284], [922154354403072], [-1665000027828990], [-3866800146289574], [-622750605505480], [-2894148102987332], [2429582949667448], [817190914315414], [-4664487561777040], [-1577290481912970], [2285367576887812], [2399704641767958], [450349215392590], [3074298609160686], [5023314046819388], [-2308634030325658], [540356250869950], [-1337398217888], [1256332709107078], [-5718115964377562], [-3172483387478916], [-4871841965969880], [-4235748105155586], [-2374711858330518], [2437655501216236], [-4815030434944548], [-746086535556482], [4169725530487238], [2798411369658400], [-3616440877338652], [-3327192753069858], [1874622366446216], [-4488934339666130], [624777126938678], [2748333447276792], [-5850594928028800], [4395801723072094], [23332760054002], [5489326431648116], [4096826205094470], [-3128000820676348], [-56939881916200]]
