
// Make newform 570.8.a.a in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_570_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_570_8_a_a();".
// 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_570_8_a_a();".
// 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 := [620550, -49773, -4122, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [-2, 4, 0, 0], [-84194, -14770, -40, 4], [-1742678, 8104, 1012, -8]];
    Rf_basisdens := [1, 1, 233, 1631];
    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_570_a();"
function MakeCharacter_570_a()
    N := 570;
    order := 1;
    char_gens := [191, 457, 211];
    v := [1, 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_570_a_Hecke(Kf)
    return MakeCharacter_570_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], [-27, 0, 0, 0], [125, 0, 0, 0], [-374, 2, 1, 0], [-728, 1, -3, 2], [-924, -24, -3, 4], [4, 68, 12, -15], [6859, 0, 0, 0], [-18254, -177, 6, -44], [-34446, -51, -133, -104], [49518, -280, -218, 53], [51814, -941, 273, 246], [-126014, 841, -223, -252], [-62592, 1495, 15, 326], [-250094, -797, 186, 56], [-544672, 1955, 1290, 220], [81994, -6033, -600, -788], [143234, 431, -1914, 2405], [504288, -6324, -1154, -984], [707240, 18406, -1248, -6], [-33098, -11788, 2834, -1372], [854602, -16551, 7602, -250], [-800440, 19594, -2838, -3498], [-347348, 10322, -5673, -246], [-5265286, 24657, 1809, -576], [-3769414, -29286, 20662, -3038], [-2962524, 30120, 16722, 2572], [-2872864, -39244, 6068, -1870], [-3737584, 29729, -3300, 6680], [-4998596, 9053, 548, 7624], [-7286936, 27542, -29156, -7458], [-3800958, 36734, -35815, 198], [-5921796, -113505, -64694, -5236], [-3411196, 103586, 23182, 16324], [13163630, 175716, -29582, -18578], [-19084610, 161828, -4154, 44277], [-13923048, -304155, 63816, 8932], [-5192482, -118962, -24233, -77026], [-30386316, -64457, 33704, 46379], [-31848168, 430649, -2076, 272], [10266754, -151283, -1060, -99390], [-57930936, -428855, -32044, 71592], [-29701046, -237076, -61605, 45396], [-41434726, 334251, 1839, 15900], [-112568702, 190911, -73650, 16993], [-20181652, -539400, -144922, 19912], [-99762644, -218102, -46992, -1122], [-47052972, 595480, 113302, 19084], [-118730500, -381091, 170524, -125493], [-73681658, 685013, 88106, -57415], [-89253444, 639999, -151042, -26168], [-79320444, -156715, 187219, 28228], [-108018134, 233084, 190668, -107732], [-150873726, 182820, -246261, 22926], [-212741880, 364271, -77680, -49008], [21039294, -233187, 53176, -5434], [-22330948, -643802, 330049, -194122], [-79831504, -392512, 211422, -43042], [-179460824, -206985, -116360, -66602], [-19987940, 1246136, 342777, 299358], [12268966, 157574, 539311, 71622], [51298340, -1674559, 116468, -221182], [216742332, 1375664, -698578, 106402], [252101152, -1872607, -317335, -247952], [-118141242, 1587572, 801488, -286982], [6789732, -865891, 26194, -84584], [249790032, 507217, -8804, 75265], [-371770336, -1347760, 910115, -251430], [246695272, 2232072, 764138, 396860], [-242701370, 539064, -220788, 1020044], [-344412612, 2884575, -555522, 430284], [-240945774, 184748, -71125, -319620], [88144112, -2164247, -175391, 142716], [233976008, 2627150, 1402173, -469180], [23485892, 1284883, 288944, 148013], [521786156, 2326852, -1499380, 240442], [-196410454, -917880, 1620832, -37682], [-768856728, -1974215, -2310536, 117112], [1047376602, 5679819, 511455, -471120], [-237257106, 2778374, -133798, -381578], [157468440, -1535943, 739281, 1120530], [422401216, -1818027, -486794, 313834], [1176574820, -371010, -2811634, 387138], [-1050358902, -1745717, -2234661, -262264], [-402977666, 1681749, 2052158, -1607556], [424058136, -7995206, -1015380, -590876], [664259790, -2090409, -209927, -1804648], [-1135732138, -9844682, -2431140, 996604], [1155965538, 2141072, 1141670, 728292], [681097272, 7294417, 34837, 2311660], [-788990992, -6213296, -99396, -2617818], [797459808, 4602713, -4081563, 2123216], [1179369392, -1731562, -1221798, 895100], [1969509408, -7735921, -624761, 287170], [-303336844, 1729836, 3231214, -138298], [-1165456754, -11918477, -1005788, 1112212], [-949660354, 5876721, -4210467, -1475764], [1859319436, -3033980, -302023, 2187930], [10562896, 11136796, 3668752, -904234], [-767555842, -8375232, -582864, -288156], [-1044554152, 6544350, 7005626, 289486], [-636051638, 27500470, -132228, 237824], [3200884656, 3232547, 2358168, 3113723], [-87954270, -25099847, 3648185, 600116], [2297865812, 11940278, -556926, -4955644], [2651636698, -14340418, -5788760, -1691994], [-978136376, 12537048, -2506072, -388342], [1243448224, -956583, -2869646, 2281032], [-1032391420, -7060566, -746138, 6646882], [4286594334, 7002554, -2157642, -2757882], [5411374532, -6885110, -2952530, 1633482], [440458364, -11336463, 7733292, 2779842], [-1347277992, -5836854, 4138896, -3055947], [1539534316, 7566762, -6044774, -593324], [4852138580, 9258524, -1129436, 4206310], [886023616, -25588400, -1159529, -3686438], [3805959688, -10852155, -6382907, -4396106], [1064917458, -8163117, 8738276, 410398], [511802058, 12324623, 643262, -9268623], [-2098312646, 5424147, -4023886, 2599718], [1961311432, 10488429, 11029732, 764404], [2655727784, 17803552, -7357133, 2956182], [3084021612, -20326807, -4140558, 2717972], [1180875972, 41228710, -3735140, 2841522], [5687249752, 7468016, 17665222, 4952724], [4022639002, 2520206, -4075970, 3622418], [1702668710, 14335161, 304482, -5154771], [-943339436, -40001323, 1525227, 5214228], [6722432966, -21136882, -1511605, -10038564], [4106702464, -22711177, 6054178, 895248], [2202630448, -32269688, 3214360, -7629982], [2012062296, -12784794, 22801868, 1150306], [4553378770, 21105728, 16404246, -3923105], [11158119032, -15264791, -3710490, 6710602], [596797610, 58273740, -15892790, -2268194], [-1232176518, 64083800, 1827888, -259212], [271115016, -38827831, 4828658, -10472934], [9462396784, 13902496, 8615872, -10511482], [-8500069072, -42390445, 330740, 4154906], [-8770765710, 29153494, 6912916, 6437538], [1065094672, 21396724, -8986772, -5605162], [-7145099010, -68593802, 25701518, -7558432], [4939451320, 34458405, 2887945, 20455744], [-7771817556, -11454095, 22489336, -7242321], [3232080404, -82493433, 15142528, -4503976], [-8666094636, 15511648, 5242828, 841746], [-1158657024, 139630833, -15778730, -4574514], [-11289183360, 75589647, -4080198, -4605942], [6034249624, 41147820, 25086108, -8932414], [-5504328088, -14721004, -7252012, -16190296], [5407635830, 36412369, 10481787, 14889790], [-5168291226, -30365104, 12785062, 13549840], [-2995390554, -70174522, 23555291, 12477118], [-12152822220, -41236724, -11487912, 23587870], [2213133172, 139845560, 29440312, -8530020], [-18493609704, 16945362, -21571520, -19062766], [2974364464, 93171732, -25027032, 3024272], [-14164520550, -75149844, -21910740, 5371116], [21638171138, -185161668, -6332598, -15844422], [-15046509908, 74530750, -15754811, 9215122], [-19816759760, -6032904, -32308454, -5594364], [-3878760468, -79655655, -23213472, 5721084], [-5839542834, -38041186, 11205051, -33834912], [-3369930774, -6431621, 16361642, 19242866], [-15494815332, -60724781, 31801146, -11797880], [-4170963708, -94941967, -51151328, -16371071], [9275390482, 50097825, 42095338, 469666], [-11598637852, 130157987, 19659048, -16200184], [-8862174938, 33980636, -23892080, 9194406], [-10320963774, 79369278, -2559848, 12255524], [-22798707018, 146276481, 47117914, 2258810], [4778262544, 48885125, 20316374, -43075282], [10366769994, -104069972, -12012825, 7921708], [-13271628146, -125359006, 23668852, -37612548], [3225292654, -109230083, 44439198, 29495040], [2284926762, 103098496, 40325536, 19006104], [29497358124, -71212044, -23690174, 19846314], [-2072735482, -203073070, -11304218, 22172712], [-1323209760, 102083832, -1467246, 14293354], [2100291238, -156064252, 4180080, 6393052], [30669195808, -3791029, 23001331, 21097212], [17070751954, 250605819, -51202318, 2438210], [-4859685230, -30969397, -33937581, -31206314], [-23644776412, -58199207, 31629988, -450412], [-24304745290, -3059579, -68747814, -25963080], [-3226192278, 34799704, 51213906, -11579600], [-2047702774, -47257551, 10284465, -12437370], [-10263357044, 88877762, 4248608, 47647130], [35587405222, 16435364, 17875330, -15425052], [3245369858, -86601826, 65745093, 4902904], [-30971888340, -57433660, -32161063, 26116522], [6042405108, -354875310, -24690004, 16241506], [23235267124, 52619100, -35598932, 14646700], [20865934944, -24598008, 678317, -24380054], [-20378411496, -90416106, -79389872, 8934080], [-30310575852, 119059675, 15703820, 44315594], [4535939350, 62732969, -57919670, -50590893], [-65654824820, 151467135, 75587006, -7367190], [-23265688996, 31210848, 14395268, -12519879], [-54930283434, -7225153, -50453398, -44090646], [25082619600, 68383956, -53799623, 12518954], [-14483113634, 90932957, 85981882, -52493412], [-7473868842, -254681371, 41340163, 29035790], [25985292418, 97258560, -27682572, 54435404], [23010831474, 154081834, 50304925, 57733986], [27303249894, 12143871, -25270894, 18416683], [20595749324, 6661364, -34890204, -49572802], [-24276428676, -63008559, -57177684, 86660295], [-12285333558, 18733540, 62799910, 62722962], [1632979496, -316144872, 5692384, -70916542], [30489525266, 470484880, 62833552, -29119128], [-7486501342, -42502476, -119260584, -60418], [-66150542136, 184879001, -67933403, -30201640], [-53041362328, -308253143, 21656840, 48844549], [63748530760, -41482394, 96652390, -3732248], [18319166082, -104755440, 43447614, 74412802], [-37531196320, -13957407, 26832657, -44692860], [7405097196, 55977456, -3696523, 22739950], [-24016533152, -331037125, -228927096, 19098525], [-27888590314, 244071135, 74035606, -41750849], [29496161792, 395826253, 69157326, 23335906], [65174260210, 43396536, 74460102, 86072003], [62689862656, -424025904, -128829881, -22956198], [-49588535056, 344179663, 153860799, -30041108], [21800971052, 6143925, -42147948, 28399403], [38530319654, -524587580, -88481848, -21497656], [24409194768, 81878611, -10294508, 49512816], [41701548752, -268105296, 104028010, -19195286], [32143501344, 321949120, 6894476, 17365524], [15477258546, 65572214, 109826409, -24023014], [-118545000208, 19160739, -94719666, -79502328], [73379572240, 148384859, 47455000, 62903631], [135056190542, -287276789, -121632942, -9839858], [28061967972, 92028378, 51532503, 105211734], [-53435879490, 411256804, 119719277, 2186010], [72966842410, 229630819, -35201798, -79490636], [77616225110, 475189317, -202024694, 114100871], [-53665753266, -589930196, 2479496, 41695700], [-78075781406, 304648086, 32993377, -69109758], [141110431912, -86345070, -119014842, 24762796], [64347678784, 25231906, -42363576, 101024252], [76086757300, -151683234, -37010264, -16452470], [-35349420314, -371568296, 10454905, 46540664], [-9671428536, -19408955, -88746416, -171260996], [-46442336780, -107540977, -11680486, -55190576], [119675982614, 32588196, 92482885, -60162200], [46578418508, 243831101, 228752451, 12980000], [113539023642, 251468989, 18654592, -169594206], [-88948445500, 183069441, 11991500, -52597181], [-72185784414, 935738827, 255172232, 9503942], [-34480111544, 224585029, -26407922, 156014354], [175330845978, -628230800, -123264344, -6649500], [-33533765394, -113515485, 108999284, 26560756], [-19656719318, 296812496, 84538966, -96318882], [-182640721654, 128563345, -100070038, -64830365], [-35147721762, 943966686, 36050719, 39111890], [56328844146, 255872957, -198669202, 124508131], [79538247116, 362801370, -194856336, 25246470], [45248687724, -416359225, -401556014, 87634822], [-51564831202, 424076774, 16547730, 41682782], [-44249250380, -911457908, -94167446, -32646580], [-107742581736, 263753534, -40339544, -64301708], [-100611260358, 751531742, 73310676, 105672876], [-80313798074, -924408963, -284100521, 40157374], [-117939275552, -295665650, 96612408, -187420879], [-42386553580, -76894615, 120603324, -287305705], [-37669854652, -177547146, 170127145, 117631882], [-3341207622, 153350980, -351925140, -11153120], [-109513997472, 853342786, 42852752, 94197888], [-63667140330, -226518145, -116167786, -126526605], [-63247682284, -831140429, 443962266, -67319066], [-72231964308, 451919242, -113819554, 80995056], [-3367432070, 490421352, 477057610, 1051210], [-72964063220, 80623210, 315859654, 52814882], [-12023771116, 77843038, -9814937, -152917470], [110319288914, 413331192, 49584519, 256367844], [46676147584, -305681444, -80504274, 124847000], [-65726203552, 48894873, 3419356, 100944344], [182874760454, 646352914, 139840810, -248370114], [112535399032, 472010275, 186830715, -116546830], [-83133064380, -331330114, -409385172, -51363628], [124586692100, 1144781234, -269413608, -15368236], [40005277578, -1891888827, 200545374, -8965086], [34573014480, 1620398719, -83145050, -98298104], [87607420942, 173947316, -72043619, -386068758], [93175530432, -237640311, 198053685, 104528904], [-65971396834, -493338370, 222202136, -40955640], [76451874656, 209733437, -314987674, 303885278], [-285871312268, -510210120, -43944588, 114406370], [224357844242, 372907581, 202205425, -82753028], [274543320234, 139523632, 75747406, 67595040], [103880718188, 1094538696, 355223122, 38914546], [-28558050520, -215314231, -137344746, -57639368], [93873439602, 163277903, -192263090, 40548166], [-110106233516, -238017696, -234987535, 134366208], [14632994790, 1551932174, 99049208, -55086414], [193028907622, -372139791, 506820718, 281824960], [46623442946, -875616969, 364652822, -121932327], [188128561738, 276630883, -60871400, 174065968], [127085345774, 884003008, -586241843, 248483250], [-237532126694, 516664830, -410445470, 63308260], [-97552359148, 1195291703, 456753614, 91873370], [19926271860, -257079408, -112359588, 184531198], [-33826887548, -1262765099, -338141864, 241498987], [27766604356, 129972934, 318547394, 164995588], [187441831744, 90218048, 185257311, -125728226], [-50508277112, 284412894, -38669068, 187543100], [22989123716, -1432309379, 238459554, -25525100], [206439638004, 623160399, -412123955, 107693840], [-126480716672, -692620075, -366251722, -9075718], [4567144766, 913646533, 48811746, -46786452], [-94833929134, -752113046, 324859812, 280512444], [119967325158, 123728197, 138563915, 155598968], [214445541700, -16023252, -58395194, -22931750], [-46338161922, 297487311, 38358784, -505724236], [-133508384642, 467419486, 733164532, -285147880], [22271479034, 1061150338, -730714035, -63402870], [-115863917232, -2699807836, -81926836, 31959024], [-32972156018, 851590702, 172884636, 182807556], [274780467590, -1488835826, -50285722, 148283194], [111642283040, -79268717, -388028464, -158413753], [-258632639198, -1230753082, -132754146, 49953316], [29065189320, -75671612, -684529315, 186379034], [246220933092, 1088864180, 12715972, -456102874], [-289388163836, 1130682900, 119485980, 290742925], [-122158448342, 263375070, 219649148, 153242442], [-229396193084, 2584855344, 436522184, 258551292], [-12906903284, 759210018, 262039484, 184775994], [115799367708, 166217939, 456723320, -427717497], [-209492295558, -1896143891, 582224398, -79101369], [23617043434, -1643492230, -903044980, -3874108], [-157788233864, 889918275, -408551110, 27027884], [222452470512, -346475192, -17502778, -249724554], [289437999276, 856383454, -139774114, -323050648], [130787122308, -529181946, -98519110, 429329660], [-231486363444, -2885534308, 425568942, -241329634], [-282061655616, 2712133243, -57590266, 5710920], [94823420404, -330059929, -388508870, -166413832], [402979405230, -192688663, 75049422, 5682879], [424386913546, 1027366826, -1096308047, 277788060], [52610337394, -914716957, -91932161, -469429206], [-219368768680, 1847975137, 240238618, -216730960], [166716153714, -1877542833, -615770007, 171115392], [9622089162, -180835362, 24814382, 215624249], [190552559252, 1560072437, 174507042, 489247768], [-225562905486, 586327301, -682147310, -180477776], [226030579330, -1061626979, 459810154, -303753457], [251296390760, -462767790, 252260250, 79170558], [300582553788, 3086211442, 783135014, -255646702], [135648086254, 613667216, -490782524, -51469228], [706062813628, 684547927, 21715864, -237944575], [-417544960982, -1089063345, 770868323, -631590360], [-66316296930, -469887890, 591497172, 454228162], [359734229136, -4355236648, 201128402, -215601842], [-445516269356, -874624291, 310298080, -37960674], [-582185834376, -155918105, 26934962, -86475658], [347350406058, -3712077670, 342854741, -78880464], [-69844838388, 2482948091, -111357647, -386540858], [-679825736456, 2973743648, -119511152, -35970973], [271963077684, -2337795162, 64183112, 29280748], [-66357006596, -37435785, -124713788, 765026044], [-118238778906, -468163832, -486773838, 359555080], [-86952568020, 2067748546, -226273792, -501027400], [82336458506, 2940382821, 1520503838, 227111100], [384539701310, -1539496110, 620603031, 164716794], [66539061660, 4052913152, -475473391, -301960766], [-231378534042, -3944351468, 618843232, 88326372], [541810640912, -1963914374, -115180010, -116485524], [146013281502, 2227001248, 474328266, -677846788], [18209454658, -2084757806, -630119567, -246467654], [-148186066408, -3762228282, 180614112, 96407916], [765608370430, 1009156459, -1188431432, 238883764], [545921183254, 912584333, -746935999, 189826252], [5506299132, 963935266, -87067952, -811678712], [-305328077952, -3237764645, 25845692, 264823686], [310386038326, -671659147, 203342232, -44757120], [151190383282, 1721641206, 463595749, 849949344], [-189182033962, 2637199554, 769034688, 562089888], [-120136970714, -388618938, -819406044, 1079511088], [-567877918428, 1394160510, -774367717, 60760802], [-673490697186, -3557806703, -232083727, 1109156072], [-372573801632, 4656784206, 1158882776, -130864075], [559205438082, 3303065684, -505103965, -235524956], [37003194116, 1599032235, -515407818, 623305844], [60083768168, -1211776585, 62539732, -87202613], [500077396716, -2316814139, 994715284, 71747109], [-265420988512, -4928161994, 672337318, 869604696], [-324184218876, -245603559, 321349496, -70786054], [608904974284, -926761401, -1609835039, 760739518], [-404944514196, -5621782041, -1005148404, 718355799], [-61990152978, -3868400222, 113195902, 661595386], [833946200748, -572010949, 160729242, -570946678], [724076311788, 586622891, -324094247, 128313454], [-332838655804, 3842303499, -105053219, 219480710], [-90473181792, -4418509608, -1631811490, 245693482], [646980912328, 565413878, 340271209, -293240886], [-404769946510, 6081409434, 644639842, 787809785], [-727922424032, 1874184710, 301997653, 901150358], [593050711520, -177304135, -551186692, 15452361], [625368530070, -1086941122, -642439956, 276315434], [-373675494172, -824932957, -679130610, -809097814], [-681048541024, -762839566, -726497200, -475034395], [-588747075380, -322368510, 1099398316, -645959156], [64418679716, -4435278293, 506945872, -880104106], [-192823922210, 1079855239, -72481469, -1172304680], [-1446359836, 2577293992, 636667380, -328570526], [-273577158780, 1043314563, 1515372584, -702076468], [-476475914694, -1632668119, -741179407, -867316908], [531097473500, 2552881196, -1281365442, -201911506], [242291430424, 188322497, 1275981973, 423498230], [760483340618, 956333857, 1951911317, -210276652], [-644146381490, 1949827477, -1258612046, -1104680339], [602571767268, -1880797352, 174582508, 308588520], [-138957103564, 654561388, 363745582, -611630778], [399179203866, -1575133114, -1754852194, -117495512], [-168043968962, -905211324, -1260758026, 377806118], [45087583908, -5346907876, -206346518, -230812808], [-1012072288108, -2668905954, -596748876, 1381420200], [-805260036172, -5367913357, -1727512550, 958437336], [1697668114892, -3798042724, 579163212, 59421310], [179626691856, -2780705434, -326865225, -1561729642], [135912494602, 4004644795, 1083893699, -442690838], [1059716476366, 601601003, -1870904546, 904561994], [340735080442, 5411189255, 279769052, 250884472], [735362180602, -7066986965, -792283625, -33602152], [-592292203104, -3542846815, -2423016948, 228315332], [18513266064, -5315791004, -625491500, 736688598], [-122145820978, 3178828786, -276636024, 540570720], [-51131941508, -331705774, -30610206, 164448172], [725051371326, -3504941768, 15861973, 777519984]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_570_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_570_8_a_a();".
// 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_570_8_a_a(:prec:=4)
    chi := MakeCharacter_570_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_570_8_a_a();".
// 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_570_8_a_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_570_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<7,R![79922833472, -447306872, -57624, 1496, 1]>],Snew);
    return Vf;
end function;