
# q-expansion of newform 1053.2.a.m, downloaded from the LMFDB on 24 September 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, 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 = 1053
weight = 2
poly_data = [2, -11, 10, 12, -7, -2, 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, 0, 0, 0, 0], 1], [[0, 1, 0, 0, 0, 0], 1], [[-3, 10, 5, -7, -1, 1], 1], [[-7, 11, 11, -7, -2, 1], 1], [[-6, 16, 11, -8, -2, 1], 1], [[-9, 15, 12, -8, -2, 1], 1]]

hecke_ring_character_values = None
aps_data = [[0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 1, -1, 0, 1], [-1, 0, 0, 0, 0, 0], [3, 0, -1, 1, 0, 0], [0, 0, -2, 0, 1, 0], [2, 0, 0, -1, -2, 0], [2, 0, 2, 1, 0, -1], [2, 0, 0, 1, 0, 1], [-2, -1, 3, -3, 1, 2], [0, 1, -1, 2, 2, -1], [1, -1, 0, 3, 1, -1], [2, -2, 2, 0, 1, 0], [4, 0, 2, -3, 1, 2], [3, -4, 0, 1, 2, -4], [-1, 1, 0, 2, -4, 0], [-2, 0, -3, 1, 0, -2], [2, -2, 0, 3, 3, -1], [0, 0, -1, 3, -1, 0], [0, -3, 0, 2, -3, -1], [5, 2, -3, 0, -3, 2], [-4, 1, 1, -4, 3, -1], [1, -4, 2, 0, 3, -1], [0, 0, -1, 1, -3, 3], [2, -7, 1, 1, 2, 0], [10, -1, -4, 1, 0, -2], [3, -3, 2, 3, -4, 0], [1, -4, -5, 0, -1, -3], [-3, 2, 0, -5, 1, 0], [4, 1, -3, 5, -2, -1], [5, -2, -3, -1, 4, -3], [4, -3, -4, 1, -1, -2], [-4, 3, 3, -3, 3, 2], [3, 4, 2, -6, 1, 1], [-1, -5, -1, 0, 1, -5], [1, 2, 0, 0, 1, -1], [-5, -1, 2, 6, -5, -1], [2, 5, 0, 5, -2, 0], [1, -2, -2, -1, -3, 1], [-4, -3, -1, 2, -4, -4], [0, -1, 3, -6, 0, 6], [3, 0, 1, 2, 1, -4], [-2, 3, -1, 0, -2, -1], [-2, 1, -2, 4, 0, -1], [3, 4, 0, 1, -4, -1], [-4, -1, -1, -5, -3, 0], [1, -1, 2, -5, 3, -2], [-8, 8, 4, -4, -1, 4], [5, -6, 1, 3, -4, 4], [-4, 0, -3, -4, 4, 3], [-3, 9, 1, -4, 1, 2], [6, 5, 5, -2, -3, 6], [-9, 5, -6, 1, -1, -1], [12, -4, -2, 3, -1, -4], [-6, -1, 7, 0, 2, -1], [4, 4, 1, -2, 6, 5], [-5, 6, -6, 0, 0, -3], [-8, 5, -5, 0, -1, -3], [-3, 9, 2, -1, -1, 5], [4, 2, -1, -2, 3, 1], [-5, 4, 0, 0, 2, -5], [5, 4, 2, -6, -2, 3], [9, -7, -4, 1, 0, 0], [-9, 7, -1, 6, -5, -2], [0, 0, 2, -5, -1, 1], [-14, 5, 6, 0, -8, 5], [12, -4, 6, 6, 0, 3], [-2, -1, -7, 9, 0, -10], [4, -6, -6, 1, -1, -3], [6, 4, 0, 7, -4, 5], [15, 4, -2, 2, -3, 6], [1, -2, -3, 1, 5, 2], [7, -8, -5, 2, 3, -6], [-1, 5, -2, 5, -6, -4], [2, -2, 0, 3, -3, -4], [-1, 7, 0, -2, 5, -1], [-11, 10, 3, -5, -7, 9], [15, -6, -1, 2, -4, 2], [17, -3, 0, 1, 2, -5], [5, -2, -5, 3, 3, -5], [-2, 2, 1, -1, -3, -2], [-1, -5, 5, -1, -5, 0], [-6, 7, -2, 2, 6, 3], [14, 4, -1, 5, -1, -5], [10, -7, -8, 9, 8, -9], [-11, 0, 11, -6, 5, 6], [-3, 2, -5, -1, 0, 3], [2, -8, -5, 2, 3, -9], [16, -2, -7, 4, 6, -8], [-8, 7, 3, -3, 0, -2], [-6, 0, -3, 2, 9, -7], [-3, 0, 10, -6, -1, 5], [-9, -7, -2, -7, -1, 4], [2, 8, 2, 2, -4, 1], [-3, -3, -11, 5, 3, -9], [-5, -5, -4, 8, -4, -15], [2, -2, 11, -4, -2, 3], [1, -5, 1, -4, 3, -6], [-18, -3, -2, 5, 1, -7], [1, -6, -3, 0, -3, 4], [10, -8, -1, 4, 12, -8], [-17, -4, -4, 2, -1, -9], [7, 7, 5, 3, -2, 1], [5, 3, 5, 5, -1, 5], [9, 11, 3, -4, -2, 4], [-15, -4, -6, -10, 4, -5], [1, -13, 5, -11, 12, -2], [4, 7, 1, -3, 3, 13], [5, 7, -14, 8, -3, -12], [0, 4, 11, -2, -5, 11], [11, -7, 4, 7, -8, 0], [-23, 1, -5, 0, 0, -8], [3, 5, 3, -8, -2, 6], [1, -6, -10, 7, 6, -14], [-4, -16, 2, 2, 12, -14], [-4, 1, 0, 1, -4, -8], [5, 10, -4, 10, 0, -1], [19, 5, -2, 3, -1, 6], [-12, -3, 5, 5, 11, -4], [12, -2, -8, -2, -9, -1], [-3, -11, -2, 1, 4, -2], [17, -4, 12, -8, 2, 7], [13, 9, -1, 13, -10, 1], [-2, 10, -3, -7, 10, -1], [0, -2, 7, -6, -3, 1], [-5, 3, 5, -3, 7, 5], [-1, 8, -8, 5, -7, 7], [7, 6, -4, -9, 8, 0], [-7, -2, -7, 4, 1, -10], [5, 2, 6, 1, -1, 4], [-5, 3, 9, 0, 3, 0], [0, 5, 1, -3, 5, 11], [-3, -9, 9, 6, -6, 6], [-3, -8, -5, 2, 0, -6], [-3, 13, -4, -10, 2, 5], [2, 5, -11, 2, 5, -5], [5, 2, 1, -6, 2, -2], [4, 11, -5, 12, -1, 0], [-7, 5, -7, 5, -3, -5], [-9, 3, 7, -6, -10, 14], [-10, 1, 5, -15, -5, 1], [-2, 4, 11, -5, 9, -8], [6, -9, 14, -2, -1, 4], [-6, -12, -4, -3, -8, -5], [1, -8, -10, 8, -8, 3], [-5, 12, 1, -9, 8, -3], [-18, 1, -1, -11, 4, 5], [-15, 10, 6, 0, -3, 3], [-1, 9, -12, -2, -9, 7], [-20, -5, -2, -5, -2, 2], [-15, -4, 11, -6, 6, 2], [4, -9, -10, -3, 7, -10], [1, -6, 0, -6, 15, -12], [-16, 10, 2, -1, 2, -2], [-2, 7, -11, 6, -3, -14], [-18, 12, 22, -10, 3, 12], [11, -13, -14, 2, -1, -8], [-24, -1, 2, 3, 10, 1], [4, -8, -10, -14, 3, -2], [12, -19, -6, 6, -6, -12], [7, -1, 11, 6, 6, -4], [12, -2, -16, 5, -7, -1], [11, 2, 14, -7, -7, 16], [-5, 4, 0, 9, 0, 4], [7, 10, -4, -1, -8, 9], [3, 16, 9, -6, 2, 13], [7, -16, 3, -7, 13, -5], [-12, -10, -5, 16, 1, -11], [-8, 7, -17, 3, -1, -12], [-3, 1, 1, 16, -6, -4], [-22, 6, -6, -9, 6, -10], [15, -11, -4, 5, 4, 6], [5, 0, -6, 7, 3, 7], [-10, 7, 2, -5, -9, 17], [1, -15, 7, -20, 13, 4], [-21, 3, -11, 12, 5, -4], [17, -6, -9, 15, -9, -3], [9, -10, 10, -7, -10, 7], [23, -6, 9, 8, -9, 2], [18, -3, 4, 8, -6, 9], [12, -23, 7, 0, 3, 4], [-23, 4, 11, -5, 9, 7], [-6, 5, 18, -9, 3, 3], [5, -1, 12, -6, -3, 2], [3, 6, 8, 0, 2, -9], [-4, 6, -7, 2, 2, -1], [-5, -8, -5, 10, -3, 2], [-16, -7, 1, -8, -5, 3], [19, 2, -2, -11, 5, 3], [-3, -15, 4, 4, 7, -5], [7, -10, -6, 6, -2, -4], [-3, 10, -2, -2, -8, 7], [28, -4, 5, -1, -10, 6], [6, 4, -9, -3, 3, 0], [-16, 6, -6, -1, 0, -7], [6, 2, 2, 8, 3, 1], [-31, -3, -10, 2, 5, -11], [-10, 6, 11, -18, -11, 15], [-1, -7, 6, -3, -9, -4], [13, -13, -9, 2, 13, -14], [-5, -4, 7, -6, -4, 8], [-9, 4, 8, -15, -8, 4], [13, -12, 2, 4, -15, -5], [8, -14, 6, 7, 2, -2], [9, -1, 6, 2, 4, -5], [18, 0, -6, -6, 3, 0], [26, -2, 6, -2, 5, 4], [2, -4, 3, -9, 10, 5], [-24, -8, -5, 7, -3, -1], [-4, 2, -4, -11, 0, 14], [4, 3, -8, 16, 7, -8], [17, -13, 2, 12, -8, 9], [-12, -11, 1, -6, -4, -1], [-8, -16, 13, 3, 5, 2], [0, 6, 2, -9, 8, 6], [-10, -8, -5, -2, 13, -3], [15, -2, -9, 14, -5, -8], [1, -4, -9, 9, 3, -23], [10, 8, -12, 16, -5, -9], [5, -4, 12, -4, -11, 13], [-10, -8, -4, 10, 0, -4], [-34, 0, 7, 3, 1, 0], [7, -7, 4, -11, -2, -4], [-19, 20, 3, -4, -14, 13], [13, 9, -5, -16, -6, 7], [11, -10, -3, 1, 8, 4], [6, 19, -6, -7, -4, 3], [3, 5, -5, -4, 6, 6], [-6, -9, -7, -12, 11, -12], [-11, -3, 2, -7, -13, 5], [-16, -11, -1, -4, 7, -15], [21, 15, 11, 2, 5, 11], [21, -9, -15, 10, 6, -5], [13, -2, 4, 19, -2, 2], [11, 2, 0, 15, -2, -16], [-3, -10, 10, -7, 12, -12], [25, 5, 10, 1, 1, 11], [-20, 8, 16, -1, -3, -2], [38, -17, -3, 3, 12, -10], [-7, -5, 3, 6, 8, -17], [-7, 18, 4, -12, -5, 6], [-6, -13, 6, -23, 13, -3], [-17, -14, -1, -3, 4, -13], [-3, 9, -6, -5, 8, -13], [6, 0, 16, -5, -14, 19], [9, -25, -3, 3, 3, -3], [21, 0, 12, 6, -12, 3], [2, 15, -8, 12, -4, -5], [-9, 4, -11, 4, 9, -4], [23, 0, 14, -8, 3, 11], [4, 8, -7, 1, 12, -14], [-21, -6, -13, 18, 5, -15], [11, -16, -12, -7, 10, -3], [-24, 2, -9, -5, 20, -16], [-22, 3, 1, -13, 1, 5], [3, -11, 6, -10, 20, -9], [7, -17, -8, 10, -2, -10], [24, 9, -4, 22, 11, -2], [-3, 9, 4, -3, -5, 9], [29, -13, 8, 1, -3, -1], [-11, 9, 4, -10, 1, -7], [8, 11, 1, -5, 2, -6], [9, 17, 13, -6, -7, 20], [-3, 9, -1, -5, -1, 4], [6, -8, 6, -5, 11, -1], [5, 9, 3, -15, -6, 5], [1, 1, -1, -4, 4, 12], [36, -4, -12, 8, -5, -8], [-15, 14, -10, -4, -6, -2], [-7, 17, -8, -13, -13, 16], [-4, 1, 10, 4, -12, -10], [-22, 5, -11, 3, 2, -10], [-11, -1, 4, -5, 2, -6], [-26, 2, -10, -7, -9, -5], [18, -2, -1, -11, 12, 0], [33, 7, 7, -3, 6, -5], [-10, 6, -11, -1, 10, -16], [9, 16, -9, 9, -12, 9], [6, -10, -24, 7, 5, -16], [-18, 15, -3, -3, -18, 18], [-28, -2, 7, 7, -20, 9], [-4, -23, -4, 13, -8, -19], [-6, -1, 9, 6, 10, -1], [14, 16, 11, -1, 8, 7], [1, 11, 18, -21, -5, 26], [-7, 19, 2, -18, -2, 3], [19, -2, -1, 10, -14, -4], [6, 0, -10, 9, -5, -2], [4, 28, 11, -4, -4, 18], [15, 22, 7, -16, 9, 3], [22, -1, 8, 1, 0, -5], [-40, 14, 2, -6, 4, 12], [-17, 13, -1, 18, 1, 1], [21, -13, -12, -5, -10, -7], [0, -2, -4, 12, -17, 13], [0, 4, 1, 14, -18, 3], [-5, 12, 12, 1, -13, 15], [10, 14, 9, 15, -8, 8], [14, 6, 1, 0, -17, 12], [-13, -10, -7, -3, -5, -9], [-13, -1, 4, -4, 11, -14], [1, 10, -4, 26, -7, -9], [28, -8, 14, 4, 7, -13], [30, -11, -13, 3, -8, -2], [31, 0, 10, 0, 8, 0], [-5, -2, 4, 0, 3, 1], [0, -24, -6, 5, -5, -5], [-14, -17, -9, -1, 5, -3], [23, 10, 20, -10, -13, 28], [23, -4, -1, -9, 13, -9], [-28, 11, 18, -11, 2, 7], [-27, 6, -11, -10, 28, -16], [-9, 3, -6, -9, 6, 24], [-19, 24, 3, -1, -9, 14], [-16, -27, 0, -4, 1, 0], [-16, -1, 19, -12, -16, 19], [5, 1, 16, 13, 9, -10], [6, -11, -17, 17, 9, -15], [-10, 12, 12, 9, -6, 6], [8, -5, 8, -16, 4, 0], [-8, 7, 4, -17, -5, 8], [-11, 9, 0, -9, 18, 6], [21, -14, 8, 1, -18, 0], [-11, 0, -7, 23, -1, -10], [-26, 10, 4, -6, -6, 16], [-5, 15, -13, -9, 11, -9], [0, -15, 4, 2, 6, -12], [9, -1, -1, -14, -6, 3], [-16, -12, -5, 7, -14, -2], [-15, -10, -10, -14, -3, 0], [-38, -5, -1, -7, -2, 9], [-43, 10, 12, 8, -20, -3], [20, 2, -2, 20, 11, 4], [11, -19, 7, 6, 11, -2], [-9, -6, -16, -10, -7, -7], [14, 1, -13, 8, -1, -11], [-19, -9, -6, -15, 3, 18], [-3, -6, -16, -10, -4, 8], [10, 3, -11, 7, 1, -20], [5, -5, -6, 16, 11, -8], [-45, -3, 0, -18, -3, 9], [12, -1, 6, -17, -2, 15], [10, 18, -19, 15, -8, -22], [4, -32, -7, 12, -11, -10], [34, -19, -11, 15, 29, -31], [-2, 0, -20, 12, -5, -6], [-27, 9, 9, -14, 5, 20], [12, 20, -12, 21, -6, -6], [23, 7, -13, 15, -23, 1], [-25, 7, 10, -3, -6, -2], [52, -16, -16, 1, 3, -11], [-18, 2, 8, 0, -9, -13], [15, 0, -9, -5, 27, 4], [-8, -5, -9, -18, 6, 4], [-56, 1, -14, -11, 10, -19], [-2, -2, -7, 16, -12, -17], [-1, 5, 5, -16, 17, 19], [-26, -7, 11, -1, 26, -12], [34, 0, -3, 6, 15, -21], [24, 10, 8, -11, -3, 12], [-9, 1, -9, -15, 6, 6], [14, -13, 4, -16, 21, 2], [20, 11, -8, -14, 8, 0], [-17, 18, 23, -16, -10, 32], [-18, 23, -16, 1, -3, -15], [8, 25, 1, 7, -6, -4], [32, -12, 22, 4, -2, 13], [29, -18, 15, 3, -3, -7], [-15, 9, -9, -11, 9, -14], [11, -3, 12, -4, -23, 15], [-27, 11, -18, -8, 8, -4], [5, -16, 10, -17, 11, -3], [15, -8, -1, 5, -2, -6], [5, 8, 14, 20, 2, -5], [-31, 3, -7, -7, 2, -11], [-29, 17, 1, -5, -10, -3], [23, 16, -8, -6, -13, 19], [28, 0, 1, -19, 16, 11], [10, 3, -9, -3, 0, 4], [12, 10, 4, -4, 0, 12], [10, 1, -7, 12, 1, -17], [20, -13, 10, 17, -3, 11], [34, 1, -2, -3, 9, 13], [3, -17, 10, 5, 3, -6], [-41, 3, 18, 3, 6, 0], [29, -13, -4, 19, -9, 12], [37, -14, -15, 1, 17, -19], [-3, 13, 14, 1, 0, 0], [16, -11, -18, 7, 2, -13], [46, 3, 5, 18, 7, 5], [28, 18, -4, 26, -19, 12], [-6, 4, 9, -2, -10, -16], [-28, -11, -15, 11, 4, -12], [25, -5, -9, -6, 5, 1], [-38, 13, -1, -9, -2, -8], [2, 9, -18, 14, 4, -15], [7, 5, -9, 5, -17, 16], [36, -8, -12, 8, 10, -8], [5, -23, 18, -7, 5, 18], [1, -16, 5, -11, 6, -11], [38, -14, -28, 13, 7, -13], [-27, -15, 11, -6, 25, -20], [-5, 14, -18, 8, -14, -13], [-14, 16, -5, -5, -15, -4], [-5, 11, -16, 9, -3, 2], [31, -23, 8, 8, -1, -3], [4, 0, -2, -6, 13, -6], [22, 5, -20, 24, -1, -12], [1, -17, 6, -13, 11, 6], [-43, 3, 11, -15, 25, -6], [50, 3, 2, 10, -15, 2], [0, -33, -5, 12, -2, -12], [-7, 11, 10, -4, 14, 4], [19, 19, -17, 38, -21, 1], [-17, 7, 24, -1, 7, 14], [-30, 2, -4, 21, 3, -10], [-14, 25, 21, -13, -11, 26], [-18, -3, 1, -27, -13, 14], [24, -22, -5, -1, 0, -9], [-52, -1, 0, 13, 1, -3], [-6, -7, 22, -27, 8, 5], [-36, -8, 4, -13, 12, -21], [4, -10, 7, 7, -13, -6], [38, 24, 2, -8, -9, 20], [17, 19, -1, -6, -14, 15], [-25, -11, 3, -20, 35, -14], [16, -5, 26, 2, -11, 24], [-4, 11, -26, -7, -6, -4]]
