
// Make newform 570.6.a.q in Magma, downloaded from the LMFDB on 30 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_6_a_q();".
// 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_6_a_q();".
// 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 := [-313880, 244908, -41266, -2623, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [259654, -95159, -5238, 5, 2], [-259654, 95519, 5238, -5, -2], [-920780, 331174, 18309, -16, -7], [-125424, 46920, 2603, -2, -1]];
    Rf_basisdens := [1, 18, 18, 36, 4];
    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 := 6;
    raw_aps := [[4, 0, 0, 0, 0], [9, 0, 0, 0, 0], [25, 0, 0, 0, 0], [54, 0, -1, 0, 0], [187, 0, 0, 1, 0], [244, -1, 0, 0, 0], [443, 0, 0, 0, 1], [-361, 0, 0, 0, 0], [951, 2, 1, -3, -2], [1735, 6, 6, -1, 0], [171, 1, 9, -4, -5], [-1496, 7, -2, -12, 4], [563, 7, 17, -11, 6], [-480, -13, 26, -18, -8], [-1675, 20, 31, -7, 0], [7769, -16, 43, 41, 6], [6446, 2, 132, 20, -14], [7513, -29, 95, -74, -11], [-136, 3, -81, -16, -16], [1278, -39, 305, 34, 4], [5756, 49, 159, 78, 0], [5826, 8, -280, 44, 30], [173, 66, 347, 9, -16], [7255, 69, 65, -165, -28], [12688, -88, -269, -106, 14], [-9090, -50, 214, -214, 26], [-14522, 109, -37, 6, -20], [30808, 106, -440, -126, -6], [13444, -126, -774, -18, -12], [25405, -230, 479, 149, 22], [16020, 112, 698, 326, -50], [33797, 60, -480, 419, -20], [-5886, 252, 1048, -28, -76], [-14162, -62, -112, 52, -102], [-3900, -59, -173, -26, 212], [45237, 3, 1063, -252, 85], [-80376, -24, 818, -412, 186], [-8966, -121, 72, -670, -86], [67533, 20, -1218, 468, 85], [-30519, 374, 2145, 431, 12], [57528, 244, -470, -444, 20], [96226, -296, 376, 42, -242], [77219, -163, -627, 323, -206], [-16658, -184, 11, 4, 186], [-59951, -416, -2512, 368, -365], [27738, 16, -1564, 614, 248], [-166118, 152, -3420, -888, 46], [-46922, 459, -2007, 646, 460], [68649, -650, -856, 1064, -375], [-162527, -791, 287, 456, 379], [-7372, -448, -2950, -710, -512], [-48815, -699, 5129, -1199, 86], [138054, 146, 308, 1662, -394], [264987, -790, -582, 1453, 596], [-308491, 584, 803, -2661, 480], [-156345, 1912, 8835, -17, 160], [-208723, 896, -1988, 1515, 274], [-418412, -610, -6710, -2294, -74], [-26568, -163, -5721, 902, -16], [319577, 697, -5703, 1297, 180], [-535380, 265, -5400, -8, 134], [-321885, -2500, 3775, 2891, 1154], [-169810, -1892, 8858, 820, -462], [-503513, -2139, 7429, -1289, 226], [-357622, 1131, -4665, -2210, -390], [-907061, 1158, -1285, 2639, 586], [-776135, 135, -3501, 508, 101], [-303662, -1254, 4711, 3076, 786], [-1250741, 1548, -5985, -537, 136], [376302, 564, -3032, -1872, 1320], [-1294350, -884, -6360, -2344, 1472], [-246129, 3193, 3597, 3447, -446], [-698288, -2182, -2293, -256, 598], [-474322, -1955, 1548, 4034, -32], [1131733, 393, -5015, -388, 2017], [-2230210, 5474, -5444, 878, -552], [-578892, 394, -8922, 8, -2314], [-2466926, 85, 17707, -3274, 1146], [-737541, 1325, -13599, 181, 634], [421668, -2182, -13454, -2306, -2256], [-114085, -2180, 22960, 593, 0], [-1534382, -1736, 1390, 6522, 1538], [-1433976, -2334, 1522, -5102, 594], [560774, -2662, -8871, 2504, -250], [2009856, 2718, -20158, -4112, 1944], [-3083387, -2850, 1711, -1817, 94], [-37783, 3797, -28967, -1365, 1534], [-2764908, 5953, 18493, 706, 240], [-1604966, -2943, 5947, 4878, -1598], [1751708, 5316, 9065, 204, 30], [-3245813, -2544, 15999, 2913, -1534], [-998911, 359, 18341, 7873, 2858], [-714450, -6698, 1470, -2362, -1076], [-4039897, -1386, 15064, 4669, -3284], [3333654, -6156, 3550, 6560, 1286], [-3304681, -2826, -14935, 2459, 4020], [-1613463, -6696, -28780, -6579, -1936], [-5368925, 1015, -6115, -13633, 2168], [2826206, 4627, 2957, 1520, -590], [-2669882, -5856, -13882, 11914, -4026], [1868634, -4308, -28294, 9116, 1190], [-6313636, 2260, -346, -6754, -1720], [-3267143, 2346, 37224, 1804, 37], [-479363, 12487, 7359, 2335, 446], [-2699184, 500, 40612, -7862, 1318], [150766, -7243, 10433, -15610, -3754], [-4874661, -4160, -32805, 8577, 5842], [1825612, -4414, -11372, 1198, 2060], [237024, 5975, -31069, -4916, -1104], [-2197154, 964, -26854, -11160, 368], [6705168, 2952, -128, 13406, 2326], [11370982, -496, -24986, 8620, -1424], [-7144001, -4608, 1172, 9292, 4977], [5814936, -1212, -24598, 4588, 1284], [-654264, 904, 7672, -2588, -260], [-7803149, -2609, -4037, 7459, 5768], [11277180, -313, 22992, 858, 724], [-7203509, -670, 32407, 9697, -2742], [5869447, 8176, -10230, -3186, -3541], [3949658, -12552, -6866, 22202, 940], [-742526, -9356, 4322, -2508, 5228], [13632952, 6096, -46265, -2914, -2186], [-5740091, 16870, 52777, 1385, -3094], [4271576, -4650, 17580, -810, 1310], [-2634020, -4860, -68880, -25794, -4842], [-5565240, 5043, 39361, 13874, 1604], [4595453, 7133, 65297, 18682, 621], [5535167, 13955, 14641, -6029, 8634], [13949308, -8014, -47871, -4398, 1792], [17785752, 4436, 5508, 7224, 6290], [7519692, 868, 66400, -10188, -1284], [7897078, -7328, 16546, 18998, 1640], [422943, -2061, -46421, 28480, -7429], [16989276, -10439, -17963, 1890, -404], [-6795648, -9901, -55023, 2890, 4216], [-1411490, -8806, -78232, -22498, 11078], [14509727, 6868, -30835, -13713, -10090], [17948286, -4883, -41853, -2616, -2446], [6401345, -21920, 52411, 35031, 13140], [8303572, 6274, 44802, -12940, 2598], [-2189016, 794, 9622, -17372, 9768], [150744, 9216, 114488, 4302, -6864], [7049934, -22182, -72911, -20086, -3510], [3962299, -20506, 46886, -33394, -5379], [529942, -470, 48126, 20626, 4594], [2745566, 20985, -83399, 14906, -10772], [14600556, 14137, -34995, 33818, -444], [13375343, 4326, -156799, -7171, -724], [-15132910, -22964, 143976, -16, -1690], [14024616, -22310, 1348, 1246, 466], [11381780, 15489, 109150, -15436, -8940], [10422100, 11818, 58314, 23838, -1880], [144582, 12477, -52410, -7022, 11742], [1962544, 16040, -108512, -12512, 688], [8634588, 27201, -101965, 24756, -6036], [-1988778, 8172, -94276, 3596, 6514], [-16057614, 6278, 48246, 10932, 5982], [1537840, -24773, -147795, -57460, -15654], [3990092, -15616, -45894, -22324, 8394], [341789, 6494, 9934, -35473, -13258], [9191259, 29176, -125881, 22155, -3412], [16175637, 24174, -12127, -28885, -1696], [-3485562, -18978, 24595, -22068, -19448], [-7184142, -2608, 121382, 26106, -11204], [-1783547, -6388, 116099, 3709, 16330], [-1112249, -8088, 42826, -60512, 2203], [-12229572, -21388, 138016, 10896, 30724], [4960, -27254, 108124, -26924, -12606], [-11885424, 51460, 18126, 40494, 2248], [12426608, -2964, 97758, 84610, 9656], [-22642450, 11191, 37197, -2248, -758], [-7574102, -33038, -62038, -19620, 3256], [-16261399, 1663, 3309, -69035, -9874], [11169082, -24790, -14110, -62204, -7524], [-22950766, 11658, -137314, 31912, 15050], [4804448, 43261, -52709, -46200, -12242], [-25359644, 9208, -20046, 30876, -19464], [2459048, 63400, -166976, -24810, 6424], [-12257544, -12474, 90242, -17658, -26098], [-10126314, -23830, 25874, -45404, -1916], [-19044328, -1202, -184451, 5908, 9302], [-10527002, -36650, 39880, 53274, -22424], [283842, -39595, 87096, -18574, 20828], [-18123821, 10460, 110663, 13563, -31242], [-7543859, -26332, 101231, 74173, 22396], [12029738, -16867, 31863, -8454, 518], [-8887086, -3473, -124096, 31078, -31484], [-1553018, -33619, 208651, 28060, -20754], [-15588146, 37378, -193118, 14730, 18582], [-20525311, -11363, 171677, -43995, -14878], [19531566, 46978, -106255, -14588, -6246], [1803391, -47666, 145391, 85791, 3184], [-36630718, 25926, -76846, 580, -22694], [8342319, -5464, -854, -26331, -6878], [-41217789, 11360, -23099, 53763, 10656], [-543671, 4486, 146291, 54817, 25238], [-8953543, -929, 80777, -59064, -473], [35062178, -15360, -110688, -18852, 30976], [6665633, -5326, -67224, 6302, -3215], [-4790849, 17196, 284329, 22007, -35364], [22609163, 56144, 27306, -78663, -26638], [-21401418, 48468, -163464, 111272, 2886], [3335470, -48407, 23284, -120394, -14740], [-3627522, -1846, -87264, -21294, 9562], [5874213, -23044, -214792, -91081, -9208], [1141173, -30118, -240068, 45110, -16919], [-25506556, -46278, 145496, 3698, 34922], [26518059, 34858, 259662, -71602, -12099], [67545202, -3792, 45392, -6246, 12130], [-61077680, 13360, -119952, -78920, -20876], [36448268, -30205, 98535, -96010, 29756], [-22968890, -6839, 296923, 28804, 30812], [14718368, 101136, 41569, -72824, -27842], [-9131459, 68248, 208764, 57150, -44609], [2458, 101832, 260320, -54530, 9984], [28001250, -66242, 115624, 40460, 43080], [35202596, 28132, 43825, 111528, 19650], [5221411, -16569, -378487, -104137, -32112], [-13679507, -37362, 159642, 2854, -29941], [266999, 63932, -592956, -20976, 11377], [33659404, 20588, 228002, -51462, -44340], [-35538657, -71841, 13479, 9208, 1723], [45863655, 6491, 56607, 50515, -788], [24392934, 9618, -134697, -39182, -51242], [22874057, -10802, 70716, 33028, 3021], [-2843774, 105246, -375192, 162162, 33650], [38510971, -45448, -95633, -123413, 37430], [29907004, -13548, 209104, 223242, 13758], [4263010, 9206, -445576, -149618, -53436], [47201661, -1246, -45342, 8803, 50412], [4128242, 71199, -117717, -70830, -3086], [-31567729, -33895, -66127, -139676, -15413], [-7549256, 6938, 118702, -70112, -20440], [-10221521, -28975, -195195, 126875, 5452], [-1162694, 6847, 462110, -53286, 42606], [20542073, 99158, -122159, 57845, 29352], [29150965, 40075, -135345, 41366, -2755], [4544578, 25766, -92174, -32928, 51372], [20737409, -55562, 398374, 65627, -21064], [19776998, 20468, -629136, 10330, -16752], [57589326, 9862, -307272, 50926, -21348], [23676036, 274, 293632, 194394, 10390], [-38715460, -35126, -529101, 44782, 30184], [18889194, 84084, 82934, -143620, -20276], [-45368109, 43312, 215857, 26107, 23890], [20491983, 133375, 115609, -161733, 21986], [7679210, -21012, 1049, 62486, 11510], [-25893020, -14363, 112243, 26486, 16430], [-53608153, 106953, -110351, -129788, 16779], [-8379165, 40572, 213317, -36035, -13386], [73826604, 3237, 287565, 255854, -10152], [-25416402, 21274, 659218, 65956, -69896], [-744543, -106528, 126837, -49419, -32900], [-37091378, -81642, 430054, 13430, -59966], [-40417297, 19774, 236326, 79428, -48699], [16332377, 48638, 138464, 70747, -12956], [64600955, -133741, -365157, -80338, 40351], [-51099310, -35778, 825594, 118692, 66442], [5499067, 20312, -65065, -209211, 67676], [-5628090, 61643, -31967, -240786, 38738], [-35400690, 51877, 96371, -8346, -23908], [45365816, -48208, -426736, 21100, -20032], [70324354, 50742, 190560, -14782, -65230], [-13605088, 143369, -22906, -87472, -51204], [7910161, -55506, 894224, 49434, -46411], [-65316819, -44587, -173131, 38132, 47673], [-24517857, 10754, 359152, -55323, 58114], [-56661552, 42715, 137405, 78156, 70306], [-8775596, -120610, 100782, -86792, 50232], [-137253173, -85186, -261966, 65200, 4061], [16425706, 134198, -767494, 152960, 47300], [-17996240, -122615, -276083, 108576, -29488], [-74979100, 77990, 66360, 30296, -94186], [26604062, 73908, -800542, -61432, 43042], [39363646, 9720, 555961, -246820, 24246], [93433538, 81832, 384213, 346656, 79184], [-531227, 221444, -229691, -82195, 25676], [39673412, -97732, 176902, 204072, 66050], [25564672, -20678, -99580, -131652, -107354], [1324925, 171160, -428608, 85967, -64248], [-114366680, -60398, -311208, -35514, 34914], [26000554, -68648, -537096, -174788, -31754], [22002067, -356, -311251, -48829, 3380], [-41171262, 32690, 33422, -302476, -42440], [80434252, -109039, 54938, -156164, 3974], [-88446965, 15633, 408361, -272069, 69874], [19980690, -17816, -221576, 92684, 81484], [30894177, -117382, -489, -141973, -20444], [-113293432, -73866, -444814, -308044, -12708], [-8866963, -27141, 1034847, 109659, -8022], [-5297224, 127910, 507690, 6570, -37276], [-3776491, 87710, 574043, 321, -135752], [-117594615, 117172, 292325, -185805, -7080], [-17327278, -179881, -629323, 165448, 60366], [52741206, -77685, -357706, 227602, 33408], [61607466, 47339, -189855, -252240, -71372], [35823096, -43698, 3466, 180736, 32472], [76250485, -177368, 589664, 163136, 72423], [37851506, 49515, -341915, -107286, -49784], [40092842, -105131, -218500, 85950, -36958], [-56783224, -63131, 871091, 225922, 99024], [78837929, 78124, -1113937, -111067, -104470], [-59964570, -112018, -69268, -78150, -126380], [800051, 123708, 388632, 118606, -99267], [93716470, 57516, 913642, -90620, -80630], [20860154, 236760, -462535, -300008, 50222], [3198672, -169854, 760290, -475972, -60312], [39583188, 85210, -367396, -318698, 116536], [134431767, 36337, -238971, 63923, 52406], [36298280, 35029, 359761, -129686, -31872], [61140711, -112422, 82991, 202967, -89564], [-73751922, 9208, -253480, 130008, -14688], [66727443, -72597, -1109721, -235063, 5998], [-48125206, 21150, 607580, 61160, -25542], [53659407, 129930, 999571, 267449, 862], [-157522258, 79474, -209616, -342410, 982], [54679477, -147424, -443580, -230889, 75840], [36998508, 89348, -67124, 406092, -46248], [-164396596, -66615, -589271, -285650, 97876], [193412, 27403, -522223, -397942, 148500], [-69411215, -91339, -587679, -264272, -181967], [62779334, -121624, -413294, 366004, -104308], [-77245553, 192870, 479640, 62281, -120930], [-84428632, -57689, -108821, -229110, -188122], [-56435457, -80452, -697180, -259488, 85101], [146672466, -5320, 408174, -215222, -70418], [-88186770, -245096, 198192, 94064, 75906], [-174583382, 10489, 997051, -76876, 135226], [-26549065, -153914, 345734, 52250, 222569], [-168598543, 193380, -198602, -124022, -94903], [-84267578, -12630, -1171514, -16808, 36352], [132380977, 143164, 294967, 348353, -12914], [-137986844, 10414, -1184368, -121764, 7772], [-39239453, -179206, -1467787, 150723, -48676], [-106178994, 223848, -90092, -82490, 61864], [-90018883, 17710, 862967, -213215, 138944], [-28176732, 117076, 1536088, -225328, -24698], [-168869699, -56488, 546439, 89941, -59046], [108999949, -82319, -546093, 137384, 3819], [-82095052, 49886, 235103, 179274, -45820], [-52356136, -177311, 23090, -38744, 23740], [-132666826, -281214, -561274, 76580, -113008], [184243307, 159918, 164352, 69235, -53940], [22096083, 14109, -1302739, -129752, 18535], [11592705, 289220, -587825, -221667, -51286], [-90783624, -38670, -355540, 246806, 50406], [-50666221, -237429, -440767, 409948, -136999], [-8856226, -232179, -443279, 391228, 29442], [95215492, -66621, 432507, 478032, -86024], [27314056, -233438, -259388, 417070, 54724], [-66386853, 6643, -15713, -373620, 149743], [-74611852, 128444, -1430655, -273722, 15158], [181796038, 284629, -754481, -324292, 62396], [-45717652, 130058, 352814, -654738, -51406], [220201538, -199996, -608358, 118984, -60976], [-146431035, -272954, -405027, 291617, -221522], [59653443, 256345, 422739, -169021, -150994], [-285201767, 158648, -322046, 272743, 57568], [44037713, 11390, -844054, -180572, -51557], [178317196, 351418, 812176, 54330, 92546], [174119562, 111635, -705527, 310586, -67994], [149905002, -76145, 299913, 579798, 165286], [-125198172, -57340, 1324706, 192686, -152562], [184864992, -79275, 905963, -335416, -23532], [-101181406, 280107, 172048, 168086, 120734], [97503296, 178472, 94617, 501534, 66130], [-21207288, -209642, 464204, -139386, 198572], [287658026, -11086, 131250, -269446, -154468], [202094274, 181382, 1498556, -253508, -101520], [17826247, -55494, 859820, -604711, 84048], [-149506982, 379080, -8640, 287820, -162142], [219741967, 77950, 321907, -202595, -23390], [86626355, -280350, -443076, 190919, -158792], [109862562, -254426, 76316, -412446, 2704], [-36669026, -290794, -1765924, 83516, 108872], [135825282, 344603, -1684667, -212130, -86508], [84469253, 119841, -1080135, -424387, -136706], [32376710, -243808, 1574100, 455544, 116820], [154660948, 311279, -1505183, -96304, -85246], [241834806, -99290, 493331, -621352, -101374], [84680999, 435516, -808866, -432829, -271272], [-183315819, -153594, 1043288, -75206, 116849], [92547804, -303712, -560729, -823486, -85672], [59189676, -33156, -1763058, -58518, -202320], [-110615607, -75107, -230183, 151220, -158259], [200933529, 190668, -663260, 427294, 236607], [74850962, -223718, -1114146, -297506, 77624], [-126942344, 137535, 1190897, 318006, 15208], [-83912514, 252571, 5890, 104540, -191212], [214697457, -275552, -1874410, 89436, -108831], [83627962, -110396, 856304, -48230, 101642], [150016469, -261450, 349433, -497347, 22414], [-61205137, 85438, -1234246, 620393, -210180], [-112791926, 180423, -1822518, -592404, -221040], [344681088, 164740, -575372, 7130, -22478], [116246166, -293420, 2147455, 682448, 16230], [-375164193, 236435, 1317195, -232200, 72707], [33937629, 24655, -2248637, 259593, 66640], [409496683, 93457, 728249, -271524, -160665], [-46747324, -352656, 14968, -312784, 312142], [84084228, -109320, 1434000, 90636, 138938], [-293218999, 240430, -47112, -353054, -69499], [136413130, -478541, 1672571, 788610, 119912], [23882797, 443328, -1366361, 591055, 9292], [-161467955, 57064, 910602, 468477, 120176], [-129411642, 14476, -1083490, 292346, -148036], [-193985516, 347498, -1554540, 99964, -79674], [38735853, 381717, -51503, -562897, 102886], [90929258, 225722, -1104924, -64252, 37470], [-71451665, 203266, -620630, 513797, 125368], [-77639802, -423302, 391603, -460640, 19802], [186047877, 164306, -2303010, 388944, -12777], [16747884, 62884, -60852, -510764, -141484], [-136723924, 242088, 2746468, 30182, 12894], [-332780, 129143, 2100697, -139730, -154344], [-126307272, -15513, 2950261, 210878, 59904], [217964518, -582309, 1109827, -12144, 92410], [55658906, 105108, -801986, -508354, -171884], [-240228454, 249352, -764080, -1308256, 9080], [216684098, -115410, -556100, -809278, 162352], [89090131, -394162, -1790566, -780199, -283442], [-90094156, -414983, 3059466, 173828, -89660], [-86619733, 474536, 1297547, -310907, -243198], [58793770, -209861, 799557, 172934, -42484], [71191618, -535952, -186901, -74916, 388814], [-47832695, -146268, 1784107, -254993, 125068], [-17390520, 253430, -1871124, 382258, 98626], [-257983422, -20500, -2021296, 188840, 223896], [-201421844, -289962, 1183716, 10760, -164100], [22191945, 195811, 508655, 667569, 105438]];
    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_6_a_q();".
// 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_6_a_q(:prec:=5)
    chi := MakeCharacter_570_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_570_6_a_q();".
// 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_6_a_q( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_570_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<7,R![9778621568, -554578304, 8909252, -19964, -268, 1]>],Snew);
    return Vf;
end function;