
// Make newform 384.5.e.d in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_384_e();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_384_e_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_384_5_e_d();".
// 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_384_5_e_d();".
// 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 := [21479188203, 25672770504, 12462543468, 866573964, 385003542, 210288484, 45109352, -2262056, 724325, 391324, 22064, -8992, 1348, 356, -32, -4, 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, 0], [-4573864312352467946930648856154217786765396489004850531413144828, 5645513870317326952650237706682038763140128879527195266006119270, 730932324891710230018137664748235097649862804818305349115803757, -740689750345069103408831871973039715106211571943996525733702290, 32896841542345584853048628725132109677529267459802350356922963, 22812664983680314711635961883724305922325278193284660514042462, -2306668800015137509983427674555372493420381470750835421458273, -1772204691843134099504182376395028060648653097351324741230970, 319785225025962553031280004444736099331689368260215163330575, 31585320085896748337163311628769530776586215294706390955816, -12715657558614362695455280668790680849020314986894212214257, 160624828759432117535431942437264426850850483108305473968, 256693217070547964178106098745548469353666737117992543858, -25136456596098738449092418028348160263335778577092562630, -500714144488728650417526374219704779738855752733939248, 131839451189518287953087740352539234290641314051729748], [-144714969754637660900132947527223075060173377041541159665003209864, -28768827551721790979857955929051740963778554164984405677652270640, 9968896005238395124613436577534406481898160006497126809195801546, -3461783866534680403056809666361156072962857735335115797942082800, -476965209346880137825925984740692545404440801711482591006441026, 51397921652027886415463453432280003099350855361208462328713756, 8191131897036533384881709329186192344566441067374318982194696, -6341416919395213395246280856990026030705075512574704610311080, 43971546709650405908726596867094136305909702262815464308770, 109888255864211143416769853580368619156702044421967128599668, -22322514412851428828629923356281152946481046764821031016296, -1596686907793469053953463498711168269727188231914125145476, 606107548817434872140244673966025683480449154975370942704, -48766781757379781676558712130301209948541098496190236520, -3533177857807977836637577183250362191491810512419440054, 194594495891782511122277897620332803426033527233270764], [2865527061880004629128795961862773744057244877765104482802647833, -3500350877272035139951729729060661831736796619580588693796597770, -699271592809348083218640080450059917116479536851936983267801287, 59289312194118794867243906128769485336264552441026787734637590, -2102232357128938651060754830064134655131042291670353625233253, -19565223802976019498126757537461301424393817023864638238499322, -77472264068210456149528300144691395743794747311281893489597, 393003665983209746770400344121110561915879405006948181259710, -62129339677079411164786059547511867028329189831991828179315, -28568305407188695873806293226322801855995782191449316069936, 3702861231405039580541108129412982932910914021047651127647, 305631869352064413454934305507519852062240768655847147272, -147577717642780327320390280027521661625531437033231059628, 789416296122730682191827280187888397491084001620561290, 2377005165229489482745569439166519452676435592356701148, -269188267812460519988488265939980063882533937349593028], [58520646862166293181166455902286694490618561040138628722996433, -55960219107691526225423729945100276492712180262353028708511030, 19393978479114421792225300626182586023636824421439831598090833, 3842646700594926625740901866192496965760005844077239519530830, -1340124648345935158677327260246309235003958780800113012197223, 166838079275644807876445467348472615580210387910275895265978, 51620407013938364732332366651465619804172635720790298878853, -4632313239427733409178256877583750994768504512225493050990, -1528708758575143051855115636905754398443414964702027175525, 416869315378385786366991312129068281082330209238501543024, 4626755533623307217532649473739388598168143636515408277, -11253293154793787914217069700674033623540572570099392228, 1337684731730561243891385447856463416237417927477782182, 146917722087081614992392228111024169573155069400435330, -40084338150661120355898117358261918462265600812740262, 2800764926540732973893841178582387325691922992641572], [-9077775806219600374356535965702394733880681558743542712850388467, -3093896690198746895728101799376444027758066677566990865538519230, -732089105890146427213150900603857270462591610378652480472813447, -145102142538893040799626031868016133476363021888926745227314230, -58196830532827982650817878788766715981523903823087664702903633, -10547164274165260843061489179537752786149506792289297737208842, -782496521208656598048214112751340616463298167844433820200027, -246798548798373400338028463761509438673192668994457316097750, -63885770252037835522772743112143253554468896311452421740265, -8058922516492423695759357007702092572941314702122342262196, 585934930075583834574215301612174575296358077200087534437, -243227921990177808702914774230950143883201005787768847748, -65576901520051147603920184533969829095638141249170991338, 6284015103551728302269967942795387297522107250227313910, 527096732614161851418209294071845850203269862386588258, -220703504023904302951538137639490844213374422599749528], [9498870344778294496024279475080875699762550343120289794383955856, 8963474114610768123911477069531441341217588672441221510967342580, 753433922987979918339052491070875923244906409619779076515836366, 155566864839078414830082158992434250039832990592225542094423720, 104436602667846559246040031049862959216051342579666962897306044, 34976770271266603678267399863122852939096551136574082710902416, -1231013807837737522590711546488487234758020761256870452128284, 138850095870392344221031308972338933942560307704331075831620, 228165592710077091089287617145369027234669153849664285911550, 28248622667365891487305402005903876016530795389641705426888, -6578680139190950208692090796617981179365352580937661076396, 491343913972361614029636728656680406337620199284311791624, 266313079209871473749729759154058002237838719106952327884, -15983496212164404425646034867054189169222275389432034360, -3618348906998688204447152946997520471627516675471432474, 681477551561160490334006228133010575973586702992399544], [1932815896246914942971892582585695775216879640826192367806491944, -3482440035729149536528325201881127325935954667987908887073032110, 145281351185185261835775081214484558556934159977414999068367459, 48388326105966522284397734393914061493024884181778209917998710, -9399275740224945161562389202060844728261146396837129898508609, -18282663645446127917139264842262901966674654916624853826823586, 1524864492211577595639545987445419278527645801563585942290109, 140565125334424276119342041880732929837531549109215870878090, -76126764165360917691255691887219537761592169781386354205125, -19017880026927432773801354942907008835507318694841957852588, 3527507890896159217992084086876705342279048630057024809561, 138139646214437143779928043074216536395721146083037000336, -136331003467590421917716246136794117277456694498277692904, 542046650985516867058958321096768989107532842843724970, 2715615707505537588557931294559889543901698944426674424, -309235442031492677293488946266498399127487438917048624], [356616929934851594746549355927493987183406993085915830069953, -19461084053222204702323420998140180025892757090544266228844, -13241400951718689792215212329017871396427321620349476677106, -3206969050599837713915934395905173336938080718682970597908, 171072635612125007255984698317637523122583298278468203798, -321048988541789898115692323592692105339542684467792493324, -30930719296350159088492140353075161709597601396119790794, -3447229955396059385692682603928220066891103332713747940, -447414541010783152849107732119234148401920431722867876, -316531602152439203829716502174548119631822366555746336, 14398162849831379471926152819770358112997460629336138, -4564938344192025633762851116605644917972480221218624, -1905046427357300189032858596775935733586808405603862, 119928357526396457130947326415477564785893308449036, 34533697018600221663762015825538813852524876492560, -7551109798418552870272693487210604310860002278904], [16022877904949489492980479861350396009086732521749342968379119458, 12144602755307665684491702436491628020483290404265481190985448480, -3094143824946664617724272474720515683724642331012832617350603982, -468467605322812794474542030261573531341115468123098968641732760, 426422762575755063349308621189562783003359267776994593673114782, 135687321162512069759168195297305100231662748656012239618511468, -17490758109408919920470536978764780867800716031214110801427292, -197673076812639963801879028787614022500583421797925080833040, 1275878609445621552563399261032195009454427370332439308392840, 138918927221665892924654840862184591780121291514545943704884, -53667604115105789297928500189423006060484877473851530559768, 2656090114991826640260728203125334417882605993074531409932, 1923870478166913073553738769615383668129671567725008394242, -121272100291988770406474879343390624081572500913308314280, -28095733992591991966094110278146056180059573103548165542, 4361598287757788039442560877543258370994918200214327852], [44013132320152515440659297487708081094432, 40265228441968860355008630779263870549440, 1722841534534307297276129109978808246752, 459837995914463264031696304915306488960, 628362737814238777751657329079454805408, 198993391334864224764367051801069617152, -12387389581978303846406124922979836928, 928140510545805541029704401231302080, 1542415596965550248478941496468045280, 164643318733841528714659928999110016, -50554767306633622888186593659547712, 3544259968666087260441581855500288, 1931650357119967318624367576603648, -126005419800997440478927022992640, -25871728873346714002012541207968, 4668889956073961853105883639168], [87390093900227531207737261476891907357919153032138785793076427792, 28466190909903565465892490976307014859215837221655228990675851630, 2906351134018304055594037738835213878082075420710065606575083617, 1091714276381621759606679670376505557968877006826008908365236970, 864124445607145388734030851989217372435924097008997327618401373, 80100842668281243552596395428741290547054990566694137774798282, -3810199633047968052938395354416270695089229853067958896343093, 3188020062386258890265050963624540065243522608613043981614230, 1313857085547070357573534734768402629601305103986622262808425, -59728884158545133870783053158355366863026964314831126082364, -14364881601446832938484975668218023115495838464478271359257, 7244331757845242481015140288909000195139405756393468410728, 395682088128304332420582950923079071531687027844401938908, -135377526825008069836203070481332812886082805849416777930, 6094648099433845861595627028031059422028464135221832492, 1660194212734138352247723462108336390318878878329098968], [4290813577406295761591247792674523455097285863069043978317399673, -29636282706061158797696518887140931537973684241943686818426064910, -11734541208504795922690421069007288578251540972199536580856016677, 529713224180137663021996174593726174828705577933342410331572450, -420667056703102115225598930255364705225474029210791081674248623, -380880300469955288491107727603151154870926823575180504807652622, 15989813466306778351725837093157832343165203973405586621657003, 2938080259172798449907903863849474677225775905878381157306410, -1836996971778239302196390901479478028702115242381916064716165, -487622208812134281952488885394924885730024671052732672223316, 89090443182346957622147477902185382456842575897477399476127, 1078433317861419468714560001042484976433181842770653173592, -3896824443893033103990191077184300806453678746938947017328, 143836783439366053941815960476171478205601008170206609870, 62094519045395538783038969567210524680630163339668383138, -8672303320675990817514437560151844548537517997725076688], [-343434156619333675223764191839500200765259000373474394160934832549, -173161991022074400060232609446926733995715950259076908321367623570, -24527976447923072943136721897249624155312320538039052949427613019, -1861213638786672622400959421881152725277865944230847062585362890, -3314255824495745946331622286067308278755831642966998923452268201, -613246340900544993287873364497766240833897348905102296754254754, 30925637627196378776055399671936777054815529147555919973346221, -5627847398429324874447467912328064440571768210516772481166690, -6298241529292837147613831188186168436561691319915263117251045, -175854728926626890622561964873063349930230418826848303431972, 134617404238232949090915696339840020994039385656344233707149, -22402297341473445427932386878990441554510630895186020382376, -4565926602668919437569129192949382387063050026048832180086, 558834927115128949390540955945233947828621096625877725330, 27198485987753071674591707661880639920211043024340485786, -11377230621776082579927294904412292947625100863372705416], [-239164130049430420930863526101560801024359031342018242223349556608, -192958107846339689705551940695702327604383240918109579511450614880, -13755502167879775538830610114446173565565382898944029689935574848, -5285645198498158648515967174617824962403901328117151170502801760, -2944676519394689027019143755995405019716160547872728679327722752, -831705299927570537965003035562991742087944846680129574935044928, 43936689029059034344969835016329325935855425023322816237701952, -9824558408549476368821047364827843361618378750325405488243680, -6444325535834502715270552696292007843024607880492362854015680, -497307530748555931610473627185577131463239301011131349490624, 164595303397935304586508273054902215471699720486549692724928, -19470213630044882659994957474024718645004125250923330279392, -6563360574574854327587008051967256266811756488807674502272, 491796417471823060374998388826344296628601986063516934240, 85914757945013404259688913060131905432552931904357910432, -18187754044829657671632879131017245477838262662213032512], [17931784177979460107612707024889170808476515204509918859635719218, 27797949589009736078015523158173219352873215083683349927559993980, 1531700717659415167149544303432806671899364690277636424722340218, 248939733936293036876892191716707505040152290449432550665161440, 349862160639136064619749220222545565522858937101026370210631172, 120785342617090518985659793901465887148262319561537304864265248, -6744831873352564437936921012690724456520373660661339775944572, 343832297728841208462511372544963142871494947746763504994820, 883635309582521091186038894494731927820353091156497827081320, 81643023214611251846119515935969490789571986036122681625264, -26087089808521348868091232001066196587411029285770472823888, 2337976938388706029666063043135674891645347478434750869992, 955642540807768901017961143732822668538756602464864370642, -69728649550641306868576351991628703847667782219160944200, -12230028156801738000708660624832025341718787823463959882, 2417573662945782569269026758197038027299668142916936192]];
    Rf_basisdens := [1, 652890532498752510828597757648334377779086550711304186745842005, 652890532498752510828597757648334377779086550711304186745842005, 652890532498752510828597757648334377779086550711304186745842005, 1687055639531660234699219012011199942581618994086057330092615, 72543392499861390092066417516481597531009616745700465193982445, 217630177499584170276199252549444792593028850237101395581947335, 72543392499861390092066417516481597531009616745700465193982445, 1450819489347582882411914619842303873824398188307732379467, 652890532498752510828597757648334377779086550711304186745842005, 672108280477603974429885920125776082365, 217630177499584170276199252549444792593028850237101395581947335, 652890532498752510828597757648334377779086550711304186745842005, 652890532498752510828597757648334377779086550711304186745842005, 652890532498752510828597757648334377779086550711304186745842005, 72543392499861390092066417516481597531009616745700465193982445];
    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_384_e();"
