
// Make newform 8.16.b.a in Magma, downloaded from the LMFDB on 23 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_16_b_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8_16_b_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [2433324183085485312818967200, -14754933471339430268597775, -184645940533558790286339, 1792289418481984019550, 15458794901317392766, -202833046637545317, -1350212102075609, 52039630950804, -361745089708, -1368564777, 41390651, 136110, -6354, -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, 0, 0, 0, 0, 0], [0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-832667899000943747969648174128105376, 35747336042143281846256439940666983, -315822772842349713922518368913586, -984700974818799065991650348136, 41331461862700986965580629002, 560369599997266260543656927, 1982309909141547091425196, -26977907232684731704856, 584100205207734152212, -4840039639061597163, 49465007556401126, 1457668688612416, 1737913630882, -57787459611], [-3535745657424636338412430368091080608, 46155226201090393030579583701800551, 2657860129713967767312665562838862, -984700974818799065991650348136, 41331461862700986965580629002, 560369599997266260543656927, 1982309909141547091425196, -26977907232684731704856, 584100205207734152212, -4840039639061597163, 49465007556401126, 1457668688612416, 1737913630882, -57787459611], [-261945462122800281578392546533324436832, 3406383378120069483222242397030808785, -50470055195292640638903730075139294, 423517139946379971857258968688936, 224084439511075988634784177222, -58660141144718248945978217703, -962706235455435645284432460, -10006073868997642270509736, 96348574192534441129100, -1014868686502680458093, 4945823139808601930, -113203248679496256, -2179236426857362, -3186889963709], [-30959075543892027641123782211196018976, 527136782729922022717226992073189387, -4630770081594388005573109059055466, 19610514967222836208816721577784, -215422818181177857191181750430, 7937750028734907547243968931, -71601889971988258348862980, -924254945977297458679736, -5342340200281390501180, -158409430689092235903, 161625821725085902, -6204346467628224, 221715839114138, -1396821254639], [35701572321905024816442027798078927968, -417863375083402744168050409462922553, 2250559042434423436009156213088270, 356688997044746924960925504688792, -6263610553396653477012008374, 1423357404687413740024597311, -56238976113303032527178964, 851830668333072593988328, -5021255893899396151148, -8161278705140497099, -627988705015857242, 2965466763883584, 89631572299234, -1002455217403], [-629028365633154357907814856027384627680, -4568898098883460559600153110344844867, 55134370532886766297539853845159674, 701871920338724534964241952662536, -8472792323690117619039951237554, -34781379027709194785373133723, 1933563540854412456717243556, -17279028573936934310266760, -73793018184279511783268, 1154738599785138761943, 6934135338776093186, -268128982936612160, 430293662123350, 35879304688071], [-216845590222232551945837178605091403808, 1067525175886733496022867466549832883, 6347282716246585135237527206499814, 520648265367461512819597859640696, -17595381831248209599335632407982, -53933105212730426191921358453, -402177458933808062609971684, -5160162564726114976406008, -4437043847267081742172, 458989418570724675705, 28584304439284669534, 149482884168560960, 2699441110893770, 26368160926857], [-390200531306600670128542775739202887584, 14195432511010232676933216697632699047, -672596291021470568240171320562020402, 11258387394866317144820898216902040, -152006762628222995925763382393462, 1103942642514218866267934622239, 15081773856874497889364640940, 219748058325195527146860520, -502311222603325476802796, -37919996680691749023531, 1793898105508952678, -2592296782770668480, -9166442428904414, 127928962719909], [5002497498271045345722827203245851741984, -22963242858368037147541011742498870619, -359727997528966357870266899837936438, 2464099958781728632683619648404552, 38284931683616891926303860765374, -1062917020205453602991110782323, 2187112578109345791651763652, 80510422374545712263463992, -856636438342448628805252, -5601796753602554298225, 115852470061927641106, 726634622654179520, -17695585989469690, -72522157664001], [-40178435603509287227480828443513012407136, 290681419651251996652635703293167849441, 1931577335247117918042811680335298882, -39284687376945897965656935017026648, -590537111979197338202015329614682, 198178514431840651607050785449, 4709843935751430077666482420, -561029742438178540521235752, 6450834079721164421137740, -61664435424729433593917, -1573299921739270285334, 2062148203907543488, 111549167043911502, -338295464497805], [-21060829563161330284155095251414109383520, 247577910381109059146421652374916901601, -397679725322260965405627352222369982, -1723905676751408076610846915894360, 23015668941751840137583898101414, -212062494625215119965187160663, -3481342454604731235965430540, -10104829775872883611753768, 7611627045343157771569484, -27755708375724205500221, -281574718738932742678, 274779618236101056, 98653412059961678, 269874431012467], [-6998656279622972366993761669445037827808, 173493915485816469131217857982977611957, -1308867415111680118620198361094237974, 5174800278739398966512482944186056, -154646399495612325411439023760098, 2194356775854112314576280149277, -10130706132669283945605356284, 103882788381347719698624952, 4284612193536687622022716, 301295593295319452863, 260631263864064691890, -2430818254685092672, 32787279165828838, -652797590290385]];
    Rf_basisdens := [1, 1, 1486841451278158740617591965876224, 743420725639079370308795982938112, 1486841451278158740617591965876224, 495613817092719580205863988625408, 47962627460585765826373934383104, 1486841451278158740617591965876224, 743420725639079370308795982938112, 1486841451278158740617591965876224, 371710362819539685154397991469056, 1486841451278158740617591965876224, 743420725639079370308795982938112, 743420725639079370308795982938112];
    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, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 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 := 16;
    raw_aps := [[-6, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-54, 126, -3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0], [-118147, 1156, -2, 6, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0], [-26735, 62124, 501, 228, 12, -57, 4, 15, -1, 0, 0, 0, 1, 1], [-18196, 42087, 8546, 410, -89, -26, 18, 37, 3, 0, -1, -2, 2, -6], [52548484, -1183020, 1534, -5182, 899, 0, -136, 8, 84, 25, -20, -24, 16, -16], [-1538251, 3571956, -74535, 13764, 3348, -469, 36, 275, -61, 0, -40, 48, 5, -59], [-2542420033, 7723084, 97696, -204146, -9170, -2204, 1004, 976, -129, -248, -354, 196, -120, 120], [7903558, -19983382, -6485189, 1536272, 21848, 28073, -2608, -12536, 2648, 0, -3176, 560, -592, -912], [-7480990916, -168375280, 968834, -2416868, 54498, -28420, -4172, 25392, 8922, 3512, -5646, -1508, 568, -568], [-2406892, -448667, -13534002, 5899342, 201013, -249622, 25014, -45265, -2103, 0, -8643, 2170, 6406, 4846], [-4759684410, 2231280192, 445224, 3379524, 262398, 565504, 32600, -498392, -146268, -2546, 2204, -2680, -2992, 2992], [-1319124358, 3089489192, -11756291, -12927288, 817768, -1339578, -81528, 636822, -42762, 0, 23344, 14176, -8934, 22682], [898110040022, -7618928744, -19593614, 27806992, -1383770, -1933516, 86044, 1949264, -153660, 165032, 88406, 30036, -11608, 11608], [9023429688, -20960494441, 403558968, -89000062, 175043, 3499736, 279514, -5628487, -220689, 0, 191227, -17674, 64810, 62210], [-24350963488, 56810582360, 422287309, 201680, -9613672, -46722552, 921744, 16942984, 242824, 0, 9112, -177232, 102528, -231872], [24044557124, -56129736993, 50390398, 31578682, 12482135, 14844762, 199218, -18062667, -326381, 0, -78673, 173150, 58754, -78598], [-39652021515, 91890256556, -2699955655, 610611028, -7802868, 94310771, -2014860, 29708507, 1256331, 0, -1049776, 19872, -246299, 763493], [-12306495148851, -159051620828, 222050600, -803401254, -19333230, -44529252, 3442580, 41580464, 404037, -888584, -1582558, 444860, -388744, 388744], [-13084974998664, 189099269444, 377788894, -460758634, 42928617, 46772608, 6380928, -38624000, -32128448, -391977, -1979456, -505728, -587520, 587520], [-21015699778350, -24697889752, 108039428, -326741812, -67077288, -33010928, -1916176, 20241024, -1126066, -4940768, -269160, 1128656, 78752, -78752], [57876546120, -133669325240, 13305551553, -1414950320, 32329480, 1061216720, 11890832, -405104, -3549936, 0, 2303528, -146480, 1539368, -4047512], [22686463616360, -569874440284, -2261053362, 3771882550, -118709255, -163377024, -11190304, 150946208, -44945328, -867977, 9092784, 1953184, 923712, -923712], [-47275838104924, -1791770129452, -4278805794, 5894114706, -6029157, -370772352, 77967320, 443835176, -108783772, -9262415, 11205596, 4876040, -8284336, 8284336], [-1062005895944, 2476623919243, -95156945448, 744960538, -51355673, -1054060488, 3707538, 684441061, -7248253, 0, 4091711, -1067906, 5292354, 23822138], [22213500811009, 3470030485684, 3957667240, -2023767806, -129726150, 736702796, 75477412, -703540368, -5965703, 3187544, -2496246, 5956588, -8143400, 8143400], [475022722199, -1114288678988, -24510506379, 5863312828, 721290580, -5936657327, 42739612, -677295287, -5185319, 0, -16746112, 9190144, 3551143, -34174041], [-781136424682, 1804906539054, 152200597635, 18144875112, -1109558244, -212647231, -17774520, 711429140, 70693580, 0, -35174788, -13581576, -8355640, -10422104], [-194928651686678, -3490858514432, 4087464528, -15788379256, 695043452, -837788288, -170282832, 741542096, -591267768, 19164060, -50346952, -23725808, 19400864, -19400864], [323322563139320, -9030427073088, -12198052678, 10978451652, 2406582066, -842099364, 682501588, 1743940528, -183407266, 142407800, 4370626, -8420228, -67408136, 67408136], [-3426858703617, 8062019262292, 234035066073, -67159332644, -1417627148, -1874421271, -52083268, 2553458209, -13579983, 0, 96195392, -22142336, -38330737, -117428081], [2381707774648958, 23916046246080, -21943372744, 94541774476, 398156314, 5753369216, -480165880, -5667550728, -223038228, 286588426, 219808980, -25272680, 50543856, -50543856], [-6715411689590, 15782896307704, 151860444509, -120580856088, 2936311736, 18347100198, -572342232, 4397576694, -231330474, 0, 203543744, 57752960, -87719190, 75993322], [13187509947134, -30679410400664, -3256270374129, -74747470556, -12617987978, 5029923493, 1270327636, -5228550974, 187405102, 0, 151208678, -241179956, 143746132, -310417020], [1032566839045071, -17428962454388, 8458226672, -58913275570, -12195117090, -8551962620, 247496140, 6981189200, -2068465601, 401345096, 22193102, 217290340, -46478648, 46478648], [14395342354136, -33805958894139, 5268855025280, 239345556902, -14650061063, 7099290064, -1443675090, -7154115269, 953503677, 0, -437476831, -128665790, -258695266, 278864550], [9059257202506, -21440367770664, -2761894528479, 313406650920, 3810160536, -105684599162, -3080248728, -12591070634, 935066806, 0, -773487200, 219590976, -600761558, -143150038], [4418249758406145, 42376498251092, 164088365470, -272620682994, 450368232, 10536603952, 510841488, -10535791168, 5739535971, 1411073376, -428592600, -27839568, -48300192, 48300192], [-33163223773040, 77403874830453, 12401661771756, -47725369578, 3678595041, 13443702324, -187155746, 21508584435, 166321253, 0, -107059767, 65160594, -189582674, -825918218], [29047962511758, -67543607151248, 1122436695009, -222740516888, 11047724656, -162898273798, 2720164328, -25544363414, -1665541494, 0, 837310664, 5361424, 817507982, 1362014158], [-70045984852894, 163220218739190, -14196140522439, 186800045088, -17812822032, -70768337197, 3348031392, 49006120016, 582803792, 0, -278968336, -386000160, 468164864, -621206912], [33590519703324288, 281870790081248, -422556162014, 1431422981028, -65072177334, 42534658604, -4604169916, -49328993808, -14875853058, 2734966552, 3944153498, 1040640716, 356352920, -356352920], [14901561763056804, -267616688220716, -615132061282, 867916619186, 80972662923, -31376968832, -2921499752, 43556169320, -17541714428, 3902893985, 956445500, -1565012408, 448651216, -448651216], [21662214008510, -47977827481668, -9093120278769, -2491835643396, -84680826246, 94337210533, -4628606644, 8349377934, -906616094, 0, 4446332682, -1201914348, -1135887892, 151081532], [-19784330185329307, 180109484849252, 22866059466, 268380668718, -82566392820, 19866559464, 774075320, -30246326368, 32392823003, -6024331184, 1608614252, 1650668840, -242474416, 242474416], [-93763346735510, 216524963572400, -1018526206303, 2178337371640, -17203881552, 550842934734, 11254769400, 88223599902, 2201259646, 0, -3259080264, -588442128, 2234704874, 507197098], [8296273692781508, -755415844501904, 1622416532822, -5072153365740, -45697184298, -227461834092, -37871416324, 176470974992, -28127446578, 5019568744, -10752919930, -1813713676, 3968513000, -3968513000], [-212621883108904, 497288104518256, 8923726897825, -1324482024512, -41838042896, 1266171167640, -2076801728, 195968286552, 92570584, 0, 1979538896, -593517920, -885073640, -1755048552], [176460687459326, -418763646820108, 25831983907919, 7133562053644, -29321742702, 225577682149, 31786147356, -98270289578, 9467356634, 0, -12235592990, -1256762940, 5281762236, -4120573236], [149328555804200072, 992358233413764, -67757649250, 2149409047654, 103995498049, 274265989248, -4003859936, -248732572832, -4240622928, 28578036047, 5438145104, -2211563424, 621542336, -621542336], [13234688604985174, -930139585400840, -3886899048300, 6727771252916, -72604527376, -172924596512, 40919211360, 211178072768, 63018426306, -26672891712, 14783850224, 4592872480, -4551208384, 4551208384], [-45194887803039340, 506376846808276, 2030008804766, -3396936195438, 111340660635, 141398705664, -27548131240, -159364434136, 86112655908, -8697688079, -8428472548, -3630565240, 3117869648, -3117869648], [-17929116580708, 61975408833096, 64776440706925, -20346164851968, 245568772104, -523243156404, -16111118272, -38341483348, -39124647188, 0, 36335329080, 2641373424, -2493428740, 1002601148], [222385689122873674, -750330048585536, -9575758200624, 19794780616088, 106795503284, 51505551232, 43742096976, 69418687280, 205146546744, 8813959092, 45832410440, 2639897584, -4638199456, 4638199456], [145972576435388533, 707572821968388, -8723866245212, 21005432260322, 344646114446, 510786391460, -34868150868, -402541812272, 464091446577, 28810810248, 50201660414, -5645799932, 4051395080, -4051395080], [-1006796426730150, 2376419363859244, -170213937355235, -28850345643068, 990371113510, 2990521459135, 22368536948, 617455113810, -84409929666, 0, 54542239382, 10851982636, 8163725012, 7598105476], [462246758101067586, 2420761005211272, 5465275336962, -6837994227640, 652186973838, 768256426084, -135671622484, -794642189808, 331923961120, 20028856840, -17688164226, -19522330876, 15519395336, -15519395336], [-1986248424927320, 4618693331132391, 215078098141360, 14034713383810, 987824053187, -3213867984640, -65139220518, 942583662521, 1113870063, 0, -29108683013, 18150968054, -8307123158, 5452636674], [111862115230320056, -2659263329989372, -8211117459234, 12086215272838, -1141408051535, -1045184257792, -166776835872, 803956376608, -256465884720, -2749701825, 36630919984, 12995172512, 15378166336, -15378166336], [2444657994793047, -5730861349234916, -53559428508667, 28550564824044, -558264643972, 8025674655593, -59866376436, -1284994483231, 72471950705, 0, -54245058008, -3084719152, -12057454393, 2663823623], [30623743872606, -55870042195244, 392072779450783, -15264985743476, -537351660206, 4745607123157, -66625917028, 247657146006, 11624930778, 0, 19337037986, -5649786044, -19662396676, -26036280308], [1043352656389005, -2461645169014812, -310650424647591, 28797708552324, -351290266236, -6736216536381, -340924069788, -1056233497749, 93736239003, 0, -61051404504, 12209087952, -57103010403, 43199929821], [-1331574723774157861, -5199575421029412, -28357674354622, 51556269471658, 673961025904, -1196537028704, -450183147168, 1105814531072, -1368269684967, 36087250752, 88589087728, -30945352672, 48112849984, -48112849984], [500541487774519990, 219037733636800, 9468355519848, -19357141576508, 256100860350, 431701063424, 61973813720, -365021115224, 1131563410020, 110916719758, -22763241764, -4299756280, -5767405744, 5767405744], [1744672553423926, -3989668649410262, 147633963222579, -81395440102352, 2429933413384, -18356161711023, -24341409168, -2239910196200, -192717290296, 0, 138171377096, 29834907280, -5123901360, -31113004912], [-1717346234222085, 4026492241958484, -8166427402859, -16716026894612, -5123766476044, -6858940001699, 302124122316, 2150241926773, 96576751301, 0, 44282031216, -88042641952, 35226501387, -37948973429], [61491700324022826, 12295527637403616, 1211695032064, 19647125616776, -1991644305828, 2071302886144, 859067354704, -1646915621968, -1400060109256, 25128530444, 53661723464, 81115569136, -94018292384, 94018292384], [-4595831145948654, 10738031020233840, 98018816431053, -15180476245032, -1036647172752, -24295880617978, -703026480936, 2143621963926, 2387863926, 0, 53112628632, 13044205488, -81588903534, 282037757778], [224583694958090, -521652158443840, 896614165354645, 674956530108, -574335435302, -44168872109337, -757338983412, -1973973272274, 123971631714, 0, -34762071062, 25742396116, -140694352884, 28124822876], [-1040083234661622238, 6471045981161248, -362898929264, 17666103598816, 6762674812720, 4389418822784, 601343437984, -3012178713376, 1692547881072, -250496493664, -38005350256, -83140759584, -51820267840, 51820267840], [-6674110552283021951, -4901494493672780, 32310281327136, -81183830237326, -3820865447662, -2292218315748, 214067807380, 1788745686064, 793121065473, 395254288376, -92675933022, 65341151420, -27940895880, 27940895880], [7447152525716997390, 35748187743905592, 85416087646974, -119887369623208, -2215358785518, 6572952004060, 566116528532, -6960190811280, 213707190064, -431876507528, -263620695006, 61288324028, -62740485256, 62740485256], [-17424042119163804, 40501014830497161, -2884587912977290, 153830586930662, -12046646498855, -50189665453150, 847138835310, 12531557137115, 502848803293, 0, -229372385535, -198570654974, 123664892190, -30243719386], [16023448248417934, -37420482376343440, 1287263149607373, 44283764495336, -350492326288, -41811918580742, 579069660648, -11856301828502, 16560834954, 0, -61713541944, -27179438320, 99511583630, -54332304178], [15050520414081255952, 29030340122837568, 83621661794536, -131468880353680, -8130584274136, 3015652771888, -279166853360, -4737878242752, 542616053160, 11280637280, -182803540632, 116092973360, 16307388000, -16307388000], [-2464469805806332, 5765724134296053, -3713467149159642, -21258992484402, 5309884003317, 53737067547442, -1398625619146, 1765778271855, 40739592649, 0, -53735227395, 138099522042, -263203409338, -55490949586], [-21567697613396026, 50572828532298894, 3895523327641179, -274120824824376, 10419023287596, 127427156614409, -1097621739480, 16441719381572, -469788945892, 0, 358838750732, 180505317912, -250060440664, -333185781752], [2682753288958549156, -14002118157332460, 23434641930334, -80917896048286, -12552823801357, -6133268778752, -614047541000, 3952950375816, 5775329761428, 394296031337, 78832932780, 181946274920, 43210126608, -43210126608], [5093218210797178166, -96567139036684800, -270506502319288, 412424220119844, 6188570284494, -16354112693760, 183720928216, 18906754119592, 1062149013860, 634290685310, 893697344476, -61907002616, -12181392560, 12181392560], [-16552448558627599, 38720343073981644, 872690700648121, -117785892623580, 17723397911340, -64668389826873, -1853329028284, 3995833994255, -172112515073, 0, -55094403936, 334980974400, -442755029791, -695427095071], [-38768616384497886, 90692083813820858, 2198104299682393, -264106191254760, -1247983873628, 24522098827699, 5060791681848, 29686247378476, -1109955666380, 0, 716522024516, -265427499896, 924288641656, -173920973672], [36626419487305705278, -106012709065782440, 116207390095040, -469462979976036, -9134678371620, -31450977689976, -2951395617832, 26098214341088, -3965536655298, -944381749616, -1052056411588, -33298206328, 298469382416, -298469382416], [-939454907683722284, -79393635788808940, -247430938620226, 406143445205074, 48637734433275, -3186861163264, -2433144230504, 8996266368744, -11779793929980, 132665054513, 143725638204, -959287159736, 339243139024, -339243139024], [-37193443381960371093, 21103576310615708, 92774142346930, -162077996770390, -20951411942976, 670616414080, -5219459149440, -6857819684096, 16426026867769, 2750049184512, 299049529792, 59312653440, 516014649600, -516014649600], [-72286093559535043, 167711230323011556, 3301248672301093, 869433847894980, 49334281668228, 137706378753747, -1646615724124, 40464311011067, 52393009963, 0, -1657349799960, 846373974864, -87791159731, 361285950605], [-3065291578966236396, 212460847180187284, 608282736006686, -927716635014846, -6772423104765, 40485650087808, 1431203730488, -43326871436344, 176143642740, 546456230905, -1917749228596, 82178109992, -151338184048, 151338184048], [1672844167252662982, -49865872922967296, 246233582257224, -632016426003356, -21228021253074, -13623328388608, 4899513538136, 12969774857512, 18949559341860, 985838083678, -797253100004, 561189042824, -546070258096, 546070258096], [57526179896279866, -135449782930407060, -14395878928690323, 1211244678604164, 54807064129350, 261214898407599, 95113202740, -42036125935950, 65937439646, 0, -2131520137290, 870232641900, 325117413844, 660241224580], [61655102236935702434, 138914234347122280, -61832435360996, 380296603013148, -21064654267152, 21081232936032, 5014575637344, -20458453822656, -13459039762042, -5188496155200, 563830856688, 741178791456, -575575442880, 575575442880], [-69190282248716165, 159686267068778092, -11750527646941287, 1768465384964284, -57219701665460, -230031605482875, -997492994724, 46982439097117, 4750112583533, 0, -3184444284856, -638198426096, -289271446485, 189334188395], [88467739420053601732, -194609477257905808, -172165447248850, 15075826029380, 15342939357326, -34442644451164, 1395862876588, 36873025996496, 15000013250166, -3851409539704, -228399654402, -137743795708, -125811908088, 125811908088], [-105832309433520766279, 421881800837997428, 4535515090090, 800973878607702, 26371950294228, 98634909310296, 4760478446344, -88943030799776, -34725532486449, 2306664923696, 1161880254580, -188129984744, -457234846160, 457234846160], [-46835843066288724, 109063791783277168, -17706728958409251, 211535839859824, -39820760128784, -96527154578284, 9962122265840, 40560767651572, 266859673908, 0, 57307047392, -998272115264, 1672377509228, -601962604436], [239455724540137852, -556015620741762264, -2988955205169151, -2614025277244480, 52839989749480, 512990868382476, -4921496229888, -150535912192404, -5323628257876, 0, 4540865720728, 771169732528, -759576927908, 352441857820], [-128861710448031410709, 119185554629171132, 219976697949448, -315213847792266, -146194618917042, -21833085826524, -12206817225428, -7018158115376, 24981125987907, 995856514184, 1469994025150, 1948074013828, 1025874321160, -1025874321160], [-43034985710263920, 101388698288676641, -14089978368118068, -1018872526147906, 15450008060573, -108223111927852, 7110709067110, 25550486973287, -1935189982863, 0, 1502789027941, -148435517494, 729271989910, -3315913600066], [-1427625735388144866, 185929658118546048, 474821937053400, -812602833067476, -153495501895158, -38462663769216, 5724673855752, 18549558321144, -95316128165268, 3377916460698, -906599048364, 2837444997528, -856211885328, 856211885328], [293318786558927915, -683633828526089452, -43868037091512651, -595380235462996, 53064133422260, -551895105769939, -7160898174324, -228513993167419, -1536791149547, 0, 669562265584, 1036259159264, -1205289434565, 98191842235], [-317507382267161524, 739484042863094707, -20848690195060110, 1003503921045058, 227095328286691, 202921318669718, -23141959228518, 157546883553305, -2742365622897, 0, -2744008384485, 4353617587510, -3220861167638, 2684035802818], [355030346333476221, -833594044805159332, 19992471095431897, 5537902624303572, -207038145337796, 1183454202854875, 13862474507124, -150739390441853, 14415688632499, 0, -9754159093216, -3133758451136, 1605987362989, -2698779241043], [122752105901352396, -288790813875684337, 7235544301691442, 2376116775469706, 123793525724687, -542555357762986, 7189892317762, -128595090550819, 1519695838347, 0, -5453477685593, 1694061168974, 545659509298, -6155655940246], [-344846206034079999, 807420854698685588, -25337176024064583, -3149160151620268, 182771975178932, -108128614585489, -34625221196, 189904696521911, -9721880740185, 0, 4978810545640, 2399134560080, -55198925615, -2640503966959], [16878275940010019246, 1127808237372988416, -1799318586900712, 6136695657200620, 122514769615018, 298199069212544, 1699651278344, -262986360631560, -69113243187732, -6947419498886, 10624101355476, -1355105038184, -34454624016, 34454624016], [219023484913416345, -510890776976459820, 82584098429848037, 118332108626036, -131452065210380, -622202749711369, -16104498393900, -145854006575617, 3390155051119, 0, 876737692680, -1225268330096, -1816356083607, 8247986305961], [-32936490045856529174, -216472551010687136, 995896042637920, -2730379002519272, -81765443959788, -129765233946112, -9823286909648, 99979027823568, -132499868395256, 1683916896068, -6679871902344, 527104321168, 929618258848, -929618258848], [-411343122865953659, 963149034863466620, -96677949264056619, -3664487340626572, 6212393895260, 905273417968851, 4484902123028, 308726293495739, -1850628105877, 0, 4139352524512, -280862429248, -1726999560139, -12839037494475], [177612012939412428162, 1274454030191214528, -2653439451610560, 8410726594371504, 153364909273704, 390165348292608, -20092587667872, -349795129024608, 48693834573840, 20642685347400, 18729974019312, -3070610958048, 2316319862592, -2316319862592], [-128867299700269513249, -1560445325138132372, -7483893026285810, 13537384502523466, 305903049158644, -183393469889384, 44437588743752, 304172573434336, -125600959349103, 12630385721008, 25473102064020, -1875885559592, -4256170318416, 4256170318416], [138871028668318677688, -715255249307315612, 9322655248398, -1365670246525082, -223512744904287, -176949463447936, -1599143584192, 151817405670208, 180986054123616, 25481596032127, 3951983948704, 3536028792512, -193688520832, 193688520832], [187354354108230272076, 582584739553323056, 3722003394780716, -7019496821498512, 114583557263220, 103832584546840, -89147125048504, -178616705997984, 23922538602848, 954798563248, -16775231845356, -7470783215656, 9661790826416, -9661790826416], [-441838472581815998, 1033244958276200378, -83960918705075031, -2581990526507560, 46394557791428, -922491045285341, 2026977718008, 251112441464716, 935890979412, 0, 973692919908, 534179226824, -2977942352968, -17450868709672], [-38851731073531867000, 1286129178637047204, 1883931438414638, -1947731409371834, -316750775792015, 98027424292096, -48243914099520, -188001674395072, -161835661583328, -7007610012945, -3184102921760, 2921971288640, 4532194281088, -4532194281088], [454662822049753693, -1061356761149978356, -152055303917464331, 972116904957684, -344969563466132, 341909104113995, 49736229239316, -193044831992845, 4275443092259, 0, 1353555810000, -7117698837344, 8606398772429, 413463460173], [-214936341120244895941, 2620921636977991292, 4377212386290216, -4726274686534314, 38591195960718, 474264330006564, -30862389552724, -516066048410800, -261313435231117, -8935914637688, -15091639669762, -2888230499836, 3375062005256, -3375062005256], [-33593682652145754876, -847618461345817068, -1812473830247298, 2656110092118738, 161125425386043, 6248048206976, 96870236512024, 98203262577128, 341134956656964, -21178449148495, 7163486799868, 2968175753416, -9983841226544, 9983841226544], [785538572062800933, -1837332085971151988, 97465247867090489, 4446604126293204, 553646137363436, 968104731447587, 40415872467444, -595756880744437, -8309874158149, 0, -10665691668752, 6634222785248, 5707120256405, -18514493970667], [-168128382017704544763, 558868724153544516, 6048139101643692, -12133251329819502, -202449573685674, 76272805469076, 3047244779772, -143203974618096, 338647613727033, -30203611648920, -21945320917242, 3033775119348, -608101989912, 608101989912], [75018583941372674, -166745232066793592, 57674409279865569, -7359002277193604, -937615193277638, -3388473009601301, -61643855587892, 10319732786638, 23629339119394, 0, 12447370588106, -11286081975404, -13504545756692, 5407208779836], [-32772041169364020, 97635989832923000, -53581405100660415, -21744805261574176, 764118827521976, -2326046837363668, 11354249105056, -189991409882356, -58717302209460, 0, 38275009716136, 8789015015120, 2864262463084, -5821951804756], [-912335082825617286, 2119993853541926050, -91719079599665323, 8461173735513048, -299201290070524, 1259692059028295, -79934442805512, 670349918346188, 24153621320180, 0, -13217249138396, -282088774840, -10372194632104, 28355558419832], [-54402440214689861900, -4264043131693503276, -7654421275131842, 8838547310810434, 502064937625923, -718702352835712, -17708873050632, 797610979189256, 72669958988820, -23105741160039, 12576816020012, -8523368406168, 2623224145680, -2623224145680], [-758176111098522340, 1763666024893311249, 76197772031661826, 4953344717345958, -105808116746823, -2209551460030746, 123850135062830, 491954269410299, 7007313613021, 0, -10390756123551, -6374089336638, 16131621183806, -36817939807162], [365363969022452904, -829120890860294304, -284368575314913155, -23222554361360736, 23593754686560, 192305525015704, -27003899019360, -210771023459368, -53805541410984, 0, 51338692567680, -705866085120, 3878581013544, 47102670172200], [755879459711235698, -1758121052525923040, -66083715173392127, -5285638917943048, -267202703618400, 7048245765629430, 99929003671416, -131807779347834, -23550367873690, 0, 19433590102344, -8932721213424, 21982220198194, 18914818532978], [572878905327468836, -1313466022090673809, -49785049690012914, -23158946209632934, -18097814840953, 4810560886285834, 81195354352338, -138407370374587, -38922289849661, 0, 40474218768991, -5472950488642, 9393972057954, -28752543573926], [1077653406187201740, -2482993486677028495, 321420850857483802, -30369322405714938, -518174967926327, -1331962121130002, -53706909342450, -638482433065685, -22426841741651, 0, 51189652004081, -7294617084446, -14173576093538, -9866354040794], [-941173569733338815342, -4490103199792980248, -13649793858553008, 21163494880169252, -58654224111340, -995381694872424, -264797122805624, 862583825643424, 6119580492930, 4447493701040, 47031010240308, -10329165642856, 27512628844848, -27512628844848], [1141943722675493861295, -3026511694924941908, 15825460255298894, -41041270979963542, -1307329587598380, -1219505174755880, 31718616277768, 938930401271264, 272763533415457, 13157598177584, -69808789937548, 20343128766232, -5206174504400, 5206174504400], [1085240120611550246, -2532275723820387030, -366174311433731317, 127026087557840, 577473534492280, 4165291230504985, 32611030216848, -672993953289368, -32688491238984, 0, 6511138490552, 6572957548144, 13031437652144, 25973200495728], [-461516152631849356, 1102309505402974912, 194243314812972417, -26641977280445264, 798205373630656, 15007501348590620, -283152127358544, 584812343867324, -44759704942212, 0, 43718099336016, 21664392252832, -42287178899468, 50051840608372], [1822352195737176488697, -2488265757460942988, 2071930930291730, -9746808666828762, -426765979067940, -831393922718264, -6429984897320, 739181916916128, -373340935759833, 38502273836048, -18457593559364, 5406913273480, 102307162384, -102307162384], [-2253662786374169722202, -2075989835619941000, 5989253702033400, -18391900562255396, -2529256659873852, -1343711235137992, 272216879539304, 1143017857541920, -137266957534482, -13516740311312, -11423874721436, 57330214045496, -32954709358480, 32954709358480], [2391189235932343982, -5632564679676859432, 289529266594589511, 56210840328190820, -1846156234895530, 2044077584452493, -26477833496940, -1218218679237022, 164060985454030, 0, -108070204344890, -20607316019572, -14776149069996, -26795595833468], [-838592565456872721418, 316308485007621440, 11242178597691816, -24268925264130236, -39658911426818, -150738964136192, -213233986595240, -138633910497240, 284975900793636, -180870166982770, -62848913145316, -10477924496760, 22371191109200, -22371191109200], [784053042756990218420, 6030666865047277460, -15815456534350626, 46361956646922978, 807720451691571, 1628447454554496, -39873977424136, -1388636208413944, -794495596811884, 79074717403945, 87363957732524, -12833193589144, 5270717101328, -5270717101328], [-2816331845703640652, 6555681601301095869, 328996043185935166, 11288241170123358, 3593379662911821, -3769012570098118, 11330095626886, 961989366570743, -100010612348479, 0, -19912813985259, 51701825971242, 16519774391254, 19566950358142], [1926226709907733674, -4524911935165992016, -316671123830816767, 33509647364732152, -2675718169030224, 13274243610550670, -153172767009288, -366457425436450, 183298254245694, 0, -78977768098120, -28275236624400, -47770012898774, -57402060860182], [-3605405542048840456, 8335964290633550901, -595729636111468752, 75151515567651462, -451930665352503, -7841473606090016, -127842004341874, 2057447998605483, 129785399803789, 0, -128386004837007, 4525048031202, -10449491029186, 71069501164742], [1232403714533589379974, -7109905459471768000, -25462504364493656, 41575167000614532, -1020882398447010, -1746557761526016, 292548928921816, 2027327199200680, -1048694320238364, 292743062698862, 112211381811292, 33490004619784, -32603893354160, 32603893354160], [-1444843570000611859, 3443115037846489228, -218921033986978731, -75029330402037836, 2941407575950060, -9924382251234181, 155050913989332, 167485468824995, -257101060573485, 0, 152923188701328, 28821218112544, 46535435647069, 48805046133469], [-4058522157502274844, 9423061970463314585, -147527676750022922, 49107458795248838, -6120215531894743, -9816844909501406, 107530545987790, 3636775771254475, 243673506083181, 0, -73223361053231, -88901958381406, 7353771732862, 18140271057926], [4247394353466370425595, -1545500214821269924, -45441238344240262, 99673582369122010, 5249298469086792, 2160229997667440, 533636614149712, -754846279919424, 280025873527425, -139506493595680, 150591345020040, -52708760310032, -48092785383968, 48092785383968], [6235100209405767059, -14646870100361785572, -7183893909306875, 100273924119613692, 2010782502896508, 31622690659103133, -246329242078948, -3691814201119243, 135204745846213, 0, -194691771710376, 47626364918064, -35765703971965, 19874357301059], [2203693983195757936, -5040672233397483487, 372263447531008764, -100613150503490050, 1921046150062205, -14670077127937820, -284217326718042, -2404527658765049, -167423958485679, 0, 159177092690757, 32802383602058, -57357901409194, -35374563929986], [4282545070475064463621, 12849403868833144228, 8973530157361038, 2841153319202486, -2860142101820320, 1513031865728960, -58740836001856, -1982259917298048, -967199090641161, -135564287577728, 18801265077856, 49584270286656, 915656571520, -915656571520], [1013626934424765984, -2335781594299848149, -415890488210792804, -30253487426293942, 1857120432067311, -8634556065641756, 402161872385538, -1166331440394755, -122842263468405, 0, 49611138845959, 7168591405326, 58893941811794, -114860754731894], [-1010272400065823224210, -6102123291246689536, 94281624770947032, -220746222146260340, -3405874479312038, -3753486023985280, -36977930508600, 2546744140665400, -668490697411572, 148670227609386, -443417245754444, 31310667636440, 566726287216, -566726287216], [-9996990668988668994, 23355155696474557600, 473932847113441997, -32786967443899704, -3260880146568928, -27694648101198118, 720919492529736, 6683112014452682, 32033606595050, 0, 48213569134648, -79546847593744, 78846519457790, -247140047647042], [-6316310019327767964060, 7645900561867282480, 49654489583672090, -92637380826685284, 88764933633066, 2047602498101484, 224519528392196, -2187851269354384, 2945914794853866, -247090039206248, -183486734711686, 4852129079564, -22937165747176, 22937165747176], [12253785140311231746, -28762848917077594512, 530512246257227969, 182046973304307116, -5257619219785214, 28786611392967947, 23051057170236, -6184830496572250, 384059507952778, 0, -285429494455854, -63864055827548, 29098098158172, 186303489448172], [-3271566679763386492150, -1719412734267564448, 8490372992595264, -22385522154899192, 1832977815712924, -447424666053888, -226679541562672, 304623390179120, -979186220283144, -457105532039156, -118276717651320, -41564501057168, 26824404261984, -26824404261984], [-6457480166495501109, 15100690481755562780, 723682564840877625, -34196665602859492, -6913018977153412, 35555435910655557, 532427445891132, 7329011303772765, 101144124874157, 0, 82571324508344, -125114504119312, 66513558856123, -74745147491205], [3009815914428561667891, -6831964892917408260, 52089139884835150, -124318045508348110, 5938686070775708, 153610952480968, 974945147776600, 931814932760352, -277781791022043, -14923520417776, -349241512088196, -69769855918840, -90517529185776, 90517529185776], [-15651275362085274576, 36519225203394838640, 318770101618778749, -4940700514801056, -2062526671431440, -73460900239602272, -763953544350240, 7857816892799008, 128814864306976, 0, -5514619420240, 3512540284000, -130325325454736, 108814376792560], [-1535687021638949050366, 4997373235130367176, -27100100986510194, 64716779013949216, -7109152418295926, -1609319857434388, -1160407631555388, 73676954316208, -1185525950531052, 309165249999768, 233283575706970, 69286465530188, 109112116602520, -109112116602520], [3635480848962789094431, -52513449912613708276, -85203710801880980, 82362399707559206, -10432614539208534, -13741166194940948, 231686021888772, 12816420604873840, 3175392021968083, -226975441980264, 336610619028730, 213180687998988, -44486670988776, 44486670988776], [1781455889565344782596, 16404547139955811860, -74731837421323842, 192082923301366578, 162722005894155, 2846101761799040, -688350567081896, -2843458295345752, -5043675241723356, -208353136498303, 338076110508316, -17330900674424, 70568146775632, -70568146775632], [-54124052327012286104, 25509137075527814148, 7389327016244254, 39548588884282822, 11596677159780369, 10056968270221952, 61746807580896, -8287558889294176, 935671376533968, 115300832540127, -34677726853840, -200530530174816, 13878372259392, -13878372259392], [-3535342409807463058, 8281942407312410914, 263860632828336063, -33909150671280368, -2861292598693352, 26142513930785173, -38661522662960, 3910998464258248, 60447821145784, 0, 50261527808216, -41372751630416, -27963845693168, -59784954172464], [-1323422525122743703, 3081050753893835860, 817643721917499801, -9292476878544332, 19445408478947188, 5414337875255527, 290353332211348, -2928187731841169, -642082205777441, 0, 5262452852168, 265122301767952, 106575149389369, -22599887032455], [2649338701269908968398, -53429430831574067648, -102320561654142472, 126281923922772876, 3058158301742874, -8792320488559488, -1042882141222264, 8971271282769272, 5820643410057900, 19836477759562, 316353800282900, -90647927626216, 113353006884848, -113353006884848], [-5197633377510511609355, -9879665801181596956, 62106497368783574, -154921952150717018, -4718901843758040, -3034646523553744, 484701150986512, 2167944845219904, 5876737247657247, -746912567677600, -257908708095384, 105968823105328, -59066997409184, 59066997409184], [19315558708700472600, -45085177079676461872, 3469179764400476061, 32263282166985728, -6958529979137200, 18633656749692920, 761513020756096, -10384997909793352, 216128070262584, 0, -48083643302096, -129983115878560, 91921804796632, -171920880894376], [-167232220158992602636, -42595095879391184620, -36623909344106562, -3733508242598894, -2905952285838053, -10525538489174528, 1463955680213272, 11397938783861352, -4147199915715516, 985834848322001, 47470593267452, 111282694102728, -157523837431600, 157523837431600], [-1997930409738895127873, 60423472276639853484, 111633368744851018, -121651596249999934, 9432134192313248, 16569524883036992, -1120835213913024, -16362264862709120, 3230341523015925, 549288058452096, -305751711904864, -245882466003776, 136671767991680, -136671767991680], [7532387576905090813612, 2629067330425198448, 71816798575866632, -142978545066569432, 8731472982167616, 5358113458658432, 1512386903642752, -3277022017899264, 6059895861077412, 581076922940672, -296676895516608, -97679653116032, -141470725052672, 141470725052672], [1703201551508608708, -4339343712305169955, 1637834348986969510, 359791362506794878, 9453704876565373, 65888649162630962, -1760243734618842, -2209687384235641, 688221433668209, 0, -822563768021307, 245744676921226, -357147019489354, -271236039749154]];
    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_16_b_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_8_16_b_a(:prec:=14)
    chi := MakeCharacter_8_b();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 16));
    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_16_b_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_8_16_b_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,16,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;