
# q-expansion of newform 7098.2.a.b, downloaded from the LMFDB on 22 November 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 = 7098
weight = 2
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 = [[-1], [-1], [-3], [1], [-1], [0], [7], [-1], [-7], [3], [0], [5], [-4], [11], [0], [-14], [-4], [1], [6], [12], [-5], [-10], [14], [6], [-6], [-12], [-7], [-18], [7], [-14], [10], [15], [-15], [4], [-16], [-7], [5], [-10], [-7], [2], [8], [22], [-15], [8], [20], [3], [25], [-14], [18], [-18], [-12], [-20], [18], [3], [10], [-4], [2], [30], [10], [-6], [-16], [-30], [32], [2], [0], [28], [14], [3], [32], [-2], [10], [-12], [32], [12], [-20], [1], [34], [14], [2], [-23], [29], [-26], [10], [-8], [-19], [26], [-19], [40], [23], [-23], [3], [11], [32], [2], [-16], [-6], [39], [-11], [20], [-25], [28], [12], [39], [14], [-8], [26], [-42], [42], [-1], [16], [13], [7], [27], [-1], [37], [42], [9], [-36], [-43], [-18], [-38], [7], [-38], [13], [4], [-42], [-50], [30], [37], [4], [-38], [26], [8], [26], [32], [49], [7], [31], [36], [-50], [-21], [32], [4], [-9], [49], [4], [-44], [22], [40], [42], [-18], [-17], [35], [-24], [12], [15], [-50], [-48], [-22], [-34], [11], [36], [-13], [48], [7], [19], [34], [54], [10], [0], [-13], [18], [16], [-6], [27], [-38], [26], [12], [40], [-25], [-5], [-24], [-38], [30], [-4], [60], [20], [-49], [-46], [-27], [-16], [63], [-4], [57], [-30], [3], [-60], [-50], [-10], [-4], [56], [-47], [14], [10], [-8], [18], [-12], [8], [-21], [32], [65], [20], [14], [6], [29], [49], [-42], [7], [-36], [-12], [-28], [0], [-15], [4], [45], [-42], [-5], [-24], [-7], [-15], [-30], [-30], [-21], [-4], [54], [-67], [-3], [-16], [-26], [60], [52], [72], [21], [-42], [50], [76], [-62], [-28], [54], [23], [-3], [-36], [44], [-30], [8], [-55], [-28], [52], [-62], [-49], [-76], [-64], [-6], [-51], [68], [38], [-30], [58], [52], [6], [-14], [38], [-49], [16], [-44], [4], [17], [-19], [-20], [4], [-40], [-49], [-8], [-8], [-13], [-4], [-17], [-18], [24], [5], [-35], [-75], [-39], [-56], [-6], [36], [0], [50], [-87], [-79], [52], [12], [14], [-44], [-67], [-52], [48], [-5], [42], [2], [32], [68], [-76], [-21], [-30], [8], [68], [-64], [13], [18], [-26], [12], [24], [89], [-75], [22], [-20], [11], [25], [-3], [-59], [81], [-40], [-6], [84], [-18], [77], [-44], [66], [41], [-30], [24], [-7], [18], [70], [18], [11], [14], [8], [62], [-32], [-44], [0], [-52], [82], [91], [39], [62], [54], [12], [-29], [-77], [33], [4], [-10], [38], [-69], [79], [-43], [42], [-76], [-48], [15], [95], [-72], [60], [-41], [-39], [-33], [74], [-90], [-9], [75], [-50], [-28], [61], [-37], [49], [88], [34], [78], [66], [16], [28], [40], [74], [2], [-69], [47], [-30], [-72], [90], [57], [-4], [-22], [-83], [-70], [97], [11], [24], [82], [75], [44], [61], [-7], [-24], [38], [35], [90], [12], [61], [-74], [96], [-36], [39], [90], [10], [-78], [7], [-48]]
