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