
// Make newform 8.14.b.b in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_8_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_8_b_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_8_14_b_b();".
// 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_8_14_b_b();".
// 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 := [31616997813655668, -802096030557765, 15101451375489, -180067834748, 2540283092, 96647426, -743866, 708, 752, -5, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 2, 0, 0, 0, 0, 0, 0, 0, 0], [-240168537249774828060, 438921715422012651, 72918037609395038, 135650155419758, 27286958100142, -3119603134524, -35423339110, 521346978, 7354742, 4673], [17999672649818073444, -42069080694288501, 1817150962183070, -26417243554130, 11136753949934, 316521478980, 4741322330, 135456610, -600394, -53727], [38430481057802905956, 517679094866939787, 141754194852490142, -26417243554130, 11136753949934, 316521478980, 4741322330, 135456610, -600394, -53727], [45775038388159863348, 1802119555982310951, 36672486504925558, -1466142409638458, 78627040368902, 1297531495828, 54449976802, 2440766858, 90806382, 1098741], [287833874783644461668, -5000468461985800117, 89713441546092318, -718390716500434, -22898903292818, 563380286532, 5861994714, -136735774, 2793526, -393119], [80019370682910065076, 1662894743218891719, -318818021959084106, -14258798073026042, 149753232903494, -515357778668, 68951707810, -2967283894, -83201106, -712491], [774492335446627231044, -33149970901662232461, 110417944407472430, 3965347224942526, 358142733536254, 3603178854948, -262411250934, -6991130158, -53876346, -1412391], [1111730392134764711772, -140585877661687524603, 543216588390237954, -156691468785680654, -2306079501218638, -9343551156356, -1181809514106, -5471783426, -378837910, -12461681]];
    Rf_basisdens := [1, 1, 17492130486288384, 69968521945153536, 34984260972576768, 17492130486288384, 5830710162096128, 8746065243144192, 8746065243144192, 34984260972576768];
    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_8_b();"
