
# q-expansion of newform 2088.2.a.f, downloaded from the LMFDB on 14 December 2025.

# 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 = 2088
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 = [[0], [0], [0], [-1], [-3], [1], [7], [-6], [0], [1], [-6], [2], [-10], [10], [1], [6], [-10], [-12], [-3], [-14], [-16], [-12], [16], [13], [10], [3], [-16], [-4], [-5], [3], [4], [1], [6], [-13], [16], [16], [-12], [-6], [-18], [-10], [-4], [25], [-24], [8], [-22], [17], [0], [-11], [0], [-14], [18], [-2], [-17], [21], [16], [4], [-21], [26], [-17], [-4], [12], [33], [2], [-27], [21], [1], [26], [0], [18], [30], [-18], [-24], [-14], [-6], [8], [-12], [21], [2], [4], [12], [12], [34], [-30], [-16], [1], [15], [-21], [5], [2], [-27], [36], [32], [32], [36], [-13], [33], [-14], [26], [7], [4], [-1], [16], [11], [-35], [28], [22], [-2], [4], [-35], [-2], [12], [-11], [-2], [-40], [-27], [5], [17], [24], [-3], [7], [-31], [1], [-33], [-40], [-19], [-10], [-10], [-10], [16], [-6], [-10], [-23], [4], [34], [-8], [-2], [-34], [-12], [-34], [19], [-43], [-24], [-26], [36], [10], [-35], [-14], [-6], [-14], [-38], [-46], [-27], [56], [15], [-14], [57], [33], [-10], [-9], [-18], [33], [6], [-50], [-28], [42], [24], [19], [-52], [-29], [-3], [24], [-35], [28], [56], [0], [-54], [-7], [47], [-16], [-45], [-22], [13], [-19], [-28], [20], [12], [54], [28], [-42], [-52], [39], [57], [-36], [-59], [31], [-18], [50], [-15], [-42], [-40], [-30], [-17], [-4], [-66], [-51], [-60], [-20], [66], [-60], [-28], [-36], [14], [-40], [35], [-45], [-3], [-13], [57], [34], [73], [26], [19], [-33], [36], [10], [-46], [66], [-16], [-50], [18], [-48], [20], [10], [-30], [63], [-41], [30], [62], [-30], [37], [-39], [12], [31], [-70], [58], [-58], [12], [-6], [-49], [37], [-58], [42], [33], [-22], [-14], [-46], [50], [-12], [-2], [-63], [-26], [-33], [-11], [20], [34], [-36], [55], [6], [26], [-78], [5], [59], [22], [-32], [16], [62], [52], [-13], [-30], [-38], [42], [33], [18], [19], [-36], [13], [26], [43], [-47], [16], [-36], [14], [24], [12], [52], [64], [70], [68], [-50], [-52], [-56], [44], [40], [84], [42], [6], [13], [38], [-26], [-53], [62], [-3], [-20], [-9], [20], [25], [-52], [-74], [-5], [-15], [20], [-55], [8], [44], [-42], [10], [20], [4], [51], [-66], [28], [-28], [40], [51], [10], [-80], [3], [-27], [-68], [-7], [56], [-38], [79], [15], [-4], [-36], [-2], [52], [-61], [73], [-68], [25], [66], [-56], [56], [58], [-21], [32], [67], [6], [-89], [-60], [-15], [-60], [-88], [0], [69], [-59], [-34], [4], [11], [44], [69], [-49], [-78], [49], [5], [-92], [30], [70], [-10], [-18], [-50], [-59], [100], [-82], [-64], [-3], [-14], [11], [-74], [36], [25], [-76], [81], [11], [-88], [54], [91], [7], [-2], [46], [32], [-36], [-94], [-40], [-41], [57], [10], [42], [-47], [-36], [-38], [16], [46], [43], [-39], [9], [25], [-24], [42], [-22], [28], [-36], [-85], [-76], [-104], [19], [-63], [68]]
