
// Make newform 256.8.a.r in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_256_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_256_8_a_r();".
// 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_256_8_a_r();".
// 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 := [-15296, 0, 4820, 0, -163, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [0, -5468, 0, 171, 0, -1], [0, -101516, 0, 5367, 0, -37], [0, -13036, 0, 12207, 0, -77], [-5581, 0, -728, 0, 8, 0], [-275047, 0, 15864, 0, -104, 0]];
    Rf_basisdens := [1, 120, 600, 600, 25, 75];
    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_256_a();"
function MakeCharacter_256_a()
    N := 256;
    order := 1;
    char_gens := [255, 5];
    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_256_a_Hecke(Kf)
    return MakeCharacter_256_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 := [[0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0], [0, -1, -1, 0, 0, 0], [115, 0, 0, 0, -1, 0], [0, -3, -7, -1, 0, 0], [0, -21, -3, -2, 0, 0], [248, 0, 0, 0, -25, 7], [0, -105, -93, 5, 0, 0], [217, 0, 0, 0, -11, 8], [0, -2337, 79, 16, 0, 0], [-14908, 0, 0, 0, 12, 72], [0, -6633, 33, -58, 0, 0], [-87022, 0, 0, 0, 302, 142], [0, -579, 522, 38, 0, 0], [261198, 0, 0, 0, -210, -168], [0, -17949, -535, 170, 0, 0], [0, 10933, 3680, -224, 0, 0], [0, -7353, 3993, -66, 0, 0], [0, -4017, 1443, -123, 0, 0], [1264923, 0, 0, 0, 3279, 504], [-348404, 0, 0, 0, -809, 1239], [2669330, 0, 0, 0, -2054, 2016], [0, 13319, -9992, -568, 0, 0], [-362020, 0, 0, 0, 1079, 439], [-183496, 0, 0, 0, 7183, -849], [0, 155207, 19253, 1794, 0, 0], [11078791, 0, 0, 0, 3211, -936], [0, -180243, 239, -2599, 0, 0], [0, 80931, -42069, -328, 0, 0], [-768198, 0, 0, 0, -14172, 4068], [20085248, 0, 0, 0, 760, 10632], [0, -138673, 74953, 1199, 0, 0], [7063818, 0, 0, 0, -33942, -5238], [0, -632499, 9882, 7702, 0, 0], [0, -476373, -6409, 404, 0, 0], [36400393, 0, 0, 0, 49573, -17592], [0, -523137, 3021, 9634, 0, 0], [0, -609681, -201498, -12182, 0, 0], [41412239, 0, 0, 0, -61909, 6496], [0, -21261, 105361, -6446, 0, 0], [0, 423191, -25214, 18542, 0, 0], [0, 275523, 25347, -704, 0, 0], [13037672, 0, 0, 0, 55712, -7448], [31527032, 0, 0, 0, -97, -19137], [0, 1094287, -222781, 3436, 0, 0], [-8476325, 0, 0, 0, 31031, 11856], [0, 1009191, -228666, -23798, 0, 0], [-72062692, 0, 0, 0, -112524, 44952], [0, -93137, 547432, -13992, 0, 0], [0, 3011751, 140427, 5692, 0, 0], [6513884, 0, 0, 0, -38065, 74191], [-88470090, 0, 0, 0, -109362, -46272], [-120608728, 0, 0, 0, 179727, 31407], [0, 2041749, 512636, 4388, 0, 0], [115521210, 0, 0, 0, 33036, 20940], [-250127485, 0, 0, 0, 283463, 29320], [0, 107307, -372065, -67796, 0, 0], [-222320998, 0, 0, 0, 34058, -100872], [0, -1145973, 193425, 66730, 0, 0], [-153112212, 0, 0, 0, 240639, 119679], [0, -3764619, -1214097, -35623, 0, 0], [0, -1531689, 852731, -56836, 0, 0], [0, -6096537, -888309, 20829, 0, 0], [-108534347, 0, 0, 0, -238199, -305344], [-141121886, 0, 0, 0, -380370, 76686], [0, 1013383, 1813399, 145776, 0, 0], [0, 12658557, 305523, 36149, 0, 0], [-448179334, 0, 0, 0, -471116, -31116], [0, -13200763, 1483874, 11406, 0, 0], [0, 12691695, -63333, -281420, 0, 0], [577236450, 0, 0, 0, 794592, -82080], [161754535, 0, 0, 0, -975989, 212216], [113349686, 0, 0, 0, 449414, -255096], [0, 12961491, -2246715, -51170, 0, 0], [0, -7110027, 1527870, -252974, 0, 0], [233255088, 0, 0, 0, 747216, 461472], [0, 21443359, -2384791, 218758, 0, 0], [0, 16437963, -3949005, 23000, 0, 0], [-1240708008, 0, 0, 0, 1274775, -138825], [-156828830, 0, 0, 0, -1042402, -553602], [0, 8498559, -1385657, 261313, 0, 0], [0, 17927991, 4963839, -297608, 0, 0], [1462543182, 0, 0, 0, -1117290, 13680], [-1292916760, 0, 0, 0, -514353, -800145], [1122525925, 0, 0, 0, -592967, -152832], [0, -2379579, -2236219, 404819, 0, 0], [1808301960, 0, 0, 0, -518457, 475623], [749276626, 0, 0, 0, -1035138, 560094], [0, -12470373, -3070577, -227156, 0, 0], [646790210, 0, 0, 0, 43402, 1189440], [0, 23323543, -559571, 180651, 0, 0], [1876177660, 0, 0, 0, 2714356, -922504], [508602151, 0, 0, 0, 1901907, 500784], [0, -34049411, 3726476, -113132, 0, 0], [0, -26767017, 10541604, 105276, 0, 0], [1293912813, 0, 0, 0, 16857, 1239432], [0, 13118199, -1658627, -481622, 0, 0], [1296585258, 0, 0, 0, 1113594, -246246], [0, 19868061, 11411235, 908805, 0, 0], [0, -11542689, -10486311, 934102, 0, 0], [0, 12335103, 8321115, -869875, 0, 0], [0, 37598163, 7251349, -190514, 0, 0], [0, -48508761, -230921, -230639, 0, 0], [-1744773990, 0, 0, 0, -3715494, 531066], [0, 92014917, -742527, 269239, 0, 0], [4459883354, 0, 0, 0, -365572, -386244], [0, -6689123, -4192243, -484277, 0, 0], [-3607467294, 0, 0, 0, -1757640, -86856], [-972290975, 0, 0, 0, -1113227, 1907888], [-1096214612, 0, 0, 0, 4582335, -1711425], [-4012604452, 0, 0, 0, 936700, 105552], [0, 14320071, 16996431, 971704, 0, 0], [1845680668, 0, 0, 0, -996497, -54673], [0, -143727027, 5339685, -814989, 0, 0], [-5991515747, 0, 0, 0, 5840201, 1360776], [4244315672, 0, 0, 0, 2668175, 1192495], [0, -22242321, 15657459, 2004661, 0, 0], [-86612781, 0, 0, 0, -9765129, -397464], [0, -104932341, -6923177, 503572, 0, 0], [0, 134012007, 12303700, -1413236, 0, 0], [0, -76584789, -17005101, 386072, 0, 0], [3455146856, 0, 0, 0, 1040295, -543801], [0, -78925833, -14087671, -2181634, 0, 0], [0, -161468579, 6613736, -541736, 0, 0], [0, -127485993, 5118078, -594286, 0, 0], [0, -153241241, 11245081, 1078878, 0, 0], [0, -9129969, 33492417, -659618, 0, 0], [2825383490, 0, 0, 0, -10334086, 1785424], [-6344461295, 0, 0, 0, -7597211, 4661040], [0, -196140081, 12787647, -1507952, 0, 0], [0, 39494511, -29542164, 654772, 0, 0], [4520784839, 0, 0, 0, 846995, -38384], [-4623245098, 0, 0, 0, 9288606, -520944], [0, -166960653, -38555073, 187668, 0, 0], [-3961069982, 0, 0, 0, 5817646, 446606], [1073446760, 0, 0, 0, -802409, 6797751], [0, -167183809, 18796793, 3228822, 0, 0], [0, 38833863, -16321146, 2662986, 0, 0], [0, -27628897, 17590285, -3292030, 0, 0], [-2787663150, 0, 0, 0, 13949070, 1525230], [0, -42595731, -12910539, -3788317, 0, 0], [0, -65246173, 34631093, -2521986, 0, 0], [3384790069, 0, 0, 0, -17214615, 1983456], [0, -44835483, 26970251, 1371869, 0, 0], [0, 257312007, -55279155, 1383914, 0, 0], [19217720555, 0, 0, 0, 13017815, -3374720], [0, -232656069, -46098087, 2489682, 0, 0], [1398777498, 0, 0, 0, 12155658, 7948842], [0, -320192955, -10155282, 5178530, 0, 0], [22732300428, 0, 0, 0, 4678356, -3106968], [0, -88711197, 36467487, 3542948, 0, 0], [189033562, 0, 0, 0, -5526092, 11899508], [0, -358421721, 23045853, -605573, 0, 0], [21701908653, 0, 0, 0, 2029713, 2064912], [0, 342726957, -41605968, -3140912, 0, 0], [22205899722, 0, 0, 0, 4378506, 9444456], [3862875145, 0, 0, 0, 21905749, -4821096], [-17198699560, 0, 0, 0, 15174719, -6541601], [-11031163844, 0, 0, 0, 32639967, 795999], [0, -291923277, -37718333, -6306704, 0, 0], [0, -385490457, -46029233, -4049927, 0, 0], [1491584058, 0, 0, 0, 16235562, -16066998], [-6822867749, 0, 0, 0, 15692967, -1681056], [0, 107870733, -66578728, -6605464, 0, 0], [16879167368, 0, 0, 0, 22397615, 9182287], [27352331345, 0, 0, 0, 4523093, -4016000], [-5117439508, 0, 0, 0, -20331108, 1573632], [0, -199132953, 65317953, 854262, 0, 0], [13469864600, 0, 0, 0, 48564647, -11955513], [0, -538733389, 4748363, -702168, 0, 0], [0, 88862309, -146595031, 2751183, 0, 0], [0, -564799113, -12453957, 2796764, 0, 0], [24985923203, 0, 0, 0, -20735497, -6741032], [-10198786004, 0, 0, 0, 1467911, 4717959], [-18732740710, 0, 0, 0, -1326758, 8404392], [26380112940, 0, 0, 0, -13052577, -6315297], [0, 248284101, 57941844, 6482572, 0, 0], [0, -213329129, -92536771, 8272522, 0, 0], [-23639461697, 0, 0, 0, -20246773, 7593072], [0, 697991763, -67767711, 5816546, 0, 0], [-39889971352, 0, 0, 0, -10416920, 8074272], [0, -23909217, 7868752, -2703824, 0, 0], [0, -179929809, 102748695, -2879400, 0, 0], [-1257764324, 0, 0, 0, 4263487, -16520641], [14665606626, 0, 0, 0, 24821010, -8748456], [0, 1180081659, -46501081, -5444812, 0, 0], [0, 541050543, 33394125, -4442030, 0, 0], [0, 129157839, 150784902, 2958538, 0, 0], [-11127363950, 0, 0, 0, -9071538, -18511698], [18729169872, 0, 0, 0, 32839824, -28957056], [-24183360382, 0, 0, 0, 59526336, 7697472], [0, -809327859, -13888330, 12678170, 0, 0], [0, -479218953, 34422693, -252301, 0, 0], [0, 490561919, 97743751, 16676408, 0, 0], [0, -35618897, -258800486, 3928086, 0, 0], [-16318005204, 0, 0, 0, 725751, 221559], [27220166882, 0, 0, 0, -15889752, -16248792], [0, -1021807641, -51977331, 400906, 0, 0], [-17501662, 0, 0, 0, -617680, -31755728], [15141492171, 0, 0, 0, 92528511, 1241784], [0, 920381787, -200866355, -2450786, 0, 0], [-28838458558, 0, 0, 0, -32611878, -12173328], [0, 144183387, -136799955, 4137790, 0, 0], [-64189978150, 0, 0, 0, -13633780, 12193740], [0, -61839827, -70406905, -14519039, 0, 0], [0, 326277303, 186788155, -1657700, 0, 0], [-19809578080, 0, 0, 0, 99677280, -19959360], [0, 785670879, 5159494, 9858826, 0, 0], [-7925119380, 0, 0, 0, -10234521, 25642599], [0, -699965379, 110526309, -2599373, 0, 0], [28748694248, 0, 0, 0, 33471295, 50211807], [0, -875844981, 85021451, -3736192, 0, 0], [-27435121559, 0, 0, 0, 4183101, 34300944], [0, 816289557, -184925095, 14051615, 0, 0], [67472058335, 0, 0, 0, -2340085, 27323920], [-25640621942, 0, 0, 0, 28444570, -565830], [-6872309506, 0, 0, 0, -32601402, -41131344], [46425904232, 0, 0, 0, 106422047, -22196033], [70392290753, 0, 0, 0, -89449867, 2994832], [0, -913132561, -181481057, 13898192, 0, 0], [0, -605286393, 368977203, 6005044, 0, 0], [25949262685, 0, 0, 0, 116858521, 5625336], [27930089560, 0, 0, 0, 71139247, 22751567], [4894829402, 0, 0, 0, 41081698, 58449888], [0, -2728066537, 388872559, -10720039, 0, 0], [0, 1608559851, 228346917, 19361302, 0, 0], [33934382508, 0, 0, 0, -22367073, 61179807], [133235199940, 0, 0, 0, 21571252, -9027808], [-7265872193, 0, 0, 0, -19927645, 9282648], [0, 911482557, -390096682, 9827834, 0, 0], [0, 1290110259, 123522039, 20980316, 0, 0], [0, 58928775, -64781943, 19366255, 0, 0], [42439375832, 0, 0, 0, -128480552, 1416288], [44974550268, 0, 0, 0, 36892335, -27631185], [0, -1126672179, 12712500, 44107820, 0, 0], [34209307266, 0, 0, 0, 72456234, 79913184], [48959995160, 0, 0, 0, -222550505, -11706825], [0, -937828069, -92685397, 12356592, 0, 0], [0, 199636501, 228860567, -27099023, 0, 0], [103244410183, 0, 0, 0, 35382787, 9196832], [0, -782992361, -572660048, -21592752, 0, 0], [0, -1547380539, -509123361, 3124457, 0, 0], [39756405955, 0, 0, 0, -66910217, -10055400], [0, -800290965, 173168577, 950490, 0, 0], [34918801914, 0, 0, 0, 15362004, -64041324], [115699114985, 0, 0, 0, -57958003, 1291072], [-49518796540, 0, 0, 0, 67102476, 9008520], [0, 1835925087, 610029793, 142039, 0, 0], [0, 961542237, -453995964, 10444444, 0, 0], [93684129630, 0, 0, 0, 82703622, -81282480], [0, -1428314937, -82316373, 11728188, 0, 0], [123560464482, 0, 0, 0, 105798864, 53542224], [-8379810117, 0, 0, 0, 98670303, -36283128], [43577940700, 0, 0, 0, -94952097, 35448543], [0, -514990021, -461577845, 21155120, 0, 0], [0, -2353126105, -33627398, 28330550, 0, 0], [0, 73705851, -85914441, -40208988, 0, 0], [0, 99924837, -80134248, 22687528, 0, 0], [0, -1856998713, 636678473, -27654898, 0, 0], [-152483632670, 0, 0, 0, -21323346, -13144050], [-59335973104, 0, 0, 0, -102528560, 93681024], [0, 3738978303, -115179716, -13459484, 0, 0], [0, 109677279, -84796131, -29161422, 0, 0], [0, -2773606401, 210356211, 27712684, 0, 0], [4830206040, 0, 0, 0, -195156609, -14684385], [0, 1877683263, -34889301, 39152701, 0, 0], [0, -2079086477, -315528341, -10018104, 0, 0], [-209738277652, 0, 0, 0, -104586385, -19724945], [0, -2045585739, -316669212, -62260868, 0, 0], [0, 1064166671, 346524533, 32973642, 0, 0], [0, 498815451, -525085491, -10738658, 0, 0], [0, -1661923497, -286203711, -14070409, 0, 0], [157369551244, 0, 0, 0, -222587665, -17160849], [-44781176980, 0, 0, 0, 229802156, -69331344], [-233525885950, 0, 0, 0, -197807144, 5612760], [-35154343763, 0, 0, 0, -176094391, -51640872], [0, 4143394757, 490826231, -22922991, 0, 0], [0, 1067846967, 716757525, -13222766, 0, 0], [31120832188, 0, 0, 0, 349278255, -12682065], [0, -3332751785, -592114025, 50056305, 0, 0], [-6089213244, 0, 0, 0, -276944100, -69162696], [-73081086737, 0, 0, 0, -10260381, 22969224], [-162881975003, 0, 0, 0, 128410225, -135544312], [0, -974776977, -411465273, -78998424, 0, 0], [0, -5305545363, 424824954, 10743606, 0, 0], [-150971033278, 0, 0, 0, 216296882, 53173912], [-59107156648, 0, 0, 0, 233220343, -41715177], [0, -1102935493, -693053983, 24693258, 0, 0], [18548094385, 0, 0, 0, 351641821, -25641384], [-41958328070, 0, 0, 0, 233927260, -74787940], [0, 2023259875, 581471215, 76532820, 0, 0], [0, -2070624377, 74717635, -36622875, 0, 0], [-344192498276, 0, 0, 0, -55088825, -39342649], [0, 425842877, 599510033, 4204839, 0, 0], [0, 1134918219, 987812511, -60520116, 0, 0], [0, -2154711233, -181193615, 70870494, 0, 0], [49134496052, 0, 0, 0, -181992420, 26903400], [0, -526349949, 390095975, -9875140, 0, 0], [0, 890715045, -223266397, -19295995, 0, 0], [0, -748149777, 741695697, 81584743, 0, 0], [139510719562, 0, 0, 0, 20252394, -157906422], [0, -5931844837, 834591253, -13899178, 0, 0], [335343072530, 0, 0, 0, -164024190, -98689320], [0, 4184430919, 500032576, -7958976, 0, 0], [0, 2934900885, 1403122095, -26574695, 0, 0], [-63130644760, 0, 0, 0, -193819769, 20040615], [0, -3872798003, -950802199, -7296881, 0, 0], [0, -9600843645, 12561897, -9073590, 0, 0], [143320454205, 0, 0, 0, 168357201, -87289824], [0, -8208009729, -54505815, 135337510, 0, 0], [115148440698, 0, 0, 0, 186891306, -158203848], [0, -5099839797, -720773725, -131461144, 0, 0], [-212327839688, 0, 0, 0, 105150319, -64228081], [0, 3544111839, 624776697, 31966463, 0, 0], [-202181176129, 0, 0, 0, -165353653, 11600944], [-60836672420, 0, 0, 0, 124056815, -67781265], [0, -2871242889, -684207524, -152663228, 0, 0], [-16115268408, 0, 0, 0, 482019960, 98298480], [247581560354, 0, 0, 0, 255519984, 122056176], [164105478370, 0, 0, 0, 302356792, -38888008], [0, 9306663495, 261273660, -13584540, 0, 0], [445939652386, 0, 0, 0, -234016738, -126461826], [0, -4240739921, -368956589, -87832452, 0, 0], [363500097500, 0, 0, 0, -322930788, 68733360], [-53655751798, 0, 0, 0, 513159674, 147456538], [-192138009928, 0, 0, 0, -299383881, -50909481], [0, 7573081023, 121812264, -97907304, 0, 0], [0, -1458910059, 1554207645, 47003835, 0, 0], [-317992276236, 0, 0, 0, 170619948, -209058024], [0, 1356828791, -613966909, -34374636, 0, 0], [0, -4525301517, -1198039323, 5673246, 0, 0], [0, 6965819623, -358419401, 104548656, 0, 0], [526611890840, 0, 0, 0, 380326216, -23367504], [0, -4662044721, -1644660569, 131680609, 0, 0], [0, 7064206605, 1744815600, -11468400, 0, 0], [0, -5598461083, -698025604, -24152796, 0, 0], [0, -4244292273, 513973935, -72238176, 0, 0], [-484274909054, 0, 0, 0, -467483600, 159049904], [-193080831092, 0, 0, 0, -950315065, 174732615], [-104071523290, 0, 0, 0, 99325526, -130194840], [0, 11011398771, -1038426453, 56019848, 0, 0], [-471670897054, 0, 0, 0, 28354862, -136063346], [0, -5388251457, 1616078465, 31791566, 0, 0], [112432087843, 0, 0, 0, 362729847, -76370568], [0, 2134637599, 509912521, 34875174, 0, 0], [0, 7651687791, -677216894, -8115218, 0, 0], [0, 7969558743, -74124633, -182445904, 0, 0], [0, -6923658963, -159239439, 1187399, 0, 0], [-106759356738, 0, 0, 0, -198554202, -243979632], [0, 6096917667, -704925841, -54267244, 0, 0], [0, -9723482625, -434074530, -141191630, 0, 0], [-186160612022, 0, 0, 0, 187776938, 168312522], [0, 1824355323, -613757483, 38696566, 0, 0], [145751231570, 0, 0, 0, 346034122, -6198960], [0, -14761036869, 432916287, -70773348, 0, 0], [179058538620, 0, 0, 0, 313043463, 214231815], [-302486054020, 0, 0, 0, 397435964, 106514224], [0, 5542963485, -980996350, 167712110, 0, 0], [44991717720, 0, 0, 0, 1016469831, -102143385], [-596601360659, 0, 0, 0, 495483601, 204345104], [0, 787179807, -189524619, -129736486, 0, 0], [272087744908, 0, 0, 0, -61475849, -357345289], [-1010184182486, 0, 0, 0, 96193018, 9962456], [0, -8236317659, -1949844778, -29313158, 0, 0], [0, 10217217423, -998377296, 80329936, 0, 0], [-314734747316, 0, 0, 0, -538016185, 144665031], [0, -9578016717, 544085773, -163443338, 0, 0], [200271708043, 0, 0, 0, -531623953, 108657672], [599693027098, 0, 0, 0, 77354762, 442629162], [0, -11175926817, 876612787, 236366581, 0, 0], [0, 1517480013, 2142109905, -28696729, 0, 0], [-656254629082, 0, 0, 0, -495830074, 221195512], [0, -11979306189, -237924043, 78211982, 0, 0], [152416508173, 0, 0, 0, -401465655, -289066440], [0, -8040292617, -1212806289, -229619896, 0, 0], [0, -4384535353, 2201740750, 147283394, 0, 0], [-736614912188, 0, 0, 0, 124459180, -70050520], [-752759624998, 0, 0, 0, -11267412, -214298772], [389611610360, 0, 0, 0, 178897079, 152847319], [169485827362, 0, 0, 0, 519058030, -481576242], [0, 11061785543, 97567207, -45124384, 0, 0], [435852642450, 0, 0, 0, -1091023842, 114649470], [-802888578287, 0, 0, 0, 394636253, 145386552], [-836624403558, 0, 0, 0, -754714068, -12635412], [0, -6965858001, 265726428, 331308868, 0, 0], [-188318727641, 0, 0, 0, 359677915, -502444504], [-448716778, 0, 0, 0, -196547962, 523464168], [0, 19426034067, -1818712311, 22668986, 0, 0], [0, 16462143381, -2095403208, 86422408, 0, 0], [-894357287696, 0, 0, 0, -386654432, -171816304], [-5932371430, 0, 0, 0, 3932796, 7499196], [0, 17033931231, -472777855, -187155730, 0, 0], [0, 11375501853, 2079639455, 122171561, 0, 0], [0, -8870862297, 350439888, 9995312, 0, 0], [-441479940007, 0, 0, 0, -1389281443, 140359072], [743212817314, 0, 0, 0, 597460030, -151837794], [783021490340, 0, 0, 0, 973589620, -75032640], [170544506570, 0, 0, 0, 1150997498, -273626342], [0, -14645361699, -620275536, 380945872, 0, 0], [0, 12675380163, 300844997, -86202994, 0, 0], [0, 7316178279, 933221763, 570308, 0, 0], [-189538870584, 0, 0, 0, -215431065, -595481721], [-332405566654, 0, 0, 0, -452935046, -450542256], [-18006440262, 0, 0, 0, 377036058, 303286842], [0, 12491836455, -186762937, 12086240, 0, 0], [522891386743, 0, 0, 0, 402418299, -246270696], [0, 14564036163, -65683611, -253237394, 0, 0], [290215635912, 0, 0, 0, -670192737, 248540223], [0, 241048599, 355251432, 37441368, 0, 0], [0, 5110356495, -2327749823, 148975735, 0, 0], [388968652514, 0, 0, 0, 591244504, 187879896], [0, -9853496053, -822948811, 8372646, 0, 0], [0, 5852185541, -242729428, 104467188, 0, 0], [0, -19769438193, -859915812, -44735676, 0, 0], [-526308952292, 0, 0, 0, 1322462223, -208074993], [0, 9544746771, 3192086749, 338899462, 0, 0], [314572039880, 0, 0, 0, 665259080, 485188000], [-213867773765, 0, 0, 0, -527498961, 106877880], [983378941544, 0, 0, 0, -1402738657, -282476609], [433254610497, 0, 0, 0, -624918891, -51804432], [0, 4209436527, 45659905, -338888066, 0, 0], [0, -317395833, 5326083645, 142422650, 0, 0], [-1065503144586, 0, 0, 0, -1105491642, 545348616], [0, 23213298613, -1195041790, 134489326, 0, 0], [-308201397422, 0, 0, 0, -538584738, -229366338], [0, -14130251957, -5237650727, 208555362, 0, 0], [0, -10939049161, -2147506895, -132493945, 0, 0], [-583011114580, 0, 0, 0, -517483873, 670214047], [0, -1322526411, -3278942529, -133980407, 0, 0], [906738744485, 0, 0, 0, -152473735, 695910400]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_256_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_256_8_a_r();".
// 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_256_8_a_r(:prec:=6)
    chi := MakeCharacter_256_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_256_8_a_r();".
// 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_256_8_a_r( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_256_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<3,R![-4610229696, 0, 13205808, 0, -8020, 0, 1]>,<5,R![-412405245440000, 0, 19577926400, 0, -254032, 0, 1]>,<7,R![441929216, -1048384, -344, 1]>],Snew);
    return Vf;
end function;