
# q-expansion of newform 2025.2.a.m, downloaded from the LMFDB on 25 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
    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 = 2025
weight = 2
poly_data = [-3, 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], [0, 0], [0, 0], [3, -1], [-4, 1], [2, 2], [1, -1], [1, -2], [0, -2], [-2, -3], [-3, 0], [1, -1], [-2, 3], [5, 3], [7, -1], [-5, 1], [-10, -1], [4, 0], [0, 2], [-2, 1], [-1, -5], [12, -2], [3, 3], [0, -3], [1, -5], [6, 5], [4, 2], [12, 2], [-13, -4], [7, -7], [-1, -9], [0, -9], [-6, -2], [11, 6], [-8, 0], [-5, -6], [7, -7], [-11, 1], [9, -5], [-12, -2], [-4, -7], [23, -2], [4, 7], [7, 1], [0, -8], [-2, 0], [5, 8], [4, 12], [-1, -11], [-12, 0], [9, -11], [-4, -2], [1, 10], [0, 6], [0, 6], [-4, 10], [2, -5], [4, 4], [-9, -3], [12, -2], [12, -10], [-27, 1], [5, 11], [18, -1], [16, 4], [-1, 3], [3, 2], [-10, 10], [13, -9], [-5, 8], [-3, 13], [6, 7], [0, 18], [-1, 11], [-8, -6], [-6, -2], [24, -2], [-4, 6], [18, -4], [-4, 8], [10, -6], [13, -12], [-30, -5], [32, -2], [-5, -6], [9, 5], [-4, -7], [-1, 1], [-18, 11], [0, -6], [-1, 21], [-24, -7], [-14, 6], [-26, -7], [7, -10], [-10, -10], [14, 12], [16, -2], [2, 14], [-21, 2], [20, -8], [6, 2], [15, -1], [0, 19], [-19, 12], [-17, -1], [3, -5], [14, 8], [22, -3], [-7, 14], [11, -3], [2, 2], [0, -4], [2, 8], [-5, 16], [18, 5], [-33, 5], [-8, 2], [14, -2], [2, 2], [1, -10], [0, -6], [18, 0], [30, 6], [10, 16], [-26, -3], [-26, -2], [24, 9], [-2, -6], [-14, 12], [19, -2], [13, 19], [28, -12], [-22, -18], [-6, -17], [-13, -2], [21, 13], [29, -11], [26, 6], [16, -17], [-15, 2], [-36, 1], [10, 8], [22, 6], [-3, 12], [28, -3], [-33, -13], [4, 28], [-11, 0], [11, -7], [-30, 2], [-28, 11], [25, -3], [-39, -3], [30, 0], [8, -9], [-5, 30], [-8, 21], [18, 8], [4, -18], [30, -16], [-26, 6], [31, 3], [-12, -17], [-2, 2], [-33, 9], [17, -8], [-3, 13], [11, -2], [-1, 21], [-18, 1], [-23, 14], [12, 21], [-6, 24], [-2, -12], [18, 23], [-18, 4], [-30, 7], [-20, 0], [-47, 2], [-5, -15], [-8, -26], [-37, -5], [32, -14], [-27, 17], [-40, 5], [-12, -2], [-19, -23], [29, -10], [14, 22], [8, -14], [37, 13], [-12, -22], [26, 7], [27, -5], [53, -1], [-29, -12], [33, 15], [21, 15], [-16, -16], [12, 25], [33, -4], [45, -7], [-17, -20], [30, 10], [-36, -8], [35, -16], [4, -32], [-12, 2], [-28, 8], [-32, -10], [-8, -21], [-24, 16], [-32, 12], [24, -9], [-1, -22], [20, 14], [-60, -3], [8, 18], [-24, 10], [25, 2], [53, 4], [-42, 3], [32, 4], [23, -15], [11, -14], [-54, -4], [-38, 10], [23, -7], [-6, 22], [27, -13], [-35, 8], [14, 20], [2, 8], [-20, -16], [-30, -8], [-21, -26], [29, 15], [12, -24], [30, -21], [-9, -27], [-36, -22], [5, -13], [-24, 8], [-24, 0], [20, -15], [25, -17], [8, -16], [17, 24], [-53, 3], [-31, -9], [-22, 15], [39, -9], [-9, 18], [-13, -25], [30, -10], [-11, 28], [-56, 2], [-27, -5], [-5, -1], [47, -3], [47, -9], [17, 4], [-54, 6], [9, 1], [43, 18], [-28, -4], [34, 1], [-44, 0], [28, -6], [-13, 18], [38, 14], [22, -18], [-3, 6], [-12, 10], [1, -29], [-12, -10], [3, -12], [-18, -8], [42, 2], [29, 21], [-2, -4], [-58, -8], [6, 26], [9, 17], [-6, 17], [-37, -11], [63, -5], [59, -12], [-42, 20], [28, -27], [-28, 16], [3, 9], [42, -5], [-5, 31], [18, 17], [-7, 6], [45, -21], [-42, 21], [-26, -24], [-24, 10], [-17, -31], [-65, -8], [-36, -10], [-35, 8], [-5, -17], [-33, -7], [-13, 32], [12, -13], [30, -26], [-24, 6], [-18, -27], [-24, 1], [-35, -1], [53, 11], [-23, 4], [-42, -25], [12, -9], [45, -17], [-30, -7], [-28, -30], [79, 7], [56, -5], [-25, -21], [-6, -38], [19, -8], [-7, -8], [-58, -8], [6, 34], [-8, 6], [-57, 2], [-23, -3], [-7, 6], [-31, 19], [-31, -10], [-55, -11], [-7, -10], [-64, 2], [-13, -12], [0, -4], [5, 35], [38, 32], [-24, -21], [-36, 14], [-11, 15], [-12, 28], [-1, 10], [17, 7], [12, -39], [32, 16], [21, -4], [18, -10], [-2, 20], [50, -12], [-3, -40], [-36, 2], [-26, 31], [0, 9], [-24, 22], [22, -22], [-58, -14], [-64, -7], [3, 53], [-34, 1], [13, 15], [-22, -6], [-24, -16], [15, 25], [-19, 12], [36, -11], [0, -36], [-2, 24], [0, 15], [-21, 18], [11, -17], [-46, 21], [42, 15], [13, -25], [6, -1], [47, 3], [-2, -4], [-12, 30], [-19, 7], [68, -14], [9, 6], [55, -19], [44, 26], [-26, 40], [-39, -3], [-48, -26], [-36, -20], [-20, 20], [-52, -20], [25, -1], [-10, 7], [-59, 15], [23, -2], [84, 0], [-20, 8], [0, 19], [37, -4], [-36, 8], [-10, -12], [-73, -3], [22, 11], [-14, 0], [25, -15], [52, 8], [-9, -11], [-36, 7], [9, -43], [-24, 6], [13, 31], [3, -38], [10, -30], [38, 16], [-26, -21], [2, -12], [39, -15], [50, 8], [52, -2], [-7, -33], [-24, -12], [-58, -11], [13, 43], [-23, 37], [-7, 29], [60, 20], [11, -6], [8, 0]]
