
// Make newform 315.8.a.q in Magma, downloaded from the LMFDB on 30 December 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_315_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_315_8_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_315_8_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 := [146417544, -2181234, -18019982, -78223, 214693, 1124, -832, -3, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0], [-208, -2, 1, 0, 0, 0, 0, 0], [645, -313, -5, 1, 0, 0, 0, 0], [-64106712280, 7287667622, 3474555084, -95289051, -21685840, 417668, 32908, -639], [710236072, -22850371822, -661877948, 304847183, 5852672, -1239124, -11548, 1555], [12880491576, -11251383726, -5311691084, 381192495, 44144648, -2473564, -82020, 4171], [-2058185000, 1402092822, 168184446, -57142863, -1512467, 359669, 3469, -556]];
    Rf_basisdens := [1, 1, 1, 1, 10948192, 5474096, 10948192, 1368524];
    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_315_a();"
function MakeCharacter_315_a()
    N := 315;
    order := 1;
    char_gens := [281, 127, 136];
    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_315_a_Hecke( : Kf := Kf)
    return MakeCharacter_315_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]];
    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 := [[1, -1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [-125, 0, 0, 0, 0, 0, 0, 0], [343, 0, 0, 0, 0, 0, 0, 0], [-123, -17, -1, 0, 1, 0, 0, 0], [-1355, 151, -10, 1, -1, 0, 1, 0], [-4148, -132, -3, 7, 0, 0, -1, 2], [2990, 612, -76, 14, 4, 3, -1, 1], [-13739, -101, 34, -13, -7, 5, -6, -3], [-43578, 158, -279, 5, -8, -20, 9, 12], [29248, 3212, 23, 15, -8, -23, 10, -31], [23154, 110, -207, -171, 2, 36, 9, -18], [-89601, 7281, -1659, -50, 53, 5, -3, -19], [34383, -2945, -550, -153, -19, -47, 2, 81], [-5455, -975, -214, -207, -105, -15, -100, -95], [-202453, 11083, 1371, 292, -183, -130, -18, -34], [-200600, -2300, -2148, 216, 100, 180, 20, 20], [-215916, 53130, 4579, -33, -244, 68, -173, -24], [-684102, 90342, -4953, -345, -68, 52, 155, 84], [-748005, 51055, 1488, -33, 689, 100, 139, 402], [-30485, 88889, -1660, -875, -171, 224, -235, -112], [-114685, 223715, 4005, 676, 783, -321, 81, 123], [-957563, 55853, 21881, -830, -471, 335, 175, -245], [-1404996, 201506, 23256, 766, 78, 230, -304, 358], [1339945, 213311, 15518, -2447, 55, 568, -647, -744], [-3010495, -4085, 20237, 3964, -401, -1025, 969, -253], [1057012, 134488, -45982, 310, -372, -472, 30, 1336], [-3394321, -485979, 36182, -3215, -1025, 165, 1056, 713], [4175911, -32875, 12963, -1176, -963, -1589, 1369, -153], [-3294241, 108171, 3235, 1708, 1233, 850, -214, -1182], [4236439, -567085, -6591, -8216, -213, -1109, -1671, -653], [-17719264, 692884, -44580, -1396, -1892, -2610, 390, 650], [-13288177, -436213, -44907, 1742, 3213, 580, -1454, 128], [12543678, -405268, 147740, 3342, 128, 2635, -873, 925], [-12080676, -78064, 141101, -13725, 1402, 3540, -2481, -668], [1671537, -1475155, 17611, 15084, -1723, -1759, -1361, 617], [-7593777, -2028751, -38862, -7505, 589, -1616, 2495, -5532], [-22735187, -1520443, -84544, 16315, -10613, -893, 3340, -5301], [-17245528, 1005088, 187239, 15997, 3182, -3090, 1471, -6062], [-23244394, -1404896, -125360, 7052, 6868, 9750, -2418, 246], [-20981969, -1127031, 184669, -8544, -1409, -5510, 2894, -4898], [-136404, -1384410, -100449, 20659, -4308, -5194, -4451, 1722], [8140259, 2275471, 436902, 5621, 3185, -270, 10715, -160], [-3615402, -3946208, -427634, -5306, 3544, -6342, 1844, -5894], [16478743, 402487, 645921, 14118, 4181, -2460, -6462, 16484], [-5130226, -1840062, 467273, -529, 5466, 1567, 2076, 4419], [44753857, -2294455, -562293, -11244, 11813, 13919, -7519, -5737], [-46858186, -152090, -480108, 19058, -30106, 10072, -8502, 2984], [-71685149, 2954879, -612653, -26778, -13581, 20245, 821, 17193], [47975366, -5098632, 688761, -349, 2186, -8318, 8001, 17854], [64797459, -4245469, 1124761, -2938, 8541, -7130, 12704, 16822], [-48205643, 327833, -259802, -23169, -2241, 7490, 19285, -23380], [-11583412, 1405710, -170530, 39776, 26258, 9344, -10784, 10208], [-34015148, 3884348, 725736, 3092, 10568, 10860, 5960, 32240], [-113183548, 1664708, -932613, 87685, -57300, -22310, -3189, -26552], [-52706885, -8565435, -233416, 26839, -68061, -15435, -18210, -32375], [-71364357, 3231897, -1009823, -48462, 425, -26315, 21153, -37071], [-46715810, -4315318, -420673, -129915, -898, -6183, -3600, -47631], [42414992, -10158832, -392523, 61363, 60372, 2340, 2343, 6990], [79802568, 9806852, -602756, 16308, 27320, -8050, -34066, -4298], [-175662044, 7183880, 309024, -4088, -13464, -34832, 7832, -8624], [73011744, -24569534, -506254, 69052, -27134, 32950, 3294, 14022], [-137668968, -1482424, -692714, -46458, 96412, -6366, 41052, 91678], [-193306284, 18327084, -2643978, -42366, -59616, -7690, 11844, 22762], [-12198847, -21481133, -808710, -34399, -2085, 39276, 2021, -14628], [241451893, 5533557, 1127315, -150382, -9137, -26220, 33806, 1508], [88302907, -26029701, 1384485, 55080, -70441, -84811, 38775, 23853], [107522832, 15100618, 780896, 224898, 64202, 34780, -33322, -16980], [-16045933, -12679547, -2067842, -135603, 100835, 50055, -38078, 68611], [-9085554, -12855164, 213111, -82255, -127734, -94294, -77145, -50098], [94953022, -24701722, -166445, 415643, -18930, 2920, -19813, -13894], [398927195, -724845, 3951308, 49147, 123997, 40350, 35013, 6464], [73746974, -31925378, -726952, -88890, 104222, 90872, -22930, 113824], [322877070, -37041910, -1228125, -27105, 150310, 141580, 33275, 100010], [-434599421, -7556625, -2857157, -62310, 184375, 24095, 49895, -65525], [-274266600, -36214980, -2697117, -10203, -74758, -155030, 73083, -11026], [-132292762, -22763698, -2475231, 156977, 17036, -22450, 27083, 151174], [-24544683, -52492473, 2424312, 196751, -178145, -95624, 55591, -96508], [-281928024, 55332884, -1970674, -176938, -104552, -21000, 55950, 75600], [-260777912, 4973346, -2065272, -101194, -251666, -115770, -22424, -29210], [-299349474, 8550294, -724034, 17396, -76702, 4930, -108854, -145522], [220835546, -49624752, -2557288, -106104, 102756, -61568, 72616, 93124], [87076467, 52655743, 2139400, -85889, -54455, -149200, -62961, -24818], [328152309, 42252895, 6507068, -105173, -260549, 26828, -97873, -1044], [-878397112, -61276368, -3773523, 644869, -43056, 174333, -44676, -70619], [-831499735, -24880125, -3036516, 617025, 99849, 196025, -4836, -98883], [31775990, 24218990, -4000364, -100578, -150574, 73210, -72756, 185842], [367273444, -53215206, 6138860, 791354, -278374, -104250, 33084, -148110], [-1035225910, 2847300, -5468360, -75052, 207988, 34780, 68936, 33028], [-187283561, 11631483, 5568207, -413206, 167415, -52121, 43199, 123423], [-829691129, 55962699, 4325325, 249184, -190373, 13065, -17733, 203501], [-803606150, -53070430, 2599928, -692518, 172286, -36080, -12150, 160020], [-418271421, -111928825, 7522345, -128652, 66599, 31187, -76867, 64979], [-889370717, 53168957, -7636903, -752816, 252755, 203030, 14962, 22186], [-591235793, 1279411, -4599037, 607638, 87355, -142577, -145517, 231931], [-1279208406, -146126474, 4075615, -170977, -54336, -355240, 188719, 5732], [-1396859523, 76742403, 13662953, 937184, -104041, -53845, 113617, -56449], [-130265337, 70634777, 14202103, 183396, 100333, -219955, 116987, -327839], [-200593594, 41774338, 4155320, -492182, 93222, -54680, -239982, -54300], [2619789718, 134256312, -10024278, -499042, -178644, 187744, -26962, -275952], [-1470723182, 93839078, -3738157, -407445, 468908, -126972, 64815, -172164], [-1052383099, 147253749, 8028003, 725658, 875743, 137080, 87410, 97120], [-327825520, -41148420, 10664708, -296872, 569924, 228560, 130648, 517024], [-3332616956, -53237664, -4880158, -2067874, 32988, -87920, -82066, -466088], [410819989, -59303011, -17132559, 1317946, -343123, -226597, 183371, -293709], [-546816087, 266907443, 4017834, -2023335, 11243, -75912, 39265, 98736], [-3292399036, -12672384, 11973172, 416924, -267928, -109920, -49812, -508096], [-1939716416, -205324684, 12501327, -2496143, 496692, 205690, -38025, -595080], [-730222477, -146945433, -2305134, -1109239, 113225, -89690, 574667, 165156], [2025284274, 209390912, -20318450, 381150, 144472, 325182, -217560, -392666], [-2232669072, -76512680, 20816442, -273710, -407000, 417010, -283320, -208990], [-301725888, 7907388, -5623785, 2994229, 812680, -336056, 95269, 3358], [-978105299, -24926511, -16309829, 686222, 947567, -659220, 456682, 591616], [-1140102512, 133304642, 19000488, 2152108, 20606, -121171, 345803, 488763], [548580455, 332359515, -14708655, 797904, -200773, -613889, 97869, 382007], [-2299111262, -138874418, 10175268, -1554254, -1045754, 824020, -468114, 341108], [-3029226082, 177496318, -4800682, -4022704, 489486, 24412, -106204, -85616], [-820396958, -82320622, -5042717, -119745, -339892, 864060, -675077, 502504], [-4912944185, 244493355, -5012359, 1681298, -472151, -399460, -247498, -165204], [-305258771, 164943391, -7341555, 3302214, -1093975, -235270, -6604, -900102], [1870332554, 166017984, -13206339, -1249225, -107606, 240554, 311245, 127878], [-176502584, 22497050, 7324310, 2500032, -490854, 823598, -836758, 227686], [-4577937636, -34019494, 35080, -2512914, 887458, -179770, 240048, 542434], [-1983249629, 306426149, -13476902, 100113, 195971, -659505, 693934, -695933], [1954827472, -424991614, -26904534, 1072438, 300230, 438203, -42977, 707001], [-538836728, 7871328, -39402917, -539783, -488038, -62530, 394643, -632186], [1635274758, -191792920, 41141156, -212876, 345132, 181176, -378276, -1390908], [-3313392410, 326004830, 8224944, 4894578, -433678, 1106930, -196680, 681010], [-2342560808, -58613660, 36725868, 882796, -2258272, -1220566, -1054774, -786862], [-3789628211, -109177741, -3092550, 2255017, -1166505, -680528, -125863, -811436], [3074238183, -133065129, 11754013, 2154628, 1281915, 625513, 367183, 174641], [6555069649, 33655471, -47439750, -1725669, -111379, 227275, 1206052, -110129], [3894356761, -35761503, -18345235, -342686, -226691, -627797, -52781, -266009], [-7218471864, 466253836, -4050783, 675827, 397272, 1302164, -201673, 938558], [1512657340, -278074970, 44670402, -134256, -315262, -967350, -906114, -105682], [-916569704, 108226606, 23129638, -1132160, 2539106, 75676, 965860, 1534612], [1317149502, 58098268, -25232706, -821430, 357128, -425770, -19364, 1040978], [-4175800546, 425124690, 52813014, 5013900, 2008810, 437600, -412820, 570580], [1067079208, -40030438, 10481042, 2923952, 1811206, 1818060, -134988, -451724], [2507630582, -394722242, -36738212, -1580622, -3858, -824480, -243678, 228576], [2273693944, 632466782, -40204890, -2811022, -959294, -409311, 64893, -1551837], [-3008113664, -669434996, 30005961, 719367, -592846, -428210, 1592513, 1017574], [4633674977, -77169771, 36124345, -2790978, -2726495, 1328857, -62423, -645351], [7650414873, 271399327, -74118220, 1648553, -696631, 384515, -94286, 1557567], [-525776340, 116070390, 46537517, -5384443, -557944, -734042, -770273, -170294], [-2564662402, -317343778, 2997442, -324284, 1519054, -1552100, 1980872, 1909496], [1911701965, -36849937, -22267960, 618887, 2543559, 269216, 1023447, 1096572], [-461920680, 176189580, -3756527, 3275523, -914744, -1103720, -621661, -972678], [-5733662906, 469499812, 8543534, 284872, 1519068, 2153285, -983393, -548165], [2866579545, 87776095, 16091852, -3335059, 1788137, 953605, -1188204, -307787], [-1609833642, 132009078, 71852091, -5957785, -904382, -202442, 516145, -1297384], [-7991278912, 253902722, -6407864, 5661982, 816598, 427190, -263680, -1611170], [5597678320, 333128228, 58434637, -2588493, -122646, -2351394, 2815877, 763502], [-2754629885, 183137035, -26689058, 4286019, 365669, 278375, -41216, -1037273], [-2475655596, 28058624, 21970481, -8805957, -849602, -1323754, -1827947, -2900298], [9961897819, -821174369, -42432734, 7235057, 1165177, -770890, -129053, -263604], [-728422959, 1221774409, -24668199, 4380382, -3684795, 16427, 90287, 72559], [-16044832036, -617575114, -4317214, 5449240, 2143738, 1974950, -1858118, 1074986], [-15070710245, 877108909, 31044852, 8193929, -688079, 1628880, -982471, 63320], [686361678, -88190028, -142593202, 199974, -2766880, -242960, 1782230, -380960], [-7592587087, 206969887, 73636642, 5286311, 2670953, -410335, 1971914, 3950797], [10197917865, -185376975, -65369683, -11343556, -753661, -1394980, -1009416, 1403792], [-5490494122, -254854570, -12818190, 764072, 1000326, -356382, 735822, 1091626], [-13104480404, -1088155876, -13635972, 5844836, 1828320, 2286670, 1762158, 1554694], [482912525, 612901645, -94071445, 5054170, 1623247, 81780, 1053166, 1978188], [3335588697, 818406293, 11845296, -4464409, -4713729, 2290845, -3622330, -4271075], [4078866205, 330046557, -158197171, -2446290, -589583, -1131053, 1729015, 3539559], [900344305, -1309700197, 26714152, 204139, -1686845, 3604004, 1245319, -1170872], [-4911297303, -984896053, -19642967, -8842612, -5682409, 140549, -2821957, -2740187], [-14763227828, -192329182, 27937940, -769094, -2556246, -2719410, 1190356, 1322658], [-4904600903, -562010357, 72816271, -4712436, -519731, -1803600, -2146244, -595152], [512579270, -1037409868, -104038873, 7240901, 186070, -3181044, -535359, 1142832], [14323746275, -703954445, 147150630, 1574445, 2737717, 1497420, -2536399, 1974558], [8717617728, 13047514, 166772716, -5694790, 4144274, 203414, 226700, -250662], [2330633406, -1621541842, -33893967, 8075967, 2693574, -2467939, 2037142, 1001437], [-7242295915, 202133315, 79244463, 9675210, 5322935, -1948305, 1956279, -1842353], [9854752133, -1638139535, -50307881, -409652, 1852589, 4226877, -3640317, -3461991], [664384898, 527421802, 54497389, -3062927, -2554384, 1460150, 681027, 2169246], [5381505560, -1145040620, 190197700, 7241484, 2456712, 2223086, -1217706, -1612698], [-9413941834, -831311636, -47534319, 7753723, 3443738, -2484944, -1779917, 1359652], [-1938780922, -130362914, 35153048, -2453646, 2582698, -2269818, -1447916, 906774], [-21396203574, 429876014, 230871346, -13467676, 477806, 411800, -183588, -1723524], [-6583327664, -1907085180, 221292585, 854623, 3133624, -562758, 3742213, 4618824], [-16718596926, 226066306, 227872143, -12391001, -230226, 45710, -3355063, 1267176], [16790759125, -631984185, -85773798, 6225947, 5171309, -666385, -231424, 1068163], [-12575133293, -122087947, -36168631, 5273110, -726779, 5364365, 1796045, 3859705], [-31462530062, 113422686, -15507455, -11200067, 164610, -139392, 5668293, 293746], [-6939237272, -1987122028, -193720566, 15020974, -4295376, -2141222, -3803316, -411434], [1754029677, -514119809, -52595603, -14591380, 6507571, 471501, 2276275, -2026003], [14021305382, 394900478, -55605080, 22834242, 3779554, -6760410, 3484740, 250670], [-8539291559, -980532441, -142893286, -8454099, 6202847, 6779448, -2431659, 1991296], [19319970075, -420992335, -64730646, 7100489, 4218171, 4329965, -2686784, 3707033], [16157288201, 1679927053, 94203817, 11826526, 7931861, 2779857, 1268321, -1128771], [-25746810766, 584618276, 137275932, -8913800, -275372, -3824240, -3025560, -3167240], [22049815719, 564142741, 146047568, 11616907, -8137329, -2231425, -2344920, 2887955], [21744526292, -1051870792, -260708353, -11447763, 786600, -1666850, 821439, 4085732], [-14926551295, 993098527, -207627089, -11040606, -4183201, -11367, -6549811, -6565879], [-24947836148, 1507881796, -188477133, -2053635, -3687864, -5516594, -541745, 917072], [-25870839150, 1563230450, 33148005, 10141445, 7589538, -491080, -1725691, 1742702], [-4862081376, -402059264, 123682461, -3310881, -6337374, 4805570, 4579757, -2499514], [25766407238, -1396881398, -119972203, 28912077, -449708, -1641120, -1564515, 1233200], [-14705270350, -494783298, -121893947, -18408953, -5736962, 545035, 3416312, 729895], [5502178895, -210924871, 146818520, -18922167, -2202227, -3199044, -1149747, -2342588], [26293753878, -782424344, 126128358, -9458442, -2828040, 8087858, 375708, -4941654], [-8120669278, -2434999822, 74246298, -27770912, 1413286, 9181800, -2930856, -1172128], [23519297348, 1685157722, 54474200, -6038390, -1180938, 9764340, -1906154, -3689792], [31566246336, -1079891464, -32017877, -35079773, -2391408, -660881, 2721392, -3246137], [10120825415, -3179465155, -248174586, 21486153, 412199, -4302955, 3418136, -1582807], [36106503704, -2697917944, -152293248, -42446276, -2087860, -7077590, 4776842, -5521694], [-447373972, -177272246, 144271376, 23095256, 18093562, -1085757, 5315561, -2726239], [10875753586, 2867213508, 77399820, 5759852, -6120796, -742294, -341158, 4320662], [-2282645599, 2114450519, -156122085, -18266446, -2701553, -1143125, -709533, 6659231], [21886923144, 1202713976, 89678412, -2126596, 12983448, 9216152, -1854876, 4825104], [-18100582203, 4625943813, 188879961, -140142, -7895071, -2411245, 4912587, 1180951], [79539634254, -1480617834, 1305386, 5873492, -15707178, -1970580, -1965048, -5028344], [-7681328334, 2175363192, 142604488, -6924044, 8694900, 1383226, 6484066, 7934042], [1877075169, 1900264149, 197800103, -13961136, -14406139, -2603615, -382461, 2411465], [38741580224, 2393419606, 24303810, 1584320, 4133826, 8351650, -250602, 6910534], [2470373527, 6502408513, -122745164, 7529719, 6856351, 6552605, -365658, 117881], [80163961389, -458284199, -321567049, 29260446, 4530311, -2395230, -8461100, -11525910], [-51112886770, 2076671608, -23966980, -16138164, -11787724, 5057192, -116924, 3023644], [35256680308, -91301956, 470137141, 15487393, -3333632, -6485719, 988748, -4321523], [17731119516, 1145979124, -522190462, -21038058, 3318796, 6609450, 662100, 4907250], [-31703704578, 6039122878, -325593496, 40416410, -16686942, 2753658, -7897800, -9108054], [24942956710, -23410010, -350251176, 29024666, -5734350, -4172730, 10565756, 3305398], [14434720473, 2885772279, -185064073, 26204234, 15137691, -7057155, 2402209, 4416905], [10159409864, -2564028904, 299044847, 22781389, -12743384, 7222910, -3146945, -6840700], [80089080017, -2388684007, -35442802, -14819997, 12053015, 16816120, 886571, 3367478], [8875183438, 1066147018, -401266236, -22299726, 12794750, 14758094, -9693716, 1664878], [1107621839, 359863081, -29790791, -22388860, -9676913, -2860590, -12846182, -17150466], [-6505719706, 1360557374, 159625533, 579261, 25967362, 12824078, 1097951, 629316], [15491278082, -5541496344, 162058700, -39084870, -4242184, -5076589, 8281275, 18342177], [-71397097405, -2154447877, -299588751, -40598736, -5682985, -15275441, -10505651, -6814397], [52185430404, 4208386356, -156592520, 389912, -20072744, -3450450, 3097826, -11993682], [32680190512, 3051298560, -24822418, -10579978, 6306236, -6934902, 9557972, -3478674], [68696280593, 2377957437, 206218118, -4818895, -1904813, -12892895, -3597780, 10400345], [50519114902, -339346960, 230391578, 19011686, 3021228, 19157384, -2771314, -8982192], [-25877879279, -5043903951, -287444661, -20143598, 529047, -1707230, -6042184, 5377498], [69890664979, -1991253339, -566766159, -21121032, -17463477, -1101750, 3084534, -2820218], [8816213500, 6035456180, -280399452, -3015392, 4823316, -1158280, -5638936, -8046448], [25084342351, -4376042511, -287496688, -15323893, 9242215, -6743335, -9700346, -881523], [-12815955142, -725402228, 242012886, 67772276, -5230240, -9891509, 9207501, -6564583], [-107704703496, -2428872768, -621151404, 32406628, -233304, 11185724, -10511352, -1686252], [37740158665, 3933029147, -85268481, 59838526, 22774675, 200121, 835241, 6296657], [-23240954514, -2979101386, -359631687, 6739649, 13358010, 22968190, -4325405, -3911940], [7403227394, -6253316334, 300507392, -10683046, -25193402, -3387460, -2755954, -4422752], [25917124438, 2989711818, -258073270, 25295336, 11198446, 11639092, -12814604, 5738804], [60946233648, 1089639892, -222538808, -101846916, -5504796, -761060, 5216944, -1947068], [22492199887, -3357081101, -151259713, 30257306, -1914533, 10983823, -6979209, 18816771], [16561771855, -2295470315, -474719774, 41856241, -14560113, 6065335, 11087758, 5467239], [43737927488, 180364688, -188434207, 18981219, 3365580, -44006, 10493129, 10406928], [-27105121384, -3031454986, 219405866, 106640, 18022138, 24587910, -17930318, 5589626], [110680113353, -756057053, 65059270, -53300681, -15831127, -7177515, -464930, -14280115], [41871298982, 5179513544, -865576624, -9868176, 17588896, -2655540, 4513044, 15226300], [-34217627876, -2831281294, 308862960, -5052030, 31931878, -896960, 13454994, -11332948], [12160179129, 2445518511, 310341505, 39177582, -4133031, -14151680, 8041390, -3899580], [-71833380649, -3905782367, 188235193, 49832830, 16910053, -9201917, -1842585, 10490591], [35365045558, 2017817218, 157889418, 13639372, -6790486, 3798506, -11323558, -12844198], [-83175761828, -3764220622, 266250536, -7925918, -11044386, -15674820, -9185722, 2207784], [96094360905, -3166101917, 536036, 73984815, 14204423, -25396232, 4612535, -4499304], [13539519315, -4795178185, 292690599, 4321678, -5037341, 5607127, 11324403, 25749759], [5974754029, 6267977831, 513354564, -49986267, 8836373, 18279125, 8256708, -6857831], [24976610106, 1261884292, -101465313, 9882297, -13087902, 9708530, -1239673, -32415570], [-65686654297, 8984588141, 478173974, 30236159, 7262773, 7545132, 14814339, 11463564], [-19225809692, -1978155988, -131936935, 49466639, -20932188, -6350950, 13927077, 4013036], [23395505806, -530779888, -541443480, 23428026, -38833540, -19871059, 6399481, 9631667], [-70410635504, -1780633996, -69408709, 57450021, 2596422, 4604250, -9476797, -5793886], [-62061047889, 6073659529, 1013249539, -76614264, -293795, 3583365, 10175911, -2705647], [70245553740, 4278900408, 891204087, -67454275, 3075338, 15272838, -8153865, 7296126], [35803699091, -5950708161, 219501799, -57707968, 5546241, 28494080, -4490912, 21295584], [-38283713366, -7090843616, 43323807, -65448199, -5292358, 12595628, 3166581, -22588824], [-16869855963, -4300106995, -446913970, 50357061, -49168857, -21761301, 7205086, -15711637], [-74779713295, 2614322175, -943113004, -30561077, -3339061, -4914088, 5767283, 28773424], [7582570005, 8379087065, 198261053, 31863778, -521071, -24454433, -8164577, -17056321], [139696133021, 6238036019, 353568564, -38758217, -24385777, -3402044, -21502717, 6228212], [68744225454, -4203688942, 27696510, -50449500, 18582758, 34326888, -14327540, -5081064], [157793611575, 3243846045, 691870950, -41984615, 23487319, 13149485, -2579248, 18881921], [-34013024230, -3584057572, -497557448, -127428, -19020016, 217476, 11190472, -17999808], [-18304251070, 11395196188, 530898380, -2312064, 41264636, 3026312, 2890296, 26225104], [-33999009066, -1099470534, -67134498, 106185328, 20973810, 7997830, 2854338, -8463786], [26723762681, -502690371, 42726280, -37338497, 10821159, 11539745, -29676406, -9660583], [-184886106733, -9479540677, -70911175, -14215344, -16794209, 11091627, -25683359, -1731761], [27763753635, -3199346145, 686613424, 84281677, 27548877, 16153915, -4832554, 10069363], [-9491972174, 15147565232, 718426301, -25538093, 9876278, 19702560, 5012187, -7886780], [81575689000, -14168063500, 729228550, -61134782, 8431664, 10702882, 22127048, 25175414], [66557642659, -19550017349, 49071768, 10759087, -16401451, -10485190, 7855469, 3854092], [-13340467606, -6482760376, 876170702, 87493322, 27159240, -8854328, 3998962, 10449164], [-137055980361, 11253396151, 629130211, -30164568, 15683181, 15614070, -17329046, -43849378], [34563805664, 3216810508, -740718517, -42533533, 30411744, -11177219, -11507398, 21095677], [-125103229720, -17059930630, -46129450, -84639576, -32692466, -1579970, -10774542, -26465686], [-249964358740, -120286800, -1166221129, -32733523, -47007582, -11913250, 1231255, -190010], [-151015582007, 10132673937, -1190789601, 12137680, -26263471, 12984535, -17983931, -7794533], [-14341648243, 5672014733, 561924739, 45563786, 17096263, -29433040, 24663810, -28600600], [102472343860, 9636543080, -314349768, -37505040, -4191680, 30016940, -21735724, 17516428], [-92250897384, 9981794136, 678214231, 67686021, -33293516, -23443230, 27977011, -19439380], [-182383508650, -7366812080, 188315134, -32435158, 5327884, -14202860, -6629818, 63116], [-41857741472, -9047204232, 911258995, 58283371, 30525136, -21239593, 22403056, 14448239], [-52664280136, 1909063346, 135660876, -152536854, 10573410, 13988490, 21124792, -6248114], [34120146602, -5669370422, -1231619466, 12471720, 36715574, -17781410, 25352114, 7319042], [-59091003360, 4353809948, -380509788, -87873116, -28760220, -46691266, -6859746, 12998858], [43596109395, -19408003787, -868500820, 11745425, 33560393, 1748788, -11546355, 10614116], [1588685643, 19175341887, 829679381, -72003310, -11110563, 35722320, -18550926, -16120448], [20486094555, -15031392713, -19928121, 42049466, 3930415, -7544879, -4312819, -35561703], [-24727096679, 6775949999, -225248906, -66038821, 3584169, 2822405, 36490490, 10638625], [-159032597389, -4267535093, -724409173, -65733054, -19710165, -18439859, 22823401, -901123], [-5578480594, 8276956252, -398852804, 41656604, -23336196, 22675358, -12937146, 35462066], [4972481347, 1967150933, -260852136, 212456127, -30857925, 5088005, -34773250, -19381535], [176181167654, -6951828464, -56298541, -100508943, -21490658, 8157834, 7930807, 29854638], [232862688091, -5434941041, -81000608, -117496497, 23828329, -43018140, 27359195, 12815370], [-121192135146, 4317358170, 132388107, -123179997, -7802026, 27170802, -39267487, -28322996], [140034215379, -219012449, -1688834430, -185000197, -35613375, 11736115, 3764412, -44061349], [-30828547044, -15534779356, 1409672767, 39441545, -28276410, 39209190, -22148629, 1088558], [-10649179856, -5555944884, -63169718, 259601338, 70511976, 47239340, 103886, -21890612], [-81303794904, -26951943076, 796018161, 42642807, -27094350, -12385498, -3154783, -16337906], [-131887010213, 16539057913, 377837282, -26795299, -4300749, -39321525, 21287798, -12673581], [114730802374, -1626614784, 871370598, 177041782, -6985368, -19552346, 19630552, 7671038], [176981810342, -11274397722, 602168502, 8630880, 38555434, 45748820, 14930108, 17404044], [178500046929, 17058426701, 120827088, -9962771, -9550245, 39461420, 28700465, -55235330], [9536515249, 5123821919, -766449086, 44479189, 23057591, 33939940, -38936831, 6605300], [-245290588278, 2214965238, -433695650, -40739388, 74237734, 25131230, -6800690, 33208550], [65253584050, -20514243344, 281331034, -127620648, 26410992, 63603549, -22528553, -27161117], [144333116318, 848024856, 710174076, 144602724, 21722008, 43130612, -31437056, -29212316], [-175591907710, 11423544300, -1495751874, -84766002, 86273496, -23241440, 13381038, 62439664], [-123870778466, -6461194082, -1110190042, -60308964, -1718914, -39143598, 6218226, 49595714], [-153407294803, 9721347933, -345495895, 13116832, -10751821, -48622050, -16346350, 4338770], [43823825590, -13122447496, -316392184, -69896964, -65707788, -1822762, 28089166, 27529006], [234108140383, 13501336591, 1380527743, 47171018, 5811975, -12224487, 6038133, 56649441], [68600665216, -20536359476, 634065670, 6275190, -106815896, -27296296, -10645890, -66707272], [90860748989, 11560707631, -1214309490, -28367869, -57845235, -32545495, 56722694, 12441057], [-345263127251, -2429541199, 1285153987, -23018186, -1817861, 42202320, -35409786, -45083848], [-153626603485, 10997034445, 880698815, 194642012, -29112279, -17871977, -11984623, -28028249], [-136633860423, -13935962427, -1406966169, 28955042, 34548371, 22471590, -6592956, 29292422], [258435376656, 12462919744, 147848307, 46505803, 15768668, 20952531, -9109612, -53545593], [46049230412, 7833757168, 527469134, 80525914, 24995364, 49977620, 23980310, -8323100], [-105337156895, -7615446819, 19909171, -50372780, -40692399, 57543081, 2984495, -8581043], [166003048928, -13951234148, -2133749482, -40551834, 72256912, 12033040, -34906826, -36622568], [281745332382, 6363633424, -83499110, -151561706, -22606804, -42816400, 54660854, -38913880], [8563312822, -9442746822, -359472997, -106743065, -52785686, 47203040, -12583249, 71737418], [52944944368, 5578497810, -1300191304, 81187210, -56668670, -28545680, 41063370, -17180600], [-149073740776, 8836981924, 95989044, 4466340, -68051136, 40017834, -24974350, -59845022], [-246480183112, -21714407468, -1519843691, -57135677, -36639544, 8099874, -305247, -34661112], [-330993783263, -280006547, 749643691, -198408974, -57174397, 25965520, -22823254, 48791988], [-273504336485, 16527566865, -1117209745, 219812404, 16726461, -28235375, -33978921, 824757], [10797687241, -17463807247, 80926735, -37158252, 12332397, -60457155, 35615643, 51457865], [-209900854603, 5179902953, -3824047719, 37308684, -29883197, -8911190, -7916742, 58354074], [-306438108711, -3913699569, 1043744951, 75132156, -28852367, -6027150, 38786226, -14231722], [-104503454870, -606559092, -1879245415, -21294537, 8240502, -39684310, -3007427, 38948030], [-271915929416, 16788807676, 184676067, 28047397, -121764898, -81338866, -3869353, 4620638], [152658050020, 40653319380, -947045888, -68530804, -30155084, -65021500, 25537688, 7419164], [41694794388, 21932880422, -1140108446, -77558760, 23553326, -39315190, 70204790, -42515750], [-81032290972, -3548838610, -1423702336, 142968464, -29041498, 1280141, -41816401, 24159607], [114778700864, 8612495934, -1395712624, -40221754, 123643462, 41695068, 35446906, 46186756], [-585588133140, -6944038040, 1247527425, 293622491, 37656510, -43291130, 24934749, 22834142], [-16572496494, -26531748678, 1758921782, -90601464, 23646890, 7401826, 27224446, -34453198], [-74620710259, 21253253603, 1636476637, -1395192, 41057367, 45532625, 23715723, 52042825], [-155885247338, -16351425922, -1124377509, -74796429, -39775490, 306220, -55607073, -65262034], [277898448024, 34166886656, -465274470, -109369418, 16628844, 58691520, -58321850, -16365720], [-233457627794, 25604861734, 2150779282, -37558084, -130922822, -6825680, -40006516, 36185752], [-241775667815, 9925938925, -1314620579, 64621976, 39202787, -47301580, -54541972, -27051156], [-67213008795, -5590798045, 2595470524, -44874843, 11135341, -36515865, -72802622, 4178379], [-442350016032, -9646839388, 1139681697, -9040641, 588384, 37261838, -61818591, 32076316], [50612100161, -13062365321, -2757473099, -52649784, 146614347, 46780255, -6062507, 20120979], [332579173105, -9084489825, 4180061420, 26091241, 16172089, 54946995, 7528746, 79343023], [145900182729, 1892722291, -2523376983, 157918246, 30989629, 2267070, -927328, 38677406], [-285466168154, 8697013442, 669158970, -102295176, -20876846, 57519648, 17647784, -60463964], [-352090515262, 8987192440, 699938142, -160108710, 65904120, 46951200, 3506890, 97604980], [-23633197570, -32828409840, 1871150630, 53882426, -172217880, 26786080, -3826646, -117584548], [-239712546866, 32400641254, 1469751368, 63360578, -104109822, -93804814, -20255352, 81170282], [156742527034, 19708237604, 1153946706, -227370550, 37450584, 53380444, -23707970, -60836092], [84360187551, 37372967789, 13189155, -36792994, -131635885, -8910110, 6076324, 30589242], [350151734220, 10526476298, -1253914296, -158871264, 3531026, -30556413, -30025359, 65139849], [6812257641, -3228502481, 253787492, -120922607, -14788023, 81470995, -7830526, -106057953], [-648739449888, 23787762068, 633381139, -52398455, 18237794, 10646960, 67710969, -33501808], [-226999728542, -20710499306, -2933361661, 33008733, -30788142, -29239039, 10936448, -13732263], [-213278631694, 45541112802, -1965788449, -147421625, -7699898, -87760038, 22894685, -7495356], [-325638037840, -5004079580, 1575002032, -232721616, -40756836, -53893870, 67452214, 45785342], [-219350781387, -24325533383, 2069306148, 75055661, 26777127, 72744840, -29316411, -15057798], [111671562713, -4813970725, 3135767688, -100320909, 24631223, 74303824, -65929629, -56583632], [147305260211, 20165522269, 2326124771, 295741300, -61269455, 30942585, 16442063, 5488029], [113243364807, -20011093555, 3534988118, -70705353, 41488701, 17764968, -15699473, -83974024], [-365269413415, 28416979875, 2686764415, -286611462, 46153387, 53935475, 27895363, 24832879], [-802897108973, -1846686217, 492548491, -300697424, 34250181, 45900650, -47613850, -87987630], [-130132316045, 23282125239, 2982331897, 192179860, -45941801, -126284701, 33505005, -38720797], [-68116683627, -20955043743, -897586447, 37482924, -278954173, -28377250, -82753794, -127667682], [81942414026, -13123779576, -916407860, 267017906, -3157308, -73900537, 19223311, -67840919], [-112858709912, -20511502188, 101786235, 102020093, 103421986, 105902510, -85085025, -33453830], [256658097969, -14036440363, 427998657, -152763998, 39836493, -64686325, 76694147, 82144235], [-316740404919, -40403259609, 2499350006, -52805023, 73477267, -47962696, -35092343, 34060428], [3111919876, 36092479600, 4198882509, -50352513, -87276914, -46063362, 95152657, -27017994], [-178886977637, -51813290053, -1906025862, 425896671, 119763253, 49679435, 47293192, 7331611], [-67306653399, -21368284965, 86273335, 519717918, -43689461, -104626083, 69285173, -4046971], [-90839298030, -11063833140, -1067970378, 287774866, -185274968, -159258930, 36137036, -44097542], [713198029741, -28312970161, 2743546909, -96055818, 102295889, -60208110, 7473772, 23713306], [-557277977636, -26741305188, 1714298966, -222125958, 93159528, 96091250, -23398768, 133993910], [292112016443, 17863262967, -1082024824, 184720239, -4195935, -70502580, -74544141, -72886238], [-340248852974, 20862905344, -1789917996, 25331968, 5600528, 26657786, -2212962, -93204298], [-91964225690, -963330134, -108210089, 207368989, -113882222, 74739137, -48044176, 93889389], [-109713169080, -39475671230, -1108646448, 134481998, 5848366, -100754150, 118920316, 142472018], [380117220897, 14650329737, 995997471, 131025712, 111201893, 14519055, 3786477, -11820065], [-589535365060, 43653614100, 2962372733, -24079565, -119079814, -70275430, -20623983, 64574946], [202047248710, -27903640764, -2370977131, -187656633, -177883078, 18832764, -50694013, 7334728], [-12892713751, -21291192199, -840925315, 229054652, 137559883, -33273360, 40258932, 10577996], [416379001452, 4652098860, 2212604486, 115861870, -31961440, 140006380, -132106910, 24498060], [-460595845244, -264634236, -1034823665, -119500931, 66076576, 114444840, 8703069, 150142302], [-486272396002, -48507480828, -1637266054, -270903118, -124895856, 7795740, -64911482, -34975476], [168195383950, 38441262490, -680898597, 79052905, -174701590, -40015855, -99213940, -137719075], [-15660216250, 22492537142, 2303453323, 15599479, -33863286, 125883758, -125942391, -88185304], [-185065197462, -33116978958, 4495459548, -287054974, 95221094, -29957250, 7201820, -44025490], [335579532158, -29933844386, 7871973676, 54645998, 143289778, 39626926, 32346168, 88362702], [514589472736, 32023251284, -765695732, 18889720, -136660820, 16845940, -161775596, -92740628], [196143494175, 3175334257, 4541138444, 20006341, -9488915, -129953224, -89718739, 38628552], [54987700119, 20042715491, -1587877517, -683806924, 3846049, 36720470, 33590790, 52669590], [-12806446035, -40798120105, -6555620, 218024997, -62760763, -203218575, 106847624, 36337917], [204028595019, 60557436619, -2784500429, 19313442, -121811405, 17567937, -39661723, -82251951], [-567197408692, 15061488222, 1605524088, -283822430, 166178342, 66527182, 62302140, 152505354], [75948540187, 12390775433, 633138367, 142373780, 34968181, 122245325, -10796181, -121440023], [382400034169, 12278528581, -312328442, -74048053, 62371875, 152584770, 14529697, 21388916], [2922702662, -32800348006, -5606343926, 537609872, 39513550, -150880688, 66232272, -20232296], [-176057869144, -54013999516, -1875634277, 383069113, -23454024, 30045540, -162264691, 57431442], [621530408153, -476050103, 693069584, 178265923, 111299883, 44260145, -108892802, -82500671], [311632125422, 34991475918, -4578892823, 241241529, 176508988, 91282070, -50981189, 172024318], [-713609493403, 52168726195, 4437331476, 295520919, -40323673, -45576524, 15575459, 130581612], [338538368663, 18221989797, -1970440876, 141471747, 154854363, -18943775, 58466094, 59121357], [261017164742, 745766718, 2472357390, -368566160, -96873830, -20421500, -87892420, -121749340], [-417452443435, 25665947623, 1440714266, 192588957, 105699599, -91065064, 34246757, 134042032], [-742424738474, -61162959656, 2160195524, -238480852, -90195784, 87455100, -54557888, -91538484], [1358310423851, 39957676749, -534089192, 113978247, -31544725, 28239965, 47056302, -140727359], [-285020393674, 49123046314, 1422285626, -43213956, -19730726, -81326210, 40624166, 93520798], [-133108344554, 23367915604, -7217341606, 463901652, 22385360, -27319263, -44625313, -43217701], [840896024006, 21804620894, 4156779598, -44970440, -144907418, -101074660, 63079260, 23345560]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_315_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_315_8_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_315_8_a_q(:prec:=8)
    chi := MakeCharacter_315_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_315_8_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_315_8_a_q( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_315_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<2,R![126353088, 37596480, -16967768, -775100, 207798, 3875, -825, -5, 1]>],Snew);
    return Vf;
end function;