
// Make newform 354.8.a.d in Magma, downloaded from the LMFDB on 20 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_354_a();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_354_8_a_d();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_354_8_a_d();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [-22179668074797840, 1662873307981032, -17055507548256, -196601024266, 2559087821, 5805883, -103558, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [-356947010208639585264465995259988420923660, 9654151949266513610090445212328685886916, -90014707113837876716775395861377686669, -1020553945814872731656206822126758163, 9211362087496075255330491435177414, 32272765742947592225785536661693, -137967969456332414968902702557, -403229322236707491211437818], [-136300644436574650780228149573810545177760, -611723712198081695672585787775968028320, -23880945938076077096670258052075750626, 1274385175313517237719367616634058697, 1714050501852531549663212177849847, -93887852792777244489516219220270, 46107419100357503772032346707, 1097246569602563098146271901], [46495488789985667734566872416994794265256, -2099592624087832717873083692618986820238, -1408668066647813515765449058104500175, 340551898521674518832096786900065501, -340057048169918736899478202025880, -15599687644076308419067191165577, 14559238687147218040433102567, 170108787082024923392891450], [-95719710011998894723211837096027785717944, 4136104910966556997345478781124427369736, -8973233723056551560865872788546296102, -412117420072470122290629244631729171, 1136515713627213684759392232462679, 12181131388669060994089749674350, -18948739454581144940582807593, -115498339258088308799016755], [-68047200429759461243445824269030483673340, -7429229784256484293180525660533457104990, 77769673790034588080518340869634168751, 867188064622670732381583192381771398, -5611263382248124484752450453880977, -26980938552899032571868666894055, 79381498061657495434909325938, 290990153212056172452479519], [10939378279915137457448417913880118449830, 7746165491601975485215549214247873591168, -69537976025533733663762070617168056212, -1154950741736555661330307161449060759, 6202885414457031247485712190533737, 57185355372024056048534169134264, -122501458831997685281243780521, -712321044445775335554949789], [-11629851154660543572706887776244801561288, 1394845953596624549552085023962955881086, -842600631972009141505704822501743913, -243916127654407357669640540651106643, 229570134912176440702599021209146, 11540722416899036972387132484165, -10082856090107755136333445389, -125957929380825480203012016]];
    Rf_basisdens := [1, 184693392610436798977351178752725965940, 369386785220873597954702357505451931880, 36938678522087359795470235750545193188, 24625785681391573196980157167030128792, 61564464203478932992450392917575321980, 92346696305218399488675589376362982970, 12312892840695786598490078583515064396];
    Rf_basisnums := ChangeUniverse([[z : z in elt] : elt in Rf_num], Kf);
    Rfbasis := [Rf_basisnums[i]/Rf_basisdens[i] : i in [1..Degree(Kf)]];
    inp_vec := Vector(Rfbasis)*ChangeRing(Transpose(Matrix([[elt : elt in row] : row in input])),Kf);
    return Eltseq(inp_vec);
end function;


