
# q-expansion of newform 1936.4.a.f, downloaded from the LMFDB on 05 October 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 = 1936
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], [-4], [3], [8], [0], [-83], [-123], [-112], [-36], [21], [-128], [107], [201], [308], [492], [-345], [-204], [-470], [760], [-900], [742], [92], [-864], [-645], [299], [642], [1984], [-1836], [-623], [1455], [-988], [-1320], [1098], [1496], [1245], [596], [518], [-1448], [3120], [-1014], [3972], [-2881], [-1596], [-1235], [-4131], [796], [3884], [-5780], [36], [1955], [2397], [-2196], [-4322], [-252], [3615], [-5112], [6543], [2324], [-3143], [-570], [632], [2445], [3356], [4836], [7175], [-10938], [6784], [-7703], [-5736], [-2735], [2679], [-3648], [10636], [-14222], [880], [12360], [-2457], [-2101], [-5181], [9145], [7620], [3647], [4176], [563], [2240], [-4488], [2595], [-10199], [-5115], [2428], [-5232], [15216], [8800], [11580], [-21140], [10212], [-12186], [5418], [8192], [1402], [-13084], [11610], [-13872], [-666], [5660], [-4345], [5796], [15969], [18996], [-18347], [-8656], [-5135], [-3909], [9952], [-1172], [147], [-27512], [23892], [-13674], [-5196], [10175], [-4898], [22005], [-20592], [12832], [-13539], [9182], [-12864], [12256], [-12719], [-6196], [19428], [-37412], [-9265], [-15183], [30373], [19614], [-700], [-5274], [43254], [19904], [-38382], [35572], [-20064], [36275], [44952], [-47723], [-35706], [604], [32064], [16741], [231], [15172], [-1056], [-31676], [44208], [27296], [-861], [-16595], [-24267], [22848], [-56247], [-42388], [-10968], [12555], [-18588], [-14852], [-9035], [35485], [54942], [-4812], [38150], [2736], [-7643], [-19928], [-31485], [13532], [26043], [-44908], [53869], [25876], [-33228], [-51442], [28581], [-29448], [18702], [4237], [-37016], [62089], [-16548], [-51694], [-45504], [-67292], [-549], [1500], [1563], [-2783], [46982], [-17055], [-36792], [-42006], [8060], [-18949], [20065], [-40884], [-23706], [-14036], [31152], [-82659], [-24092], [36109], [-42477], [29608], [-19416], [-21180], [-29185], [21632], [-33042], [29136], [37083], [39085], [90956], [102555], [-39524], [52404], [-30107], [96219], [-20280], [37172], [-51192], [38027], [54428], [-64048], [62709], [-63836], [59376], [56210], [58641], [18660], [33192], [-69708], [61040], [-14492], [-60649], [56382], [88620], [-4484], [-48084], [-74356], [-90180], [87130], [-82263], [56616], [-76045], [61317], [-16284], [79283], [65612], [59019], [-1514], [64100], [-1644], [-65867], [-23750], [60123], [111964], [99990], [126474], [-41092], [96210], [15383], [-116216], [-126733], [-80260], [-23810], [41368], [57036], [-51815], [12550], [99384], [-110184], [59152], [-124560], [-20783], [-8644], [-5868], [98546], [106482], [-27572], [-49815], [56523], [-61536], [108357], [126408], [68938], [60090], [-11540], [-5517], [-139296], [-33640], [-113738], [-19671], [120236], [-56376], [29464], [143138], [143280], [-69865], [94764], [-17303], [105972], [151443], [68685], [-39368], [103692], [-50771], [120444], [151236], [-97198], [-68607], [30452], [-179305], [16017], [-57596], [70113], [-181774], [-145352], [-93464], [124704], [-147519], [21433], [-77274], [53432], [-81132], [-134908], [-188832], [26411], [107406], [-130309], [71612], [12035], [-128454], [-105195], [100540], [-128778], [169392], [-117937], [12436], [178752], [127743], [-116764], [-24214], [36375], [-101464], [-82319], [-49827], [42000], [89364], [198861], [-118548], [52114], [148710], [-191880], [-1188], [-100328], [5915], [-180291], [-38860], [146713], [213240], [93160], [-189024], [-72711], [-179548], [-51937], [170076], [-207468], [207457], [101349], [-74090], [-13578], [-162753], [-22744], [-107490], [17924], [248340], [-17012], [-250297], [131096], [94344], [44978], [-123282], [-108612], [16228], [-204288], [-15482], [-103636], [-14553], [-30476], [179577], [170053], [-119757], [41816], [-168006], [-281598], [-188008], [-116761], [63765], [55852], [46008], [-185591], [-235287], [278532], [68144], [33973], [-49689], [-268812], [-3704], [-9006], [-50412], [239811], [-98462], [109272], [-144600], [37463], [144339], [-36348], [-95370], [7912], [124500]]
