
// Make newform 354.6.a.c in Magma, downloaded from the LMFDB on 24 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_6_a_c();".
// 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_6_a_c();".
// 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 := [11900, 4720, -616, -290, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [-96440, -16386, 7600, 189, -29], [93440, 25386, -7600, -189, 29], [-159545, -6798, 12925, 177, -47], [-374540, -33426, 24850, 399, -89]];
    Rf_basisdens := [1, 4500, 1500, 1125, 2250];
    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 := 6;
    raw_aps := [[-4, 0, 0, 0, 0], [9, 0, 0, 0, 0], [-2, 1, 1, -1, 0], [-31, -1, -2, 1, -4], [-44, 1, -3, 5, 0], [-84, -4, 10, -9, 11], [255, 7, -8, 0, 14], [53, -5, -2, 12, 47], [-21, -143, -4, 62, 2], [-967, -32, -109, -63, -4], [-2787, 75, 102, 143, -29], [-4485, -189, -46, -228, 25], [-2909, 276, 89, 167, -120], [-4350, 431, 17, -1, 51], [-1001, -332, -93, 33, -122], [2850, 897, 161, 121, -132], [3481, 0, 0, 0, 0], [-3797, -1643, 164, -129, -272], [-6150, 913, 227, 571, -5], [2936, -666, -1088, -153, -284], [-7693, 1057, 16, 63, -214], [-10496, -28, -980, -923, -795], [2013, -1250, -589, 1621, -568], [29, -468, 599, -2137, -39], [-57046, -430, -54, -1145, 1241], [-47674, 124, 2254, -364, 842], [-99544, -892, -394, 1136, -3000], [-34867, 5930, 675, -1738, 921], [-86225, 841, -568, 396, 607], [-50568, -1168, -334, -2181, 1842], [-86332, 2788, -3284, 2547, 793], [-72818, -5846, 4268, 3476, 1074], [30738, 4149, 501, -4881, 5836], [-77598, 394, 2692, -87, -2795], [19649, 4156, 2397, -10906, 3439], [-179781, -7125, -56, -3539, 4617], [-157170, 15198, 3090, -1683, 1801], [-59413, -7501, -11764, -3209, 1936], [142959, -12854, 2431, 6571, -1783], [10551, -11186, 59, -2713, -12677], [42446, 1939, -10351, 5873, -8416], [-161805, -515, 6942, 8071, -6307], [-104046, -457, -4083, -11255, -5122], [-189386, -9444, -448, -3350, -7396], [179100, -5590, -8792, 12318, -14680], [29843, 4025, -7262, 11261, -14914], [193071, -678, 11541, 7438, -434], [96392, 30318, 1162, -2400, 23054], [521047, 5543, 834, 646, 22602], [146443, -11919, -10136, -26547, 9392], [2458, -19658, 10636, -12732, 1464], [376900, -23486, -6128, 667, -11688], [-18858, 14218, 17842, -3294, 17868], [431054, -10300, -6352, 12695, -8196], [709018, -7222, 21294, 12942, 7828], [332755, 56448, 16937, 33201, 3469], [-434016, -3994, 872, 28431, -17024], [-71198, 32088, 12686, -1009, -37773], [89948, -23179, -4795, -21693, -21983], [345332, 16586, -10276, -50864, 8256], [-6487, 63438, 1575, -6108, -8710], [492831, -10671, 22110, 3872, 22620], [474932, -72910, -3606, 12204, -23280], [61147, 88618, -19231, -21014, -327], [-170467, -20527, 2690, -6408, 23465], [148710, 22701, 16837, -20243, -24648], [-208454, -31480, -82, 44788, 1356], [-232215, 19661, 11682, 44288, 187], [1034919, 129894, 10537, 41397, 17454], [-111414, 45696, -11904, 29437, 29751], [-925861, -75010, -16063, 55538, -1373], [-934308, -28080, -20760, -31656, 8398], [-198112, -16021, -10953, -50889, 28407], [-809851, 77092, 12561, 18628, 9692], [-951600, 1198, 30338, 65495, -85381], [109686, 7226, 15910, -599, 84526], [-685378, 77776, -21844, -31408, -62598], [521490, -36400, -91304, -61325, -17547], [185499, 28858, 38617, -70640, -44717], [1066374, -100128, -16688, 43548, -7996], [-992636, 84560, 31332, 44262, 33506], [1947402, 11818, -18142, 121381, -22277], [791897, 122760, -14823, -18425, 31610], [1709411, -40384, -20609, -67654, 37148], [-46001, -18087, 87234, -4922, 73301], [-1268749, -37381, 72546, 82718, -95508], [616240, -66235, -52369, 3401, 4664], [2268611, 2875, 113702, -15987, 10020], [906107, 66723, 86180, 31712, -15384], [1870625, -71664, 22165, -82728, 25556], [-490736, -25280, 40644, -5472, 110150], [667239, 26588, 21035, 40924, -208685], [-1698631, -44333, -22018, -106390, -6251], [1374093, 34240, 68635, -45321, 61439], [911804, 3860, 36592, -54767, 55343], [-1204863, 51588, -67955, -160357, 13456], [-2160427, 54398, 12229, 32743, 45983], [212083, 125318, 79887, -101485, 122696], [-3077564, 175402, 71590, -39353, -36089], [-941348, 139114, -14700, 296613, -58991], [-404797, -323457, 83780, 78486, -60941], [727646, -91514, 98594, 96208, 165832], [1790484, -327859, -89811, -63483, -11210], [-2086753, 108076, 174573, -73791, 125069], [-358044, -143697, -147265, -190195, -75695], [2714916, 139057, 172373, -47935, -64745], [-3458410, 275221, 57935, -115823, 258912], [1504671, 299458, -30117, 35623, -148], [-5710986, -81142, -24792, 116074, -295126], [4396675, 236405, 70596, -128462, 207445], [2064386, 250940, -12950, 317647, -87373], [-561252, -387840, -89190, -202168, -67646], [6285017, 935, 122470, -111004, 209958], [1101362, -67826, -22240, -70971, 69637], [-3092456, 565780, 131820, -6813, 78841], [3224980, -162723, 93911, -65787, -162262], [481973, -215297, 14298, 223414, 76763], [1858916, -21772, 248664, 24960, 94820], [3854591, 95500, 64649, -300053, 30452], [-3428589, -146317, -352754, -48026, 10974], [6630787, -125115, -160390, 114569, -213091], [2720930, -114382, 94838, 92664, -78200], [1243256, -419720, -196622, -6052, 6880], [-814558, -192879, 67979, 74227, -92874], [-5950520, 225776, -214894, -84454, -35028], [4824933, 89134, -250171, -64461, -176721], [-44624, -357850, -265008, 216022, -306010], [-6885291, -537527, -90246, 28228, 378408], [176580, -363258, 145438, -282390, 147756], [9940400, -166053, 185359, -34291, -282009], [3320679, 213554, -54251, 441878, 162904], [-1484395, 824268, 96261, -55070, 36741], [8108364, -458022, -192800, 473714, -133426], [2317551, -72390, -207123, 72932, -571352], [2176838, 57301, 302305, -196377, 419938], [9279937, -18473, -47348, -68520, 91111], [-3752830, 60964, -152530, 230500, -114900], [2003222, -518894, -26016, -140064, -303376], [-3112422, 526818, -389240, -326652, 33226], [-10386167, -92978, 352775, 375626, -395533], [-2657860, -174470, -38156, -27976, -823218], [108031, -78308, 50817, -607761, -4245], [-10858258, 165471, 270201, 137795, 297507], [-9084398, -447102, -223334, 586465, -99888], [-1554531, -528963, 208920, -362663, 85131], [-6788560, 737737, 474105, -235263, -108230], [8926019, 104482, -410323, 287434, -358002], [8835248, -126554, 316812, -385613, -240934], [-10660274, 71334, -290894, 106764, 265506], [-10039023, -234959, -262682, 97584, -457732], [3216614, 645896, -156508, -352612, 326666], [-12003634, 145248, -315858, 191984, 184648], [3361924, 461792, -161052, -99100, -227660], [-13117054, -460285, -43023, -240517, 344812], [-6228276, -220878, -198454, 158253, -538107], [-13191553, -633298, 25739, 143131, 405993], [-11119628, 917806, 426092, -337958, 141696], [-10614954, -735896, -301516, 103543, -605212], [-3794614, -558042, 10746, 124419, -442559], [-13995372, 1201022, 553816, -586417, 927956], [-13980469, 462970, 547287, 513941, 115267], [-4664630, -107386, -603302, -118658, -42628], [-1604985, -834304, -289, -93652, 619340], [-6227163, -1113876, -344999, 325682, 191553], [-1209064, -673072, -173242, 799833, -438510], [-4325336, 991995, -390789, 46889, 644722], [-7119129, 1062068, -97313, -373230, 529652], [15426607, 418069, -423902, -505999, -202739], [-6794214, 557940, -43004, 431442, 663032], [-20176380, 255982, 182978, -68178, -420066], [-809768, 496486, -702308, 113677, -583866], [-3012418, -1126160, 459844, 318760, 481236], [9858563, 583670, 364777, 841048, 314601], [16753392, -1355180, -867014, 675661, -726157], [4882016, 1091872, 487928, -821808, 1011016], [-7942174, -1068237, -195853, -619663, 697638], [-11224914, -339412, -557666, -528283, -93165], [-18113658, -1057880, -435130, 147508, 242242], [-1811397, 753839, 94364, 316828, 379253], [-5264226, -374190, 694102, -352516, 738804], [-3278208, -268742, -641006, 500502, -722064], [-16018904, 655482, 166710, 170936, -908882], [11114106, -241576, -378936, 1047357, 353653], [-14629852, 1235290, 300396, -748758, 382434], [-17053136, -699080, -425982, 829987, -558534], [-19223031, 1362912, 909237, 54924, -181413], [-16865892, -1348820, 462322, 584122, -30944], [17384936, 791026, 691708, -23536, -513914], [-27166782, 1458990, 985606, -1330413, 1026309], [-2008987, -1722617, -297976, 512890, -1792944], [19566166, 37156, -590128, 68895, -546377], [13598340, 594795, 558071, -1561677, 581154], [-9553334, -441482, -1360734, 542766, -515850], [12041563, 185838, -1038445, 526089, -433686], [18060836, 1510830, -16962, -1323200, -320086], [42059887, -74750, 155305, 248652, 687809], [27622053, 445814, 282495, -915264, -496242], [15502739, -248445, -854694, 1403469, -826458], [29942551, -1307266, -638329, 896413, -1003065], [40920685, -381693, -308252, -172284, 22016], [26057402, -2847744, -746820, 783814, -191866], [-4442776, -1495632, -295540, 1865523, 385015], [13558775, -1296080, 149423, 9772, -1298532], [-11781403, -1802975, -1563170, -283792, -334567], [-14000046, 2056138, 1473356, 604360, -451122], [21835939, 8992, 358841, -1465293, -16023], [-16958942, -555587, 882331, -2823, 1108051], [33289061, 470781, -24658, 50260, -640234], [31600429, 656218, -286925, 979736, 509501], [14826548, -1298420, 290262, 2156704, 371884], [11368759, -850171, -14388, -836160, -226335], [-9154436, -1874141, -650555, -167445, 1615758], [31419637, -1684317, -1290798, -854854, 541881], [66144368, 1121536, 749148, 713070, 1145414], [78021406, 166208, 843792, -991091, 239766], [10465025, 2106749, 651886, 2056904, 137983], [-24382160, 633146, -994062, -143663, 72703], [25774497, -781344, 301999, -648079, -1458236], [5033389, -451363, 2208134, 462682, 655414], [48111678, 1611843, 92227, 1883459, 64484], [-5538610, -84592, -891700, -2680179, 61489], [-86976292, -369579, 284749, -559623, -158117], [20894252, -475490, 248590, -1042428, 306470], [9530499, 1327203, 1082148, -474625, 713468], [78331418, 229062, -491588, -842490, 121308], [9559167, 2653125, 1309516, -207827, 1740592], [35345633, 819987, 87606, -317204, -565978], [-727662, -952876, -2061390, -430012, -1573926], [28344058, -2948818, -1682822, -1510270, 64534], [22352175, -1827310, 255381, 1136326, 622375], [-9968027, -1115627, 1430678, 1043127, -794176], [-5871722, -1551613, -83287, 31501, -915821], [-64567351, 126684, -1541827, 297702, -434236], [-46494368, 132676, -1698338, 1865043, -854112], [-57139678, 11730, 741334, -672660, 280716], [35978860, 1858354, -279008, -710985, 2777928], [-36303192, -108456, 306866, -256777, -1420369], [21097833, -3762680, -330937, 454297, -2000983], [-9245444, -1162223, -1750483, 1175795, -1434920], [-35022329, 1410864, -1155831, 1635405, 976375], [22798302, -1838344, 407232, -634319, 977244], [-35589866, -374184, 694340, -1719502, 1094042], [15403160, -1967352, -232668, 3264573, 187377], [-7746984, 196904, -1082102, 1436268, 1378630], [-5892993, -127631, 1383014, 34080, 1123174], [-9439265, -2185594, 580499, 1060551, -1221331], [-59685648, -936023, -763871, -1263375, -1906899], [55622100, 1072011, -939593, 458491, -1128422], [-132598675, -1897741, 440174, -396291, 1135022], [2032066, 1749908, -630264, -1006779, 2038006], [-95975783, 4767656, 1687889, -2403302, 1282814], [-45746781, 2219934, 1782369, -2062902, 2572833], [-20507117, 2753810, 443613, 1254933, 453848], [3970766, -860955, -1529189, -2340175, 1567245], [67599852, -693509, -167795, 175317, -420326], [-81534806, -3558498, -508714, -1228617, -295542], [-3816466, -5715, 531763, -4301905, 1400709], [27392532, -2008430, 856048, 2971344, 220490], [-92178580, -1291042, 584692, 320073, -1051756], [4594617, 1111414, 2475507, 964396, 2374178], [41634402, 2258381, -192453, 1678719, 2296819], [29834192, -2517796, -449498, 1725763, 430080], [-20562800, 743652, -368630, -1209214, 2071018], [8418652, 1608762, 1252952, -2399438, 1601080], [-36035812, -1000923, -374737, -2741741, -1653684], [-48972410, -3170468, 951848, 2855586, -1995744], [-12623301, 447369, -2718034, -683600, -1599786], [-80489114, 4491848, 245138, 1337482, 1634048], [56753480, 4827742, -2688982, -1080005, -929211], [34946604, 3259923, 1550173, -892765, 5378392], [-49395490, -1596510, 1272150, -2490816, 4684698], [-7272677, 1001293, 1277246, -1584955, -32684], [-43400579, -3866011, 132018, 1596128, -1356563], [-19094640, -1028110, -2793922, 3699003, -76891], [-38811426, 2289769, 2927243, 1288209, 690523], [-32571123, -308464, -19355, -863458, -1263448], [-39587815, 4709440, 1798959, -641067, 1994085], [3961908, -228421, -2008653, 951323, -2549917], [72270950, 749310, -1140466, 4080067, -432639], [69454744, 1804926, -1378000, -3006057, 421566], [150753388, 756928, 1824298, -834349, 1807536], [-74313976, -260244, -3639586, 630306, 864488], [-10929134, -63036, -999742, -167118, 474242], [30090358, 638862, -1681658, -45996, -83540], [19520294, 4329555, -556523, -1442493, 2203517], [-74707633, 1456950, 1659517, -2018097, 4031760], [51873600, -338888, -654594, 1505723, 677993], [-30751985, -2005889, 2591896, 251968, -12074], [-5719154, 2379739, -479919, -2896563, -2554723], [-49423502, 342736, -2816040, -1326788, 2025772], [-132583126, -628812, -2043308, 599201, -2662236], [35392598, 5703664, -969126, -2555616, -3187566], [56201361, -507375, 4560680, -2310032, 1214160], [61499370, -4996287, -1330897, 4056403, -679226], [-8353372, 1245047, -716465, -41917, 2779341], [-43697642, -2931152, -2951668, 5313149, -2308930], [-6482707, 2968009, 2229680, -4379339, 2246956], [-164674016, 1544723, -3165011, -668085, -251162], [-17083571, 412526, 2307167, 3518029, -1933672], [71343782, 988185, 2097363, -3299909, 3342013], [-10389831, 447867, -2651934, 2284917, 60881], [-95462126, 902224, -2993688, -857059, 2989676], [-7179206, -4835673, -1477807, 1649783, 3611995], [-22991708, -4223784, -2673952, 3610250, -4773708], [-105980196, 4982614, 2435730, -3203048, 5006148], [105740830, -483340, 1555540, 3516157, -303641], [74339108, -6239804, -549794, 5621273, 1747492], [-21620749, -5294047, 926008, -292063, -375508], [-30369139, 6685464, 2887377, -583397, 3323720], [19502584, 4147628, 2664570, -2595706, 1228964], [-18241184, 2867672, -700418, 409285, -5465074], [-112242287, -10192253, 1732606, -577200, 1386988], [-2367388, 2993825, 2923231, -1888057, 4488238], [-168556029, -2045783, -2977562, -988839, -5655683], [-10120513, 6230320, 3522099, 4228050, 1186779], [112511318, 223990, -3406382, 1046479, -3558987], [-18247947, 8330966, 594575, -5217915, 1383068], [-2901670, 5200406, -2505406, -520425, -1885322], [88340148, 5246360, 829562, -2232172, 5049408], [-84740870, 453467, 3581403, -7875453, 4734124], [105733196, -10850680, -3056428, -1719650, -2004612], [-41224980, -3911336, -1911634, -623970, -4990150], [-177891521, -4075800, -2342859, -926773, -1252308], [11258464, -8340434, -2502350, -551638, -4953288], [-79198944, -5393167, -787821, 1714041, -2897968], [-7300074, 4991662, 709970, -3166708, -6759940], [-42030314, 6009709, 3555819, -1244581, 3792897], [123901886, 4156944, 648446, 2035668, -270456], [-84149064, -4966616, -712044, 1818016, -2401762], [20305095, -3247318, 1938127, 1097279, 5932013], [140482233, 5043141, -141426, 6635958, -494941], [-38328482, 12841936, 241702, 2141382, 2920104], [-38228222, 8762198, 8107314, 492634, 4315354], [128605516, -4690608, 587974, 9718535, 2270648], [163688575, 4399595, 3562008, -3636156, 430107], [-56088713, 1885230, -206961, -4791287, 4398987], [-12208121, -7862437, -6956284, -1845997, 2606621], [65839280, 6338824, 2937004, -2595922, -21008], [-163305497, -1613583, -3176104, 2340861, -5844754], [34517034, 972184, 626758, -3624771, 10425139], [107254388, -3029176, 2572070, -2936522, -3175146], [-38360380, -7812322, 1896972, 758059, 847738], [-80896846, -1193198, -1244660, 4535680, 2105710], [-180001850, 6507822, 5235490, 2870038, -3653602], [58057926, 2511798, -1863632, -3160312, 1486536], [69880520, 6176071, -1814517, 4440971, 2640734], [35145862, 2835482, 3475738, -1102179, 82889], [191456868, -9142090, -5038770, 1823424, -1681120], [-293925666, -1750663, 3181931, 3136353, -2982880], [-28487700, -2581226, -5445128, 6396133, -6042038], [117084947, 4197896, -4764225, -8546342, 2841428], [-123451411, -14041937, 2923654, 2748433, -2018309], [-83771789, -5898694, -5243781, 482481, 3104814], [20702213, -6276741, -1581794, -483793, -3487243], [-18395571, -4229575, 6739764, -107041, -172103], [36460056, 7656040, 420012, -4251196, 6965830], [21891068, -8298566, -1614778, -6299686, -2214848], [99066147, -10920154, -6611137, 8833931, -4621509], [-24086191, -5628721, 3249138, 3822100, -4309484], [186248798, 378642, -4967406, 2892721, -3937280], [-22044992, -7845912, -922122, -2021835, -3211667], [-154260509, -11274265, -695356, -5112768, -129552], [-110350492, -10115318, 2355638, -977148, -1375594], [126335968, 1078393, 1474125, -6147495, 4611476], [196656789, 3959641, 9064252, 2686159, 2878344], [-83199039, -967847, -8820174, -1071387, -6550254], [-11411200, 1463778, -4767378, 719920, 5752356], [-110736306, 1574540, 3347542, 4676866, -1139940], [87328462, -1742012, 1511428, -6950064, 2961154], [94825501, 16647846, 2561049, 11130671, 1095377], [2760892, -1107181, 141127, 1953603, 10751747], [128964516, -6018891, -267559, 11940525, 1153244], [-9865169, -12321109, 2787716, 4436980, 3144020], [-218389820, -1195800, -1009426, -1113976, 4544638], [14099561, -1872779, -5558016, 6685149, -4986131], [-58913057, -9952029, -9641934, -1546276, 2765158], [-60247981, -16564793, -5338198, 2953784, 901994], [15994207, -3508291, -2840436, -5833759, 8981756], [-28944344, -6873760, 5331260, 98998, 7759870], [172967258, -5537919, -4930841, -2213855, 1754583], [-61315096, 2938812, 124830, -3266592, 3125332], [190911595, 13107818, 3316631, 2865757, 412175], [201414791, 2057191, 306108, 2824550, 426355], [-245393618, -2075304, -4417672, -91943, -9803272], [88077122, -17812706, -1749452, 6106131, -6001459], [169045512, -8842101, -9360921, -2225607, -3537414], [-97630962, 11305258, 8963484, 3714457, -1894791], [33858257, 6752441, -333504, 9955181, 3974293], [-160777147, -6116057, -1597742, -262674, -4804293], [152072408, -5486805, 2960723, -5658149, -7764736], [-62426276, 10760594, -571980, 2454847, -4280801], [78084771, -4827944, 257095, -13393784, -2421497], [31818845, 11187151, -2227196, -10757412, 5446918], [205774408, -413382, 5197272, 1503754, 7600670], [-76105327, -13870816, -5091275, -6338455, 1472862], [35419604, -9536444, -1882342, 4438752, 6219530], [-313534851, 1798503, 3653946, -1309083, 4604262], [-82390462, -5798640, -5379820, 10417652, 69698], [-17048889, 14034763, 2751412, 4288074, 10929749], [-27685342, -3062745, 1593987, -5469819, 4666718], [135309096, 2382789, 2445669, -8095253, 3708239], [138931584, 16624096, -1507664, 3396466, -3369652], [-175360174, -7241426, -3525532, -7124868, -3206968], [126816135, 13917552, 256165, 12551413, -5611298], [171899435, -14742461, -51132, -2550406, 2147124], [-187847226, -2800025, -4796215, 13150331, -8790861], [57487488, 19188574, 5616780, 7085814, 986668], [-158497720, -10604554, 598144, -12132538, 5403136], [-192365872, -1375717, -208285, 229741, -5646775], [130686612, 10603912, -604058, 16486129, -1236134], [174788363, 1674278, 3673621, 1589658, -15312724], [-180597583, -6103408, -13807137, -3161241, -9210494], [311984629, 9395993, -2123082, 6473394, -10875222], [138966438, -9056622, -5670144, 9461645, -3565401], [46040534, -16223617, -5341839, -8271387, 901399], [-87375902, 2796700, -9751852, -4010906, 3359342], [-71263972, 9458014, 7540878, 1878104, -5994222], [-200846631, 4625015, -6910534, -7639081, -3378469], [100842324, -10178144, -7380514, -1432251, -770570], [172159681, 4467756, -2538189, 218829, 7250147], [-190037947, 12138240, 3785881, -1651264, 5535039], [87930398, 9762203, 5720849, -15576941, 6059741], [-82963309, 3270646, -3458159, 3973736, 2107281], [330595150, 3953048, 6817202, -4411738, 824492], [-27826254, 15331592, 3564972, -5655610, 4612576], [422197438, -23128278, -6720638, 9650446, -3590310], [288032201, 5843389, 619002, -1643804, 6595308], [332554459, 3699360, 2133677, 7980467, 3871524], [122815129, 15761011, 1318818, 4562033, 3476280], [345121786, -7245430, 6539686, -3907407, -10595024]];
    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_6_a_c();".
// 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_6_a_c(:prec:=5)
    chi := MakeCharacter_354_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 6));
    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_6_a_c();".
// 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_6_a_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_354_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<5,R![3768834, 1194385, 32740, -5970, 10, 1]>],Snew);
    return Vf;
end function;