
// Make newform 252.4.b.g in Magma, downloaded from the LMFDB on 23 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_252_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_252_b_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_252_4_b_g();".
// 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_252_4_b_g();".
// 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 := [52705588025, -139977817400, 219245087130, -176540053420, 101978126949, -39463975388, 9778426658, -1739202044, 272741368, -37785264, 4434734, -549972, 52557, -2828, 358, -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], [10142771057259775974584780322904963393266065017766572290402425, -11971258184690885667750565209387400109224341560978923910327180, 7312584696125779717204809701167371187406845654210545462668625, -2531407537018606845455037929273434878280382964225485053443688, 571985252543507455436000287243097970770225769586943001792026, -98325818206881298687407117794119516737714149004003899214976, 15521802863878640170406948596520849741380618093241234542548, -1972742335219214521049122092158917510176506349259866644956, 253683970096005582154828332848991761086357625527281929228, -28450584098761404483340873071260990662849852128462637388, 2502923822281649797503053317408858907871050829967818994, -176436906770490134088706222855854764599374344125855904, 14375372618420590122984786749850925338382341644440131, -453724337702875034798109972067457053462775366281016, 37090037549832970798371903112485173357847469253063, -432975305211228716693237737869737947033723808652], [-7106543363854185278509124315047467129505616338753365811238745000, 25082033360544285554478323640820659588410298307862470746406703470, -25186236062870190312660810438808352427128928458456240350916733360, 15841624529926873786791706219977657280877165396022266446494790087, -6507275617160647942835629104203347327762168490579847505296112232, 1682243420573710992786424420778191900491762453700388103334103458, -303992044637896409912430068387462050181617426953243669780492512, 47912941078739322274813638049882917109451144269690364203743192, -6752277098177419205780659071119411323576133940333600803627496, 793447928033169354631655619074637297892513719858098619338864, -97746455471000582784025786130051641372360593291631323532056, 10002674938304854512723511247668294399494250059969407225540, -479229207043104709119803225191783946644831592460092685992, 70067035752139318054442048157189072237209473040894839188, -577366574295319569669019200513951597959683591058174792, 195694583749748752339091586425700964908639112909847811], [1255582800805549684415466350046944600046745179987936702983200, -2767700783648930551597385895489290973341554959271261813655760, 2505974380964292613950352396035379345683078602363247186375165, -1414128122271068369501107138876630708231054513970462670237526, 506121659944772499522572635240424568425175821196719650595462, -118146618825501314291863811034157022225093035096207821264322, 20602498030030410653331027842200795457795014276688726405566, -3183440757971040166842459754173943796738937269315685355442, 431610577400459998929818146943554931603703407959636564186, -50618703781266820945234403762525475749205650429545142036, 6276287419182469946347170702152082388932990217059258428, -539149440661929027402897554206594867270879600599519698, 34467432709851624678875163242271028667922054961285072, -3458765609940502534550002134804869369287539779273602, 58700022092461221663567093720218166206776931908751, -9613072459842772064965216450965646657286539956534], [-305939541887897973882123841563664697550525484179500429488955, 898625598358627128778855632563394307394222735958254849204660, -848805736001523192151615869797963538547382662750234869131929, 523310667742017214793737026425112811543777884269453103345208, -200424495861605581848979336189884452978156228401741058885754, 48110493167268974166117451234041112343714819546239372733040, -8445848166459963521669763175916416133814506765900263529836, 1323173295732628123101540023595927025360424119532900547204, -179932052551408109617344579528650369957541546637998764252, 21115637393989890729284196624733534788781816401686210420, -2663988434470409127184767843429989655985338194286756126, 230658652056734511901929562983846728900459178679830848, -14572263638566561806412436676890370417971436029541749, 1510964953648572555962042439795084204779529347531800, -24171283004675535938087024246513514326754620817299, 4235698590234635288478366867736918495157744916500], [-487641375903095706760823071952494890282364023438236766968275, 898793738155880555949290050836784897583991906098918339183540, -849064933856161260248144631677791604694665833571837750390201, 523511805697997067251879090287367620588110466222328568380152, -200534950814188642798030798242529312007319874531303377540426, 48149684111975280968901500852441178764896604209208659329840, -8453743176318797571534127117248242720111482434588192076364, 1324119937353593353913594312406952560258291362360626282436, -180062233011873482338876270720490201532859084315117590668, 21139239796844599930946242763230408561784040592962118900, -2666275709626781778470286088412748114318635562602096254, 230811957412673827328863691475154283501753159723294592, -14591733085577559542173193080873315050936640706167461, 1511342949521434508811391834791980263044370617486040, -24230755430928061945537834034174956729316474633011, 4236460031161478726138664996157607533761512318420], [32825028222181542853098483966348369768833334837171212265957200600, -68293598151041190085629412537472700478399881901146261859260154950, 65390315080399192384905060931514857713948677583969731307157556320, -40742793049312888540853286975696457388015262000696358201631075865, 15911085329752529971145698345446849521112313182742769315911855176, -3956965789857949750860874280747348153411819874371975434824843918, 709250972782465487663130257093463801481861160499309554479247440, -110959000005158832169514251285481547572318567403922443564247736, 15375593920507113098511340777952436655405253420040959097899928, -1829359056032483150634282810206792813193571865048676809937104, 221381448408059571966348481426556296750167952322265945689560, -21998457281063425272409403297456522001332029917829602437188, 1118529751534292423480918219167809688179482205530964364456, -149998980360266747505174856388109464746819921405555190208, 1513291967558853280482489061835061423705091901075734280, -416600047715100198464098154982409345521214495626764421], [45626578934518212267313628380730873165168856290383205637903000, -106691528217319749624523166172239793559425794142150096488837575, 103490636501888276403252779725919761503000440801475191310960540, -64649075781758875992040440433652767359761087911514647266025544, 25611621994480695537864661255177346736818544680677086596219052, -6441371844859450080682163232998639124271372267655113960192644, 1157059269378099632890293472706849818225566933555624761556372, -181401989792467009143304779746308749045172658170594890571532, 25269732400424274819438592443870535603536846897347214567496, -2994929856819151563649109161575041635957700116620812039472, 364282998496313665412119501494006789335448004514650528996, -36533138521731599011506897156846328776089989953486878054, 1823560750296885810295338294879990533129654699477461172, -251163841613367824139317097434372199868037793086066399, 2386549091073143174543506636688555523538908999604812, -698679501988008978518181122061857135671293656658310], [15901133834378440242756473596387722110138689610716132837423056100, 9635563989578248734517317853165067054932741630696813803825697785, -14094210997065956644645923879711014997426004427524214070332544460, 9404127531277315985039463646745132346384559985362393673554657611, -5007111675207008322192443042857027033042497576253619320843246620, 1511935325231131149473162749023486234091405628314047781631958186, -281321621922281360765735883300060038884765825658589851185428856, 45439502755915477848052455738582066589964864983374405748657520, -6763300987820335480222612445348653200272612945259405261013260, 764244345440800263346589849473584851205624185765931056062928, -99562465810332520014368370240724406735418914693484047693188, 11086459510089741767997555386406806899528309439724907363702, -443116531310449804427440546667539368873181663869742014220, 83240387533454156451461202230019128423235049293839067411, -308508356934349197703803176480071726203682845814629656, 235686371214764914664979590669934145485221050978968597], [-729767450923681421524849477317807769861609856212503520836425, 2918990083141097936231624340623274201920002076767738139026940, -2865721584631215033370434239977898696714941455265186262459190, 1897884212828435677883150554216622624091069263069138464087334, -762514497596018913758310266727645659586838085930882737957008, 186463759894363664193604753816277906089308441361385638251498, -32893702009989014107936767799403114130341735096561657925154, 5198894078916743071093445820822208526393031131435637781878, -708130464166191233045084195996241600985547618267285262174, 83155150741386652754222133230913342736513736876888340624, -10604624969858667152364485480723097679885408815875058542, 922440490388529026964693315507081908429961418844961482, -57882342746718147137505082219671726993853188133265823, 6118061030028500091991352319036831987157577239589218, -94456903229319157024887309899730021113409681152454, 17238630554442162292107324430167003330515301313306], [28041729577882916013878191140720670821932533999228558000452339100, -66033293068620155170540114327560579906178912853552974995486601165, 61748828758372715272192504487843599070005377529697446521304944660, -48587610100035039298944751620384180724158385378514285303981760349, 23961223780540527386792574146887712873293011105533886382629493956, -6784789549629025401869282670860482973444020346679979667959991682, 1256093588631536517838378745818335026174613497218112578936378784, -201061500336929829898444829606304479639169675687935487674935956, 29190452272338339815340520349479329753933043758217534288936668, -3374495631702735807285437233269973805075755408883576507510076, 430275837053407453377436052494202625948855977569360871954572, -46023715312939479846716932212620516751646056243600442842346, 2017591396134409553004118758684801625726984517924520466836, -336022157971037595448130157816210431225011030013821394447, 1932827806169024549410501744184217903016838217331105824, -947945660743150435684597833865080058817306558637875579], [-32610309241263829528551833712031703800995558671106631737769027900, 74949992600366022969981579464408442245348077247633268176833093125, -64489860882014671011595413727439348819348109070376686755569805260, 41110886926931619740005917094049061244589681482282021208524446985, -18037025622867196523309995307704047568418575167680550185403964444, 4883505273361292321178163838961202501353673390654566920597155142, -891426140762023510320697180424863946460856663480906537530934200, 141642942502750081997086161015564304271382215379056484320872944, -20312432623263782731006329997008929239357986142300276157057932, 2357769501392405853383744427697354143361620893712913172485976, -296161650121501178786367054928897574361284599592420952740820, 31188835814735509143211871537189938377955266017475026594702, -1408365330968599327071950596543817403751882737801487897964, 224180609516537544252466960606463351023991533097295696227, -1473248969472184631459352652695964133469228297133074920, 629660523016033635929661263597392094695742062120744459], [-106467920652249534742703338052027183592160717346736701813911288900, 241889034703637559933251078609920756511552457895462689555092819885, -195355824972307558863421009219994947250855699798868288615342308980, 116186450928651074961250970474100458203360573027202440052118922831, -50169496020965370082697032983626909986097286784810696474751249252, 13612263253430627471070679286153454138987311118066838387420709902, -2478456696351081623570964631303466802135416024020058937451838536, 393906217477672335215234300031500828328751338077024619554900772, -56647830757927648425780829257049373857517405921479643021361956, 6546559226745482238002432173019525901661027110697843265849476, -823436423062103187784110740045235128682741942745003713066668, 87254187878556976861857377923902190001139346679079336490698, -3881686344481719849329613518678229126023107898089226239012, 629385737459560129738675224061585477404323652528769546307, -3916724596554996125778135120657975718203397829337581176, 1767620337160969964526119034541312934003050734999701349], [1379790701449850395291838713402610220076666553755936947366775, -14263997374856745405944666437751381757313214240428666600911540, 12752742416003355028285915147171464633872397620405644560255975, -9834592076039085883164117099070692851660489226565025942892984, 4443025503560129623493768413288879655466324965365444364694358, -1130595511500905794988497654692297473128945074347386107279008, 201311789412326504456958300381289449385354577138204680156284, -32408788983394435463259266996989279139692236473739311539908, 4429530884782756685635488724358754891773156179918853677524, -520486624273378433090485785129348146972887971304434606004, 67887803752605960039350703123794048726113987282517975902, -5962431386136866366640004779724345366074905227141451072, 368677872541826422599194340206951236542877071872226973, -40540316526737544824138979722208942093556806704989928, 580616227480901023792902897865638500637346561950529, -115355915438749655055873744350362313188724964398036], [-24352528169043333745738448003534230264994105834233067396900, 55448247205298141320118710699612700218347567334143221714440, -42410928929107012175724473517317435974776231298936083924550, 26139501547108378087018709791864685312224186622851961885584, -10602236036466710550728054348783280973662939147047762124698, 2598885420317832421157581723426597288119459808436653098988, -458785637624760946685164206100803912944135432807940911394, 72761890235979710755368744317281670239142079053637696728, -9909598247682746275600842571949919101952224802810452544, 1161720777505328285326832589243392678231207858234736544, -149012381872666854186690531750279366669065432836901182, 12995458441261810158796030159545420637293758746777632, -810961388239616338697713450632573810382260410870538, 86810025130171188142362986144941008712965582469308, -1307333707397717018550563596501192075990844817514, 245250599126628798891705394197046727598016957656], [-15428146538741326925398685489202324332468761219058458624166300, -18375418323605378942309251045336804972290699746590504936328300, 32082625522277149789099645631384847941535512524496032616287800, -30682645822486286886572063916929349064802279502399665575073845, 16353375010857264422060760917254585712241031670858752458793672, -4746907013825024889804710559652620992339403282338431473097406, 885193697112560786007700778524073230496957253141513600282300, -142337362117843156893892973548595390170160417499348873081232, 20807898175901494619535655641719573666137782439691346896516, -2398247121974141259850470669995227404962388943000815755668, 308264206366366262629976401545945486044117856333857471400, -33260186850198967487181852722106337085770705431486914736, 1432722182799950765497296810987035113400390761641636032, -244833735161372759649530645242390166721442651298817486, 1297098584722732604255863792552587136883131133860900, -692108925442655352003815562747478988946454518410257]];
    Rf_basisdens := [1, 112646835814938662570128060725779200786803093784466405064600, 2009957491445950556238794987530078279638927602396234065567657800, 56323417907469331285064030362889600393401546892233202532300, 22529367162987732514025612145155840157360618756893281012920, 22529367162987732514025612145155840157360618756893281012920, 2009957491445950556238794987530078279638927602396234065567657800, 2999936554396941128714619384373251163640190451337662784429340, 1004978745722975278119397493765039139819463801198117032783828900, 56323417907469331285064030362889600393401546892233202532300, 2009957491445950556238794987530078279638927602396234065567657800, 1004978745722975278119397493765039139819463801198117032783828900, 2009957491445950556238794987530078279638927602396234065567657800, 112646835814938662570128060725779200786803093784466405064600, 210162007117422877929343396876453732811199801836691054225, 148511710613709956867060365563032235823771804521666474476700];
    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_252_b();"
