
# q-expansion of newform 735.4.a.m, downloaded from the LMFDB on 24 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, 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 = 735
weight = 4
poly_data = [-1, -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 = [[-2, -1], [-3, 0], [5, 0], [0, 0], [-46, 2], [-4, -38], [22, 44], [54, 26], [-160, 20], [-118, -12], [30, 102], [102, -24], [-22, -80], [68, -128], [-200, -168], [8, -86], [232, -36], [342, 84], [368, -164], [-370, 138], [-212, -122], [-204, 484], [-304, -84], [666, -112], [1224, -86], [-34, -632], [736, -256], [568, -312], [1318, -336], [-572, 618], [-1180, -628], [956, 208], [968, -386], [1982, -478], [2014, -104], [48, 608], [-96, 758], [-348, 64], [996, 76], [-190, 1220], [674, -126], [1386, 712], [-1558, 206], [2266, 552], [684, 398], [2614, 350], [2184, 516], [-2748, 1172], [-1456, -1068], [-2850, 140], [2212, 794], [-2674, -310], [-2182, 1396], [2200, -356], [498, 656], [-2612, 992], [3326, -648], [274, 186], [1334, 2216], [1918, -1732], [-2780, -1008], [-4142, -996], [6432, 84], [9784, 56], [-888, 586], [-936, -1774], [-264, -2244], [6642, -976], [924, 1940], [2358, -1484], [1350, 3388], [-3982, 414], [2860, -468], [-3310, -540], [-5772, 376], [740, 332], [1134, -2944], [3636, 4490], [1570, 5608], [7198, 3040], [12828, -1336], [-5362, -3264], [-1274, -1478], [7032, -1678], [3366, -1314], [15468, -12], [4570, 2152], [950, 5644], [-6690, 2432], [6548, 620], [-9632, 916], [12144, -2824], [-5636, -6380], [490, -7742], [3116, 1304], [388, 7508], [5150, -4408], [722, 3504], [-4680, -6068], [-3194, -1136], [-3432, -2044], [-9264, 4714], [-10652, -168], [-190, -1936], [-444, 1808], [2272, 522], [-5436, -7088], [8718, 2452], [-4158, -2114], [-854, 1300], [-4028, -2796], [14662, 3912], [-12612, 2674], [-7930, -1254], [-13860, -1436], [2318, -9708], [5240, 9020], [-4220, 4588], [-14884, -7058], [-16482, 6134], [-3962, -10420], [4542, -2500], [33866, 308], [1644, 5844], [22130, 1070], [15610, 1924], [18534, -5512], [-23108, 4492], [14820, -860], [-1436, -4590], [25564, -4736], [8340, 4544], [708, -12100], [-20790, -3252], [-13558, 7664], [-4438, 44], [-20622, 4748], [-28712, 4868], [-10078, -11916], [-3242, 3980], [-18914, 5090], [-10702, 1884], [-11588, 8716], [-11144, -11928], [7074, -14824], [18372, -1244], [8420, 4050], [4818, 392], [-2766, -10978], [-26872, 7972], [-11138, 4040], [5506, 7640], [-18904, 7372], [14264, -12272], [-9728, 8460], [-1854, -6794], [-29868, -428], [-654, 2880], [16476, -1250], [31782, 6112], [-5132, -1188], [9508, -1502], [10880, 5824], [2568, 2436], [6940, -18694], [19568, -11712], [-20596, 13844], [7372, 14730], [6754, 14032], [3322, 9636], [-43478, 10], [-20270, -15328], [32230, -12094], [16914, 6168], [3162, 9226], [-6758, -1848], [-23152, -484], [-1226, 19464], [26212, 10740], [-54614, 5672], [48024, 7632], [-27880, -10580], [-10886, 14188], [-3058, -6740], [-17348, 1352], [35046, 10944], [40726, -7536], [39488, 1532], [-9870, -16824], [-18948, 22044], [24472, 12042], [31320, -18040], [28572, 21560], [23734, -3032], [21396, -8516], [6846, -31092], [67650, -5712], [-4030, 15532], [14922, 2520], [-19652, -16796], [16274, 20228], [-36602, -19882], [-46312, -7922], [18466, 7996], [-15696, -14468], [8426, 26220], [40162, -6270], [15392, -6136], [-18282, -12228], [-6838, -16458], [-79434, -1420], [-48602, -12264], [-54448, 8440], [63344, 4996], [-6140, 8372], [1890, -26996], [46252, 5596], [47978, -11696], [-11124, -26080], [45460, 7942], [43638, 5320], [37462, 342], [-4442, -6412], [-2864, -28608], [1980, -5288], [81630, -3952], [-46478, 10488], [-53718, -24058], [11224, 14040], [39818, 13634], [65098, -8252], [10414, 31282], [-54616, -15088], [43990, -628], [-8592, -44484], [-65656, 11920], [53158, -2528], [12844, 37630], [16394, -11982], [652, 2260], [-8520, 25672], [29606, -26262], [-45144, -26720], [-51186, 11560], [-91918, -9200], [49700, 3492], [26804, -27844], [31540, 19248], [-15160, 100], [-37968, 16236], [38942, 30776], [-42182, 25040], [40488, 24212], [4678, -8808], [93794, -5356], [-21454, -13734], [-15330, -4016], [19716, 6144], [31746, -36228], [43168, 6530], [-20644, -22684], [-94364, -348], [-16410, 11988], [35672, 25678], [-26066, -19996], [98802, -17970], [45106, -6204], [-43038, 11552], [68864, -4444], [5460, -50738], [-57910, 11320], [4196, 15112], [71200, 1370], [-23724, 39708], [26984, 37018], [-47988, -12500], [-30496, 16704], [8830, -35272], [63450, 13968], [50232, 12212], [4512, 48104], [68756, -20740], [19000, 54024], [59370, -33808], [-80048, -11788], [28346, 50478], [104406, 10708], [-30608, -58174], [-74474, 24534], [-12766, -176], [-32462, -16636], [-62424, -924], [67428, 10], [-14700, 47752], [-45430, -31148], [19134, -67008], [-55390, -16958], [85118, 10160], [-133032, 4796], [62344, -652], [61612, 30718], [-29236, 13278], [11040, 29664], [55100, 17188], [-48340, -28376], [-15438, -47136], [35176, 13376], [19510, -35076], [25710, -20902], [16402, 53780], [-128296, -8448], [-71110, 5180], [6938, -27520], [35144, 23996], [-24072, 13420], [92146, 38932], [-25412, -15488], [94506, -2458], [125032, 9018], [83114, 24512], [-27342, -16458], [-94666, -5812], [-4186, -32664], [16312, -36952], [-107264, 1198], [10906, 10628], [37996, 39504], [8228, -8304], [-60528, 5076], [22208, 44058], [-62810, 38128], [-102300, 7622], [-95998, -46326], [-77764, -7248], [-40440, -35916], [72500, -40480], [66534, 25680], [29378, -20832], [-10710, 34044], [-75972, 8628], [22098, -57084], [114396, 37394], [50230, 58344], [39672, 63112], [75668, -32698], [-28018, 3318], [78454, -1180], [2496, -14276], [-35468, -13212], [418, 18300], [159158, -15510], [-45378, 44996], [65858, -66940], [-38808, -44200], [-62362, -35128], [81814, -23820], [-44180, 45468], [-117012, 1704], [97428, 15274], [31516, -41544], [-60078, 54708], [62442, -32080], [105892, -43928], [31246, 51822], [-6104, -19964], [-62178, 26180], [83166, 8760], [52760, -63544], [58330, -6944], [-3078, -7190], [20594, -48034], [-126964, 21488], [58190, -78680], [-19766, 22058], [-100154, -63424], [112012, -28432], [53850, -41514], [-88376, -65038], [3370, 67824], [82828, 43190], [86422, 17848], [-61292, 35954], [-18900, -14332], [73824, 66518], [-103970, -29702], [-46884, 63324], [-108148, -25900], [143700, 44650], [137768, 9660], [182536, 21976], [-115894, 26104], [148878, -31856], [78214, -75626], [-104, -33860], [150710, 43602], [-99686, 63392], [55266, 23922], [6778, 55160], [195172, -10240], [-178862, -16876], [20306, 47344], [-16292, -65790], [149280, -10408], [49506, -26056], [25470, 2128], [-81942, -878], [192694, 17536], [120170, 29624], [-172372, -22584], [-34056, -54252], [144500, -37922], [-7808, -43430], [-49644, -62148], [126872, 10292], [-99878, -57216], [119694, -62632], [45854, -39270], [-131444, -46004], [-138010, -55572], [28224, -37528], [71286, -22832], [81260, 63514], [249636, -5064], [77640, -5852], [-96152, -69750], [-60486, 40172], [-35096, 40664], [42714, 85656], [68186, 20622], [101236, -73756]]
