
// Make newform 90.18.a.j in Magma, downloaded from the LMFDB on 05 February 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_90_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_90_18_a_j();".
// 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_90_18_a_j();".
// 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 := [-735, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0], [-2160, 4320]];
    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_90_a();"
function MakeCharacter_90_a()
    N := 90;
    order := 1;
    char_gens := [11, 37];
    v := [1, 1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

function MakeCharacter_90_a_Hecke(Kf)
    return MakeCharacter_90_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]];
    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 := 18;
    raw_aps := [[-256, 0], [0, 0], [390625, 0], [13842098, -13], [-32257632, -10098], [1447919234, 8332], [-790106298, 154972], [22106856380, 795768], [-243774891414, -2596321], [-1993657431750, -287736], [-2746130669668, -5380774], [-31357643818942, 55919048], [-11705738638662, 558393076], [-62428461595546, 320036743], [92973306061782, 547005173], [-179669890323834, -2793146612], [-451089585180300, -7229582492], [-782211459483838, 10399620832], [-2919869465527342, 3508603221], [33794280217068, 25885837638], [1766695349792834, 23846847332], [9501328198276040, 38844564188], [-10837543987559094, -122981186795], [48749761096111110, 154224519560], [49944968927693378, 106505005740], [-17420123544422982, 1253704291096], [97616936224835294, -971778172555], [59792446560384822, -1154371110421], [-97679734731611710, -1976026862456], [-353873825721889914, -717375649176], [419651158094801138, 58163675031], [52708659932320608, 1249281239746], [294265386673514862, 15910502694128], [-1161573230796374020, -13132575984748], [-2083050558809960250, 5973570044600], [-339522739764761548, -27872622810470], [969661325763549098, 49475079904792], [-7526704981746927706, -26922423349045], [1471477484651802942, 12514018946669], [-6073636939136087994, 77823311048120], [-1786798333327443060, -140749820648964], [-1512799242189465418, -135252916306384], [-14828448756158853972, 279139211205338], [-2087740532645639206, 102761387506180], [-43564667445729809298, -78134902082116], [4388118374826717320, -20146168872704], [-35173327961628220528, 82392783441790], [33868921243402011974, -588045238939411], [84240012808017183222, 302350588228327], [-81130853857004084530, -592346266139008], [27298997320413215046, -1772206626954828], [180606156267603399000, -253904808626668], [-203619296953839431218, 782488202544860], [-281192151997935497952, 687197525666070], [-227037336235952356218, 485695968816552], [-383952210633526611774, -1662421481173309], [134784063399962674350, 3229686707770416], [-26872880434134188428, -3736246200746026], [-322077746249822002342, -5554558599969688], [50404701318986458938, -6206246589257860], [411133436068788006974, 6068729688723299], [30496265249864755806, 2346038953049520], [1002508420646813061458, -11687573384035635], [-175979333027478710892, 1769453208051554], [-1068433263229308033046, -12645268004318152], [930384511376329739142, 4239891952825764], [92195988729365064872, -2198054249962762], [2098764532053749613698, -31299812427833080], [1232770713637630217742, -24399145524048649], [1562248107001193275190, 17428494017542352], [5921363764473899673966, 17707541990607368], [733377407165720137320, -71928162520277856], [3582980127401624316698, 7039753898426523], [2508368764308503112794, 44598580226047800], [-5974760482172637991900, -7560138285615784], [6262185754172588047146, -11914452629619813], [12152023838590487974470, -18512288947222352], [-8171725465564206044542, 26356544473194764], [-9115247334678110429922, -12385444123337696], [-2080706124376314601570, 32579212754288516], [4546203909519463694940, 57681667116812348], [1281915603293070398042, -20012566645507960], [-36838328978071595095812, 5819300751902530], [-4402911226712249965246, -146204667114868052], [-28324392333234374322040, -4813315600332384], [10180756558414265085066, -116233911095619047], [-32124756934143549760710, 10562528762430612], [-12416869155325037098342, -221204313780533760], [-26730740320896911347422, -352433456789643720], [-26917140730706782170466, 268830812125675457], [-47266457536822191313458, -21429186229191341], [-31359960587873924378280, -530903216775013740], [-38856940080529190826742, 191768653956812023], [-12962789992392715126752, 334754344022467334], [83106821459842001845820, -546027207352480464], [21153286353234925322946, -494064928175662813], [-102694970692598507955270, 299825482995021472], [29022106861007509345158, 1794424904230895360], [37865353273921273771454, -428653843656754757], [-62150077445787243369778, -1584641559332781928], [16663646367549809021738, 325651313582619593], [-144242591025421433842338, -967378415065206264], [1720336003153097482146, -558879741266928263], [10031187553613329523490, 2450909324011298028], [222626507855242834701992, 1219456701381324950], [111217871585976784012778, 533511222597641968], [446204645870999799932982, -217379766526967221], [371403696805913080214766, 472285551420184928], [284608875796648637373120, -1011824150182835804], [-252913997487808014616138, -663302371993876652], [-105325886354685557092582, 3701404370834128283], [632101167833008220570114, -1268795982183535204], [228674080346519877627462, 1542829592891878500], [-628765953806640973972780, 817505315766466720], [-272494361407727134623868, 2085661033603905266], [-721800640046975645841582, 1487535787648213700], [-138671919770793200255746, -8469825533406665697], [201541183857077305543782, -10013818516037947967], [-90755101145034659937834, 31096581710679788], [499333710006215483824860, 445178468463578676], [777737732755982573225642, -5162710622707211824], [495531297970547301934994, 3719590868869655060], [455920143652910357710062, -3820551031934634636], [872405353187950168631226, 9925734269198174841], [-1674386851743830750930968, 1385202123192342450], [-531001997238583150924962, -2539798063932964168], [1620698059716315193783070, -14119787772492057672], [-303492639577458546577320, 248730070296150820], [3366074486202897885085058, 173399106991139427], [-877307396212902657027286, 27535505530769130816], [-498267690346192448044780, 26896493362147450524], [-3161661955231425753529494, -11272684453848930385], [-417266532995255552218468, 36826299753133976714], [-265622814246568098404182, -20968333069855920752], [1613136391906203354975318, -17090559794051042528], [-2715201422774758272243070, 4313145308502864568], [-5098828866926827863824994, -2508001749908886740], [-109918395163089659403862, -8594239075832005823], [2960940153674541633103062, 9830063659867631052], [-625174918527895202395770, -11687623962169178368], [-2386887411791266331249968, -35464920778863450502], [2153606122996371435240438, 57488128783419611144], [-538177541442350985009226, 63065810349934362529], [-8171710135315304940346098, -13693337166470269049], [-1204178863149962090519230, 77787335902621946432], [4761023874179628222822000, 23116339607079845372], [3578165541375325121714, 39170987899268050596], [11751642819860443056867822, -25670381702312684456], [-2565123146200117820975620, -84946885230150691564], [-631150483343905858548054, 5026284350138475827], [-7053087493234200356092582, -53496876002646496240], [7276930823072989250723538, -65005115982210445540], [3723510368088158593031294, -154128096835078713465], [13807913300025887427831102, 3191489151134540845], [1367313868479960498910178, 202566386783463730841], [2309571050483173637900628, 427568855829198310], [8963612535134770132971440, 175262157933317544516], [-4816734425068925634631830, -68034256109659451820], [11756349651961673058553898, -55946318934720544780], [-9026745523101419405593902, -137910861304636535136], [8595540501807629186798622, 119642123527517343595], [-17365045230672335578738554, -83311307902066348608], [29529535502973623985707738, -19402138975852859305], [-16026816080557008863315592, 185312732205282455850], [22930681550513475197962542, -8048526620232351092], [1126901695237821528775746, -147936746796551707173], [-27218034674623566415095268, 92852717368512782770], [3500836172629102348818458, 308180373596221845564], [30699438349860034443607730, -19342613679146864984], [-15384448975273209462183954, 170660634621343396372], [30220583984197091636392860, 6740504500117622824], [-34665356543163478461177778, 105897445695198675264], [-43230239900456914634853612, 75881210216429605930], [18325903197271219273678274, 121630467591094070444], [10156284601180888729963760, -564067526080019509184], [-37165496549221158409314090, 223037633159726338808], [-17522295897207253825363288, 302057512427836826678], [-57319209795555285686647542, 385950865798471179584], [-57786994646712721570076026, 83726900910886649809], [25484840472730881147487250, 299160478996960619584], [22956798176531150871184538, 44453722096317411827], [-17210971604937929752571472, -688697552825324961782], [10521126146473015088384234, 676217058312982821132], [66860337608055150589405662, 155347553200316865532], [-13296691992352930278351654, 377808391213230704147], [-26867540723458366943050590, 524460712098788620216], [19140304101510053420624018, 80509572040086186984], [115884148866078905509417214, 69839053845198356351], [118020415085830725202204670, 282771124590639805332], [-41082440415381649091252652, 217548737302984130550], [25296700561139300066228714, -983698677746070634704], [16523327014848053046617946, 751890445581415835657], [-120567398305279235709248968, -277671151883075249158], [49148369054658470426678238, 800552241229940043120], [-132537226934819924104483338, -31439794972868337577], [100616982170184035505858246, -542494517406475504068], [3580200186934280771101262, 1280407341507136235348], [290237172734566758016288154, -31175443214465505652], [98576956370983694819069982, 580956547432924251776], [101849407051505853420951186, -775052666036593444221], [-95880852058321536935888070, -1494012413286113766152], [-15204844218407774471625148, -2068636356766601509018], [138198166232275693030175978, -148865781558213588676], [33139924249366909891001810, 758144743570190842688], [327831644948263554783515460, 609625075592773126516], [-214426826852566117690519098, 678527502986847475216], [-100269818603325265239637600, -2212737811947399363864], [59035448322055628182605426, -734875554293575529159], [-46683256225766671989217530, -119519217480541221592], [-182023749168652800468117928, -206507635869546139378], [277061838171448090173932378, 842397638360626420700], [77978677573787886868228758, 1232299656010681950808], [-205209438203844113531085346, 367410261677530630053], [127712261983331369519180982, -2057450699215055178253], [-122744794987792135024776720, -859622599263340308060], [-9648469949643975997019338, 3531720193459764118796], [-291124815640353138980784862, 834699918188824411831], [190609624597823498759790318, -2198683793980946940448], [-340813697928960863167164738, 3642503985546443633125], [331528534061063641657515246, 1745402124565563329452], [275158049444960057785799642, -3646292107117519182096], [-327396047615992784572590880, 6046055675864894649636], [-208561182825066027028593810, 1278441478951452001320], [-416407286367344523947360146, 2390860560498584455233], [671583318580914376763931942, -2590254588147451186137], [391073201665949668311755690, 2543792230306805646208], [-402072349048850218657880994, 6773686174676704482500], [-1324008116648215219728000, -3184418756038980977368], [-451734244616036564110152742, -3062152704305544683161], [-896849611999898609384665992, 4281523307542171835738], [-330667389402650379081162286, -8008567321352937542764], [175333969793250680121749900, 2321582872299008780712], [-315976476595216493287972828, -1394616658627055907026], [-37053087723810017042232822, 2467744724024091165052], [-74015429673383335566395026, -5619950056709386068061], [-1183016908080877038490570578, 4227952635940536336801], [-1735586255795597827104290170, 820078895831929525532], [764623736521289608326451926, -7902362905284767741884], [206004939202502772620189820, 7037789440696381068736], [165004254291407655842717028, 9830427573037409360370], [-908419699775171239679423334, 1899380970334841714093], [-410954257662271983532375648, 4543411386942372946362], [-379319087630370415936248826, 5657203431491958220969], [-102181538162257285325507530, -17075197726994499575184], [-816305859037596162504169314, 1190263581292779509224], [275008089340095908286081000, -8689466279218455523352], [-468200627626332494257187422, -2041377901887744783873], [272592579114542163472699368, -1632495648681207925242], [384905496041860863720434300, -11906886796167245944564], [-1100702907197180701969293534, -1241597500291880770977], [15800376947844430759755698, 15587546715032445421836], [1544491946573064867370876398, -12408273059714642699360], [1233657964650276164398280982, 16852403376120729494697], [1820788902131928658205628110, 10907320811933654859780], [-999112229852883204523940154, 11008205808753557170512], [1016257537170663888613025460, -12066639303174832065776], [2145730789348913569077322502, -9208747229190377036792], [-1458772233243500675841058462, -2795402515363828612959], [-290032860380760566818207338, 22870954857600375777688], [411213670129472773192841018, -9893540228410713936192], [1405997069048353637037604214, -23308480968823701973299], [1075653938645366112311770182, 4690113933079572357071], [-218875315365048884709213490, 11567110176506302669472], [-457692320676824068971151246, 17530278831870992508368], [-1032199138982247612253156458, -2644893051691526641884], [-488073703504708187939135380, -10428989976717258585984], [2879789965400248269203395770, -19443702893844951498016], [-419442312095142625638034602, -37705405812251533432048], [-2946806618224668397838214346, -15466396244571230483097], [2442936221867883908132803086, -22957862828515750615496], [1623949453613765714511950462, 33971700531217705821104], [-3626160698036370916377184942, -1686455426450910115171], [2080806442453564396763909594, 22401628135249880489580], [-5152124691216870746497319440, 475663230370459531440], [-2528607066794307719741437462, -32427253833585316761664], [5162659843083057930763571414, -16078600372469918072519], [-4564296496862153009398818978, 9628990360838597744191], [-2240831964808543438030428490, -22453413811938795444904], [4087582822059186146046047462, -40452823282546538808652], [664722836882555435117549328, -14886562341387315053510], [-630411989427622604421709734, -15177211088720072736757], [-4306272000495219619312437028, 30539269858325186496678], [-6566923998694168588587836058, -10963645884260554626319], [7192473439731554991691304582, -762438892248356449632], [-7483967054626113725029296742, 38612066686257248803341], [-5787442258689105409865524092, -1688904766593625263610], [4128822647008435186892430554, -62604890922977928944732], [-2761459947650229421392288738, 73889553326138597637364], [-1815568569646716938538638320, 49335568039261061875460], [765431387342155658640660330, 584639396951150320436], [-901429895925577072085605842, -44966429559638644522152], [-5208224572966604248688295738, -12256202338055345912889], [3815366602069574467406324526, -36864439040285410212844], [1401265698802421269657523568, -38729463792412958950146], [8307867202964643036907572314, -10737547792349507199744], [8273894119652100495948737070, -46068623870208913278264], [7132714312994714885127974252, -51856096090331604902550], [7904989085950571712893099406, -29086428802723779174640], [-8297017455586428635384637060, 9004968956806356008656], [1299004345960154841163719458, 58550489912668624957373], [1007523333815426953148006834, 115117702381007199933152], [10674875652297025375405136502, 9319915673996720465464], [6810304556765576494641365480, 24558193618336476396244], [10776172887687816733909292706, 1945573234653395094425], [-10155505363314130405184412928, -17616575306883659804950], [-4657869083946084457511202622, 44063544315647652418852], [-6507468638559109897421146578, -103156205642458235929713], [3311289832079701768525579190, -89969201036943849299912], [10478070919984208834271323880, 47675675812817488016376], [-7844684206277800009277070526, -62116729088287683037576], [12279076814180016669311116026, -125722496238055431607749], [-5867215450882913553742914270, 76411608845002184174480], [7904568981529027508933276958, 67990128048512371668816], [-3658568539973364986974512226, 17441218605676253350239], [4598285494202544441307269102, 105529935163792331250165], [15251191666080365730563260490, -47522263524927111729080], [6325947844398715958123763300, -104487512765921088530520], [-21687960749726009596224287532, 85798100172504949911822], [20250721954225189168330720154, -89145560390168586080872], [18266265581121928213361252970, 152669259822963015608660], [23010540194523553028434520552, 114227848544610107469362], [-6648528561402634294964962942, 12268757339555922993328], [-1699031525868980815141568802, -247810459904120790289376], [16664046414245918134580196974, 49523853069359351969729], [-17198768981929932883332762594, 150861320405886352589160], [7520302420752297021079932062, 4076906258433195105932], [-16365130876354155805573495540, -104013278429151250427856], [12393217164134457262992305894, 124956760588658111540415], [11162475711991269709899284742, 185023942418660873965445], [3864181066735670721773079606, -351538666543484945642940], [-22333192057141120802811474958, -98993669592920832987960], [-19714332657351771138500026218, 134279487216545310014304], [-180604388527519784448035560, 51378246677748500368820], [9017732074503137130250484346, 164689535700079196590117], [-7245537990788725161031903408, 3742027798080233056722], [-40728875609224740061664403018, 25293060094852024151091], [24605472018411048584019188210, 250684600607728868601112], [27035391953096799471761569446, 166550745359624131083392], [3756519727256690916725793302, 51227797531340849419492], [-8247873481467496393877769742, -124190298995033178136857], [-4054745576943328235795462206, -282878755526881468802400], [-26772463971271057394043951018, -227656641328951647911072], [29833860094228189870549185270, -280008876530641808144856], [18619222533073747165996220852, -236039343389031584964286], [-25390382847836490436017279954, -47707166034506452279288], [-22482021915202547261040368460, -266647888315812394938736], [-9509392031189795233353269638, 479972925066178088448864], [13456656021049188293432814818, -406487165831062716699623], [20818092177593242764800495748, -50983990935088133155930], [17275828874558575179323433582, 165323490795847016178892], [-14294319149369499662169683728, -137220403277723706674386], [58941494943736098490021918538, -66036111952768604222344], [6013313995224638892621159438, 162769859864606795401440], [-2983468750434196048910087986, 328568474862069281696001], [-42459057539931402394569777250, 481812778028783207774688], [-4826449751333409507092031474, 488815207886653072626956], [54067512893556858841964355960, -366568088107408614858452], [-58233537431628659781131552472, 433462428004760827451970], [1598514245347575727646443662, 55162109965801644985020], [-14028890777983686593039149254, -165103116530069146263793], [17586649294037390460879389258, 657109508711839835548668], [-21606898072930861495575029322, -222601652186917409877472], [48074332092191075878785405702, -364324120774810513277211], [102862981943404745235801362340, -50231271109835521607500], [80666454179378441570046013898, -70959330563437007308087], [81785611595475778745381213834, -426257158761553199420908], [-73920674941424056693253461218, -9930321669418953546660], [25248881858396111425617647534, 160173508112774320089797], [-28481448072347576799166788298, 166799744407009741548508], [-14473697963684672988293226192, -512232863623707086086894], [82213409820207992762881950980, -170083970238582406089808], [-7867953930786256739432647134, 382787756874383435645903], [-7932448973890774656369491610, 656243491742979452126952], [-18119712227985767161356007468, 63348096366222331590074], [-47671633883905187418858552142, 550857555967006062526140], [97412574614282572811182771380, -757095505789781651012272], [-115553152394140208644221877932, 23707630484807480364230], [24296587902338571035668162514, 949185812768183343840256], [-13112450005246904854605914310, -409184456625103205782300], [70960563097271372024069001218, -772450933104256676570936], [-74430027465957098062909193262, 202351806423770938157184], [-43359681530890987875193496754, 331405966335241285404792], [-61178593137707226704846195782, -436070017480175493571873], [-99801600676188026645204094738, 561506854057225881253296], [71863281755680292645649891260, 187317464652209093842040], [-96359937823659299810571694614, -1027618959828630069950281], [133918121324841642596449085252, 38588024975521410021078], [86834648301772161146156947058, 1206698909407973159379032], [-153958635243344729346666147946, 32120060142862929955943], [97465799724860379158461769382, 23632427402219790579269], [-215264600592343260945590625610, -199619188172991517090420], [12308772242400902176482145686, 1442529975682975122959864], [-61300419836845838295511247580, -253136569115928394927524], [-192045183867215062989166178302, -76103078130463251019963], [-3233571002900323477384989252, 2065419070246936032294006], [-118738406666879228479640196526, -442724270387585429964416], [27460375284193853515285317320, 1449772699838757323586860], [-208651396309801719089531289210, 738178500109794852873856], [140654929576930134244309757312, 166998033389933830096450], [-134542383410517677116074177162, -929421465197315265093584], [-31601298583345577087825182990, -676589105546450074951032], [41384883856688618964331190886, 1403287063607937810503924], [-131033041510258058413079835622, 839558818060688225812907], [-68896459436082206139845427858, -1937012976194712744808192], [-46374231562239563578725831450, 336137720804031402027872], [153160074600192196898838246452, -45161268347282500220934], [-236015651855076270474956881222, 82488776418324943470180], [48278432516020780669474776558, 16684831444109225193808], [-52933256656934359563892228906, -713900467561423628321205], [-92516251744366878871238069700, -126185975688505479662044], [-37736365413958175791875054766, 1577070506983888100520632], [-19874429019203521643079608658, 2331031004869396204826232], [154965610467644256320080221666, 1780104387242529103940253], [39858067076845248519348270272, -855146969080213097586594], [33031097049357176176984206098, -1008052882057669201301068], [-2248712548129170840764776062, -1961555647268932988624552], [264273841225701983685052108320, -926531101978930696292200], [-310990002802401282008942971342, -1335294908634713681159157], [-41651788068519420163338731298, 2218143797964991389673044], [-183642307860045833911310093334, 788114954771998381997303], [-126458616710826724078016815650, -2657980879093181497171632], [245172953010420974688335859458, -447884563871877711279284], [-102363306512272595389726968618, -1239835640300276872858555], [5946652751571628184474027460, 277193570184108390522220], [-35340936124739760577898444086, -3906563166734081723675424], [24054145129214761536812616102, -1155064950547617396937272], [-213650882923589666003612061534, -3160796899174735102421767], [-85103029453802871948388506750, 1925399312388404493763116], [203056357348181023751071677512, 2888218428779751124688406], [361592527422436816378186212120, 1555593574900771313738536]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_90_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_90_18_a_j();".
// 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_90_18_a_j(:prec:=2)
    chi := MakeCharacter_90_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 18));
    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_90_18_a_j();".
// 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_90_18_a_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_90_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,18,sign)));
    Vf := Kernel([<7,R![189284738539204, -27684196, 1]>,<11,R![-1398138384764030976, 64515264, 1]>],Snew);
    return Vf;
end function;