
// Make newform 16.22.a.e in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_16_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_16_22_a_e();".
// 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_16_22_a_e();".
// 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 := [-89637, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0], [-192, 384]];
    Rf_basisdens := [1, 1];
    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_16_a();"
function MakeCharacter_16_a()
    N := 16;
    order := 1;
    char_gens := [15, 5];
    v := [1, 1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

function MakeCharacter_16_a_Hecke(Kf)
    return MakeCharacter_16_a();
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..(prec+1)]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 22;
    raw_aps := [[0, 0], [52716, -1], [1054070, -20], [-222385896, 4222], [-26903201660, 527181], [-245183338466, 4314508], [-3296932336046, 30718184], [-9651198962660, 366379451], [204868932888136, -944258822], [-1202393761072530, -23192603812], [4344953585279584, -18061983176], [-1093102048125930, 50855746684], [34089019286779338, 13526799376], [-132264826133002012, -769879839131], [-213247205779311216, -2319694970380], [-1527990137794759066, -2918184305860], [-391712498761407212, -7304311733439], [-3588639524539298546, -23337258872596], [-8337061587005769044, -77794800439793], [-4724131574924358184, -231241233933906], [-5793070167251503766, 528252850485192], [42640351109357948912, 355065026452268], [190907311020043122908, -591846679323509], [-29871466215347989830, 1314255056990664], [391697330463355975394, -156001529627000], [-185799191634979669674, 11427231871117980], [-834421043683469263816, -2785500043135450], [-1174376038086711106140, -554592182719435], [-1547198774597966874626, 1815447337775420], [-555560600348588317902, -51697545265493056], [-3040389775384433962624, 70193567835427232], [-11619384472557344382100, 119441787983713343], [23418566025471215524266, 30060657834682064], [10187694063880400526852, -167211982280001139], [31430705130677227774534, -783242725962347284], [70200251493668943986632, 92924659899973594], [-91474599421229322201362, 324207791261246604], [-52379892007698528149556, -948678982974802473], [-10159635602290803642120, -1823779817933961258], [158818546123181288557374, -1716031672744204948], [-380051501686117091208708, -1945026821045755277], [-358750000362226852012314, 3071317106658760844], [732523998687100032292416, 5369353190999383696], [-71243736126142948053310, -9202115807422970936], [94402581781269881154870, 4357902154966632268], [2245024224136810119200600, 3841952293029254862], [-845443341081511083904420, -4095876143003712341], [2361061390009778893521056, 47416872313068761480], [-4400133512023191034799988, -46684755626062657401], [-6343091555637313096784426, -25786535219172100660], [-5088457653810444920109430, 32854453374007305736], [-593499822887588618650672, 78450473581134037892], [-12438856273330117914062670, -17081464095319201688], [-20159629086559134779216044, 51192336878983264401], [7205933356400711254807810, 221864915257704908800], [-2895344336967920513653736, 38885569734803572734], [23948047272559986583915294, 6902854685637226780], [25772631733474332148745776, 326179013553996439100], [-34943443543947426808304954, 171646020317630248764], [930813652304471193185914, -50512486778271298904], [50599103709022866934894516, 116325769824295014377], [-10193140992762405336932586, -144509260761496767988], [11967495846392002056517500, -550410834908315535053], [-124392728634217002319247448, -1298255182005374734734], [-30472997510587453690892262, 670460206455575696016], [79053839839926168630498318, -1768068661445231060900], [222287481850803252767120452, 1176563407334816252605], [86422626505246711893731730, -313287889860312271456], [210167086735073710830257268, 4530095488408307084921], [154592287538694680227710126, 4501455334931379958524], [-18611252116985632687890206, 623533623762074346784], [-123828897460887613159665864, -6158498462608699023642], [-896810348134346164539912880, -1116527523886217291740], [201166742921596186642905254, 7079488886417001242844], [22282323800232935384680660, -8689920153106415386575], [-855962399164137577391203200, 10892227224293542556064], [-1190262752179051362368777482, -14845541305302506279492], [749088822190017408774379934, -11553402400683923891652], [-2046148536660648300041718318, 8606855290871142525096], [1844033768765752660211063802, 4001048513657065033168], [-2221412206798940053208406324, -1443405634562966945417], [4529316568219370834832465302, -707059259462671074516], [-1347692212160892601564173808, 36073823235349412785108], [291231602244290298563307634, 51739960293828442358184], [4895943879543412654058660136, 23973670774896878393682], [-3867198801966842554363560556, 11817016336541073578945], [-3094958577165087054131096638, -58102886104119564492984], [-2774601153962741590156870678, -33568593218807163856432], [-8820753994358681613594165538, 63598091502163935463260], [9246698077956207793538927728, -29193313137572768225076], [-11980764939479916397574196900, -16302657014980217539957], [-6598216354333836482853342304, -125677593564691408254392], [2863719346575377777098350776, 143045264957378220270854], [-27024091771533366958364692956, 27838592431564157870645], [18717207645333806742071995836, 30443715732904255771747], [-8951636473739269256497150488, 5027135624886034118146], [2454118897699895269362868686, -315448175139588785021748], [4499430945868132285369577770, 32151193301141440229520], [40986099937149492185423373956, 189885261007374602581901], [20198596292395254491593527918, 207725696737744862625900], [43872472720872506850896971852, -39047839146349494389929], [-59865497792224197409616204098, 16434529201372665814284], [956247317016360582597646972, -297290593589868287177741], [-47122635456776140197320645350, -536047191597804809074032], [-23810206932028170991001706732, 321230192594687429384993], [-45268491985800762883479401662, -629699605929807820847840], [58256260067334680707569174340, 725268791657539408011837], [-131312217019999670377740621166, 558575716851258745912128], [43807233600321567805164638472, -591564700996777976188118], [220374644939062950626472721594, -107431066589616999595064], [-61926130513330651841784679136, 1546205166610803883878504], [213045431972500725701599392086, 207077929558812996143276], [35651215714947429278357760522, -673731717064516570252696], [-92337367529969836803999915100, 845696897122742428413429], [-175308274777966198591351464088, -308294608830841131303198], [-4206859807542129289929622654, 636552362346120318239112], [-142620674918738653353456369300, 519978326995645396749567], [316647109779807165563491430552, 2200204573878625305230750], [-282620396262308360316757497186, -904300632100953625665060], [-127605381751298792844798181476, 3723668143400455692835323], [277939864985280576667321624646, 43236914031179870888972], [-53454091370462868080950510046, -3839183115949147397323832], [-338295221920294136332253839210, 3728813371661480702649788], [-58654210826684501529674053532, -5360627132503459893556859], [-916773169709537494619555301380, -2301962237076266935767309], [519833567766416030595192734094, 3222151618725829581435692], [-472704402189240085885647656650, 8311493028031493095287868], [1322739816588737168385387016048, -3062025522083516722574836], [1468389823206601319621670709896, 1628140482861268352211978], [-1030838567850459331319916099538, -5875994440069925834172772], [606864505923962219398815121036, 7910755040093248095823623], [332688983703180947429738828728, 5966956553170939931783878], [-172182919461983952813018066480, -15961372080304548630126716], [-947859770617796981423253809626, 2757932116435990758557356], [3055855513306671734414619868378, -1212624411719453772918384], [-2516949931990846753460169785854, 2570415151579040373615048], [2213308003638394102210587796086, -1889309871574428058796164], [318395107142267694625701402908, 27097770033976146676258075], [-2233547941112047734814957761682, 1254932390952273604000460], [1124035745548611372934381790410, 4440647212253665912814992], [2152830070738619165893184171492, -18184662647151094357342779], [3940423416083661133556255289702, 13999792201922111451274460], [-2057747478002642403270190199384, 24950832487751677380023538], [2345618274098209364925073586708, 50680392800635021078442785], [-3911333513811626546455121367026, 30947914384069395230015564], [2859086615919346290412615061208, -43340874603467698079136338], [3877986351580725642162986518022, 47321380890735651849300540], [4207293300725900878456888590522, 33638875692251530392819984], [137837734321300158867817773684, -25453556994420028153135495], [-191547189942390421980528074720, 8462093440752224346732392], [2160406423797881977749140026110, -87942117205390545435100196], [-8511923582436583320602079992270, -11830930425656817493544800], [-3614268730153287087768600385988, 7117848647956297817609827], [10030049445224543739642859829864, -62010346032332451838580894], [-12632642973061402502415174934780, 63888998375902889227957773], [-106657406153556352067330087504, 97600432317396272920153884], [-5561961202513507156613114222392, -11658647798099585495879526], [-6513412810147582952679069818078, -121494065555870179811559096], [25801460533981718467573607680074, -25119351114832669164235896], [-13379187147964386504988222810050, 54192692705602331719362556], [-6949420043451110260585927512324, -114427884953190043986883309], [-4852440357280300310376215470950, 196438371292015386828991056], [21904739760614780733258112149592, -65294676563215890801508978], [10334940298840450680604772333508, 57412570909797885928963837], [-1097475904613416650295449834222, -49171866528244846425483800], [-14902111385995605377145220084344, 289554105610187421609504330], [8440682295710663386858431898016, 295130576467836519735639944], [5791697252562157009958915716822, 446140508550648185298662460], [-31237018381067745367952471031886, 183251679954056763047559400], [9806744270747845082279367380774, -295634213536438438307920372], [-44512738897210791116063451534252, -204875247423046465706992847], [-17193254851898089176548559356466, -458465079772824485960612676], [-38948254075759464305610158043880, -26788733436271201395966274], [-4870452644876399925284569272278, 359387076944042458839986472], [-12747150966803676548904200360144, -387242606669215265318299140], [-16757817678080090786867848438406, 246916950420053778561776680], [75144291825883982862164953726132, 72899361894653497737524489], [-43362731793349798882796209933290, 423166786576478207280896348], [30623904597577002764671241204600, -228167661818796350835707274], [-60165551961379781471301872798530, -173336161905171427654069204], [-42986962076769425855786639544128, 803854558464155884378329840], [41922907336460094324430238284460, 574429615309530152267757423], [20590841457766314889674929562294, -457490568962571753853512404], [79329248320740135556471377206634, -498248040537824026354762712], [4280811889122734695826913252336, -1473138281598326865621900180], [46364726778069240218401581114630, 126542160978171185926612460], [128874860863858084596718872662446, -8980725704157090975214708], [-69407962336886747940913495049460, 569551076413539491732921319], [-1378199524666505261704452780278, 847744356137171262739053904], [29662912048603840747903395149184, 294015985313938170320444384], [-110439391037958471892481250350462, -284747533990093830730495840], [91342261178462926312169506499076, -1139051402684326148338118515], [11742819306883418522341305260444, -2025508448630198624733382437], [-122570883326442534987333026858770, -1154084847355466754799704164], [81931521056418221770817896643532, -1954550938826990379722079145], [-1449657307946062320347460533942, 63345165242523014668239976], [189972057102750900429160457829490, -152210950260866293162064320], [216844123918322046139999657922446, 542117111082390924862919692], [97305920691464270041605817955266, 3128181992479428731222636672], [387141268337539170364101642507096, -759213895088588236631610994], [271776155206528973266019114430430, -418790703973341940291047988], [77037399347336951542006248977776, -1434716738284620168020167028], [-110788567078362622822508959731322, 1525814771206298722851406620], [188478560918927717145225931583074, -2213196040047869345886109184], [-33983232206496237795397367917788, 2532537487165205836137504661], [170069057978441357938375039521486, 2945181405690962682149920572], [-169542104357233908749681363968256, 5766626158451681391884431552], [-153889546951109908749163435485972, -1265665277698183617827420417], [-331186485523729057545797736210134, -3572495770578088719635347384], [-451022960536847061535660770293884, 992813423537107042414543629], [214025237250960603802116369082194, 1858208705419183704174422632], [-218602532446023304870665853473594, 4433773681061666959738978124], [-183049516815635867926222725960376, -309665399414616988911142022], [281544745318798405375937300186036, 5999634069366812615541454249], [-262100359180077817474833185429896, -5948939151675752736858675146], [-494416508353218883039176130412854, -1676670339706275806689858032], [214324978557491386745643560430736, -5508992567386105737849300492], [795928989579103089694306909172882, 1095638667341058784766658472], [270475202011428301756086326258184, 6179658040522979667595060330], [230971445288306686922975614031022, -2086913623204255955662155748], [-363933017897718357260560470887338, 7589300083145735938225705996], [157983902908159568876143738783848, -3379644287831805324951861342], [893639129225637468556337542564482, -3922537177876363257688734968], [-832789493124082736170919877467216, -5119046336448516312569173540], [-90709185034393572629090424413028, 7341192487698770992932517979], [-577968716033141018596470187729594, -16307569109445505653336610724], [-1644273811766447450756884850784006, -3844787066869086448951382712], [-1001717907471283609281321640394016, -8126230943150703657750366440], [1524390980930613456858091206699000, 4751239526641252610090660566], [-1805410088783150543427123614918300, -3937036377315419294111337595], [114729600487051254868707234637374, 5324551993899072488598325468], [-100422682814892563650104160936708, -10511844518273442294359342253], [91981247237841000177434755214656, -1607120413123478691781210224], [943091224567586763822803057478890, -22339772500601874251105450712], [-31771178370811783224785745240636, 4445976510347202884148424573], [1817501046896539029422321102436464, 3713590069275047026445201612], [-1299542352317444775934878578245870, -6350045072832881481223669080], [-1267157884669722888252322986411898, -3778896988788746087881608308], [-522563018782328649234632975723020, -20950353578241777999255071815], [1532784672141650855592743372553400, -12448440288009786528218446458], [-2395512019808384008074885311600196, -4206173742102566816973799453], [216224954268322416909417472035412, -8428923180988192081175197199], [-846794733117428378423638105525480, -4878742003641382234465484226], [2714579184030083998205342681877022, -6912304557035221004828799892], [-1671265506279014423220856415580846, 24542554626005069757941108256], [1685827122499998307638975277518920, 29817350369147577370282688954], [687631673561446767231928140624992, 28419327539104979250691773880], [-3427910779379411542956395573367732, -714340622036059816733771369], [-1657831561684726098043133548584220, -6762777748794930472623226715], [2036668261894053133342628630519696, 17900694266005556686504415412], [896172900003914349993830238271758, -11637539124097518305683774980], [-5046438007659392588853696704147646, -17734457599452491269411676256], [2525059539139870030095159903277016, -47714990603579638409190446674], [186193904748833498705531844588394, -25334904668231549480555158584], [-1109290198678385620905761354344098, -55458377092905942260686152516], [-6910979955541402063235374132530468, 23573824396296605291902896587], [-1812767731618264875469595056343290, 48080304290520196797594484140], [-2618157030541996688797482306876556, 23597361205423095482263236729], [4770569513857752909101367275985750, -30409032870693263418096638596], [717629057299898322650330429963866, 53314484426937036850240903760], [-3406253434181450768728598293013632, -6989447666638479855440183968], [1954264035657645114447286080414060, -16548904725094255285964136097], [1854697155634421072184471173218294, -11994985169747260240307278308], [271774065166565545337762427535086, -96576146775791061748695564612], [7089561284926478356862019188972066, -29636931123076487180282313336], [10081799725873320582832367270471116, -25874936292197575498319835977], [-2618979376852305394871622062973122, 49677459795257190433582075708], [1783839711310425788236719065115802, -49834383659406425035422950648], [5124384361745301340373021969074324, 83013403169856063311654161825], [12145598666532162853114970312718646, -401546806138354730106548900], [-8505154195450483283467738475777570, -59415585115720671592059683316], [2754530015161818165275643774255196, -10990169085658794701454534837], [-2297003824996901813700248786161862, 43133008497767931697158097320], [-4688723062000469568321955299849568, -118796828540922815010332677304], [-7519542800081178728765604616798286, 53164261939436340114880957216], [-4632061947589112036364215771310872, -102253297384677414349154594238], [-15879883307027736179687594827469484, -27755900390620166700472729167], [-9725563502249332137739970435224882, -1129235600842153826578472372], [-5343887496536120713998297087751382, -86692266979621409292816686008], [951701599440693091801218738956572, 67974922413002203093812365819], [11907703184749753490991473212798816, -47964231984180264191688011784], [-2882657994144091403039266217737096, 266032810418674349808490535414], [25232038812502653832957734989218216, -6801605974036745420779376462], [-4684189004055601631780679209752138, 324341815082744956316947270508], [-20139395873102313664949974061585852, -27506991848784182206249567907], [28628724262532255020700740598754544, 102036683149665650482723393196], [13227565855947331417779012067149458, -142210345106560153497484941720], [34911778227716703886543108788146694, 14582711553516312906282492540], [-5049343288523322312173014951929848, -28701593039409032061826127958], [14347393547631884061225684871810786, -53687884364668758714842851424], [-18859564346223140642814888811663618, 86087754654223664083932280988], [-19690159274978211268328532876031428, -78527549350798934385671568221], [24200903710937398733897174186292314, -147499516869353515079514947960], [-23172054076685649007439615431262460, -168661562974429435859511705491], [-1493676804934747374709094151556194, 194418770728068661609151820124], [-7132864551141903638384260052775442, -137917488387918316565236306964], [-29878220897173337870667919867997984, -69737415235357724827167166632], [-17172229246727645810362793699871258, -9415696442999004262373728276], [-33346105397648166063337352550119532, -31101041279613027697142159743], [10098396098557105269754306445191468, -366028903580290965769099623825], [39141733168497800804478155672388074, -61730951401954697030514308720], [-43819719824866296924700524765862178, -13570216340322792672006944884], [1436288958280940714600334054151792, 74503782238206979716395473036], [-49569867248361899619629220655607972, -119419733649006480258471666517], [10792282981705859040673640127704052, -53400061842791221379632468295], [14956451726671076735089363281042530, 58338803735649545701839617608], [30825610141739605792050794109686820, -205257045441618390357186328043], [44828369282968842021933308894773118, -38766182271953889190735892948], [-2506368579514900858748757363920920, 61398749530178031830404631746], [-47354873647955094092910755764311178, 483964530452436741257906066940], [-721245263182893307525908941100240, 520204446543262923474437567356], [-34290103618663987740311321810293818, -7583400125992800716587825204], [-30637891570055206465745708076219998, -211926057168062669551918875832], [115626846874857181717943761202758220, 132536394530647594824137895063], [24057964259748347602919134896570232, -433902239159802354383877841034], [-36791732190796032911161549305858358, -179369473255583852218041055352], [35990225780238785577853307982528636, -107074590372889110689278233645], [-63866367338612323588748737796920128, -337828451735075365471393005456], [49111126467963472378214273982156098, -539119507650565651003396682752], [94475403041225902855047545617352850, 381948611918470172675677071424], [-1009741654756773865240197690650404, -230407858571868406194680044405], [-140314368859630164886048483948959302, 33697947687118707054123207696], [-7974969663478339030792403543296082, 1292114656941457918783537472892], [-39395465167107638540117932854327520, 293965590779019710748606186472], [-113170677962724097390972812969272566, 498979172819490136239972256656], [39464606234376094740567122386458162, 785939202601314407933345378344], [110871690225304333888924447501342572, 129876644296400401401671446367], [83557207635731439796082255703469620, -861240458103595753120352671415], [154256977649631210486708134645781472, 230442664959964144906979590552], [31761815991703315918862491483813014, -1091785674706303017115641157492], [43662123270569514160425327124082494, 634864603427333654260852851340], [43865272058101073973746304752791950, 920631768874920525285138298652], [29247915176493192190660084870813248, 1349131246923516557458132842832], [25197436652092711453994793016296492, -1047089071126889342340801007249], [41515200273820202921455705662379716, -466924988090858007546181633475], [-141878672642459808977699403550555404, 797076535158766743371723809497], [209072371216000798858006202704535086, -440430179926116599410774039844], [219345796797091885018823230556307042, 954218426364691391376243412768], [163953341663289470402112295970144906, -1304251546452776196528624040344], [-72851186689091162562375820918514736, -2505477689323575547889480716476], [-11601102217557733418259172061489114, 410773731667221798269274402444], [-37385818075319448390029039939478822, -1924457050119253754364444540272], [148384953885516780492039758095198326, -209234320935175356165314934212], [61171062426124910922807532319566872, -1403197795155464099205304123778], [-119599023951591491966288636392452754, -2831749854321011323882087305044], [151791857662790615701569616442784076, -1486682554475713360464369400137], [-140188015128270819276495232119076074, -2104668371886919926777654611732], [-199953061865161013291784062743437340, -27232901406208527336044918971], [377838044773859289844458423518091408, -290033022836569097435921457164], [6305781656218090680440497492024678, -2995041845808896421177500296724], [31619271391510570947426482028704172, -1209207896259114378500733571857], [-146895478655423724911742636131745430, 3307985930790267431717246049808], [286038951382356280854595618803928670, 257620681997521565716492407820], [-318977685505476308001482228050195728, 496822658848044266604734009964], [86771045724721621522300892378484230, -1168664703455836083480266070164], [-100925765780799176588017036208106566, 3393872834619813107374200589736], [-218713033066944808372760523767899616, 2337489642457178782546626397608], [20638994649681354543533889799928996, 868679237914217771022036795157], [363737093470725588692456484982260530, 2249515814410518358523994623336], [447241011717363713351729766201453672, -1592413023418834337012496952862], [189994329878705423821673202067314422, -1192564818476029288760567553572], [-213807390463798314369416010690162774, 1494794502278688625111465756744], [256438404595324656536553593388296112, -1273533861236100942764042771172], [204024580476896877063160761122313524, 2110986419810092107530945337577], [195934493766273526942384452007662284, -3079157912063633625483010447145], [-143068921062793742396507069600056758, -1144792653897436899884595590424], [-149574682046004893758702718896894914, 4690991403866462590557144073420], [106048202090268585227458594017518168, -1067564002609582889782640972338], [-452149841548933003290332618056529606, 3634792687259792589324415152784], [426858603439742684522851245331726220, -986264326315977539701624911897], [-92375077558271311309779701105370588, 1321314415856728795125057874837], [-757894948609834495847423444923171120, -1463853953243197426699482293116], [79630145363312428949642175171287846, 3584208554166454076707477151772], [-347309199672234601389621045091488280, -2872987024760418860527487525502], [-159508526948723455965556170585884722, -2475548590456980480619264157476], [-690449387692160930750613404408091108, -3429587808266186159665938739877], [249940535788362196416320141789110368, 7451253734109277007601221307832], [-379767372585686781813760421582418782, -1199419255133239412126212116864], [-891786632948476877116787973714933006, 3308327868494290218383738984232], [816136380841860596576300037521970458, -2297277898167264249486783424944], [-1289462710024440811250374071236357874, -1882548519833453465799800264484], [83887401087988158699219992364314218, 11111481308472752741283408470608], [1091393426007035867484562921403289864, 3292032590825041970503043282922], [269019126217803745659460445251736034, -2944576097567103394487562911104], [-22834129246014504877187603705068276, -3687167584789462183783594339673], [-678250488071194179270951549994866120, 4699251759135871144557986269222], [546869953937834672288357102325717072, -2373313982168203818781040460060], [892475385261717030058219236398414246, 3189285817436927839459181135676], [-993672968833227205950639825078846508, -7638439786756590466580327154639], [45225458478995932331510333292541824, 1633960209582092918874643420128], [-251504264203273327627288226215716734, -1947840441197520960543551245024], [-882698659195670923684001547537549322, -87187567149643006840886234628], [-528114354882369673487941919448530940, -10296355006544112300964986725651], [604146124770374745014985346564839324, -9587739456219482886443996180485], [-95386702563005814353040971143473720, -5147165782562252135958808925030], [673400029512560525265153554820458746, 9362287914209947810532892584528], [-965151649504445653774012300021333536, 1355334920007302914515788215512], [-113184111971838583411272066934183350, -15103588005371191911914851169328], [-768521932854672920981077137404092316, 10239210176392002313046351174533], [146726275772013640088405938785050342, 11314506102946307652708952043932], [-1247347000259552221905558917226324082, -5460133121380101419662452400388], [-1297749841175588888450059372120506174, -10375047501423180229178134783544], [572356464865280122099915928014432112, -2876290339901937624688562500340], [-478049504349347911206625142009227718, -19076408481807018070743180970032], [-2260110391507669120551729293041085482, 1975775649713334750401114328812], [-70250240025722795114424783455276104, 3658752376830679241255666456198], [1036618490013333850373081245174114942, 5913531060208126565153937407820], [-584380132408714818665321593367057742, 1041148665831618807869115684904], [-593616558819929543188386272769722180, -12865347992204426410035978258269], [1243594460119651731146630546426004204, 2479653412690257138198974089375], [463019450308568634622706677848102482, -22028184150631736595473956325088], [1661826243959117345323455112048572614, 1595773663402436750059711353692], [1362955392272447699033901884466074036, 14108761031249731963978713480777], [-1871223747196170882187903503328676020, 6054935636571391017686140392055], [1247587137392578970872718827440867786, 8896821003879989713288955297512], [276889060694264152830104946543856574, -142116182713882243308791302516], [-2095266845373632052671777983381629504, -9486859344839469402378809174480], [467097892940221661793020196550016728, 3533597230924054813330258603758], [1070965438405445001371829250645398162, -10938504224693364630811686845272], [-320975713164923801238744958471775224, -32385442247789054263144106888982], [-2332208311936921024539188223946514258, -9365109165224813489510142928852], [-2201713337161507135510585005830627242, 3669820864204984005656915122460], [304350181438321379132209202637712208, 22596842885970135810294077129380], [1966755491995655241046896490551437012, 3069652816124633836550553967025], [-952986260209214958038219746014852950, -26375870014847767708444400177776], [-1294097837793808672213401393842367074, 24790969108758165492094963659372], [-283325832982944355671852331338166628, -24273575944169942671071321001957], [1795214854770162567388544700950308602, -5042457573008220002416036540856], [-647239819300287224668920416382529740, -15505714873152611960505807899447], [-3784470722424277914005607976669331672, -14081362652425447471018292046894]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_16_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_16_22_a_e();".
// 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_16_22_a_e(:prec:=2)
    chi := MakeCharacter_16_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 22));
    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_16_22_a_e();".
// 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_16_22_a_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_16_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,22,sign)));
    Vf := Kernel([<3,R![-10438573680, -105432, 1]>],Snew);
    return Vf;
end function;