
# q-expansion of newform 135.4.b.a, downloaded from the LMFDB on 01 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, 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 = 135
weight = 4
poly_data = [1, 0, 3, 0, 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], 1], [[0, 4, 0, 1], 1], [[0, -11, 0, -5], 1], [[14, 0, 9, 0], 1]]

hecke_ring_character_values = [[56, [1, 0, 0, 0]], [82, [-1, 0, 0, 0]]]
aps_data = [[0, 0, -1, 0], [0, 0, 0, 0], [0, -5, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, -33, -4, 0], [-83, 0, 0, 2], [0, -3, 38, 0], [0, 0, 0, 0], [127, 0, 0, -22], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, -244, 0, 0], [0, -183, -88, 0], [0, 0, 0, 0], [217, 0, 0, -76], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [211, 0, 0, -118], [0, 363, 158, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 8, 0, 0], [859, 0, 0, 116], [0, 638, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, -687, -484, 0], [1604, 0, 0, 0], [0, 0, 0, 0], [-3112, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 639, -406, 0], [0, 531, 872, 0], [0, 0, 0, 0], [-851, 0, 0, 404], [0, 0, 0, 0], [0, 0, 0, 0], [0, -99, 944, 0], [5456, 0, 0, 0], [2305, 0, 0, -382], [0, 0, 0, 0], [0, -1227, 434, 0], [-155, 0, 0, 596], [0, -1990, 0, 0], [0, 0, 0, 0], [403, 0, 0, 632], [0, 0, 0, 0], [0, 981, -964, 0], [0, -2836, 0, 0], [0, 0, 0, 0], [-3125, 0, 0, -502], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 1623, 1832, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 1767, -976, 0], [5852, 0, 0, 0], [0, 0, 0, 0], [0, 3824, 0, 0], [1315, 0, 0, 1076], [0, 1106, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-1637, 0, 0, -1210], [0, 3249, 2222, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [7519, 0, 0, -712], [0, 0, 0, 0], [-4121, 0, 0, 1364], [0, 0, 0, 0], [0, 0, 0, 0], [-8183, 0, 0, -610], [0, -3585, 902, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 2865, 3794, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-9179, 0, 0, -958], [0, 5409, 998, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-3238, 0, 0, 0], [0, 0, 0, 0], [0, -11710, 0, 0], [0, -6544, 0, 0], [0, 0, 0, 0], [-13361, 0, 0, 710], [0, 0, 0, 0], [0, -6921, -2314, 0], [0, 915, 5348, 0], [0, 0, 0, 0], [7945, 0, 0, -2248], [0, 0, 0, 0], [0, 0, 0, 0], [0, -7461, -2404, 0], [3476, 0, 0, 0], [13249, 0, 0, 1310], [0, 0, 0, 0], [0, 0, 0, 0], [0, 3747, 6314, 0], [0, -2715, 4712, 0], [0, 0, 0, 0], [32978, 0, 0, 0], [0, 0, 0, 0], [0, 14714, 0, 0], [0, 3963, -4378, 0], [17077, 0, 0, -1342], [0, 0, 0, 0], [-37726, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [-6089, 0, 0, 3374], [0, 4580, 0, 0], [7153, 0, 0, 3206], [0, 0, 0, 0], [0, 0, 0, 0], [-2597, 0, 0, -3592], [0, -6315, -8032, 0], [0, 0, 0, 0], [0, -4647, -8656, 0], [0, 0, 0, 0], [-14092, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 11571, 3926, 0], [45254, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 8835, -3364, 0], [12307, 0, 0, 3590], [0, -10059, -8338, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 9735, 9146, 0], [0, 0, 0, 0], [0, 0, 0, 0], [21224, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, -6531, 7106, 0], [0, -13546, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 5822, 0, 0], [0, -12615, 1958, 0], [31261, 0, 0, -154], [0, 0, 0, 0]]