function MakeCharacter_8_b()
    N := 8;
    order := 2;
    char_gens := [7, 5];
    v := [2, 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_8_b_Hecke();"
function MakeCharacter_8_b_Hecke(Kf)
    N := 8;
    order := 2;
    char_gens := [7, 5];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
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 := 14;
    raw_aps := [[11, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 3, 0, 1, 0, 0, 0, 0, 0, 0], [0, 53, 1, 10, 0, 0, 0, 0, 0, 0], [58697, -62, 0, 0, -2, 1, 0, 0, -1, 0], [44, 2651, 22, -1265, -99, -22, -11, -22, 0, 0], [-248, -48385, -161, 6042, 494, 4, 134, -28, 0, -16], [21730719, -108095, 260, 3854, 4188, -1115, -91, 81, -66, -17], [6716, 230823, 990, 27867, -16455, -478, -527, 290, 0, 384], [-7892749, -708114, 832, 36960, 58658, -6469, -16, 408, -435, 392], [53440, -9290205, 11415, -443578, -149296, -12320, 14736, -8480, 0, 1920], [64793900, -20926432, -6976, 468896, 126736, 15212, -43504, -1560, 3596, 2296], [-317480, -93260595, -56499, -933618, 618906, 63340, 181154, 37900, 0, -12720], [5933317952, 146320078, 69624, -3847900, -2484520, -137274, 256726, 10446, 57156, -38286], [-379016, 334310023, -210628, -9561015, 1655986, 41668, -698590, 2244, 0, -19712], [-1016950802, -563994860, -85952, 11213792, -330884, 349022, -1236048, -27720, 61194, 2792], [2709608, -855035743, 544009, -12830354, -8358570, -455884, 1524622, -216172, 0, 119856], [5925120, 549676647, -6205632, 5423117, -13419904, -425280, -1562048, 251328, 0, 338304], [3922824, -1276639589, -1251637, 75366930, -12567986, 403908, 2603238, 1034660, 0, 315376], [8425980, 781961615, 21797758, 29706099, -20584951, -747390, -711039, 176770, 0, 462080], [72648964185, 2923311210, -2964288, -71313504, -30956154, 11007537, 4967952, -858648, 1095495, 388344], [-63300715771, -5238266937, 237148, 88267906, -44908748, 2828163, -12222989, -125289, 277202, -613015], [544561634522, 8223218036, 7924480, -222874496, -154133556, -16020598, 15582784, 1616736, -2081898, -3074272], [-34502432, -12072829957, 58375600, 320134105, 58109256, 5728336, 28915016, 2655568, 0, -1536384], [550637710917, -17626489609, 8312860, 357989794, 15525684, -17101453, -34139741, 2168391, -11809038, -1807687], [135946286999, -8942656439, 9838116, 341106174, 392173180, -71273651, -11423859, 3692505, 13407278, 1239399], [-67669944, -18324016003, -63404027, 8738287030, 83974686, -8006748, 87989622, -19164540, 0, -5578896], [-2178355200163, -5425725998, 1299392, 302561312, 515237598, -29283947, 2194256, 2088456, -11974845, 4965976], [-12632524, 60165091283, 86141722, 866532955, 138330123, -12438298, -105498509, -17439514, 0, -2500608], [113028896, -94109239065, 41904795, -11759470818, -395160072, 20676752, 107441752, 41261072, 0, 10292160], [2058786789566, 92093827004, 13481072, -2284645880, -1123775440, 25432108, 175192908, 475068, -8446392, -12055868], [-12537068841448, -35369715080, -28724544, 625940640, -208191176, 108836344, -86190960, -8463576, 11449664, 3333816], [-22138508, 89402293703, -727797062, -32332802825, 440801979, -131064506, -375980125, -168966842, 0, -18951168], [6935119017388, -203410431734, -17048984, 4132297772, -96546296, -56178574, -470948958, -7399158, 177462924, -5148490], [1979520056, -35994216553, 1676673052, 8006301657, -5117370238, -227696668, 117765874, -24479772, 0, 101608448], [444922064, 736186630697, -127474883, 68089859722, -60988116, 111959528, -1073611748, 201138344, 0, 44589408], [5905132299587, 598876177998, -139082432, -9279754400, 6984895810, -316231797, 1371610480, -10660008, 261927101, 107102408], [1450165240, 551722060211, -923623349, -39840127350, -2269894702, -216553220, -1389420358, -80945380, 0, 67803920], [-84183176, -706922089845, 1760635068, -28000289163, -1100174286, -392177852, 1339583522, -507983036, 0, -57902592], [68479564267997, 458051183434, 392384256, -19499409280, -26221836490, 979995765, 567176512, 22945824, -677089557, -323546784], [-11687465800, 187763114087, 1323962191, -2550209006, 29414722722, 1495636700, 93814858, 336144380, 0, -579746160], [-3792439640, 2243280062771, 9456030100, -101280699323, 13975578438, 817103980, -4422538282, 529339756, 0, -143882112], [-3236852224, -1657465655823, -3492635571, -68904806910, 5369028864, -138748288, 2840246656, -607328128, 0, -234289920], [-150199557861056, -2908618017112, 874556352, 51072300064, -20867472056, -1658664096, -6676513456, 133351944, 607385976, -474500520], [-51730296834745, 2583060651609, -1682119580, -35069260322, 44435640508, 1655368605, 6148776541, -276951063, 796364558, 851266391], [4994746672, -3043806322171, 8157191161, -543434369390, -15498208812, 10241944, 2844167780, 678939352, 0, 334348704], [368007974986961, -3189375490814, 279166080, 83398775232, 52426459102, -2228466935, -5215583136, 239590128, -2244593593, 439604304], [1522931704, -1037801699533, -1443933764, 339717682605, -7857795118, -2617262012, 4174185602, -3112140988, 0, -247439488], [-857021031792172, 6580607030976, 132902976, -132526365216, -1992635568, -2268432108, 13841235888, 65214840, 1164726420, 62741544], [-34681906912, -1493273013069, -14595542256, -899859755743, 89484465656, 7088654576, -2096211784, 4354708208, 0, -1366973184], [1960020080, 8103429390317, 18389283745, -670208882238, 14119228292, 3390292280, -19310631980, 4555706232, 0, 582706976], [-117073966563747, -7270535777569, 3754632124, 69912755794, -205764143724, -468197893, -20237015765, 218780847, 3383064354, -3098289583], [-267467535628882, 2779866625340, 7693042688, -159734534144, -272390836924, -5019634370, 1518720768, 1137677376, -3485505150, -4280010560], [-864341007178537, -9796184178183, -8620062492, 225315691422, 81248357052, 25211505597, -20355230979, -2036736375, 319833294, 2509853367], [-106987874480, -14138004025449, 23888350056, 455509791365, 234617664332, 3506759320, 36184500396, -9823154792, 0, -6664957056], [-941473242635194, 3352349376980, -6908469808, -41131105832, 72679396496, 16762372516, 7548411780, -1540416300, 1769430168, 2287220908], [2925230815096225, -1009810913046, 487562048, 27347684448, 28116904102, 3646303225, 17437168, 271466904, -8371984113, 326838664], [20127290704, -7478979443889, 141637334859, 635968325462, -74181943924, 4599627688, 22886165628, 8509833832, 0, 1955103072], [-3378560756286262, 4064020338348, 73719616, -6139003808, 199576122532, -12262117926, 13666183408, 727793112, -2874098194, 2109659720], [92945955176, 3311318877817, -67096191487, 2488908517278, -235008168170, 12161353652, -1265675186, 27797175316, 0, 7817910832], [1095620003686765, 28159691059711, -21224377796, -609675304174, -95142200684, 73349097371, 54764971083, -5643190065, 2709138402, 4294807601], [91242712948, 11446733450363, 7821169402, -3825122384013, -182629556101, -4339170554, -48229371997, 6669412358, 0, 5504291456], [-169430099600, -38495811304515, 74098416561, 4235714647778, 318847142468, 14940220600, 109379761812, -3666400520, 0, -9303310560], [-144676167972, -11735248001097, 185476442286, 4642533021915, 302915455953, 31197396306, 61517676489, 20226546258, 0, -5485425024], [15231222188086271, -63969479406834, -314026496, 1319681749248, 89117140658, 6403887623, -134406804352, -211040832, -2600083143, -319096000], [1323446054571824, -64731482736274, 8859777656, 1164843093476, -376140180392, -3163437850, -147348231178, 537557358, 9594288644, -7247105582], [316398980928, -70048806103861, -376840485281, -8448515130794, -854994041808, 1283732256, 53364374640, 43812591648, 0, 21264429696], [32058897124, -156165564238253, -282265325326, 1862108042355, -382899236609, -40960926962, 304414092359, -47609321202, 0, -3324197120], [-667251127952434, -186825807091924, 6105560368, 4166071701928, 1075436722608, -53168623780, -371534665028, 3975982764, -18115893528, 5822387924], [731779162008, -96108108333745, 36972454540, -2699258169935, -1991104040022, -46512646284, 140364339354, 38654536308, 0, 42583591296], [-482933747408, 192371739348499, -623792914801, -6840751443858, 1639095709780, 2831123224, -415852291228, -60805076904, 0, -31818100064], [9694056965176834, -69425504695904, 81574798720, 1656724636736, 699055913920, -248876255200, -107186381472, 23572291104, -82992260544, -10857925408], [29993915771682525, 358055745586, 7246340288, 258629397920, 589218909630, -130352545643, 1498698512, 3298630632, 75573982947, 2649551608], [-30973565427741178, 167262168076404, 86642550976, -4072966605920, -1950085637060, -207087059850, 321771484432, 17012530344, 23109024578, -35604959944], [-1354144612936, 163979819892305, -476162065583, -7958936588634, 3758312042210, 206593028828, -341585224694, 81131888124, 0, -62730570352], [-983363767576, -180306373827249, 513510545844, -42279313036263, 2320995499446, 117442020428, 162363243718, 17644723532, 0, -49898648448], [-70792964537458864, -120601335181504, -100433390848, 2923186729600, 1425361739648, 291128704336, -234121707456, -21945469152, -31140633840, 34596983392], [-73608125480, -436567675493563, 60381240037, -23223531023618, -527284408422, 63134113900, 709549385378, 70155460876, 0, 3510673488], [250586802848, 184914398630799, 239479063011, 43121519933358, -531506801640, -110320464304, -95958401288, -106327681072, 0, 1996391616], [8472390128674607, 437046765527057, -62701622716, -7653346197650, 3054884637980, -29050151627, 1000858242357, -2875208799, -35973709026, 54075996319], [4735106991977216, -146944688571362, 111846641976, 2459076522372, -1147565040488, -113107781546, -289214029722, 25608053022, -200968047964, -35022482910], [-239678953652, 272743177161711, -918253115226, -10183858185733, 1222282134677, -21099348134, -613688828883, -58683034790, 0, -18791843328], [2054841913568, 437456804393533, 706807194233, -58605334457430, -3954865926392, -204432006544, -1237104787544, 15031713520, 0, 109731860032], [-58839837268663242, -476945139687300, 628372778112, 9170592219072, -1541810555868, -1878766580922, -946957722528, 155468276016, -129321659190, -161967950064], [-10506822186211561, -660859637612935, 346392074468, 12553208087966, -2179520817860, -896778114499, -1405146188803, 78455334921, -57999769906, -111026069705], [139415153661381071, 514614658142190, 292586229760, -13962203660288, -9646889663918, -411660572073, 924928138240, 47532849408, -1356805975, -149987681536], [-196170600836, -81868564375341, -14822590338, -146318093926177, 1180507116713, 16200123778, -684621602847, -5635923326, 0, -10918023552], [38752219419095679, -144875007351183, 6195131844, -2580833891922, -13674857194212, 1352404704021, -530515699563, -41309863167, -472507313826, -130124721345], [-30874645216415056, -1267128444736930, 2413398584, 28235385575684, 7051514379160, -365799204970, -2563103703130, 14757417822, 60720227876, 41858854882], [-2640980964016, 279850216490687, -2019399095045, -62299688643530, 7555766424204, 114928271528, -872943200132, -206554984600, 0, -160741628064], [-85170449948806678, 1577636780640244, -477876922368, -35083724748288, -8355044160884, 1913070158746, 3105667610112, -141355364544, 99638651942, 53810828736], [-2086805474556, -223214053589329, 814480315330, 73701029857591, 4255976643447, -429511437762, 1059231321279, -822288551106, 0, -196388556672], [-43324532618981420, -387000235869024, 235903205696, 1416385507680, -16746194488400, 404921054356, -1170135362960, 3079235544, 2221410612, -226665499064], [130187571587397749, 1064852201666346, 411370041216, -14494738186176, 18079762871670, -2471141530611, 2810757518496, 176825320080, -419450108637, 119105919024], [-2573288027504, 896082481905695, -946167796664, 244144177546045, 6797270883132, 864523346872, -335909436580, 751957835704, 0, -56282755584], [903988374864, -158826069933349, 4761657172840, 155419987429617, -3654816079156, 206706597528, 1350931756332, 382360140184, 0, 87826771328], [-21553730891563953, -869676409281690, -210924060864, 15569791044192, -5874125688918, 509146906935, -2176025754384, -86374854888, 882876923985, -48200503800], [-2824329794344, -1017428001671701, 8176453818931, -252007790083958, 6122974949082, -257097131668, 1049133672034, -702233672692, 0, -222568270512], [-5910237209581188, 1943757448824474, 810739639464, -46371290207220, -19434546851640, -1577678879166, 3863423533170, 160635698586, -174191512212, -328832543706], [-4180206182364, 365546606002227, -3749750287470, 232682982280371, 9841245369135, -936082546578, 811015795959, -1743065383314, 0, -403491418368], [-8786433920984, -908604737514765, 6188629661811, 75163700929650, 19443680158182, 1865779381012, 2690900482910, 1191796026484, 0, -336991677264], [7732980560348, -242751867204737, 3170212792814, -171072013730637, -18951534490415, -2392408156654, -479189052023, -1999319590382, 0, 196544283136], [1014356098760, -1440435247796377, -11300568536249, -186943261582454, -3677081977218, 691639822820, 1061270538838, 1011324588740, 0, 159842382960], [-10764161288884, -407421502584217, -14280657692186, 5704619117923, 26696748677973, 2825246893082, 384110127661, 2143424559386, 0, -340911166848], [37714605183912940, -1008519809324390, 1960032176296, -1081127107060, -58539056477240, -3390902906302, -3376670538894, 300617650074, 997996607340, -1058179226074], [1372406708300, -3008389988270173, -5859215161754, -457753374487305, -6257998825579, 933264699290, 2719017517933, 1365122846874, 0, 215929073792], [-221867219818927018, -460067767690268, -1771414368496, 42206054970680, 87262912970256, 168280328692, 737867745428, -173371350684, -70310701320, 1251300316444], [17287203506716, -1882854808364821, 10806368113678, 592604394266359, -50697149459391, -3653306901518, 7146454369145, -2322561607694, 0, 665372646912], [-14331571494840198, -3328326328987896, -4513869350112, 75073182158832, 26394393909024, 14871755165736, -6998298829464, -1100803240440, -782625816720, 1211459628792], [-539217459125551213, 2388541707636870, 2537847674752, -65141723606976, -44815123481446, -4613144553925, 4733965015712, 537711519504, -1603102006155, -924713116240], [136823979444551213, -4263272328242305, 100656695612, 93780763132562, 19330077157972, -2036252372197, -8873995469173, 52559871951, 1133808452450, 57022920241], [736786183874850620, 2147949751888520, -4321171538048, -3823242098624, 106763432110680, 7477376114588, 6461109252256, -749924132208, -371312414316, 2071399141424], [1815639637472, 2110594054532781, 6843496859817, -514178925079542, 2341195541448, 1215409647344, -7021843266200, 1781604171632, 0, 283097262144], [23131254625883261, -4443265239229185, 533285159740, 123971440752018, 86158786539860, -9297536538469, -7948913942773, 375072927567, 2487575379042, 591933622961], [-3640361867844, 2708497890108283, -31767279172258, -39365334507273, 16052445269401, 2077046638242, -6968664980079, 2145544159394, 0, 34248760576], [-1433929057129616929, 319222366960006, -1710494383296, -24774026738592, -47219970513782, 8256569196103, -783046424592, -604821916392, 1023702281537, -103971365880], [-42706087548426089, -1828042973160151, 252687085476, 23797868631358, -34356529833092, 1458311223213, -4709935826323, -63466759239, 379864891758, -443087363193], [-29874816531140, 8410119472584623, 48698177331742, 193372046094963, 87481853814713, 5616924121570, -12173446877263, 3131461683170, 0, -1242731219200], [-1174333875613951887, -658633916020566, 1091980757568, 56105288071392, 110537301664422, -11052329906487, 1267114012464, 646780125240, -346091208417, 848359618152], [5692316558768, 5285963104165103, 23411362443835, 901131298302310, -10108651901004, 954815947736, -4375537777724, 1968409074968, 0, 506796563616], [-36711378268144, 5225683734227915, -3018822361784, -69943511630303, 101761185882396, -284619425608, -8740052974724, -5255368374856, 0, -2485374474624], [1388153236576, -11700638272591159, 1303171064725, -1428741366330750, -17917901647192, -765620360528, 14452288138568, -784698691792, 0, -9539165632], [-484907587211378785, 12015490546741553, -4441695747388, -276263075410642, -89518125729380, 16954565455061, 22514247757781, -1388253272895, 3315361780958, 276935928703], [58451829778360, -5567070528198483, 24935337379773, -118457461902370, -156947184877342, -11237768841380, 9618400694922, -6440929895300, 0, 2398419473040], [-16348326433056, -5395926330218673, -518519436432, 1167214689843893, 23615042478728, 4394140959888, 17507775087688, 3386135024784, 0, -504002967552], [4667765006936, 13932763914087331, 43568427309932, 500464145189805, 10339877766394, -3778599189868, -21912975837974, -4163856972908, 0, -192628891520], [-11116735731960, -2666494809627973, -74051905880405, 1101784600377490, 19248153319278, -1149022405500, 8990845362054, -2937659811228, 0, -894318702864], [-36964472888776, -21253007521529579, -20223858984379, 320911902533742, 50283301056322, 11690708967068, 42580649664106, 9879634973116, 0, -905536996976], [1719229066882816026, 1280074985640676, -2496414198400, 6518114699072, 80301467658492, -1159455196790, 3362653638944, -405926098032, 4691074858662, 1278635904304], [-1119440943749597533, -2948147075055834, 5855262065536, 43948204601920, -28083693760262, -5808910845237, -3649876683872, 1504301591184, -14070898438555, -1342357291984], [28335384921280, 6745151310533651, -11780047045433, -2705323147755738, -41758140598576, -12758716055840, -29174253464944, -12382989014560, 0, 187863520640], [-121582456800656, 14320161668018499, -1646522916936, 582814076816697, 326980587924228, 13438302770248, -19867584213916, 810855935560, 0, -6313723417344], [-446697494686462795, 20386000399389130, 9407406919296, -480655068795712, -202897818972010, -28659267106611, 38803902236128, 1848503651376, 8655504266307, -3861895965168], [565799581901154494, 2296984414244780, -18255489155200, -58214334318016, -21532995520076, 58579661475854, 831709158560, -4835052955824, 6445472286050, 3750330287728], [-51614154478896, 354053057906145, -36184514795499, -312158819112966, 132394752588204, 3111453061608, -1846324779108, -2940713385816, 0, -3026083223712], [-1342203841709543824, -16818908152522770, 2805934600312, 335672245624548, -1934828606632, -1866774354586, -34550189186698, 648061659630, -6130651297020, -861749621422], [765989950241937263, 14895256510859233, 7429539381636, -425753793213234, -320267075668004, 4211274164293, 27732077950533, 1050683683953, -11416552764034, -4277488329777], [108554979117080, 37988964102264741, 15553695175077, 814030423782302, -201772880304886, -9364864346740, -72608742501934, 2611835709740, 0, 5988350028240], [95621182878456, 15102792310659347, 66172654487356, 1669728332531661, -221013893560558, -5270082563388, -20875097560638, 6074053136836, 0, 5672067850112], [-16522133447048, -6507787096066093, -61786160016725, 590480872219018, 29131838990130, 23764053862204, 11139962151578, 27898183765852, 0, 2067064951824], [2092374235385342496, 24831544060312110, 4230788888952, -555287221969308, -136229235713448, 4957202598, 52452991083702, 890537922606, -10244675799420, -1559175121134], [59746618014076, 13283352867109851, -108705448657602, -4885970666059785, -90539756244183, -21054720051518, -59414694721375, -18703096330046, 0, 1175811860736], [-95358433502920, -23663874695051007, -97766514498687, 1442251151841350, 186555776488706, -3611394758500, 55259681369258, -17288891161156, 0, -6838748201328], [910408357943988383, -20496210082136146, -28004955884800, 554173208526464, 355927994244946, 47747862529319, -45280256331712, -6450311551584, 31698768284345, 8654021230048], [-87914614958780, 27096102728241147, -32050861216926, 2275192184952731, 259232721207527, 5614683295390, -36890008864977, -4610016487010, 0, -5112349891200], [196121411409368, -73562229914369541, -78130700511357, -1036230840445398, -621825616012134, -34169062667284, 127262644619554, -17131291190644, 0, 8518885738320], [4157780909900646385, -49506827413168878, -2602250715136, 887023673379840, -258181371912530, 48863869082473, -108925108656128, -1749624706944, -17326251666921, -2646623405696], [-80440176372984, -11729402031845879, -16475165570431, -1024713984111378, 185193963233134, 26776832352132, 16802694754950, 23191964129636, 0, -1792434111248], [-499653693207091652, 2467771966919434, -31779035256728, -168063437428948, -267085604416376, 134249377094258, -3602156337630, -9053916427254, -7675202635380, 4617285974966], [68215447428904, 60274433922998303, -185871408136364, 7593139202356137, -87466434281050, 14739064459948, -86328636836170, 27764874639788, 0, 6512905089920], [-6697912848682828428, 46651199504037456, -9619221711936, -1085557565957088, -352178919331680, 64918250781684, 93548250155856, -3220430777976, -16527647868060, -42070621992], [-188241234149008, 4799688643257671, -269804907982253, 6881339870754102, 450023118190916, 25617617555384, 25146833816212, 7350151016952, 0, -9133733269216], [3152402173963510254, -40045223086311508, 18859568927536, 508762050244264, -834210286026576, -33280490477092, -108399997676996, 1588599152940, 37639046120424, -14093771468716], [133066106679364, -36001705850944353, 203425446305250, -8253864834267225, -361487871591129, -6636003709922, 24829468250735, 9336542858014, 0, 7986273283968], [5532426820448949431, 31097922925608494, 17001403107968, -936991158162752, -869786061237070, -34067601892673, 42854189282016, 1487039552304, 36842577510225, -12540284451056], [-162547509018304, -83500902975494849, 23795931456032, -10051735174183371, 299665580615344, 11756604711392, 111337668583600, -6781301901344, 0, -9268953306368], [-7251545791938255350, 45829728000502300, -19548268440128, -1169683965555424, -627632100238124, 101857673274842, 80866364939472, -6849134045688, 2877604804350, -999133696936], [7140340543676092115, 28603198648018974, -40608521173568, -4179712859360, 1520894870653330, 30375042378843, 89711565604048, -5299217558712, -308515993027, 24710868497432], [-8555305673806885721, 66893519752794713, -32591091765660, -992091819036962, 957401116830268, 42542795375517, 161398242836957, -4767932673303, -7598392767474, 18287293745751], [-2382718182923411155, -51400770938425297, -15129353689348, 924061601475506, -332592341101868, 39688258095755, -128345261205445, -5735550436353, 50499593688962, -2077297619711], [684409061847104, 65763346149586871, -368853624379493, 6435835379322670, -1594167851055504, -34929867389152, -137339781131216, 47010042886688, 0, 40969955137920], [-216830661910996, -45676962636665593, -247622883943082, -8719829503119053, 510368662983261, -16265186598742, 40020026297845, -49513324613206, 0, -16624069007232], [-2994698757120755460, -69811594879548822, 36617880748008, 1243586099961708, -458775697051512, -88962894505134, -155618233745790, 7455577591914, 5631526570956, -14251147972266], [18957489490912314017, 16656717591781778, 11845951552256, -1127597360951680, -2030373682823954, 123187678902041, -2825980244416, -3320344521696, -29768540841913, -21806985117344], [-87252427985632, -6005450987704705, 111009825420304, -166442499755675, 205387323702264, 74797052762096, 10665690343864, 83109276433904, 0, 4156111835904], [16110131065795873847, 49272512709856761, 42211570086628, -2028564454642530, -2686002209237956, 65513098337213, 57665010203261, 2662053648777, -36993084788274, -34225409140297], [11675189406459933427, 6942791010524022, -141121100388352, 514035000010752, 1820462489167306, 351263311875163, 34913330214400, -30589143020160, 8866490771493, 49353671327872], [-3892612705652167012, 12501561202013048, 48278732042240, -1173336763629568, -2375433256176248, 39776915351996, -10856997772288, 5102798546688, -50378220747964, -32970336402176], [-238056030112104, 21777271945712509, 331441426702301, -5943904738349298, 650112693861226, -44877775187508, -44045565898062, -88585985919124, 0, -21854105365808]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_8_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_8_14_b_b();".
// 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_8_14_b_b(:prec:=10)
    chi := MakeCharacter_8_b();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 14));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 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_8_14_b_b();".
// 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_8_14_b_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,14,sign)));
    Vf := Kernel([<3,R![27083265579587767116678921216, 0, 3697485496537144650073344, 0, 14722593225477049728, 0, 16370347169952, 0, 6964588, 0, 1]>],Snew);
    return Vf;
end function;