
# q-expansion of newform 720.4.a.bb, downloaded from the LMFDB on 30 May 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
    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 = 720
weight = 4
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 = [[0], [0], [5], [28], [-24], [-70], [-102], [-20], [-72], [-306], [136], [-214], [150], [292], [-72], [414], [-744], [-418], [-188], [480], [434], [-1352], [-612], [30], [-286], [1542], [-1172], [1956], [-1858], [-174], [2068], [312], [-2646], [1276], [3198], [760], [-166], [-3020], [-984], [-1962], [576], [-1210], [3384], [-2038], [-4098], [2248], [-3260], [2980], [-3180], [3374], [-1950], [2232], [-1822], [1488], [2994], [-2472], [-3954], [2176], [1034], [6654], [1756], [-3234], [-2036], [-96], [1202], [3798], [5668], [-454], [-5604], [-11266], [6426], [6936], [388], [-8062], [3388], [6984], [2526], [6146], [-9786], [-886], [-11352], [10190], [2448], [-7078], [18088], [3852], [-6522], [2090], [9894], [-3044], [10236], [11496], [15316], [-11616], [-14996], [-21648], [-3378], [16158], [76], [9278], [-14564], [-2154], [-8700], [-4194], [8020], [-2686], [3012], [15522], [19224], [-6502], [-29396], [-10006], [-23118], [-14036], [4288], [-1314], [628], [-10944], [-1098], [312], [8678], [-14470], [11838], [-25548], [18412], [8814], [-17314], [-768], [18196], [-18142], [13660], [-12768], [-22952], [15818], [18558], [14978], [-8946], [18436], [-16314], [25446], [-42740], [-29946], [32596], [3804], [3278], [-5784], [17306], [-31134], [10780], [3456], [2618], [26550], [-27596], [-37848], [4804], [28608], [40768], [-27642], [28106], [-14730], [-9564], [53898], [-15140], [23808], [-23094], [7584], [26752], [7778], [-9886], [-39858], [37032], [54902], [19512], [-9694], [-38936], [-57762], [63676], [36750], [-36380], [30326], [43132], [34536], [-30886], [-65142], [29640], [-15330], [58778], [45796], [-45718], [-12456], [-59542], [-2388], [-32876], [30246], [-38244], [32202], [-51118], [59690], [59778], [-18720], [-47754], [-56504], [33554], [50834], [31224], [14118], [1384], [-72252], [23214], [-22748], [-70294], [-52530], [-73988], [69612], [14784], [-67030], [-48524], [-14586], [-93216], [35622], [51662], [16504], [86910], [-12692], [-10260], [-79234], [4074], [91008], [-27644], [-14280], [-109702], [-21260], [15520], [-24738], [-77924], [-94752], [-101230], [-40818], [-34392], [-87408], [3252], [65332], [10084], [-13618], [22458], [72192], [-33500], [-34224], [-7820], [-36336], [-88414], [-95682], [17784], [-41878], [-15834], [-101832], [-28138], [-74612], [-64530], [68978], [-33788], [5844], [88958], [-36910], [-46062], [-13412], [75942], [-68538], [29932], [54174], [-109594], [18412], [102242], [-73304], [-42310], [-21956], [-32052], [26990], [34298], [-99048], [-9168], [-102872], [-41952], [108782], [88372], [3048], [20882], [-40722], [52936], [3294], [55494], [124956], [9330], [-164184], [109874], [8886], [107800], [91470], [22776], [157948], [99074], [30966], [-6512], [133308], [-98876], [9266], [107268], [152150], [-1824], [-66094], [82992], [61110], [-165930], [17260], [-159072], [-144598], [-174336], [-62712], [12410], [-99234], [66220], [36146], [25566], [24508], [-161166], [97634], [161044], [-59276], [-34680], [70206], [-58906], [-102522], [100984], [-141780], [73852], [-63948], [-119578], [-129078], [-56038], [-98156], [-89998], [159810], [-11322], [-177272], [-204042], [-2112], [79742], [-190508], [150600], [135534], [63460], [-35638], [92574], [219796], [136070], [-80526], [216048], [-156072], [-18270], [72936], [-49534], [58086], [-121320], [-204072], [-23420], [-156070], [151206], [-62084], [49610], [-240000], [5356], [-152328], [-152538], [-36632], [-37150], [194976], [-76032], [-234286], [-100170], [-118390], [-33834], [-188118], [150748], [-15414], [-2396], [-39384], [137032], [121898], [13444], [-227904], [386], [-34722], [5640], [6196], [90360], [72986], [-70880], [-77946], [80788], [-75282], [131222], [92130], [208324], [22170], [-264426], [213136], [167906], [-208698], [-139724], [-231816], [-160606], [-65298], [-167388], [-193940], [-277390], [-77010], [8736], [-57764], [131346], [77496], [112086], [260258], [220488], [-298512], [-166318], [90294], [-264996], [-28842], [135700], [-198600]]
