
// Make newform 25.38.a.a in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_25_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_25_38_a_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_25_38_a_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 := [-15934380, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0], [-48, 96]];
    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_25_a();"
function MakeCharacter_25_a()
    N := 25;
    order := 1;
    char_gens := [2];
    v := [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_25_a_Hecke(Kf)
    return MakeCharacter_25_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 := 38;
    raw_aps := [[97200, -1], [-6995700, 72], [0, 0], [1724221976743000, -9650004336], [-13367018177424269028, -32186306471000], [-265290870826966589150, -724443400725408], [44719536940965883666350, -24633489938571456], [186638233286256856853060, 1292976182287157400], [13120590074966940972731400, -34024622863285905488], [-635336913562941208975814610, -2308319659196250610400], [130710409895709447740772512, 6464144668428775512000], [34012681896910393294366619050, 251014973543177117121504], [-630241647733186566987342420918, 582346983985352488112000], [1285120511578959415584790802500, 4277308746306872497542552], [-2126103437784467012579203791600, -3802403479056906286688416], [-79899868129295405035752839446950, 115415105640300817180680672], [-118981229803045064379449684850420, -481938482040478107746255800], [50899420686519350100053127599822, 2899807396670346630044580000], [5445961640490679054321904676273100, -7835678640912228686313856056], [-373066544896916246344981079434008, 17419362398013361241118390000], [-9819925838248213011954691253743850, -1181005639005244198519101888], [136200819017047919517823972572337040, -40848551750076232862116202400], [235230137695454964654373108800536700, 238689899875563369340619699432], [-666434460855619058957171989397471430, -2334786552264821085521027995200], [-3001030944236614986519565045330618850, 10627502949105201678203260881984], [-91707626645345800863644808706568298, 34038048925456034215078907188000], [-9961230061591122004248605874500856200, 34855177292978739353526575464272], [6421917530924787839984396236435018500, 24630885537760682931284731165464], [14742270277170567272447122138170903230, -41258780417940494578210593208800], [-29307669600804134831823248544074713650, 33638501497340241518252258401792], [163996714562080102640260704885047459200, 3289457630565276475754186411514624], [-124420461956238631186326717911276635788, 5858009220167894066969619144899000], [-647093255957472840071221756074661713450, 4972831159552869876416994180466304], [-4759621368973495193091217082436338119780, 4253427604000757395802335328101800], [-249841683235389768135250916187744061050, 8456169632297395997454162452132000], [-10728911655260345880462030843215974701448, 9548419743621050086637228288178000], [-54325874741845644916208610385699980632750, -42122105812184531133039114724703136], [78316861299633496539079150820336713221100, 8749675600328076043746913999168392], [113630182003728902096147801367275207052600, -193697247188398911418946617384606256], [-279999029465064092297155910740752805732350, 48101375114138767438848143664233312], [-37810903209132004035276423138418913685660, -1002235930128182577575204569003967400], [155270915925568798266431818187464446465062, -653416610994008144123195826350460000], [-839093341221447109534687693809308265442368, 1507402596357183374979034992186448000], [956728996158081562238726884383055582834750, -860248229006850253624081353087027648], [721334867524903164350497125672653449408650, 2842998218230359975951074475127730784], [1371266102267262206151889179938110610378600, -4565072432217238241968965761058474000], [4548965279634817580411184864932522934266372, 31651794368313088909756501505016063000], [-2013936610040963551407801565680758895125600, 99220018078677348789303246474159294912], [-53281441074209166375227539456113424981545300, -37444620854825526912141989750639107576], [-42070960264233534237660149427725297543532010, -23118308402087111785415694186846242400], [30814859630431423932477670941349077065128950, -127220432406495965832058295015287416768], [-85468140709266816414188944322109576470790480, 148150854079377418753224284990517696800], [18192999400938027932597492880260557299810482, -340407761971678525120202598706613640000], [-108939635554992345163876152182187829415165748, -765472312835018634426845270463071475000], [-125288810044716177545656838944651073288021250, -1089945608651225293053025340361565454336], [602748882520195906699169192004191826828576600, 509983553329824807139775248804498600592], [-814129787359426984131324047703842969484870690, -542154072850223957412822465729908709600], [-1044912111029848919348102104838755291947026608, 2040154813777463610704435781085917132000], [-1971410942341209281146400210357013391003372550, 946184079597928885992880901062475833824], [930494707912263029825086293557596574332416762, 5041249819061727761692647218877829432000], [969776759029249041292128712606612788688791700, -4611698165134634212898942105492618124168], [-795859395023996376812078939224205143983441750, 727174556182904462978289624176302483552], [2267750032430606097090055626321255858718889500, -30946134082429563977624493122675898894936], [3528365581751252566153684843366461346824306072, -22407795818226596191591362366259070998000], [-6901627199411288101483653335757491688655818650, 4637147526657978442323321860570017752192], [22446554929936882432863079770207936946372172850, -2596769169935028400888684619724904865056], [34823141392177444385510184742601101647451595612, -42523711871397184695289757623789782519000], [34656428940205977819940316422796814596034909550, 150408530451038299821871579770962048027904], [68266226683966893824759356426497720294146562900, -40555525250542114081543897046784591019016], [115486318943554292273239717792808744909220733550, -47907274629558245052930964889405076396000], [-93893918009125366371107555223000781206574836450, -207408174535694531123968820218918288553728], [-23672250349918773626108648128927624129750790520, -233297909761453231931121377304863462590800], [-64695263693274548934941626836678098284091908400, 396913847325049763430251049533447114533344], [-258825422107641756178726441101711374757293157350, -29479819110552147614675847315895623168288], [-155385596592869841837558799306786991575677691060, -673576299754978449488368819464118185017400], [943004992712594442394008602154776831668193155200, -727726931495180416209180310743868361331968], [-558373926767190320082359062565474571054900451530, 1580815690469957188310085293620156236896800], [367841286270941601080096499838527052932719327650, -2527153640103141298488044040605389332995616], [-338080762430626629596588831991139095213992241198, -1545066892293552833048236812498615558856000], [-799160624867255553525605557596674934981249844870, 1405813791614093582098306584905697413923200], [-920080641223971375439095453567657730603270741740, -7835023108865793996586420853687061436798600], [-4145805779264492786427386086008332152383987990058, 720171424447101632814756960568047103332000], [3175832997215056446498667861332567481681230963312, -511238079881835417666682660163477332476000], [-83468016403434391105315463387924002261205544050, 5981823448328076295627124341822973627917632], [-6871110685274422640899826023441749309755804667880, -11876864495139065761694568537648625385449200], [3215841087566317583291185139044268438401517680500, -31318250385633154498804450440960115101976648], [5164413354345105790263549798611982087363343430850, -36830112398027819731999064001596808420840000], [-7870860361167219164068738835185422818801223814250, 10682585905706579608216395851833141356699264], [-9478318108785424245714626333802602601688981089378, 47954226803852464610007589568408479780468000], [22367140298338835691798919693106884198514700559600, 29161823015282167281256254695473185958072992], [26538405815326035448870321804339767375432534479100, 26652624059239287958985532567818678138535144], [36851915907522432911475410352652170442810944678240, 27364850203536715812614321339119147604929600], [34935854383524743969474550799312413492946426199800, -111971597779345138569531913462648777841278896], [67256677951400028937737458855014395394112653380732, -81603890916224390179974085004182245476959000], [102587478702326392004154227298396222448526930094500, -59367267095293372739832870970446060434217000], [23902993713462852909456295943432005389904461829800, -227332989822443591701052777458060792541366928], [-140645117596974772260107687472668073447703109139570, -4779710427450269501871270720884693590664800], [-57568072300716044765517915192865681067298815222358, 460067040533742625571995215685008029228592000], [31813022199365698630500402232428505072248028828900, -256964032974894551946090013877537675043544488], [100189239957738074903442812767570951588865358209582, 1647816298292483250495082288536194556092964000], [-57947444878333551448275424243501044383987460574100, -346337716380048213705224723752116644223799416], [-519556280205516293958280220943933305898374576250750, -415072444286416743427961253295732269726123936], [-125477714070292564508176013605978977388815015132900, -1355732703079566778330145263908651505774366808], [76741102467515438078900489321815149536886417069210, 499533395095542088899041920002583404194454400], [568447727128469159474768635384134436770496343540492, -2383523177193762996734499023956103932273059000], [-882855762061688843710635975698642782145346505098050, 1644542621102756377732177772589284189993044224], [-1004663011668733765571536720262106061793379814340700, -344107647344760973591098195353437156606861096], [595134610371501648690003199639066410441773812080750, 1672710914050629190633369513949054153649265152], [-3351729963147473396944773645506741442866617731328200, -3242432451688748176798367801144529029921086000], [-1240388252780259577144015090370377902575677538137798, 3198096413003560710731912206786347051881880000], [867864119602139558797715345928962470077007362004000, -9048645605802788718876137367087683030546953536], [605994171729338658470473088872716077368945011039850, -1971156758985521309182509980529593921365058208], [1260502151514331805065045607624316802158349185631350, 13152793578315023497255332570479074441513409344], [3317392268540954573001294287429713301729735431812860, 6944283481636701931365789680483471877857735400], [12127864978005105477371057117944951898572243786712, -8304117457405190749557667923656684085239142000], [-1641051088740564695715733791954026420327047673294718, 34355302373387568001021706036042844900301528000], [-11751614328290689121412724832115888423381347393520500, -12869087353445438593247468307163621890396856248], [9593037794907606475103654850421530221750141688893400, 18684386058808804946349920745089140113737514384], [1543735014813604722748179893726494984878811661350050, 19485887473833376760801467649595423307043675872], [10996304677107299759552101063889074492597897850269380, 21455459604715546211474015036687400579196994200], [7130502367829663388777669511380754340901181966726022, -21539493937520593481064531384395917319057148000], [-2609808053145133289672258788510239174725568880450850, -9040890955008358348325766239421816836137994688], [-3019037875055287294199471208442716358094846980046550, -94939609962175208132681690399480301746695698976], [-6816814909878049032304777765916391437974168176522300, 71294476941591413394625340635105587836504212632], [31951340751563027408719274956067182775272142594636132, -71292831472722953564826591740920971900669657000], [17282239553228651670167345115551418513297129440557902, -61651183876232970516445272615954029526320028000], [-80752727796686265215911814552809997087318737689144970, 9547780315479524385416269270466905831772743200], [12024070257638893062348301009443393433180424025350160, 104951683190129106464390264586042777822924482400], [27325947235768648847321222990148478762042961913968200, 253563732627312824902769008720284949873091525424], [-12094327562727425591194522235576919876743828455981550, 60950617137841374827332411894215804957806507232], [61240940827831838092522396379929002059663346885000020, -236025274149554374415102775301346589036622024200], [-93846567949352818191270306988492249247751724076181000, 154105085815191722049532783656488928892833423952], [148890569120252021008471107909519478599219426996504752, 16497837073703826068714584526501925347622132000], [141891958526177262264733096776398848404656439959940250, -367660389467756071102949778012632559882967794336], [-178097573169665893347639962230751846923484620566202278, -561638279293979834631510942727054728114876112000], [184903100394764391806643174414677409665342427759575810, 643035983079055512412247234031416213054835710400], [17461306879811085535201006012428834437121559574968650, -551118707731260709147211998709542120449005587488], [-27617590219636328557706022745814427429176412104677700, 112109069786192571251640896588983099990570470504], [153168255839196368273938035910356236365653564898621650, -1919040195170162454822162319664368210082905344416], [550957227288081151543562412378942063933515446938432330, 466388290942883419626545696528192610740482147200], [-700413436876002860502886440564583396102032639992111428, -270596610444565384335344261816691924291654159000], [38391234551943421167537816948702058321373612529176742, -128071508463662267266443823457997052429260812000], [-1302873945167789091784793454635092590622762995469256600, -656347956550118524366425905799894516403795983888], [841568199085474930789538382533338380100921845642995700, 1792966031163262534581624881805212472242320471224], [359246268835988321133365376537721526980144533247075790, 233062943527656651205696040716073033981403741600], [362517442034535131140152793963326000533257248116665320, -5402704499282515292719889912127472534642728573200], [31729166040071689750391182984672716151767663377573050, 2586167572461521071959741148732006575597795490272], [-54646879837351414850041859082362007127159592639816250, -48828594424874112128009721732959109692552177536], [1159433532395461463053594106965249755758618589462711980, 792911582732423350706676940096156471066785160200], [-2027596189607555503631695967980530367335535950792626400, -1218708939505098163662977283352326383478281510208], [-329003819067779279016253901556951475824531021037615550, -9659669477128281186910114430090384789538497753376], [-327110530419209426630739473007267599215027820985145038, -5224883152649582096784782524297130087997235488000], [785869354990270344857668429759893018449545555501524700, 5756311402103173163338057445685075485144449237032], [-3668227349194505670871752557270059301552841298927018200, -4382653538707950081404639582311651246843447991696], [6407735648579231840267601727198761338563956896633222500, 111429626755782840738246907233358158692829963864], [2875914911321145211167266417148476982657908697887032272, -165196256504445017491135352237960057698712276000], [-1034903723119349727312713848245429985388313468013423240, 17074973721350914206925867169650900507999865048400], [5180364872660200697365372046203975860915442901710701090, 11808922065750371183196726883474054938489717169600], [3965609432553665842146378669096657432438528244888362550, 233929610116362360292555253252110741765044208704], [-4648326435949025984098579342749034761191383031998863618, 24043404766665600216800947482809796399665880404000], [9066684518514143446163035295110600430364710585274687900, 21346127408689521414616572223584598723700940463784], [-9752758895599592355821953124078272200438071123796327450, 25285493768492767280238852878235506344384300409472], [5329939896686793472958368954721801780513598748193800600, 31324028165912261021498555477372214500096106480144], [5209870028254085897075129472832062004851058576822499292, 13697170191519761747851134664263923042427147849000], [11502813891101271223086323546386986894947608472303731950, 13057287149035028044055740391795130097301613807424], [-26065428807945250994710423246716728993007515539108015800, -31726026381006904867871027143593537162328540546768], [45112689871561262570484702316789753502609976878011232, -111653109380861839581173157817730092482884443032000], [33228029978236287792121303563164982786856096099666556650, 1949256049744784270980808617691663203344419273184], [-8292194046918037722459003332581067332834120686998229070, 80945202909901322087206135519556330517780861739200], [-25052909483257869930297026406688050821101277114268162150, -4901170597851422099410147173046740991542767765408], [-522541039804970115510766340741692505761473511509413940, -116709598518841754254480011832970855343740136812600], [-40823883343144732720466196336988130552383380395248351858, -109462493370399102708310766237185560186385855596000], [-79431727259757259640271732331382511663454428951033190488, 40213606850933280225683649254322201482965056902000], [-52176116549976472365265046643684206094681976255941723050, 130841508772950494037721524473455277876766338240832], [-49341151936539481107567192766445325716461643759333276080, 131067030685456615765896820758009638803032784216800], [20741000239133111301150523365701807513368724318791942650, -113634088204417085709394017219455208885115784776000], [59849035538304977079552389095028264151395460558113375852, 157404861789419656288027065689707803486660045477000], [-30171045247097113045011108739312897719519952193867723178, 41628938710207044617148065137763782891283210100000], [46938101693189824967614335883725852747544030658759068600, 247828065813266732734086431919598821167427781290192], [-52661231154222376901852228717085092136912573745144604290, 78852232813888861162547887624768332286950929354400], [15010882981458108759138742448668135036615408967814404800, 153135144921504570157314373861985551224879292619904], [-127412704537862910552822220065883639342402383090154117068, 203697510974601124109473540608847347723582303283000], [71059984537231848619803470864535284545490871883385706250, 122864877702436998720924956605741300612207515853152], [47356960878558662054014913732215339479527756238585744150, -255879888821925831317955295287847630983986033678016], [-84929163070326633048660555319679387451001672321629325200, -334832179415731231462845389379790647631375874949728], [143572084956207683950971287763391103096218409726990428230, -134893690569655206554132541850831126850887344936800], [-48598024413359713783306540089958440783983595269674871150, -560615084331282932544065637438775150596050465866656], [-393352835440609087637784835220564681668214919981078502100, -55361612445173385931591005367658211890921682903288], [-318165562914879343229106314275693891498975738716233160310, -57484969220871447101664451001888143670896782326400], [-307260034710341398312219335587345829910608766349991512448, 838649244203555462911001760316027824413194020960000], [225708735924603789109149548756101207882157030952100743550, 632920227418901999026508128657994962016756422255872], [92093193216650986065124335074075172767440969633584128100, -166415920358924054789892607293436149821371524701608], [31375309115635476657114405162563890211334349166538090692, 818166077115212089813126607429683378378776670575000], [932970535402359886867387106933538400543980998942345830062, 987677451674638898093941640223864068912128709428000], [385572331767810937424829124573155233383324353548586168300, 1944774028232610052164902583043239536008289724493704], [-427814968236278643286581756077244163682167812526924994250, -1133249551318721166995789608002170467631016938771648], [-789322368139179181080881259489146090517376288985812371598, -889002699762734543593299160041954638015876901696000], [75444877513312608710290469275810776638236125645580380850, 2033011297610719474421895952406739097736276786896992], [-697499335761149183946349999018112690402803049413621747650, -414228760436925350653304902117492361388961025145856], [795882881893000030045697085068454165853311098865793973400, 1312510573907761274261423332957282330380463586832912], [-637883463901191878582023542705478000572899001150864455010, 25046666619364234376103287822281404983488819421600], [206409857134225321060827097741033220513815838008258832912, -4496028550548995279520850053524181341110911399204000], [-1700841388427268647334581220370037897349249316248860682950, -630501102224781358881656593517393785494625282948896], [51910370405427834341966762299816942363553767140606385250, 2886101024393251540778138804338978832680300475904000], [-2679311494565505790358032342382949815700329170188480242820, -542691211657716224347638026052570521553985856587800], [-734692314478945081003665415214517616909257225735081425550, 2081949266712672770990352693108355167170573001529824], [3280873753495492214538298208738226174340639005679488784640, 1316310696354279802076525341581978842030573379417600], [4288309535514075769309466254996935729916826689344752498700, 2083451610167113539206420067337221323898339332085832], [-1512137032682252528843093358020291913553103003985406207830, 100505059331025968625085378131607541452923992036800], [4351462352339805015402631240596512001152823617483921058332, -4884884077381204107618596747861829523105272252135000], [3905788197443087337735985332416303078176071765622013503150, 4053678669141842225889947391008967648262332304075584], [-1743755515123381861887062468498940262503814027586786555898, 15279212901713528266279111459134890651148026598596000], [-122203804196805221185624083662306036652357234443848830200, 10227850373078612529383142393923881157046357657162672], [732314042477358722528526825684240319425462818451964900500, 14665529012423606799786171563560144001620423771027064], [1918733428356020266593966106994324787144364586249545029960, 2713262562341725586426157825546064042826878494340400], [1577386015801701072797507659084212700614873117044661927242, 7433771990284528071153618646427536756626048316080000], [-1832789693926532774635856856723046952260301831074395042800, 5935049748169939816001819583505741177154886938896224], [7620258127959878845777576999324389938639477671192838795922, -12099365465919809862016404905773969504355535568328000], [11022871189309167827434545959201143927912443180751457286600, 5594476020131194131068218836858486172730903583031344], [1535424610696210885767540744631395378330327680225020213650, -3579326141580454307724812773174910933104787724992288], [12549316537623376443444908311476659573761074934274763149462, 6076831627538358512237874725501229138037517644548000], [2806665809542933271097793589036363200527055705807909866200, 29893173708075684921606691737778347985801042695258000], [19816400419753140853878373862395850057751333676727231840130, -23508854055324546391194726660879579161585906205044800], [6847235756573214275509656418431888250014589463103894180400, -78129686058667022088819405291563282501963495232350688], [-18078312409200499608245439160990312700925954892046258511300, 18322652434622917618118523730517943334922717438098024], [-10221610679044055841562274141664152048566024705017149228410, -87722477656248333809887470874224851449858643583986400], [6754879506439228631660117804299867034680000052586720994950, -74599933870420978276756458158390991636422349526994368], [-11380941478745555718343828894210073920256527182160051622880, -78362145895973035272013002842161212564157226239867200], [6990747736132966359000813572521271365733459602245274809400, 14676862495254982528099008655690201245822238298168784], [4526219050039676616983052849985460363038848291781750862652, 117123353692855096711265699619143683772422783236529000], [33439113889702312413415782630678319790914538110423615586050, -19471035385853765612478655051857980726384067077130528], [27472791712123535125135638013202612858064907736006951495780, -73571152092084066084777605409122354250106358582725800], [8988018910474265953685564985186004182684812395571466521792, 83077337705925477902388953632288572498353176377168000], [24390680795783536973098986799174309428440801151126625197162, -11780074248766273303122542642086533711574167246664000], [7270106458952107302802037218289601566335324781865021873700, -152054071948908207862976628179889242961852520152297768], [33647859365080849599277688385404259390524522566541156290800, 57701057777464074180388858078757591036548529425683104], [-8292961994556873266639791255857424109650682545177634069230, -99721027132966807940125976763922918279837114441723200], [-180052477611211618569544579019996116771610653202098935750, 215927353459830678743704338476537188826301742227833952], [-35625822409917162226702940994582018824538532990209755020500, -6497946555672978285459169371326460717649583940715000], [-77154344579819868069697838428391369785091684085262653729528, -82413939721389408582863445151081825061498648278482000], [78830337609663072639823211683886480393300425609090416951900, -28162756298293708706564520483465430403049155029910488], [54518810193065043329455169417543456666709671011300714904012, -283451546845977312266537751573848787911153898848787000], [29659581454763663467380690351862508631493310369703521767000, 61413605506718563437818480538672126240009392262033552], [76595037253475949820597044442184761594433181636468780797150, -97324497282826145272574791092997825855458097849308000], [-177130773066653287541894128942558682160396749328585486330450, 5878454008798605890658814427392339658830308210364672], [91980734415740986660965030419974785159135565379709639193080, 283249641486591915580241795314958212472420418504773200], [31224697885942765060482311518840625561463218624452413493600, -261761297011232556281141618456408194040098704699397056], [-179841512601633733207936575006138416323259996877132205670508, 169194028869697622287682044312879305113212073841083000], [-39963860828248448391817812567257641781490555246054194811460, -364252226694460281640262050785559059020842441194005400], [-125399591902301449088987490576848639589673975515793713346800, 80201776180171380109912111146757307465538212331438432], [152454922569464049225936732964543829471305093230402724217650, 338126112904986273783204125098522395113502166836309984], [-142276798236988154879149597236307096409091477456933511620798, 81596423498980275319875607283718055487158123246560000], [63121786595888695780122336712692741869544511531165794207000, 139534397730073703258050375768846902447261128963336464], [-14743916571182276117426135770033190869217809307120891605270, -845105325419838393367967809141070960948699626685236800], [39145648823649056418218718730875005589646541230219865402850, 310758304274560854779880571458590211652807724050445792], [-78698996332168336453234382393363012849380124939193767830140, 797276091641173509479514779273593629977909194143749400], [-288150327200357481652811832729956851095159537556656417033658, 6667029706904118263917056906759179939992567531236000], [-164865916941488676574996048113097472132425287625850315984300, -446259895582359491998575647001229295556983446660922376], [-313956349328228404986596431008281513132459043744337329388950, -16036719830207687163562315934432209742326598656113696], [-279255355084266264584402661659412738975803000316564142156250, 88219543138223665290767484236267479050301279294644864], [-418618856827475787616404719015212378852282808968239313846400, -324662667471228305227767980591984945317294245930148608], [73265959315270849719559378728651225343126409072977810217100, -133860877481750153304610711225866606901416038098371256], [-110575722187263920574613028467848483661450011542087071596490, 440514944975941552476729563695285297558447452286490400], [6697940573089489673697796358004449902003808812066919655250, 841982484801371190828333786872045607533417360514512352], [-100008125816153876588853454121626402662257516831393013698850, -2148144060902489644809508058509187081905669557330017216], [-666284335496730094962289064266372388542389135733856019985900, -208786730292124445423061562544932844258675406544293000], [379029083448360492351837629233794997355049954709282013292030, -2267474951932569494984269457446594914995002268452792800], [-339937319194188715353935398201545103684865079229570185545958, 249522987426300583132080908299834930552955039685976000], [-493579244762866616487730405730024523729432850605130905289100, 751048913441652049107491804534101586632666325415753912], [326430448757561205605567232012402213766075216845367392717450, -1611061842393354300286045013020991293380087837212564768], [130846631681947020261090605745683450573244121784136881869982, 3035706915258292528649586156106230672132583056704004000], [-639189351296296678754265544724410770598779278767627560196100, 429945270138498040301620515312581384016519112818878184], [1023631555756218662901898816633526310381771752568973739028550, -1942166487102417655381471638796813085535497925023156928], [1278212472604692146056560646340248739613837949560912237699680, -1351089899690253118823554712503678232646719633061796800], [1453669780466242616771501537253799972889007138614433585263950, 1581431004657684283703815348583750474582549869813741824], [-178660344434086602480079178958758789428682785206415537971800, 4939766495819625103221545162230115902619301249700094832], [-1256395599630234053847470221672897580235885369887294504234700, -1985450710969381836159203238711550720962015604411159496], [541379572082607982188870822949036489735912989325152231574670, 620273149243168093267517962479753185596612730676112800], [1037835924046622578411924087931345921448667458001110987858602, -706461237560815985144040475243023829118727405019368000], [566945713875861008725757749108393656832840112078804153269572, 1741735403767706455446128774056292282011249258869775000], [319054685793308826397685972536565290145484103880275644386400, 92555378983720681352130927507622560232972614852930112], [-479219620757179055329398878383264210689028554639273837640888, -5660506180057231062386150946165954826007138955183906000], [3734290954075810691981249643491036064556001471063045667767400, 128563028602106167865783906755826196708845708451455984], [76677355712961217041139948527381924455320783481013430290422, -6030920892297141401117948802579781711159011499742172000], [-5403677180443823843421634072182591207427545783752599472279900, 2146571786393909010031928518171863960814315030641424344], [-146053912285850890227502489353057008244618382396099499223408, 2855023734641025467100626663226971685976025905492092000], [1683744299800445629682306204973167744506863840650212757431150, 7586123913381726817045068353833574992526691301587323712], [-2306627085922955164705255336259035341702611421656393784692550, -9661062589915394913600822932701376845354705467104953376], [-3234021437340008514267069897937547558006736575460606894575560, -4073725602088451917141518861373360901237348947055396400], [-3460943888277404080768649447296555866722897199578598733920030, 4483003321608225633553820320506455279954773999773868800], [-4953894156517745778529464456325207778471396302821837956485698, 5018186326051049439478867985224691475787768546056244000], [-4387763433248547874995416664255405064033076129579960654302500, 6048673486896380591042133266568855014964175551043341864], [-502245081321829424968345252555310123105267181531101347666650, 4657291775135807881994049227473237025017589362928483392], [4649915552466635591683912844430153501545933556174256815238812, 2684862395071188164511120906440144575083928694881529000], [3864262146029896040188735899992583903576629603846129621740450, 10214228952829566980524604563237065847232813526950353632], [-4794108726384930561161485859789549239501393686461596517677650, -19516545790637282875709629984640005377007453005053788000], [6985028651979887198691599070763486277579700620455387262277152, -12591445348748144590097342555158639578050655801463560000], [623836650205115475746036915529280570377059788570992434194650, -26897312082018948002250919859889175691260065424511613088], [2745374132999466585617140999967793326578878387604399492441740, 26481094432376702492589919292666474043685589192309718600], [10112080955888004577296505748911202948719221038498529558388300, 956457986003384523651736009595722478954832562002172104], [1396248839282784447317911408573622745336641812097453272249750, 51357412815780013372215762495598383849079979548378061952], [2286966348455712161444206200303919346294041270860627328087650, 14768552496687348162198374200332285669112852715997785184], [4088830005776872557002976906262053386617114294171393364810000, 9274831076995697349718924006748328589235648674932444000], [-3876016770283101892633308008521157236984847625008361022397700, -13878562290578887918607427241505337594300372649884283928], [-2634625636156175121847347351811308696668727203952899695203028, -8943439053207864253909009447317266224721817876197739000], [-7447891894081522378015903966753172920011317616105468678135650, -11871964895270956898071086439039948402814672542640043456], [13846854089259522967705097112506631662548369970009851870733700, 24122151875016546821953514433093183249518110883914572824], [-9546234301102699082877314254470750053133519440452008415260610, -3493579956220457715123993826764590069250908694209282400], [16230338471147907120930433168682005527156270356668351883224920, 13704120743864800899779025954295926797972341037258694800], [-5539549968615884499131322323386406201949123730939234921344950, -55500251302108247281264836143370158853507005174444087328], [-22913404279612158687650483199663831776561715264405804133112400, -23860757821681777552252876933147709455527989308720131808], [16159057826128985932550714439540359058991379419747999981864710, -63690030393316494957327414331335697733017024317634389600], [-12566629727796030856772330950733906876963597973401421016012638, 32301857411326494805737161032752003158172716161130008000], [24580126536763946729317921426800158197668781696366432240686700, -11765212662502944358910787250380628975910346290010536568], [-8842621242025196239176970590184262325854849664394660497328200, 8385909135170483435401419481222933617781015413315485904], [12797717487168656186408640487742672823012407601120100404074570, -62822030060462762012217769857840456902503801876076635200], [-22930678999172339628742011495986574366901386191440394508284700, -30307704842838306120615153853788081496803770594726777000], [-11735820803647073368887634247558413768050754761344536205723328, -57272110593884418098009126295859541812231875638301520000], [24326677966696616282440277406186240390408698911735010670620350, -5927139140540359454854853755566607814289799722417758208], [-41689911553469960400145323785869256571915059893736914462835310, -18192101048282357044554849900926234704154061114153894400], [-23949454784610749710836685087841763051502024615805374961788, 93274317500244330914497883721208471152870415184138079000], [-4518317825790451058116559046786776119938263765335314156059450, -144206451279513675450110019088272918245911135987078221696], [-62248256618646008676541799626033452016322563581840923915971218, 18453448024243167538368715360383570311921166424278996000], [-25653180720635398652667520294289068217140247194128349202156000, -50891204341824530057217719486277902051695126774672765248], [-27152731426086064177021290978483403765194842770072872952749450, 127370088121787071164435159192924737097347595027428895872], [4512480143784295743483801631196808831104788651016560021673522, -176896298057387644775393354449575686024985328556304456000], [9831567839805264543518416511737166111672979704890194484564340, -166292609420529463242492835143521291230023617155097603400], [-6969303540441276880362799444692230151364275331510579295806700, -2546684834574921081809787714963334956296820173775867528], [30109930557367466265313261708338535274936981995856486307276000, 131833690897301877027121305689525851842755687643480659264], [-138822720020003865352944553470400386330157507997600642216232150, -9998759330248650160471982608166858388708257496822703008], [-27629584816454749282595540821666913381268716862108085885331458, 89044608563939322273068276431007268880358750392201092000], [14352287635061584880893921608772770579426556184460824686096050, -3063674457005484342585651818567550984759980134782084896], [-38879356978106528463389925029879644349133748616383380190012480, 37839716830429644885808254392075892740666067733007068800], [-106695586739993271037727972639938138111621193168999899635832500, -50833685332727461709229600521027074145132677954820149048], [22943154545743771433765155660739019602843008548713835123884252, 168250995786371697354011945913750318156194954308348041000], [122614416883435441032501139899730169987467028984053241728454100, -34883541454764359891442562407045368518764006625307592456], [17717137826393097778276478136000830493337270696306315141603310, -58351077010612823826336080637487698636414997428435621600], [-223681473859011344449888362221240572786778350125487203643850850, 4166147526830967520709425706423939216130897997515872512], [51073858691966814429392047199180164347691649785202375765834762, -138037436156865561197614055308968441889029467433890184000], [5704134139455314476809281106082961443818419520835450499774800, 130465178500500131323793917148684143927871769001873377504], [91562240883094006114934223767466879319882716844438592866500250, -168176997981153087359069727792959138627157434952385004448], [-34761224954153195141777086685632098835856381701144554795701850, -353688711963129424640759033368090159660451553542430956416], [-49754082180065769784718705982125330234345799092982679696612170, -5468946939658255402859605744993941670230607860374456800], [-37508786761913813382619123714566014959484121854330263552515928, -232446872597599321564616493132139580047715062385426874000], [9209748944769821675585691974543081738958279260226939328842450, -223971191857327621018148511559750326757258830757079505568], [3866531906380545366517779527165045448223415789694878490332820, 577099025024271636972968096198178839078168834902389799800], [126071766011152206862524746773969348989384315484447066754916182, 569312181764756779179720497015147686082189567592948900000], [-62109940915464205794907071188179994180761203663230618253991100, -51356731215743166191336290834647973351553712760917959016], [-29708991590524471184191194481745118222591107129354953236396048, -291357789882921785004513907730727338273977560662954588000], [-159786743474618253055816517108200768135280218877599853730051750, 139422998433880882764944984074779796887740216864861722464], [119452499991999388943166113327770076512224417582844739292279092, -733140051682487165629707011084329286939780031563909709000], [-219962196057164492304219497985320740664415640403422907775939050, 128441301324018171718560921158297475904145292015991914624], [-187613161750116224387384079942127379269968101856508957953869538, 259668145453494457316685887380412028118695238755877892000], [-97606793541962560710495160697260487088165159093718907702214800, 40198669708005799103952725030501333035877697957546352032], [321183519191674012507126399539135484092070859167923405558534470, -318178039145060310455433768476901695864024147565177103200], [-258564822282038397313700982648536729867953669214837791301000250, -132987084236114477969840626352573183107321100603965549248], [-525726832014999677527845659491172952083876154502342839310528800, -237082501453685866195382371017719518474856241880432120000], [-602029878820256908820991819752155157151530609363893518942324228, 132142164706792655738479307714489192520716050070840577000], [129650641805589762000191477189231536414955941271043271907206350, 1517776064667297011012223216006987330805939065423753511744], [318440543912958868546204896222589190345269857434588319307055400, -7008147212694658480153080783863779639419367704400908688], [-260687757363807391404001016588431946880478990967629431972912950, -69533215964192895728802897527533888202020661638537771296], [281839204807625096566397212025913585515767540633137150050307882, -64500883749012177158612124883246906084622116087395560000], [142415360621982875269882770983976431175564038138748869517860400, 108121439824161544637737700998479127734061629963323210784], [-312699335162921076911863892860734875144245679936761015780595220, -1975133238103801094415253238250887238661948533759138759800], [406898872908882035125610139025191290548134566651927179657701100, -1371381576757976356278908550795359651242797499723837940856], [-388834056812449307374000548313385958036330351213368974227451850, -365227579414465577194810386606536481888046100791647953088], [82542080835806697861679086405027525525812934324456026862408450, -1570232586001413150328219587722302179008829917401490524576], [175120896620761168339044550620209473933187819505407302618235800, 145135124350411006265972874493481118771314484701339181072], [-246656722049258551455793191278497298339976104152509938819628358, 257158092062705437524432396442260028062078834595114032000], [505950995570547753172580585108148515964000174388923069665853012, -2504424173414447347981201307046680432885217162673258805000], [338064511588428787962688835954108725054112320789359165060023420, 478625189746743413782781123309061523576009009465313101800], [-585053413767004400860802979864839021681191991682259815450414000, -2764018157152293941283762763868898901865907156006738268448], [665094548526423963174593839310247262263081189286228173063618150, -2710619617823940756152781729223709975196512238820578380000], [825772660352939027360499454797364873810200115128497996970283352, -1415977531783853260194088907925937665079345516517847366000], [583924704905743756193909632462370098547546572994811187066203250, -1042075006772995154647829315416569487359147065500285851936], [377284804297751322701903548898521362105528357284574397592169540, -2218338797354180463889263425747584130378532420720126327400], [345756240887564832643770376979757824498674047269913321634038432, 3669631412519184053042914191857031581417324194096803288000], [883904816921330824878331426146541924972318703291750338335334750, 4361625452285082118052737079079638835137052649399503025152], [-868680955952904098133490377024046795621078733917206840226560270, -1060826772307576110809054845179436781848883883178932244800], [-2387249351033835193660616100923919350796425270658221519148522650, 1917657698509727236325582024952719169731839795071651529344], [-638189797051708217013893414006917066597888662394782505455140658, 1833109923731139920029832927071881246767303786376834292000], [-1607374813054797109613717736546268934114700649383727769677027050, -3490412293300533592442476055508632822592312576735495363968], [-631930098209042391718013460672025635172565616265089277386956600, 2277524178905662568676992341280914887321955437226427790384], [634155811577867813244945335959397621332226834327335926961182750, -8938056435069287258408375907781637959736665517657396571136], [279169578720422767290297755489514965787062284460876418947463380, 4444746037120405097810746658239666550259707594608446142200], [1481685524948342634180933614221297060531215036178693026489492600, 3213759655936446970796081748794696496141538130613417709392], [-760392234738029698835844221572091601001153651468998946914873808, -5030438058252563970056434363951747155777408761832967980000], [-3321414862402966195033695767308429061846796097755549691674040550, -3746200953842337197028269550799408634436870970354624658976], [2176505688264523534522908098417697459421869413306438796957771700, -2695708121168186988963827110239337424113998435883638247368], [-699589797267511067648134146071966393672574033228818694061315200, -6878622052049545038233687592112370691667175600128961943296], [-52247692596350719528705569244313605216430095214090024111221630, 1035651457727553603925391785224964008490537729393749292800], [-933536422544028691616797238872315804243921200592702135654941750, -8150921539029527437756747258507263204655848022572798703648], [1931836525927325201220067109694593289959034450973499817661427100, 293028128980823662022191556084748414501377234771592057000], [-2007044662742563809095916305020792214495885008083321689297442500, 977918338647949208880202197075587075225175881772243324264], [-1691665481785429900690267371208648339124181006197109252479797128, 2628686687610412377653911930694499972740807855243389042000], [-646751587738023964650488853964640379237334408773175520120022650, 8451297378646943788022377794299106785905872512803465060992], [-3296840415743929078322594911175225592367060437970153371478063840, 4776921919412550550825824164264980043392860939397744862400], [160292216093950904332698719382167037810335666257986542627084490, 10682064061904871741109721862712205020427248252303979401600], [-392740215863029591368600562250372068074949853546192324246299588, -1851485844765158699784741099120504264497854227649538127000], [-2331893858480382320881800572108167787796445166528490298277229018, -1918471734536401819778847298925395254761007143832341452000], [708113139272561724059040273482643071735675866677043068076796750, 3125072879828735704498088110455606139096277605904981076000], [5184101110882135187664675722276829079941628176478514870667263550, 6535023803409569127689864905588357098390315830591797995072], [3810149802565214660785623510460820565459984614303489715739375600, -6741096127993385122902938989060256289415070942976856047456], [238734268231859149508295251863032470422452238136291310136186950, 14642544242950204852593411493885364723871231999492635741824], [4337217467036407857839115425896169403446284272228975331741979670, 13170125196306482296619210923486435689596027903411688304800], [-6199779474714899748039161239797837140741386705858284147006706168, 911413954804806224760156943037859613493849133074357550000], [2585726500737834994864748261459593914489650859273433937358995650, 18587053105795884136925988985211989925276859722574278527584], [-5263316551261660316522836634497320331985403043823047494126808398, 11232972575519976643538788779771931605025000203720355768000], [-3046599998831439987318199716916035779537314369603566700004353700, -12093928952727832054635469567649507508595272226396281338328], [-6124819594124391942440786387931630998925694831712862059586390540, -6009260003825339060073580982076211505421636799630815734600], [1220741254628816265182794816043216514857845594506967165329611950, -15662524890225767428559490860437792355243945497226467661568], [-1033691961341175606930212706401400346650738327932877619080850950, -20232734798331933812874007948215575491730082215509229944096], [2413560810546126177225053478998620922698717469438245843444516500, -20277551729340465438593976023636683496588876438220838579848], [-1710050489572836178564840271599505189626778483491014051070109548, -18832531226388534432632680355871153437896599374350628325000], [-5090193726648087762137534498288513346186537862496713244924434250, -20709649868954817882815899464955686430535538963242945593536], [-5814832150198724407168980651360560192990367242887875032580424578, -20105583184606152338716591981891735452690426130475648124000], [2760836025192682411420859330492674592919300950404236324832741440, 14439914184502667676694365757459197112589178656231893257600], [4987946477866762607748516795863017926932987163957873715742411800, -29138888674370575373486138490065088273561302072167792275696], [-5976753745430567491197036940646034744263701689256093344454856850, 15248793363829859508368935390949749093865214872808568536384], [9471971333010307702569778131678307108798988174912631143602297800, -29456399253640068614368323312229835194410133467319085106128], [-10937240435170720374391676892234156765182090720261670730164884370, -7500373325674387118352014125938870448180433529008698728800], [-2142756987820723139426645445060248142424085060589288924765632150, -8472049507086420038292215817177402649090721631204991508256], [-10131693053352185442329321361159668438926873442535058707440554800, 12996348571315027215044854365709656435837357384407009261024], [-8673572814608801850966263478281206110910630390579369326045811380, -5236706568662995894574652703631809655663050346826675590200], [-4323948229176906836870965330992310599535443829033929399309233450, -39005048243821616412965196117364939214319987612359390790528], [-938662511228732503394377422649970763822489479281076953564614750, -34591029515918029460215702726809687551781931234943156632736], [538608307211391242904807001194800144231948080661495699107415100, 53108090631472517281175973398083548858708467272283155749992], [12985885139620176725499510890024992710070996729470044750520940410, -21264012381412190003635000581710572922532142033665073281600], [-20823541976044829390921875335172191772932228375595810762861042708, 5812610178865938000480574916739466758664536829354112613000], [26190822286869513670579838506687836960971827076777121469801407000, 2722506061356796707712147481387748030256257634685627338000]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_25_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_25_38_a_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_25_38_a_a(:prec:=2)
    chi := MakeCharacter_25_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 38));
    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_25_38_a_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_25_38_a_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_25_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,38,sign)));
    Vf := Kernel([<2,R![-137403408384, -194400, 1]>],Snew);
    return Vf;
end function;