
# q-expansion of newform 196.10.e.f, downloaded from the LMFDB on 08 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 = 196
weight = 10
poly_data = [1299600, 1140, 1141, -1, 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], [[1299600, -1141, 1141, -1], 1300740], [[-1299600, 2602621, -1141, 1], 650370], [[6842, 0, 0, 4], 1141]]

hecke_ring_character_values = [[99, [1, 0, 0, 0]], [101, [-1, 1, 0, 0]]]
aps_data = [[0, 0, 0, 0], [0, 112, -1, 0], [-798, 798, -9, -9], [0, 0, 0, 0], [0, 25296, -168, 0], [-92386, 0, 0, -585], [0, 76062, 3042, 0], [302512, -302512, -2097, -2097], [1251804, -1251804, 546, 546], [-1363746, 0, 0, 1806], [0, 3327520, -44226, 0], [3430114, -3430114, 99918, 99918], [7077378, 0, 0, -59694], [-566920, 0, 0, -116424], [-17743320, 17743320, -68286, -68286], [0, 16655970, -486780, 0], [0, -14709744, 858429, 0], [-17975846, 17975846, -577161, -577161], [0, 85143352, 548730, 0], [-231807744, 0, 0, -29568], [0, 50403430, -1998828, 0], [98746912, -98746912, -1018836, -1018836], [25713744, 0, 0, -1920243], [-324643746, 324643746, -1535628, -1535628], [1390646810, 0, 0, -1516194], [0, 58428762, -4396827, 0], [379641640, -379641640, -2803554, -2803554], [1419527184, -1419527184, -962094, -962094], [0, -559578470, -1835442, 0], [-691686906, 0, 0, 11363520], [-1358933764, 0, 0, 16201962], [701502816, -701502816, -28809489, -28809489], [0, 397739958, -14413980, 0], [6909750848, 0, 0, -12578193], [8030083818, -8030083818, -7847868, -7847868], [0, -10392738284, -7801794, 0], [0, -7655104478, 37126935, 0], [1843498096, -1843498096, 20897856, 20897856], [3333306144, 0, 0, -81230790], [18639228258, -18639228258, 11084205, 11084205], [0, -1900239432, 63521430, 0], [-3002569234, 0, 0, -95560389], [4337818776, -4337818776, -182773752, -182773752], [0, -3533751230, -18614232, 0], [-24415082226, 0, 0, 78010464], [0, -1559364968, 4886406, 0], [5825861912, 0, 0, -90281646], [13794129272, 0, 0, -134085240], [0, 41838459936, -195960783, 0], [-1656197270, 1656197270, 148916133, 148916133], [-25372235658, 25372235658, 42008232, 42008232], [-18865173948, 0, 0, -16363494], [0, -65297213786, 35891262, 0], [-17460392544, 0, 0, 688332015], [-49363902546, 49363902546, -213628704, -213628704], [0, 50624132928, 300173664, 0], [0, 44793607026, 180752667, 0], [-52997683592, 52997683592, -797289876, -797289876], [0, 35086071898, 722633688, 0], [38157597690, 0, 0, -709900128], [0, 14811168736, 966409821, 0], [-183976661274, 0, 0, -298065423], [-69731155312, 0, 0, 1016401617], [0, -62766609192, -61328352, 0], [-18764157314, 18764157314, 1899824886, 1899824886], [-72801203814, 72801203814, 397812576, 397812576], [-72171906872, 72171906872, 1718004456, 1718004456], [61314419342, 0, 0, 1077068160], [0, -117912252312, 1049620824, 0], [-449631070378, 0, 0, 75180879], [0, -34479048954, -1064692692, 0], [-143076750420, 143076750420, -1476842010, -1476842010], [0, 249321500344, 1503414432, 0], [34803767146, -34803767146, -3891951756, -3891951756], [-235946052376, 0, 0, -2541399084], [202085393160, -202085393160, 3680277882, 3680277882], [0, -13463295150, 1239491442, 0], [166307780506, -166307780506, -4101374943, -4101374943], [-666460424454, 666460424454, 17860332, 17860332], [0, -113240142218, -4257209646, 0], [361513788384, 0, 0, -3569158149], [-246108652378, 0, 0, 2111855256], [0, -1086408369420, -152230890, 0], [575426986946, 0, 0, -1391784066], [436488294256, -436488294256, -1030598748, -1030598748], [732684669336, -732684669336, -914537190, -914537190], [-234922013694, 0, 0, 395819592], [843728244922, -843728244922, 2558892168, 2558892168], [672024604902, 0, 0, -5295091461], [-859047801880, 0, 0, -4500866916], [677458409712, -677458409712, -9832343661, -9832343661], [0, 1376028738672, 3534842454, 0], [0, 204796817644, -2542899618, 0], [174823406040, 0, 0, 4910323950], [-3252631376, 3252631376, -13823182422, -13823182422], [-280394242128, 0, 0, -3637417560], [-278750977638, 278750977638, -321609255, -321609255], [0, -1449968904762, -12806840106, 0], [-626694452384, 626694452384, -4087859913, -4087859913], [-2933275512062, 2933275512062, 1947605436, 1947605436], [-713579403760, 0, 0, -16326929556], [0, 943447140138, 8135177064, 0], [0, 3232895120784, 3900554271, 0], [1719702661842, -1719702661842, 11556091092, 11556091092], [0, -1289072616248, -24188500476, 0], [0, 157264131766, 7736438844, 0], [-4190830519008, 0, 0, -10524727293], [1677198422382, -1677198422382, 7520671788, 7520671788], [0, 1250318981880, 18824777328, 0], [-2443872923086, 0, 0, 17682842772], [194473843648, -194473843648, 412966224, 412966224], [0, 28370542426, 25522349454, 0], [-645366171066, 0, 0, 36774859968], [0, 1389708277888, 6757360389, 0], [3633875117192, 0, 0, -26875732716], [0, 1431714534666, 24623849628, 0], [231362311376, 0, 0, 9465130215], [0, 4587882177144, 9738890406, 0], [-3657551062110, 3657551062110, 11350837638, 11350837638], [710297561328, 0, 0, -18192264468], [0, -4584427913366, -24601970439, 0], [-4084378901806, 0, 0, -34570912572], [-7298882405262, 7298882405262, -5011583259, -5011583259], [0, 1950005889552, -14370974142, 0], [-2696542251200, 2696542251200, -16573315041, -16573315041], [1443589233390, 0, 0, -70879867086], [-2984810893454, 2984810893454, 2506732830, 2506732830], [4560535193928, -4560535193928, 2603095110, 2603095110], [-1979909165248, 0, 0, 1922327910], [-871877468966, 871877468966, -15258262833, -15258262833], [0, 3402849153136, -3891875904, 0], [726607168932, 0, 0, 37287030858], [2291206452676, -2291206452676, -20237013342, -20237013342], [-2481420947290, 0, 0, 50719079502], [-2682969081954, 2682969081954, 71687354058, 71687354058], [177606901850, 0, 0, 6594449706], [0, -2188126277358, -118975405299, 0], [0, -5737589849936, 86948756037, 0], [18279168804750, 0, 0, -13540622949], [0, -605963700294, -84686374080, 0], [6061977971840, 0, 0, -58117167207], [2439438622938, -2439438622938, 74076571296, 74076571296], [0, -3091453596272, -153693946476, 0], [3188338036848, 0, 0, -89324399850], [0, -12619010332166, 97917542577, 0], [4930628584056, 0, 0, -172256388774], [-6856306761178, 0, 0, -85162865877], [0, -14270157741882, 25028733162, 0], [11185722160144, -11185722160144, 132508603305, 132508603305], [8931713356968, -8931713356968, -83837326440, -83837326440], [9076779973546, -9076779973546, -32139448362, -32139448362], [11966119995690, 0, 0, -1863070896], [5278207782416, 0, 0, 216647188002], [-11882944810464, 11882944810464, -8767193454, -8767193454], [0, -4417398149048, -42528120390, 0], [-13961767455084, 0, 0, 14609450142], [-4004817489776, 4004817489776, 102653325180, 102653325180], [-3627752081058, 3627752081058, 141533796606, 141533796606], [17110917731306, 0, 0, 76443504876], [0, 3297243568626, 222445312293, 0], [6503125749840, -6503125749840, 17500012572, 17500012572], [24162162784938, 0, 0, 21218258544], [20146411722596, 0, 0, -108115234290], [-20766598351968, 20766598351968, 3045645051, 3045645051], [0, 12006266295006, -231100101876, 0], [0, 6439282221624, -98430508902, 0], [0, 26555278971136, -105880398120, 0], [0, 24233611304770, -172188423459, 0]]