// To make the character of type GrpDrchElt, type "MakeCharacter_354_a();"
function MakeCharacter_354_a()
    N := 354;
    order := 1;
    char_gens := [119, 61];
    v := [1, 1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

function MakeCharacter_354_a_Hecke(Kf)
    return MakeCharacter_354_a();
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..(prec+1)]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 8;
    raw_aps := [[8, 0, 0, 0, 0, 0, 0, 0], [-27, 0, 0, 0, 0, 0, 0, 0], [-74, 0, 0, 1, 0, 0, 0, 0], [-42, 1, 0, 0, 0, 0, 0, 0], [-358, -1, 2, -1, -1, 1, -2, 3], [141, -4, -7, -9, 3, -2, 2, -4], [-2818, -10, 11, -24, 6, 2, 2, -1], [-4189, -10, -5, -21, -20, -4, 15, -14], [5170, -24, 31, -44, -4, -9, -9, -32], [-6044, 68, -65, -109, 0, 33, -31, 16], [27157, -56, -115, -159, 86, -35, 18, -26], [-9817, -7, -218, -49, -194, -56, -47, 62], [-55788, 57, 411, 279, 45, 108, -149, 215], [-58929, -19, -426, 88, -59, 144, -22, -359], [234704, 351, 115, 37, -137, -73, 210, 568], [-144348, -10, 336, -803, -322, 334, -186, -648], [-205379, 0, 0, 0, 0, 0, 0, 0], [-1136050, 1296, 819, 430, -270, -96, 32, 258], [-1068779, 603, 226, -896, -47, 387, 363, 348], [-729450, -2152, 815, 532, 727, 39, 58, -248], [-953882, -185, 989, 1666, 839, -1632, 719, -1198], [-1578315, -1175, -1807, -213, 2410, 420, -917, 322], [-2394358, -859, -1567, 12945, 1535, -506, 719, 2629], [-2006665, -1615, 671, 10320, 95, 1318, 2664, 414], [-245071, 3977, 2014, -15211, -2629, 994, -238, 8082], [-2628264, 172, 635, 4200, 173, 418, -17, 616], [816778, -3549, 3168, -8182, 4953, -1652, -1151, -3518], [-3383629, -4632, 12449, -1026, 4164, 3507, -4196, 7108], [1528813, -3363, -4059, -23881, -63, -4446, -6046, 4942], [-5234820, 1665, -2104, -3142, 1229, 4043, -6328, 1726], [-7876797, 1733, 5066, -1549, 8803, -9290, -1694, 2184], [-15431268, -4638, -24538, -1224, -8362, -6082, 8362, -9818], [-21619916, 19001, 2688, 1265, -5021, 7887, 6922, 13351], [-17751029, 1611, -4322, -12641, -5605, 2288, -918, 492], [-27051053, -5796, 26390, -14240, 3277, 11831, -5127, 9258], [-2950163, 478, 4201, -45955, -5642, 4349, 14346, -21514], [-13440229, -6370, 38122, -89185, -2848, 7180, -10991, 21412], [2231050, -795, -13867, 27302, 25799, -12440, -3309, 10962], [-23491631, 36840, 29793, 36380, -15950, 11684, -10523, 36190], [-12055037, -1341, -49826, 50186, 23622, 9596, 5405, -24308], [7946936, -43983, 776, -8125, -1459, -16267, -22316, -66365], [-28443357, 19511, -40181, 128693, 1221, -31943, 15763, -20282], [33812850, 29335, 46914, 13759, 53699, 20404, 5703, 30670], [-14493538, -28526, -3718, 7876, -15158, -20773, 425, -90403], [1030190, 62157, -85072, -4364, -39649, 768, 35665, 35668], [-20519190, -26105, 55129, 10172, -42447, 42018, 17789, -30946], [8525480, 83418, 647, 182277, -68922, -31451, -59283, 62771], [33500590, -66648, 63769, -18368, -39695, -47416, -35195, 126186], [-26412326, 3494, -7717, 164078, -41428, 65704, -73356, 71859], [-58250158, -29126, 162306, 259350, 109615, 7300, -41297, -12490], [59656394, 43682, 77830, -205902, 49574, 30428, 27932, -44676], [33842764, -30682, -33338, 83854, 109020, -2885, 108491, 41032], [65845896, 114966, -74446, -151990, 8174, -22169, -34295, 60553], [67672558, -26929, -71726, 220548, -71473, -60663, 146588, -193670], [-2728334, -36722, -301552, -248260, 14600, -51313, 42727, -156127], [36806723, 136798, 67296, 513410, -156161, 112386, -122152, 190322], [-31697360, 105657, -71493, 169904, 84828, -35249, 123749, -79138], [-149619875, -107369, -57925, -207203, -71540, 127190, -150969, -131430], [-8088479, 87413, -30976, -642, 2715, -119755, 158901, 120088], [158837382, -141800, 47626, 94748, 87018, -68211, 139199, -231257], [-134854058, -207034, -23291, 651677, -76846, -42633, 128305, -245903], [-80008758, 39481, 120943, 894490, -204541, 88251, 73982, 132402], [153015460, -175690, -243720, 67734, 77038, -85408, 303652, -143392], [-90202087, -330113, -412476, 323414, -272012, -47669, 8610, -455952], [-156343799, 118530, -244479, -14889, -245596, 92842, -270045, 73148], [-51357016, 14182, 196068, 594879, -254070, 5860, -141852, 181464], [-23282354, 735734, 185936, 347770, 21264, 165380, -1052, 147506], [139833, 524628, 324179, 364641, -144696, 75090, 144175, 53238], [80639722, -157873, 525845, 396715, 226081, -79465, -61880, 76944], [171187077, -87814, -560633, 730973, -32387, -353544, 42342, -581392], [-104314237, 204300, -208307, 524424, -47206, 216635, -146676, 247726], [259584652, 300407, -521771, 28660, 355788, -85720, 58332, -122302], [488784171, 593708, 139748, -761878, 88082, 263127, -74692, 667124], [528981878, -664896, 298845, -482925, -92934, 423164, -166508, 246102], [124880389, -335513, 29382, 17301, 453177, -136794, -116458, -127078], [126621306, 265528, -99325, -676590, 107369, 135749, -220014, 517444], [93502902, 254625, 1156980, -1070146, 152805, -131046, -138887, 703752], [232978011, -585626, 314534, -234879, -362800, -76, -446511, -861928], [-228400623, 301138, 518891, -100244, -426938, -70361, 492712, -905630], [90284010, -164866, 1116386, -214966, -398084, -191708, -206684, 993462], [263410952, -576046, -898966, -884842, -488854, -166783, 314459, -1202039], [289898927, -159988, -630477, 681011, 437155, 605878, -255776, -180676], [262575060, 404377, -880125, -489603, 686239, 184079, 585610, 719068], [547411792, -1579490, 523933, -2355689, -546924, -311481, 75425, -568913], [571178597, -159220, 173366, 1151307, 298623, -111738, -76366, -1103884], [-65110656, -463150, -111005, -759566, -113940, 114094, 844736, 827385], [-252831376, 1121359, 482814, 1385069, 549385, -215763, 234490, -638031], [302296328, -535945, 286715, -65960, -9519, 959118, -999195, 1415232], [-380440642, -1568129, -398475, 2309964, -454413, -293425, 560894, -2019336], [1308375700, -211345, 966003, 1462923, -41249, -357890, 5333, 470750], [-94816712, 701302, -882086, 5266386, 623842, 364107, -368117, -280145], [-1034619851, -415967, 609625, 788502, -21221, -194173, -595877, -515476], [891085731, 327312, -1100364, 6327873, 644515, 476578, 366636, -1255564], [325440325, -1277355, 606343, -458378, 303887, -748550, -123486, -789936], [1163776093, 1353453, -789052, 3299749, 941493, -871604, -278336, 553466], [-1409441344, -464319, 326691, 3609075, -289489, -38135, -581540, -1087940], [-1225027285, -1283541, -1790729, 1215374, 1053269, -46222, 24292, -817010], [-842485760, 832829, 897907, -811811, -1261813, 515237, 276594, 3895482], [27068623, 377679, -1731274, 5609943, 1139449, -44530, -802704, 2025296], [1934761633, -1234078, -2472031, -3910163, 1007845, -865562, 433476, -1428792], [-16328939, 1427066, 2666233, -216525, 558644, -621482, -61407, 1875810], [-1522348850, -2324771, 677830, 3647908, -37793, -1012400, 664141, -758512], [-2619506054, -1694753, -1054296, -7775531, -2693017, -1130632, 828305, 409064], [-2779418787, 122095, -1624203, -6284428, -1174619, 260388, -1504812, -1508278], [1569107471, 762359, 2234540, 3890074, 3316865, 1305393, -1542825, 1692904], [177484425, -3770691, -3280602, 6379650, 999567, -1084376, 625750, -4781521], [-817248444, 1861067, 5264636, -7780853, 742763, 360181, -782740, 4478521], [-1809907358, 132183, -7699505, -3257729, 558701, -2746613, 3121488, -3342438], [-393260332, 1062151, -240393, -4759714, 1368788, 613806, -1363674, -529194], [354052789, 1634074, 1093917, 1505871, -1152806, -1758402, 3237781, -1125400], [195275339, 4089, -2752101, 1552925, -13174, -360794, 1818327, -4968278], [10508554, -1903279, 1373443, -1510020, -2533742, 596376, -684902, -2174276], [-1552992508, 2591580, -635383, 1409406, 1125256, 1101252, 264016, -2740239], [159065985, -561987, -1787836, -10309079, -2383317, 26244, -1103318, -399148], [1935979267, 1253659, -518579, -406641, -3739256, 1174610, 146737, -316470], [-3851974370, 3879871, -3444322, 17568849, 1444363, 294214, -1127285, 1913826], [-855879969, 1980946, -568317, 6565609, 3115540, 1883000, -1079255, 960556], [1194744816, 1033031, 2898602, 9783808, -1398467, -789110, -558375, 1963714], [-1670997178, 577672, 208669, -27049, 2047344, -2340257, -23659, -280246], [667204068, 6638270, -2261587, 376314, 1757608, 949745, 754691, 1301264], [-730939825, 223601, 8253891, -5036617, 2516231, 451873, -2723807, 5425366], [2058083368, -1457254, 799282, 4230550, 909988, -2368312, 2447494, -4557986], [-2180653318, 3381949, 3066116, 2894534, -762009, 652452, -3709311, 4248836], [-5205974490, -5888375, 7490116, 5760655, 3242977, -479765, -436430, -6645395], [-1143138108, 2568662, -4721714, -3381516, -1679068, 747665, -467407, -1468081], [-3525494081, -2877465, 1011446, 5083448, 1513852, 1984608, 199731, 248500], [1366514432, 5042970, -6293374, -11763312, -540150, 873072, -851808, 6022188], [755050188, 1489202, -1544061, -11439366, -400928, -1307347, 394451, 5208332], [1216160726, 5906864, -6155027, 1714938, -3238307, 3107604, 874413, 5006358], [-5516800781, -6490497, 5211322, 4311576, 4605995, -173633, 492605, -3545694], [-1478789468, -1241312, 3006331, 20179031, 652128, 1614991, -703003, 4430387], [-1958008875, -3241777, -6698633, -3752370, 3462261, -522129, 1716589, 2494488], [-120573564, -975187, -2564318, -7246278, -293555, -4435614, 3544289, 716846], [4064544346, -4468024, -546017, 2312931, -5694674, 2987914, -2753222, 2087538], [2169761164, 111129, -809120, -7475107, -1950791, -3139358, 3275059, -3450610], [-1011150091, -29418, -7805749, -19699345, 1702158, 1528928, -1355109, -3015574], [-9176960738, -8279380, -1187200, 28252770, -511654, 511536, 1292282, -7916606], [-664298394, -6101758, -5130548, -1305364, 6150900, -1353094, 482886, -3515870], [-4841403554, -8187590, 8759575, 16067732, 1915059, -4004018, 218451, -596676], [-3999125719, -190940, 5792217, 13979556, 2000292, -5366833, -553750, 7399566], [2066752766, -366332, 8394502, 22461066, 5004490, -2232537, -4190537, 2354985], [6130145639, -1511407, -820198, -15658534, -319500, 4771880, -960413, -2315468], [579494305, 3799118, 7402658, -14580090, -6996196, 971865, -6616166, -1159176], [2640741696, 3800905, 7224560, 14278074, -3195705, 3761021, -35878, -6706490], [-2188421621, 4154721, -2976903, 12666733, 4107399, 1723491, -4233425, 3453084], [161859084, 8539171, -6344508, -19089111, -998185, 236554, -5151673, -8194332], [1387538370, 11346120, -8291591, 10076367, -456576, -3639114, -1582676, 11009088], [-700390924, 3556181, 16760354, 49207758, -2932841, 2041301, 708766, 4638746], [7182213338, -10525636, -2358040, -34865758, -860944, -6475412, 8843430, -7290004], [6759114360, 8717846, -2618423, 6975090, 15649642, -13961, 1968423, 8112146], [-2432471204, -14224278, -8241092, -8960758, -11134158, -1748892, -3348724, -7318802], [-4945856096, 1105626, -2752938, 23877682, -6109390, 4663118, -3158472, 1613270], [6030023218, 10731512, -5199874, 32742672, -5415614, 5982346, 333326, 1955906], [8785692830, 12698763, -4638076, -58228027, 2446637, -905640, -2520607, 3628538], [595124701, -7533113, -2028608, 58210463, 10808995, -5214518, 511962, 196692], [-1225092061, 10431184, -520678, 25797560, -1902985, -4544074, -5786492, 5983422], [5556858480, -148149, -1813492, 13517078, 108321, -4256208, 7006547, 6302880], [1247951446, 11546009, 11793594, 31283946, -1284407, 7234955, -9844388, 727774], [6193166399, 581355, -1813044, -15314605, 1511747, 5357088, -6930026, 10873606], [-4613963668, 15663691, 21064578, -2779078, -2239055, 3268745, -5184978, 21108092], [7415510643, 4694583, -3054403, 22898486, -3725183, -9605712, 14569500, -23951202], [4325883622, 7728556, -10221240, 50542614, -9338446, -4618497, 2861101, 7777071], [5525065950, 13443495, 27964657, -16085559, -4531717, 5170590, -12708093, 23703938], [5256339291, 9926472, 13086755, 23988274, -2271134, -1615019, 14153836, -4890322], [5523542396, -6205173, 14197606, -23075498, -6347219, 2485121, -7490230, 1328150], [484167206, 3989343, 4279362, 17839893, 2012397, 2292036, 5705117, 2430654], [-4054477814, 4127003, 7750791, 12173935, -5072455, 13388072, 3420967, 17890536], [4548027889, -4688533, -25743717, -8976135, -3784431, -5559535, 7706645, -37132312], [1074421796, 15320204, -10099124, 9976504, -7538620, -296144, 5827094, -17782142], [-5875543986, -20892706, -26415909, -52682628, 6423989, -3505266, -7447519, -4947648], [17508568898, 20737859, 6577666, 19998972, -8117103, -4936021, 11657264, 11687612], [-1316402092, 9772601, 10136135, -55460462, 13519644, 514648, 1689342, 11887520], [865170631, 11946539, 4472130, -46117028, -9757358, 11741855, -8525442, -7012340], [2534980721, -21883515, 4492274, -2778551, 3149557, -2342648, -1388514, -6714336], [-13138909192, -12688432, -711477, -26119330, 4676503, 2253398, -12161805, -415522], [-4278720068, -1527331, 25624296, -55918449, 11450575, 4224243, 6861698, -17367613], [-565030453, -5553289, 29206172, 9037269, 13168777, 13871586, -5323662, 15292452], [1073000478, -16117502, 6655939, -53991016, 12819723, -10833602, 6752771, -24861060], [8244916321, -19789422, -13300073, 17030477, -6392858, -14692378, -5141889, -22172958], [-8053851910, -20807164, 17688964, -113521362, -11349840, -1107982, -5959578, 12690908], [-23571047442, -3103596, -8891492, -28393464, 283596, 10247614, -11436496, 12100084], [-5819100124, 39177458, -4142238, -29634842, -8397676, 10599894, -7901446, 22081084], [-4661929775, 18916620, -5219945, -24469905, 6806975, -4716770, 18102974, 9062160], [12556152282, 42455774, -30582990, 59995908, -4668878, -3363728, 4104226, 22869088], [-5690651328, -36945408, -9458135, -62920238, 996081, 9939861, -13216804, -33622728], [12986773373, -1406262, -26289825, 1235908, -18952572, -3478075, 3443742, 20163200], [23526683752, -3085847, -8082402, 45211462, 16116113, -8999870, 15590479, -24576220], [14579382818, 28353212, 21284330, -12740838, -12375522, 7458047, -17223929, 39987589], [8042020863, -3561019, 35778738, -69245631, 10206971, 13724844, -1967186, 2480144], [-7858150774, 12244230, 539897, 160459462, -882810, -288549, 277421, 5331020], [-21401379179, 32837391, -3098528, 22673437, 16341275, -6949746, 8207446, 13629442], [24681699152, -23198331, 4611410, -151435363, 8482701, 1104179, -12330068, -36373395], [-9200519756, -6550468, 15431864, 55402508, 11363210, -7814641, -15447739, -12252029], [1834151760, 3947450, 34202049, 72956623, 33810174, 4438955, -12772283, 30334488], [17044432378, 7124422, 16440156, 50531528, 9553270, -7957690, -22071974, 31783098], [-16518306629, 3456718, -12605783, 145966296, -1429708, 7263387, 28345876, -5666910], [-10723962496, 30596416, -31828647, -95527539, -12341290, -848092, -7113886, -23035180], [8407176408, 19218700, 11490746, -44011792, -45705607, 8009138, 15787993, 46597094], [9125951587, -11815369, 13051631, 57147032, -23367257, 8211224, -7582290, -13458792], [-29147522728, -33865594, 36298755, 13057488, 740616, 21398479, -15228447, -9341956], [-13685768610, -31648739, 27733118, 147122746, -6568741, 20790154, 13602635, 916562], [-3589255319, 23366821, -19975838, 39135799, -13697813, -14922586, 29745552, -14441160], [-13077489852, 48793764, 48699341, -34791247, -28759876, 9342320, -18024432, 45077542], [-11746245315, -76239916, 4419999, -29025105, -160676, -682600, 25025473, -45101270], [5789350126, -34870502, 38661616, 31229492, 1219336, -7422168, 6630046, -9545914], [9715994961, 10986215, 57265356, 69613854, -13057988, -4273124, 5068821, -3261220], [-11099015555, 21189954, -406966, 40345764, -49791372, -1105315, -25377330, 13751784], [18262643626, -31577270, -9274071, 17786426, 4548864, -5676670, 9193588, 20809471], [8763429519, 23395330, -6588283, 154759914, 10831038, -11703229, 9893802, 52666866], [3500958060, -15506658, -53466518, -83888980, -23766024, -10898183, 26389361, -61999003], [9062515833, 16708238, -12456625, -26951179, -12570000, 24743364, -14384543, 43892186], [-17751592932, -17924512, -57633050, 24246179, 3997424, 7499972, 26913326, -33182032], [26173253745, -71075768, -25869304, -41613511, 25850543, -10981830, 45494286, -33346576], [3105954118, 11002136, -53078078, 94966532, -3372230, 22211916, 6898364, -55839162], [17610108696, 3619310, -15382297, -24304980, -17222065, -18132145, -31275504, 64865640], [-31746325101, 23966746, -53760015, 4538611, -7772872, -3016582, 36224285, -28433296], [38047064055, 8491031, 62791351, -86450365, 29811598, -19105916, 27832377, 8735698], [-20130550530, 23263487, -24824439, -76205307, 65794567, -9723632, -4336709, -7059911], [-12879837530, 17597698, 10561313, -17542732, -3383122, 12617061, 33757315, 19311892], [-15952173594, -21949796, 32754474, -923961, 6479294, 29411444, -3034138, 9585554], [5836616917, 59294980, -20806565, -54973681, 18291255, -6216210, 15762898, -10458908], [8616836977, 7141812, -42132160, -138239294, -17280422, -4470177, -20230642, 59942326], [-18863961980, -70914918, -33233234, -11119280, 15951252, -20727408, 1022042, -32871374], [14514757306, -82273411, 21064497, -296917626, -33807665, 37947634, 256299, -61513754], [45202675090, 108069958, 72784, -90636702, 23249942, -8706981, -22059305, 78166845], [-611729636, -13647716, -11797920, -45108790, 23028931, -6120500, -6460795, -11105006], [8059718058, -76469500, 75045285, -6539794, 25156094, 8998479, 1185787, -46459804], [18372583550, -10065884, -53566010, -163639914, 2571628, -22525148, -16705926, -79913992], [64931699518, -80701265, -40809706, -137145458, -42635975, -2119118, 13111907, -84677668], [17926448615, -20366980, 24536087, 50952612, 1958372, 908217, 1612662, -37794266], [-20270932668, -17018084, -25960142, 275362386, 51680387, -17065484, 1588697, -17145014], [-1155401405, -39953379, 72783118, 204694902, -21862559, 24062058, 6428052, 8031019], [28516643634, -44668493, -89050643, 101673361, -27866571, -15610696, 59922691, -120672196], [7734691570, 110984877, 31537794, -121491002, -66766169, 27391119, -2128776, 100820522], [70223762892, -22125510, -14822204, 35605588, -29472570, -5979586, -57339460, 15863276], [38262084744, 35740884, -13394114, -104170778, -47791110, 54421975, 14736017, 98047940], [27280485673, 131618297, 71942990, 22620937, -64892807, 23132528, -5375042, 123056926], [-46157210911, 41925281, -12138057, 30097160, 58466431, -18385890, 9465028, 18963866], [-5708508848, 25453459, 58067500, 328165135, 52242603, 15032216, 2400813, -17875314], [-85321260365, 35257912, 27966844, 48007418, 23249245, 31446162, -12547298, 74699990], [70848451936, 21232875, -37281384, -60713664, -29604663, 21877333, -13073504, 40239608], [2936064522, 6898514, -115448156, -72202956, -4425116, -57417185, 30674781, -62713041], [-14618546599, -96418321, 2074633, 335397597, 27464692, 16570682, 2497667, -31924102], [-13771378536, 86640322, 100614222, 263716990, 50860070, 27454232, -33651888, 38170828], [-44335894710, -119582616, 15984755, -292814596, 1978404, -31585544, -37675034, -14212375], [-15824849911, 54220196, 70721474, -39961000, -46393745, 48223390, -77487490, 85634046], [54017524245, 15873288, -46254308, 59363520, -75926226, 52182159, 33878918, 7128512], [-21553323598, 11271383, -45541318, 393914123, -23219237, -15445415, 54087824, 41807991], [46092940338, -28065315, -72038803, -183972286, -14343783, -73216686, 33053233, -95761190], [-22020394924, -41861148, -43481269, 273084062, -64353827, 38043885, -30549992, -28570904], [-34715095014, -13630662, -131058651, -77266013, -17211464, -73390500, 75161282, -41027736], [19464120495, 42752448, 105487507, -111922732, 29030708, 30478059, -12819190, 76190610], [49007003772, 33745487, 83812809, -145455771, 12516313, 27761857, 22144690, -137395982], [-14453954877, -37488995, -58881052, 126635612, -35373037, 48379772, -40850768, -20042077], [13737882564, 9241254, 152876074, -369065079, -55465614, 25268454, -32799010, 52433338], [17266008830, 42806521, 87349860, -18469578, -10512433, 71597165, -1415012, 54479228], [-60187285699, 170091239, 24166180, -32531346, -45832853, 71335997, -24619855, 186139118], [19412702750, 43325182, -66126138, -171660310, -809526, 9312090, 9653222, -24588008], [-28711171606, -91606047, -34579562, -188539984, 25434847, -46573527, 37032634, -50784824], [-52575135238, -53615872, 44543171, -204028027, -76260490, 19623441, -54256137, -61857609], [125936510835, 72729602, -23628202, -193022084, 31701048, -17699569, 28419502, -26697116], [72701323132, -27531237, -195086418, -45054270, -42960163, -45938501, 14111574, -17331224], [26122865720, 59406696, -121192168, 357033084, -72308114, -43946636, 6512056, -5555556], [-39896543738, 112035208, 81484012, 376371130, -27765090, -15141068, 27967670, 91759854], [-52348208412, -145508499, 119841034, -180368899, -5625795, 73721444, -64816343, -38975834], [-41824339980, -119084182, 74776352, -388986426, -20728892, -7704487, 8578973, -33639585], [-101637971906, 59813493, -169638017, -179067986, -31613065, -24715921, -19583134, -54321234], [-91317647650, -3072568, -90518630, 336997308, -5613708, 84117180, -3740472, -54866598], [91902578679, 77041783, 295198248, -239621463, -24237589, 80317024, -69211024, 193471432], [-51560026286, -43656412, -207037798, -434475081, -108738376, -18396486, 41497586, -86806070], [-90455499228, -26040023, 147036148, -222245436, -41316699, 55161112, -18354031, 88516296], [39562184692, -97145165, -25059415, -214814848, 84603445, 7093352, -100694025, -55815982], [-9794605145, -79543572, 133805063, -283737661, 16568516, -75603158, -21047503, -33055892], [130700930397, -66449963, 93697253, -83391335, 44989542, -9331288, 39469367, 30854998], [43310916837, -143742727, -30351700, -373800556, -1279085, -92538378, 95275022, -22267437], [-36484422504, -90607137, -62087439, -638854265, 91284329, 18635232, -3121799, -37762566], [-15608317457, -76509679, -138805663, 467229570, -72438235, -13695530, 49967078, -90207438], [11131493687, -1931065, -88836548, -508793506, 42910217, -5395851, 42892101, -87893976], [36313819661, 26820903, 96572028, 512317125, -100509453, -75588856, 49851240, -73170440], [-46484668098, -145161583, -177616708, 154164770, 60214741, -73155939, 6542906, -81283294], [-24789184432, -41852366, 68814889, 82639516, 8245179, -11094249, -48640120, 136441780], [-64501522922, 153112777, -189763120, -116737834, -10610749, 30920058, 2205177, -7932810], [-38422857732, -5197690, -206667382, 70781232, -111450742, 32023464, -3459062, -100465640], [-156132248702, 39028549, 291052703, 176426820, -23303364, 47883786, -125996978, 31666944], [-91243935093, 161804077, 17591946, -500313646, 86073219, -29688843, 94926809, 96221948], [-81445452458, 45672703, 143123585, -116662525, -50868707, -1620183, -65637684, 113241234], [-34867993323, -61989679, -42304804, 91353217, 46295643, -28355744, -45016992, -83633418], [76955960930, 47940753, -37296633, -267309346, -44063369, 29187973, -18490484, -161419080], [-63723696427, 197153728, -62801288, 383702602, 114647820, -76481413, 29147012, -40680600], [-56574712452, -251587240, 86052292, -245279156, 12706840, 32913032, 46414362, -34826040], [-137547703274, 68907251, -48960561, -445367772, -109187580, 5158891, -127278721, 113164250], [-103426181236, 34146938, -118651738, -336368824, 113922038, -23742972, -49210162, -147426846], [-88154400142, 86832276, 49378841, -210623308, -8049398, -23365363, 66336229, -22239292], [-105460090658, -213941049, 83489324, -48815767, 29414451, 66055113, -39010744, 39490515], [-67757349411, 98795493, -123162374, -342439504, 51469273, -20093169, -85960707, -47590616], [-111568118044, 27178653, 16458193, -479707728, -222794864, 47368471, 15602941, 66865598], [-244075833798, -46921407, 41239092, -928275726, -101331696, 36376686, -33044334, 49081984], [679959304, 57386718, -249178564, -224594715, 63484220, -104509382, 9557788, -170067504], [-79858912822, 90955647, -75978447, 37442919, 12356225, -76106630, 150909859, -972707], [182510369129, -25630973, -184553762, -395301240, 113498997, -175749613, 46039527, -64287540], [-118826654529, 85468485, -197749741, -707293439, -64273691, 97805759, -228744011, 217627412], [-306963836116, 16457619, 87111599, -693528766, 60212656, -15688243, 48412263, -105003990], [-131305559301, 98315992, 81395246, 543082294, 208324278, 26951169, -58770758, 202791472], [-94778515954, 106168590, -295560586, -15941968, 133517446, 1175869, 143024129, -11065189], [-267089565642, -64028058, -8952334, -334484392, -169219888, -19456322, 97268722, -188363216], [-51867456871, -104336377, -247279284, 772729183, 37746699, -58553556, 116793880, -370244416], [37660504030, 199557495, 204320034, -173642622, 135761209, -38883001, -153255976, 263873942], [-68121453926, 17281642, -86046448, 74867118, -120209923, -18764084, 175843825, -66310578], [17218771470, -124431129, 46258523, 803532071, 18687121, 13971845, -10219420, -110715016], [-113401571222, -196139729, 4336170, -180577120, -157373801, -1503820, 106534541, 24804720], [-103198321624, -1217888, -121475941, -959025162, -10027077, -41121933, 104304032, -99167920], [-43351488582, -49060911, -21268057, -1431394180, -69929903, -8119643, 56131430, 990924], [100229784080, -56863827, -31473238, -293851399, -60014637, -10434413, -180223570, 195263901], [-5515680573, -60404235, -156463747, -598588139, -29031113, -111076604, -80104678, -143937895], [-27249881951, -108275937, -129490966, -306498394, 104394450, -201628029, 10560404, 60568512], [-92705977139, 41572287, -116412084, 575355165, -146179569, -162781372, 38634632, -112289744], [71594089368, -26747863, 36225151, -901076833, -203658609, 44168593, 11248352, -63419806], [-81026777946, -232621078, 122287197, -368659190, 53786769, 1636283, 143134240, -470195892], [14339362726, -235932484, 208253474, -273508184, 141535352, -15217690, 66858588, 27475030], [-68621732492, 106198075, -284798572, -273552355, -281834251, 2656751, 25103548, 317541899], [-113565278116, 97806934, 84566050, -81509608, -30798424, 26549746, 145040898, 51476436], [18818344126, 116239020, -1406216, -806405430, 235639466, -41305152, 112520038, 87366326], [-191401053468, 30666378, -27667471, -149275091, 74103218, -26587775, -44044021, 117755130], [20387392712, 177073052, 25576324, 416335412, 118131924, 20770686, 144631830, -445899064], [-10196411710, -91450173, 69283814, -132292307, 40801111, -138238142, -69956453, 173731078], [-221118692556, -80937562, -241571422, 96491248, -119902276, 868144, -53339718, 4183816], [-82909046067, 152617457, -133554022, 875844414, -26224163, -107631080, 157767536, -15562505], [63869746854, 134012420, 445160, -727085216, 401979662, -66585098, 58315222, -34935912], [149882158896, 188924458, 18338780, 105531678, 6659786, 187647402, -11790604, 174912868], [-166614125037, 89636233, 287861709, 169253968, -6337361, 91739290, 69753810, 17265614], [44196903615, -101589309, -174180868, -873395543, -164942552, -45052486, 13378381, -162757630], [330251893156, 213025980, -131216392, -1070056900, -42487786, 23982032, -69113132, 348433602], [244535163574, -146632863, 254534932, -505441218, -13348483, 190043436, -31219119, 220694082], [24572333104, -276224029, 183363064, 243044964, -133983809, 30573095, 52917608, 205087038], [-218333558747, -77790860, -278674893, 625062841, 79988812, 35436410, -107013075, -127648902], [152279450241, 30259739, -178786001, -795834048, 195929587, -315743088, 301150656, -209896668], [194764966683, -345120751, 245393511, 470466383, -14019629, -110929623, 79148957, -139094832], [-62769068720, -322187396, -229993200, -60783502, 370826996, -12395048, 24168368, -536068636], [381551953108, -319253847, 133168575, 1573175330, 365051407, -149599152, -84169487, -65367788], [202897484985, -83819721, -670881140, -289012339, -45090739, -64172756, 95455140, -107998900], [362956585682, 151205018, -181805844, -883083208, -93423848, -208838680, 60582868, -134271740], [-139626429850, -150496335, -81147636, 1418136580, -62915859, 149850273, -95842190, -189186312], [332559881558, -327780192, -5557277, 748336630, 300914537, -175331940, 76070779, -200806088], [-76256729354, 318603561, 72390566, 354700254, -82281625, 36261728, 30491819, 124150202], [346729538294, -145840740, 42000823, 454204290, -79912735, 185849516, -3958729, 212111084], [299982473652, -52525557, -130619942, -719575141, -197788037, 252317465, -110281534, -86274661], [125389201641, -175179288, -211758839, 74549451, 246710617, 101329178, 103090600, -203539176], [48579086736, 338684440, -153250370, -381876736, -186644974, -59425972, 227805846, 28063032], [-5766481766, -369889345, 3363804, -617528605, 137214025, 10967846, 218252391, -353285088], [-165423405704, -83427651, 292504674, 122742744, -369243841, -236549427, -27768612, -330920896], [301712165486, -272056168, -206384333, 45854891, 133550282, -43615500, 37326962, 68257972], [282198368255, -89405763, 404710385, 529013615, 64965213, 112674984, -121192190, 57285627], [-55204186140, 36707490, 53853315, 1183823095, 87653920, 89526541, -53027911, -71957978], [136479149287, 17062242, -198296985, -73367605, 73907026, -310203695, 224325236, -175643200], [349211628775, 74584645, -305717273, 415109537, -167134375, 54499955, 80904737, -400020646], [119055761560, -437101586, 376840092, 990340982, 66769614, 82002214, -117967458, 596837154], [272124927190, 275444036, -48286704, 1413464176, -59592320, 86547212, -53971114, -149283034], [435596161261, -119436527, -363315687, -581559292, -19537013, 34409140, 90389452, -312827390], [159616302014, 305451306, 617542933, -389352006, -70540948, 174622851, -200984631, 659306976], [275631832858, -13971440, 401153033, 876858430, 191559603, 32028373, 179251432, 101810964], [-69304913951, 49086688, -208070291, -429494333, 174393807, -38985064, -89043652, -425195284], [346860931000, -72504572, 324157367, 362248338, -210933568, 3956456, 207116268, -387180649], [-137244005684, -224999789, 3770291, 1008529574, -90812330, -146830998, -112821752, -103976326], [410610048552, -273483295, 522892182, 651902749, -127173531, -40626119, -180513604, 180674739], [60117499598, -313310563, -8644923, -1318909902, -203051627, -66934294, -90212685, 79982890], [229579352778, 326146941, 139765767, -812807804, -77669127, 256315812, 6567321, 446921700], [183769076552, 481192966, -254408417, 45745586, -174620287, 156344870, -177659297, 136717668], [-157225345148, -139525584, -172200387, -1350448822, -38661777, -88703134, 117795467, 60570626], [274674815548, 69277794, 64718696, 923118306, -2099922, 63616426, -174452418, 240076120], [231317758319, -563072851, -255275731, -2221621838, -159273475, -40365150, 74816410, -145303492], [-90576736443, 371056529, -30145292, -1788563030, -72781935, 18128114, -473678930, 228713023], [167001818666, -310148355, 77281546, 194638771, 583644863, 149652452, -54803945, -257609428], [505694407878, -265422335, -133465961, -582859854, 358952267, -115970705, 45445686, -349092598], [-439270291612, -298839473, 99539548, 1155357912, 35801761, -395014450, 236525873, -532687158], [-287633923061, 80142243, -269486457, -531612817, -414501669, -221442317, 255250839, -210708946], [-288601081900, 215949438, -187179499, -1680743246, -361971248, 97801619, -52498341, -7290314], [-4068136808, -353513336, -238629913, 36767792, -81612456, -150396627, 350906623, -892943388], [-247662799536, -476512851, 592019833, -132418188, -15726283, 194383130, -334003331, 562856612], [-536669367946, 134670716, 153455474, -398851524, -81541890, 152651528, 182652772, -551419806], [96062523117, -423163827, -297664830, 155292074, 419010911, 66591277, -325788813, -176037226], [37491659018, -348851449, 270363012, 546949018, 627729533, -89619246, -314854191, -125869686], [98396588607, 40340795, -99224711, 2579598524, 10297533, -45510914, -53528634, 676846], [-171910002171, -584124138, 278834492, -133523927, -491644641, 25064912, -294335024, -353074380], [136482753912, -193075613, 703638998, 671548918, 253813763, 30514273, -222473378, -377179866], [47772502241, -354327049, 1057397970, -1342666751, -212083381, 132688410, -227437832, -370222596], [36152438790, 230914127, 469246192, -682467603, -70333949, -55640178, -286945591, 704577916], [71370450057, -403291337, 145220933, 320263519, 132893490, 97776082, -120529847, 312141234], [238559062391, -378453107, -105784835, -335740127, -152932869, -265962917, -21124421, 100116332], [-537867888277, 156288132, 452278643, 1466352801, 40554918, 429593776, 28523877, 346602794], [290865517756, -317593237, -140009704, 124259483, -93868465, 71402588, -340206427, -363327762], [71391096487, 535899167, -331146360, 372753743, -515010331, -234989676, -292076036, 68753680], [34891264433, -131113340, -201367502, 1685838000, 368211047, -154679761, 70182881, -12528110], [-225313671826, -114719598, -1171628971, -78267810, -428569500, -150371746, 4581996, -71807589], [-833500141948, -707340706, -180575130, 555764336, -77542276, -293087391, 356849605, -476130097], [384289240994, 399933921, 906050473, -1333388099, -108425791, 132312257, -108392536, 188998828], [194059052044, 1020265510, 712901244, -154719978, -464018272, 559546402, 11957104, 437258958], [-836320150244, -225557245, -26113445, 481544416, -124246743, 40258736, 131101533, -201618258], [320892689854, -520071398, 112053332, -1680678282, 38053658, 225383426, 132618020, -65287764], [84968404209, -150072808, 424662551, 441322375, -84061108, 114257586, 252096771, -28446412], [-221442513770, -5310704, -731864488, 775426059, 3937780, -71189264, 257030492, 16678964], [44211863267, 152829293, -928195834, 2055120804, 235015501, 20355067, 149433223, -257778104], [473251986384, 326080648, 65736014, 2392646520, -400655250, -106132992, 396027854, -373422006], [192511780730, -809104112, 647219075, 1958047572, 289154013, 49693226, -78207757, -101863226], [-221055746940, -355278285, -1451415997, 985898649, -429882625, -286667326, 180994223, -665018967], [452172340916, 211029391, 249485449, 125820448, -66706277, 587675567, -93860004, 106980198], [-373632849067, 513095594, -984688240, -259658672, -310733738, -68908753, 403747174, 291990776], [-330025833300, -908150795, -314955922, 850590450, 207320641, -12583322, 221468015, -245720308], [229276465748, -592535084, -363632726, 2307553208, -275443246, 54585269, -245610651, 342795109], [-573856744135, -200132407, -23579652, 1141596000, 82736429, -60914952, 86998524, 65733761], [-233031884056, -28729821, -162944222, 149427964, 117955969, 11465667, 329010266, 337095136], [-806746545178, 258352222, 257408729, 91331483, 157002876, -70032347, -293353127, 357998797], [-429234552158, -166891328, 561641929, -1286739405, -453222754, 580736129, -183634959, 175151402], [163985978830, 116098986, 499661783, -285663614, 238395728, 417001491, 336332115, 86738944], [-50572533463, 476740855, 419160728, -1436608287, 66520557, -83698232, -784860862, 326458814], [-2858929527, 504095005, 604304420, 751431656, 398409795, 80894094, -203045580, 887642569], [-352970133978, -1073466719, 233758286, 1442802024, 24883719, -176336542, 21830703, -838211808], [42346173676, 64552848, -289038510, -1465228964, -72462542, 472498582, -486584924, 490458438], [-534299573249, 557634574, 99578307, 2003049947, 286242922, 340713825, 432474184, 656162592], [569024419514, -338517369, -915773618, -2121279080, 250381225, -238264215, 419291336, 126610852], [532671481323, 88761144, 343967548, -3533914716, 108254363, -186278086, 4900448, -264939582], [35296935759, 330368182, 522900543, 617078762, -139194856, -50243861, -544207378, 414407728], [-210600052867, -1409190645, 548495270, 1642750596, 590207365, 20138455, 309213973, 162119202], [382368295271, 69646655, -240043883, 314634654, -677917287, 220986407, -58377993, 866649196], [-327742309824, 690923264, 598077620, -1474848908, -788579394, -136667310, -339609472, -36739658], [173143078036, -336209698, 168869754, -2681679874, -296815190, -266874195, -537175047, -184958151], [40900196642, -484641455, -312802564, -2256434318, 791557485, -552952626, 561116201, -561152954], [-717075920036, -743339388, 110098111, -1243648242, -858234358, 112636493, -72967095, 38743620], [19866991478, -1873835057, 422190459, 835159101, 407904331, 52266828, -106210853, -324520099], [-738358615518, 155514305, -686959597, 1429247754, -29142149, -489057656, -65158435, -696309116], [15900880100, 585155850, -307147520, -58671258, -302926404, 314490179, -216690769, 596625172]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_354_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_354_8_a_d();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_354_8_a_d(:prec:=8)
    chi := MakeCharacter_354_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 8));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(2999) - 1;
    while true do
        trunc_vec := Vector(Kf, [0] cat [f_vec[i]: i in [1..prec]]);
        B := Basis(S, prec + 1);
        S_basismat := Matrix([AbsEltseq(g): g in B]);
        if Rank(S_basismat) eq Min(NumberOfRows(S_basismat), NumberOfColumns(S_basismat)) then
            S_basismat := ChangeRing(S_basismat,Kf);
            f_lincom := Solution(S_basismat,trunc_vec);
            f := &+[f_lincom[i]*Basis(S)[i] : i in [1..#Basis(S)]];
            return f;
        end if;
        error if prec eq maxprec, "Unable to distinguish newform within newspace";
        prec := Min(Ceiling(1.25 * prec), maxprec);
    end while;
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_354_8_a_d();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_354_8_a_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_354_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<5,R![-120127165800000000, -26928661784375000, -1315970127983750, 8314287356250, 25927370375, -135397930, -241770, 592, 1]>],Snew);
    return Vf;
end function;