function MakeCharacter_252_b()
    N := 252;
    order := 2;
    char_gens := [127, 29, 73];
    v := [1, 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_252_b_Hecke();"
function MakeCharacter_252_b_Hecke(Kf)
    N := 252;
    order := 2;
    char_gens := [127, 29, 73];
    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 := 4;
    raw_aps := [[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 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], [1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 2, 0, 0, 0, -2, 1, 0, 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, 0, 1, 0, 0, 1, -1, -1, 0, 0, 0], [2, 1, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, -1, 0, 0], [0, 0, 13, 0, 0, 0, -13, -7, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 0, 0, 0, 7, 0, 2, 0, 0, 0, 0, 0, 0, 0], [3, -3, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0], [-51, 0, 0, 0, -11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -7, 0, 0, -7, -1, 7, 0, 0, 0], [15, 0, 0, 13, 28, 2, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 2, -4, 0, 6, 0, 2, 0, 0, -4], [0, 0, 27, 0, 0, 0, 9, 0, 22, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4, -8, 0, 12, 0, 4, 0, 0, 0], [0, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -1, 0], [21, 0, 0, -17, 4, 38, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0], [0, 0, -39, 0, 0, 0, 39, -77, 0, 0, 0, 0, 0, 0, 0, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, -2, 0], [-37, 0, 0, 5, -32, -42, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 6, -12, 0, 18, 0, 6, 0, 0, 4], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, -1, 0, 0, 0], [0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 10, 0], [0, 0, 0, 0, 0, 0, 0, -14, 0, 0, -14, 15, 14, 0, 0, 0], [-15, 19, 0, -15, 0, 0, 0, 0, 0, -15, 0, 0, 0, -19, 0, 0], [0, 0, 222, 0, 0, 0, -222, 67, 0, 0, 0, 0, 0, 0, 0, 0], [-396, 0, 0, 0, 118, -118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 330, 0, 0, 0, 110, 0, -36, 0, 0, 0, 0, 0, 0, 0], [-13, 0, 0, -11, -24, -2, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4, -8, 0, 12, 0, 4, 0, 0, 16], [0, 0, -306, 0, 0, 0, -102, 0, 28, 0, 0, 0, 0, 0, 0, 0], [-36, 0, 0, -36, 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0], [0, 0, 69, 0, 0, 0, 23, 0, 106, 0, 0, 0, 0, 0, 0, 0], [201, 0, 0, 47, 248, 154, 0, 0, 0, -47, 0, 0, 0, 0, 0, 0], [0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 19, 0], [-115, 0, 0, -17, -132, -98, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -8, 16, 0, -24, 0, -8, 0, 0, -16], [0, 0, 0, 0, 0, 0, 0, -30, 0, 0, -30, -29, 30, 0, 0, 0], [0, 0, 12, 0, 0, 0, -12, 329, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0], [0, 0, -159, 0, 0, 0, 159, 153, 0, 0, 0, 0, 0, 0, 0, 0], [-1023, 0, 0, 0, 429, -429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 573, 0, 0, 0, 191, 0, -174, 0, 0, 0, 0, 0, 0, 0], [103, 30, 0, 103, 0, 0, 0, 0, 0, 103, 0, 0, 0, -30, 0, 0], [123, 0, 0, -135, -12, 258, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0], [119, -12, 0, 119, 0, 0, 0, 0, 0, 119, 0, 0, 0, 12, 0, 0], [0, 0, 0, 0, 0, 0, 0, -14, 28, 0, -42, 0, -14, 0, 0, 20], [0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, -21, 0], [0, 0, -6, 0, 0, 0, -2, 0, -164, 0, 0, 0, 0, 0, 0, 0], [0, 0, -477, 0, 0, 0, 477, 241, 0, 0, 0, 0, 0, 0, 0, 0], [0, -72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, -68, 0], [0, 0, 0, 0, 0, 0, 0, -34, 68, 0, -102, 0, -34, 0, 0, -4], [0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 87, 83, -87, 0, 0, 0], [0, 0, 473, 0, 0, 0, -473, 7, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 52, 251, -52, 0, 0, 0], [61, -97, 0, 61, 0, 0, 0, 0, 0, 61, 0, 0, 0, 97, 0, 0], [-3577, 0, 0, 0, 263, -263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 2010, 0, 0, 0, 670, 0, 60, 0, 0, 0, 0, 0, 0, 0], [-188, 57, 0, -188, 0, 0, 0, 0, 0, -188, 0, 0, 0, -57, 0, 0], [0, 0, 0, 0, 0, 0, 0, -44, 0, 0, -44, 15, 44, 0, 0, 0], [-152, 31, 0, -152, 0, 0, 0, 0, 0, -152, 0, 0, 0, -31, 0, 0], [0, 0, 0, 0, 0, 0, 0, 14, -28, 0, 42, 0, 14, 0, 0, -12], [0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 12, 0], [0, 0, 723, 0, 0, 0, 241, 0, -282, 0, 0, 0, 0, 0, 0, 0], [-257, 0, 0, -227, -484, -30, 0, 0, 0, 227, 0, 0, 0, 0, 0, 0], [2160, 0, 0, 0, 974, -974, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 628, 0, 0, 0, -628, -791, 0, 0, 0, 0, 0, 0, 0, 0], [0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, -107, 0], [0, 0, 0, 0, 0, 0, 0, -87, 0, 0, -87, -475, 87, 0, 0, 0], [0, 0, -1473, 0, 0, 0, 1473, -453, 0, 0, 0, 0, 0, 0, 0, 0], [201, 126, 0, 201, 0, 0, 0, 0, 0, 201, 0, 0, 0, -126, 0, 0], [5570, 0, 0, 0, 588, -588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [151, 0, 0, -75, 76, 226, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 82, -164, 0, 246, 0, 82, 0, 0, 44], [0, 0, -2109, 0, 0, 0, -703, 0, 270, 0, 0, 0, 0, 0, 0, 0], [0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 13, 0], [0, 0, 1950, 0, 0, 0, 650, 0, 92, 0, 0, 0, 0, 0, 0, 0], [0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, -10, 0], [0, 0, 0, 0, 0, 0, 0, 70, -140, 0, 210, 0, 70, 0, 0, -28], [2163, 0, 0, 0, 683, -683, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 611, 0, 0, 0, -611, 445, 0, 0, 0, 0, 0, 0, 0, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 82, 0], [399, -10, 0, 399, 0, 0, 0, 0, 0, 399, 0, 0, 0, 10, 0, 0], [0, 0, -496, 0, 0, 0, 496, -1185, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 4068, 0, 0, 0, 1356, 0, 272, 0, 0, 0, 0, 0, 0, 0], [-5144, 0, 0, 0, -1234, 1234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 64, 237, -64, 0, 0, 0], [-317, 0, 0, 277, -40, -594, 0, 0, 0, -277, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -6, 12, 0, -18, 0, -6, 0, 0, 116], [0, 0, 0, 0, 0, 0, 0, 58, -116, 0, 174, 0, 58, 0, 0, 124], [57, 0, 0, 471, 528, -414, 0, 0, 0, -471, 0, 0, 0, 0, 0, 0], [0, 0, -1340, 0, 0, 0, 1340, -677, 0, 0, 0, 0, 0, 0, 0, 0], [883, 0, 0, -183, 700, 1066, 0, 0, 0, 183, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -26, 52, 0, -78, 0, -26, 0, 0, -108], [0, 0, 0, 0, 0, 0, 0, -78, 0, 0, -78, -925, 78, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 119, 0, 0, 119, -811, -119, 0, 0, 0], [-190, 98, 0, -190, 0, 0, 0, 0, 0, -190, 0, 0, 0, -98, 0, 0], [1039, 0, 0, 0, 695, -695, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [557, 0, 0, -337, 220, 894, 0, 0, 0, 337, 0, 0, 0, 0, 0, 0], [0, 0, -5331, 0, 0, 0, -1777, 0, -374, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 94, -188, 0, 282, 0, 94, 0, 0, 68], [0, 0, 324, 0, 0, 0, 108, 0, -112, 0, 0, 0, 0, 0, 0, 0], [-671, 0, 0, -101, -772, -570, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0], [0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, -126, 0], [0, 0, 0, 0, 0, 0, 0, -44, 88, 0, -132, 0, -44, 0, 0, -40], [0, 0, 0, 0, 0, 0, 0, -121, 0, 0, -121, 727, 121, 0, 0, 0], [0, 0, -531, 0, 0, 0, 531, -1053, 0, 0, 0, 0, 0, 0, 0, 0], [0, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, -6, 0], [427, 184, 0, 427, 0, 0, 0, 0, 0, 427, 0, 0, 0, -184, 0, 0], [4844, 0, 0, 0, 210, -210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 5388, 0, 0, 0, 1796, 0, -472, 0, 0, 0, 0, 0, 0, 0], [-24, -4, 0, -24, 0, 0, 0, 0, 0, -24, 0, 0, 0, 4, 0, 0], [-1329, 0, 0, -343, -1672, -986, 0, 0, 0, 343, 0, 0, 0, 0, 0, 0], [0, 0, -5454, 0, 0, 0, -1818, 0, 244, 0, 0, 0, 0, 0, 0, 0], [-586, 415, 0, -586, 0, 0, 0, 0, 0, -586, 0, 0, 0, -415, 0, 0], [0, 0, 0, 0, 0, 0, 0, -196, 392, 0, -588, 0, -196, 0, 0, -152], [0, 0, 2109, 0, 0, 0, 703, 0, 1274, 0, 0, 0, 0, 0, 0, 0], [0, 0, -2654, 0, 0, 0, 2654, 231, 0, 0, 0, 0, 0, 0, 0, 0], [0, 424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 424, 147, 0], [5377, 0, 0, 0, 989, -989, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 394, 0, 0, 394, -631, -394, 0, 0, 0], [0, 0, 1496, 0, 0, 0, -1496, 1087, 0, 0, 0, 0, 0, 0, 0, 0], [-990, -126, 0, -990, 0, 0, 0, 0, 0, -990, 0, 0, 0, 126, 0, 0], [0, 0, 591, 0, 0, 0, 197, 0, -1874, 0, 0, 0, 0, 0, 0, 0], [-6354, 0, 0, 0, 564, -564, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -190, 380, 0, -570, 0, -190, 0, 0, -116], [-209, -331, 0, -209, 0, 0, 0, 0, 0, -209, 0, 0, 0, 331, 0, 0], [0, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, 323, 0], [-507, 0, 0, -625, -1132, 118, 0, 0, 0, 625, 0, 0, 0, 0, 0, 0], [0, 0, -2559, 0, 0, 0, 2559, -1955, 0, 0, 0, 0, 0, 0, 0, 0], [365, 0, 0, 611, 976, -246, 0, 0, 0, -611, 0, 0, 0, 0, 0, 0], [20350, 0, 0, 0, -236, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 37, 1891, -37, 0, 0, 0], [0, -408, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -408, -304, 0], [0, 0, 0, 0, 0, 0, 0, 234, 0, 0, 234, 1777, -234, 0, 0, 0], [-466, -134, 0, -466, 0, 0, 0, 0, 0, -466, 0, 0, 0, 134, 0, 0], [0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 146, 589, -146, 0, 0, 0], [0, 0, -3732, 0, 0, 0, -1244, 0, -608, 0, 0, 0, 0, 0, 0, 0], [-370, -162, 0, -370, 0, 0, 0, 0, 0, -370, 0, 0, 0, 162, 0, 0], [0, 0, -3129, 0, 0, 0, -1043, 0, -210, 0, 0, 0, 0, 0, 0, 0], [-2537, 0, 0, -295, -2832, -2242, 0, 0, 0, 295, 0, 0, 0, 0, 0, 0], [0, 0, -2540, 0, 0, 0, 2540, 2717, 0, 0, 0, 0, 0, 0, 0, 0], [0, -248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -248, -539, 0], [0, 0, 0, 0, 0, 0, 0, 12, -24, 0, 36, 0, 12, 0, 0, 24], [0, 296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 296, 521, 0], [0, 0, 0, 0, 0, 0, 0, -515, 0, 0, -515, -1357, 515, 0, 0, 0], [646, -247, 0, 646, 0, 0, 0, 0, 0, 646, 0, 0, 0, 247, 0, 0], [0, 0, 941, 0, 0, 0, -941, 137, 0, 0, 0, 0, 0, 0, 0, 0], [-10196, 0, 0, 0, -694, 694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 189, 0, 0, 189, 153, -189, 0, 0, 0], [-1397, 0, 0, -295, -1692, -1102, 0, 0, 0, 295, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 76, -152, 0, 228, 0, 76, 0, 0, 24], [-1617, 0, 0, -51, -1668, -1566, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0], [0, 0, -1943, 0, 0, 0, 1943, -1085, 0, 0, 0, 0, 0, 0, 0, 0], [2001, 0, 0, 935, 2936, 1066, 0, 0, 0, -935, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -331, 0, 0, -331, 379, 331, 0, 0, 0], [0, -120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -120, -360, 0], [0, 0, 0, 0, 0, 0, 0, -214, 0, 0, -214, 1917, 214, 0, 0, 0], [0, 0, -1424, 0, 0, 0, 1424, -2759, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -402, 0, 0, 0, -134, 0, 444, 0, 0, 0, 0, 0, 0, 0], [2375, 0, 0, 761, 3136, 1614, 0, 0, 0, -761, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -54, 108, 0, -162, 0, -54, 0, 0, 180], [0, 0, 2628, 0, 0, 0, 876, 0, -624, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 324, -648, 0, 972, 0, 324, 0, 0, 216], [37, 0, 0, 195, 232, -158, 0, 0, 0, -195, 0, 0, 0, 0, 0, 0], [0, -712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -712, 129, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_252_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_252_4_b_g();".
// 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_252_4_b_g(:prec:=16)
    chi := MakeCharacter_252_b();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    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_252_4_b_g();".
// 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_252_4_b_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_252_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<5,R![33536, 0, 422, 0, 1]>,<11,R![37856, 0, 442, 0, 1]>,<19,R![23005696, 0, -12028, 0, 1]>],Snew);
    return Vf;
end function;