function MakeCharacter_384_e()
    N := 384;
    order := 2;
    char_gens := [127, 133, 257];
    v := [2, 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_384_e_Hecke();"
function MakeCharacter_384_e_Hecke(Kf)
    N := 384;
    order := 2;
    char_gens := [127, 133, 257];
    char_values := [[1, 0, 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, 0, 0, 0, 0], [-1, 0, 0, 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 := 5;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [5, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, -1, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1], [-51, 1, 0, 1, 1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0], [-3, 0, 1, 9, 0, 1, 4, -2, 0, 0, 1, 1, -1, 0, 1, -1], [5, -2, -1, -13, -1, -1, -1, 1, 1, -3, -3, -1, 0, -1, -2, 3], [35, -1, 0, 11, -1, -2, 0, -5, 3, -1, -3, -2, -1, 1, -1, 0], [-125, -15, 3, -44, -1, 1, 0, 1, 4, -1, 1, -1, 2, 1, 2, 3], [12, 4, -1, -26, 2, -4, 5, 1, -2, -7, 1, 1, 0, 2, 4, -3], [-31, -5, -2, -5, 3, 4, 0, 13, 1, 0, 4, 6, -2, 0, -2, -2], [-9, 2, -1, 11, 1, -1, -30, 15, -1, -1, 2, -3, -4, 1, 6, -1], [-22, -4, 4, 42, -2, 6, -1, 4, 2, 8, -14, -4, 4, -2, -8, 0], [-22, 4, -2, 71, 2, 7, -60, -18, -2, 2, 0, 10, -8, 2, 12, -2], [173, 33, 5, 126, -7, -17, 0, -9, 10, 1, -1, -7, 6, -1, 6, 5], [204, 8, -10, 69, 0, -1, 0, -16, -12, 0, -12, -2, -10, 0, -10, -10], [-16, 10, -12, 56, 5, 4, 102, -15, -5, -13, 39, 10, -5, 5, 15, 2], [97, -44, -7, 219, -7, -23, 0, 3, -3, -5, -11, 1, -12, 5, -12, -7], [-897, 17, -2, 25, 11, 2, 0, -13, -17, -7, -9, 0, -9, 7, -9, -2], [-20, 20, 8, 46, 10, -2, 152, 14, -10, -7, -20, 4, -6, 10, 26, -28], [110, 0, -4, -236, 0, -30, -52, 3, 0, 12, -45, 7, -24, 0, 24, 4], [432, 48, -2, -368, 14, 52, 0, 5, 30, -6, -1, 7, -8, 6, -8, -2], [-205, -14, -5, 497, -7, 65, -21, -59, 7, 5, -61, 11, 12, -7, -26, 19], [973, 7, -10, 19, 18, 8, 0, -10, 10, 0, -4, 6, -10, 0, -10, -10], [6, 24, -10, -27, 12, -11, -228, 28, -12, -6, -68, -2, 2, 12, 22, -14], [-1509, 5, 7, 544, 3, -63, 0, 25, 8, 7, 21, 7, 14, -7, 14, 7], [-322, 12, -6, 718, 6, 74, 60, 20, -6, -58, -92, 0, -8, 6, 20, -6], [-1577, 3, -16, 247, -11, -6, 0, 73, 1, 5, 15, 26, -11, -5, -11, -16], [-16, -20, -48, 89, -10, 17, 136, -62, 10, 20, -148, 20, -18, -10, -2, 68], [518, 16, -13, -1180, 8, -134, 235, 15, -8, -3, -157, -5, 16, 8, 0, -3], [1250, -200, 28, -149, 0, -35, 0, -80, 24, -24, -32, -36, 4, 24, 4, 28], [-532, 8, 12, 1044, 4, 100, 45, 188, -4, -92, -284, -60, 0, 4, 8, -20], [5465, 3, -10, 239, -8, -36, 0, -92, 8, 14, -26, -30, 4, -14, 4, -10], [-2384, -135, -32, 1321, 32, -144, 0, -64, -73, 16, -16, 0, -16, -16, -16, -32], [-3759, -41, -22, -169, -37, 36, 0, 93, -135, 20, 24, 26, -2, -20, -2, -22], [-83, -28, 49, 73, -14, 9, 24, 112, 14, -178, 235, -51, 13, -14, -41, -21], [542, -12, 8, -1130, -6, -126, 49, -72, 6, -108, -290, 40, -60, -6, 48, 4], [54, 4, 58, -95, 2, 1, 92, -66, -2, -38, -344, 6, 52, 2, -48, -62], [688, 301, 12, -963, 44, 104, 0, -272, 51, -32, -100, -80, -20, 32, -20, 12], [477, -78, 29, -1095, -39, -99, 394, -21, 39, -89, 312, -21, 6, -39, -84, 49], [3267, -428, -5, -2203, -37, 183, 0, -31, 91, 37, 11, -21, 32, -37, 32, -5], [-929, 58, -3, 2409, 29, 269, 69, -317, -29, 71, -273, 141, -48, 29, 106, -55], [12645, -9, 38, -713, -52, 40, 0, 0, -124, -2, 6, -30, 36, 2, 36, 38], [-13280, 182, 40, 91, -42, -45, 0, -86, 90, 16, 0, -56, 56, -16, 56, 40], [-24333, -131, 94, 1401, -5, -266, 0, -165, 55, -27, -21, -88, 67, 27, 67, 94], [12, -76, 104, -142, -38, 2, -856, 78, 38, 1, -652, -60, 26, -38, -102, -28], [10700, 437, -72, -943, -40, 268, 0, 412, -65, -4, 72, 148, -76, 4, -76, -72], [522, -128, 74, -1124, -64, -90, 1274, -103, 64, -18, -711, 5, -40, -64, -88, 54], [-735, -42, -15, 1437, -21, 169, 878, 181, 21, 85, 550, -101, 80, -21, -122, 57], [-1165, 180, 107, -1219, -21, 47, 0, -163, 123, -27, -17, -97, 80, 27, 80, 107], [200, 20, -68, -282, 10, 6, 256, -290, -10, 171, -572, 56, 142, 10, -122, 48], [-242, -12, 96, 434, -6, 58, -530, 70, 6, -120, -782, -54, 80, -6, -92, -84], [-550, -66, -2, 1426, -33, 198, -1398, -273, 33, -63, 647, 64, 15, -33, -81, 68], [352, 160, -108, -600, 80, -80, -149, -204, -80, 132, -512, 92, 88, 80, 72, -52], [-19045, -219, 46, -3255, -173, 238, 0, -285, 159, -27, -149, -168, 19, 27, 19, 46], [-2689, -607, -9, -224, -61, -91, 0, -395, -168, -53, -211, -149, -62, 53, -62, -9], [154, -40, -94, -416, -20, -26, -2090, 11, 20, -298, -669, -41, 72, -20, -112, 134], [35886, 1014, 86, 1001, -10, -23, 0, 234, -82, -56, 76, 46, 30, 56, 30, 86], [265, -10, -41, -329, -5, -5, -231, -343, 5, -371, -695, 103, 24, -5, -34, 51], [-35406, 702, -126, 421, 38, 109, 0, -86, -458, 80, -20, 26, -46, -80, -46, -126], [684, 62, 256, -1324, 31, -152, -934, -205, -31, -103, 933, 98, -27, 31, 89, -318], [-6861, -1484, 27, -2797, 11, 141, 0, 10, 15, -63, -38, -2, -36, 63, -36, 27], [-734, -84, 86, 1454, -42, 166, 531, 202, 42, -398, -726, -90, -16, -42, -68, -2], [43436, -768, -50, -843, 100, 79, 0, 84, -504, -12, 16, 78, -62, 12, -62, -50], [1385, 20, -199, 2749, 105, -93, 0, 398, -79, 119, 154, 234, -80, -119, -80, -199], [-100, 52, 200, 98, 26, -46, 1144, 286, -26, -381, -820, -28, -150, 26, 202, -252], [32510, 1829, -14, -1997, -70, 386, 0, -142, -211, 86, 6, -66, 72, -86, 72, -14], [1516, 136, -236, -3060, 68, -364, -1648, -296, -68, 372, -84, 168, -72, 68, 208, 100], [-1386, 238, -134, 3142, 119, 282, 1626, 95, -119, 193, 891, 44, 11, 119, 227, -104], [-56853, 403, -36, -7849, 111, 1046, 0, 483, -173, -53, 121, 210, -89, 53, -89, -36], [-17780, -167, -52, 3589, 156, -412, 0, -28, 315, 252, 260, 60, 200, -252, 200, -52], [77031, 905, -62, 819, 89, 50, 0, -217, 563, -40, -124, -22, -102, 40, -102, -62], [3521, -54, -295, -7547, -27, -855, 58, -249, 27, 147, 652, 175, -330, -27, 276, 349], [2348, -184, 318, -5376, -92, -548, 919, 2, 92, 430, -276, -66, 12, -92, -196, -134], [4453, -339, 9, -6062, -371, 543, 0, -121, 262, 57, -101, -167, 66, -57, 66, 9], [2680, 192, -155, -5488, 96, -632, 1285, -500, -96, -293, -36, 252, -64, 96, 256, -37], [14732, 1152, -274, -4886, 286, 934, 0, 214, 110, 154, 138, 258, -120, -154, -120, -274], [-1032, 224, 248, 2732, 112, 236, 848, -240, -112, -75, -48, 216, -184, 112, 408, -472], [-8790, -2315, 70, 4959, -114, -954, 0, -434, 129, 34, -102, -206, 104, -34, 104, 70], [-5767, 246, -7, 13381, 123, 1457, -4866, -379, -123, -587, 406, 195, 40, 123, 206, -239], [-14666, -728, 4, 8294, -28, -1058, 0, -613, 568, -192, -403, -215, -188, 192, -188, 4], [65957, 19, 178, 6027, 256, -776, 0, -324, 296, -210, -114, -82, -32, 210, -32, 178], [-1292, 184, 4, 2724, 92, 180, 296, 500, -92, 207, 904, -20, -256, 92, 440, -188], [2644, 80, 345, -6296, 40, -804, -1727, 634, -40, -337, -10, -102, -248, 40, 328, -425], [22030, -1528, -128, -6860, -256, 556, 0, -820, -228, -84, -528, -316, -212, 84, -212, -128], [-3271, 22, 175, 6839, 11, 747, 199, 497, -11, -1563, 1017, -225, 200, 11, -178, -197], [-96933, -357, -260, -15509, 297, 1998, 0, 541, -419, 97, 203, 366, -163, -97, -163, -260], [296, 56, 32, 252, 28, 60, 6144, -956, -28, 797, 832, 392, -164, 28, 220, -88], [7474, 300, 266, -16822, 150, -1934, 596, 82, -150, -166, -1248, 30, 128, 150, 172, -566], [106561, 1769, 348, -5175, 78, 452, 0, -738, -42, -278, -266, -336, 70, 278, 70, 348], [824, 40, -212, -2215, 20, -255, -1176, 332, -20, -792, 528, -156, 176, 20, -136, 172], [-135592, 126, 136, -1917, 42, 107, 0, -290, 110, -124, -116, -128, 12, 124, 12, 136], [3550, 450, 250, -7570, 225, -902, 7766, -383, -225, -713, -423, 216, 185, 225, 265, -700], [-2544, 256, -154, 6244, 128, 696, 2229, -598, -128, 174, 1160, 230, 164, 128, 92, -102], [-2186, -416, -517, 3156, -208, 346, 3579, 1791, 208, -787, 239, -781, 136, -208, -552, 933], [99971, 539, -160, -1331, 571, 446, 0, 517, -251, 240, 496, 416, 80, -240, 80, -160], [28187, -2375, 427, -8476, 215, 569, 0, 641, -396, -505, 65, 143, -78, 505, -78, 427], [-97093, -101, -328, -3171, -169, 534, 0, 273, -319, 404, 220, 144, 76, -404, 76, -328], [-1763, 270, 269, 3647, 135, 239, 1037, 731, -135, -253, 1725, -59, -284, 135, 554, -539], [-164, 232, -68, -888, 116, -168, -840, 1244, -116, -1235, 1272, -524, 560, 116, -328, -164], [-818, -424, 237, 1384, -212, 242, -3039, 309, 212, -1141, 2949, -247, 8, -212, -432, 187], [151498, -1578, 146, -8539, -186, 757, 0, 1082, -1050, 136, 532, 250, 282, -136, 282, 146], [-15071, -2860, 425, -2163, -359, -653, 0, -1358, 505, -113, -402, -714, 312, 113, 312, 425], [-280, -228, 592, 1015, -114, 255, 5000, -726, 114, 896, 3932, 100, 198, -114, -426, -364], [-108, -304, -18, 1424, -152, 364, 2214, -1618, 152, -670, 2542, 422, 48, -152, -352, 322], [5693, -432, -519, -11567, -216, -967, -3668, -2002, 216, -64, -1275, 393, 391, -216, -823, 951], [-28963, -3836, 437, -7385, -299, 61, 0, 391, -31, -41, 281, -115, 396, 41, 396, 437], [-242757, -3337, 440, 21079, 153, -3074, 0, -43, 637, 85, 415, -110, 525, -85, 525, 440], [66109, 1525, 121, 1810, -323, -393, 0, -1953, 550, -335, -1013, -799, -214, 335, -214, 121], [1706, -128, 764, -1996, -64, 54, 3292, -2539, 64, 1076, 2481, 681, 368, -64, -496, -636], [137940, 2668, 162, 721, -120, 263, 0, 1728, 428, 268, 912, 482, 430, -268, 430, 162], [82797, -727, 680, 8373, -250, -1504, 0, 582, 2022, -54, 510, -116, 626, 54, 626, 680], [-384, -552, 307, -540, -276, 80, -1321, 1034, 276, 141, 4226, -694, 496, -276, -1048, 245], [-116653, 1511, -164, 7025, -665, -882, 0, -1959, -703, 64, -920, -820, -100, -64, -100, -164], [-5059, -996, 89, 10633, -498, 1417, 7176, 340, 498, -718, -3669, -451, 17, -498, -1013, 907], [3009, 70, 75, -7289, 35, -909, -1629, 773, -35, 1441, 1905, -181, -160, 35, 230, -145], [3272, 120, 996, -8369, 60, -953, -8536, 916, -60, 1780, 4856, -436, 512, 60, -392, -1116], [-71031, 3325, -267, -1994, 857, 1291, 0, 2155, -1374, -163, 663, 1093, -430, 163, -430, -267], [81734, 5992, -204, -3874, -524, 1302, 0, 1079, 568, 192, 241, 253, -12, -192, -12, -204], [-7115, 446, 833, 15007, 223, 1319, -3453, 1887, -223, -681, 5589, -271, -628, 223, 1074, -1279], [-652, -180, 1080, 2350, -90, 350, -4872, -1006, 90, -1657, 2780, 348, -218, -90, 38, -900], [-139317, -1367, 646, -11921, 269, 598, 0, -469, 1071, 84, 448, -282, 730, -84, 730, 646], [2595, 82, -81, -5207, 41, -703, 6569, -167, -41, -391, 2875, 343, -780, 41, 862, -1], [99567, -4535, -361, -17192, -317, 1461, 0, -1211, -320, 59, -691, -389, -302, -59, -302, -361], [-14228, -484, 68, 30820, -242, 3500, -5276, 1038, 242, -1622, -2922, -568, 182, -242, -666, 416], [27289, 1351, -126, 14031, 722, -1500, 0, -1562, -2910, 312, -52, -238, 186, -312, 186, -126], [175748, 1085, -176, 17009, -16, -1580, 0, 740, -641, 276, 400, 300, 100, -276, 100, -176], [7178, 5584, -260, 515, -276, 485, 0, -1220, -316, 308, -364, -412, 48, -308, 48, -260], [-6077, 464, -585, 13375, 232, 1335, -10012, 562, -232, -640, -1053, -57, 73, 232, 391, 121], [-15789, 1921, -310, -32775, -771, 4110, 0, 1253, 665, 311, 265, 264, 1, -311, 1, -310], [-13446, -1275, -530, -21393, -378, 2678, 0, 886, 721, 290, 106, 346, -240, -290, -240, -530], [8568, -412, -411, -21106, -206, -2288, 2811, 1631, 206, -1997, 7, -841, 480, -206, -892, 823], [4571, -5036, 59, -23163, 219, 1783, 0, -1507, 2243, -35, -425, -449, 24, 35, 24, 59], [-7809, -966, -489, 16629, -483, 2053, 6667, 601, 483, -535, 799, -521, -4, -483, -962, 1455], [-148181, -443, 258, 7227, -99, -554, 0, 3219, -929, -208, 1004, 954, 50, 208, 50, 258], [10637, 174, 1073, -24233, 87, -2705, -7675, 223, -87, -1913, -347, -127, 332, 87, -158, -1247], [8952, -404, -585, -16550, -202, -1536, -9607, -4051, 202, -383, 1373, 1445, -688, -202, 284, 989], [-23841, 4927, 256, 6589, 243, -358, 0, -443, -2203, -292, -188, -152, -36, 292, -36, 256], [-4391, -298, -2419, 9067, -149, 1171, -7945, 299, 149, 1963, 6577, -443, 732, -149, -1030, 2717], [86049, 789, -152, 20357, -458, -1980, 0, -114, -434, -698, -990, -140, -850, 698, -850, -152], [-8086, -176, 762, 14333, -88, 1149, -10364, 5072, 88, -154, -1580, -1494, -766, -88, 590, -586], [144468, -4327, 788, 15325, 1012, -2708, 0, -428, 1731, -140, 580, -68, 648, 140, 648, 788], [-5626, 1126, -814, 14102, 563, 1418, -17894, -1325, -563, -523, -4061, 716, 303, 563, 823, -312], [-115898, -8183, 230, -32497, -482, 2050, 0, -1646, -1343, 670, 114, -786, 900, -670, 900, 230], [9770, -384, -799, -21260, -192, -2314, 11137, -619, 192, -1265, 6433, 297, -656, -192, 272, 1183], [-24289, -5747, -322, 11903, 1097, -1526, 0, 255, 275, 124, 360, 558, -198, -124, -198, -322], [10985, 1074, -839, -22283, 537, -2887, -12518, -1261, -537, 2631, 1956, 1287, -1526, 537, 2600, -235], [-398004, -4003, 1168, 18633, -992, -3412, 0, 564, 1671, -532, 104, -532, 636, 532, 636, 1168], [-3326, 500, -806, 3754, 250, -26, -1656, 4616, -250, 2430, -2588, -1436, 192, 250, 308, 306], [168169, -7483, -1088, -17903, -215, 2364, 0, 1839, 143, -356, -540, 904, -1444, 356, -1444, -1088], [6834, 778, 6, -18998, 389, -2634, -10154, 4661, -389, 1195, 2629, -1348, 161, 389, 617, -784], [-35555, 6367, -898, 6139, 179, 256, 0, -2907, 569, 436, -1072, -610, -462, -436, -462, -898], [-12885, 802, -765, 30535, 401, 3355, 9138, -1641, -401, 4279, -4898, 705, 328, 401, 474, -37], [-179123, -3003, -300, 12201, -150, -1104, 0, 1650, 1082, -534, -234, 600, -834, 534, -834, -300], [-11476, -512, 375, 27392, -256, 3044, 4519, -1142, 256, -2191, 4790, 698, -1464, -256, 952, 137], [40484, 1048, -322, 19336, -1202, -1068, 0, 5491, 2410, -298, 917, 1537, -620, 298, -620, -322], [3343, 474, -1607, -6847, 237, -659, 2159, -1193, -237, -4173, -4913, 249, 920, 237, -446, 1133], [-12426, 72, -690, 31923, 36, 3667, -13284, -3980, -36, -1114, 7300, 1702, -1054, 36, 1126, 618], [802, 1744, 157, 84, 872, -626, 19333, -327, -872, 1643, -1919, 1157, -1400, 872, 3144, -1901], [-170951, -8995, 1320, -16843, 830, -292, 0, -3482, -602, -1370, -1374, -1324, -50, 1370, -50, 1320], [-2276, -660, -128, 5186, -330, 754, -22072, -350, 330, 363, -5476, -60, -130, -330, -530, 788], [-8636, 648, 723, 23612, 324, 2812, -17617, -4700, -324, 3189, -5992, 1764, 56, 324, 592, -1371], [2358, 1418, -614, -1738, 709, -446, -7354, -2995, -709, 979, -2911, 1712, -723, 709, 2141, -804], [249315, -4531, -10, 18365, -847, -2978, 0, -2271, -4867, -89, -1135, -1036, -99, 89, -99, -10], [208009, 1457, 137, -10070, -83, 1779, 0, 4027, 254, -115, 1291, 1269, 22, 115, 22, 137]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_384_e_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_384_5_e_d();".
// 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_384_5_e_d(:prec:=16)
    chi := MakeCharacter_384_e();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 5));
    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_384_5_e_d();".
// 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_384_5_e_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_384_e();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,5,sign)));
    Vf := Kernel([<7,R![-519546316544, -271760728576, -22111959680, -12942592, 29617840, 186176, -9800, -40, 1]>,<13,R![115283511800064, 1020751011717120, -13278939766016, -218176770048, 3129196896, 4006400, -107088, 0, 1]>],Snew);
    return Vf;
end function;