
// Make newform 48.24.a.j in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_48_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_48_24_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_48_24_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 := [-66694276650, -43285816, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0], [-277029222400, 4055040, 9600], [919737018368, 152248320, -31872]];
    Rf_basisdens := [1, 1873, 1873];
    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_48_a();"
function MakeCharacter_48_a()
    N := 48;
    order := 1;
    char_gens := [31, 37, 17];
    v := [1, 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_48_a_Hecke(Kf)
    return MakeCharacter_48_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 := 24;
    raw_aps := [[0, 0, 0], [-177147, 0, 0], [-15004050, -1, 0], [-93764024, 2, 17], [399558685724, 1078, -1144], [-94331609818, 52233, 21781], [62311541111154, 1011128, 141950], [39474112534692, -5257272, 20102], [2131930712885848, -5050708, 7402458], [-52596963236089322, -587534613, 149150458], [77083880223184928, 495538262, 383813777], [-276830582540473778, -2604357667, -3111398065], [-466679679893087014, -9055142556, 5218483214], [-253794859008928452, -50288656700, -2283708330], [-6902063977804349648, 162866218984, 18240428634], [-21558154635546034114, 7178566255, 183653403834], [14123352214517545676, 1507551987756, 335849263884], [-172097889309069341706, 3205840912593, 482094098327], [360378575197867622996, 1618686881932, -2615874162324], [-7563437373011547512, -697530187992, -341805254058], [-1388765362609464699206, -6192112890938, -1134070038862], [-1803648810824799734960, -41250416152490, 17639481282061], [6264590497386328115940, -25483495598846, 20044858725796], [-7835452717432892447190, 181125556609112, 66331411921228], [-43094085882789496921182, 146159912276396, -38834993433832], [-97533709489458199606770, 529606887616419, -71696049537714], [147739887865187412450472, -492931166642690, 40944412225855], [152993137098315897938812, 352699797142556, -343297041556264], [-47589589963548977011002, -1910809631247959, 462509829646537], [-77035391376065565602030, -3263067410887236, -163480482400568], [-505206009991392259286912, -9805938006645798, 2104188620513339], [-267400614837672650983276, 2506252620420600, -7123528229743880], [1811187343928741919080314, 34004839961627164, -1647093019642758], [-648397109665745013726052, 25241816043917276, 1531261423840980], [12414842480676505624575966, -24654871501516969, 467316632398760], [-5957408614228188010757416, -69524184650240318, -27489240515312079], [12516586404674497511736214, -120602297184606539, -29822989917354169], [16833777700733065051598772, 166873282594430316, 60421563727302606], [34140681882198908511863016, 243545406027949416, 3051296091937248], [-2902878714811018356797306, -415793462889791961, 100322197594640332], [61049353319877145191868484, 290743025295806916, 149217833633813924], [-5055227838847689949829698, 431276791219759289, 162833843540857377], [120266367379908652647452864, -508068154182462284, 81449259562252948], [21456539228625364212916290, -568178198714112406, 12469134607618238], [11146516768616808979312046, -1638174918391406561, -746420967366736346], [315135981773799728452836104, 1039501041457060142, -65534798338106669], [155557999231968286380982116, -2038011865841097836, 243408511262270292], [113345569917315596124238048, -988726359022999038, 2003271918072580343], [-233874778559866923943352844, 9608965475455217446, -741208661913497620], [1732959143369531104211088270, -1359193179559852191, -497541240167323051], [1172449129979889685063469850, -14055353864225304540, -941123148137728720], [883111689066252921767491568, 7938099896507049852, 2289678545874013048], [3149001462658074841336290706, -11208049801022241330, 121871941927724806], [-1310037711721904752205710964, -12055015785684103834, 9240372566356307032], [-3243352645543978322281457918, -11278202443786973216, 1258885032884982016], [2604747195361329484831727432, -37755937564262245540, -21363896088489384764], [-8462621514994766247694061018, 12862815718318391871, 2576254503661701974], [-1645411387169315743882507248, 105212581817891528986, 10838667382268778535], [6151173151328494046395876702, 43279068771864807273, -21504687431547127647], [-12210660256350421793769746582, 67228419608661425268, -21917950985911351636], [-10870351053183237362858639700, 28726993452132826624, -6502006257299323808], [-24828759554906221795441205426, -177767263140739190065, 18807207848547896906], [-44586818768129609407708286780, 81737364880593576572, 25357588053907142108], [14579748872222720439561341304, 153486227481413436212, 82135280411989884280], [7133669821866976748143345482, -107179367530670152334, 25045275806518303910], [-18778473549651425437432032010, -226357194192720542233, 174922263363603231066], [-122750629873567721001301502116, -73223191912589855628, -195518141360502220832], [95743178703273663101673164594, -195736670713732070650, 44771322159196309266], [59764156742908123458312068332, 296574964881783725666, 220934385883485470036], [51980466256615405095483174102, -1700051255694902615335, -541685755946708698001], [70972916329664384554272321442, 107121567591799049852, 470249850950037654312], [52388677265712212670289182120, 516179339012480011592, 826461244311374855638], [189755571391792992909014483056, -3117096892524927927690, -744837845366284795495], [109902456312040608366738261758, 1721582896496727931905, 503293803624864664191], [414916445319171525450743973388, 1049174832140357946400, 1418161070140729221806], [320943433295837587903722983808, 2231119235534871004164, -1264423322033449035444], [275404391481231619213580145390, -652563104991661172749, 1331754789150578113116], [-217638634503364587759974949466, 6540559375484898254509, -432947550084252707053], [111223631013826967476729828338, 575922047911805246408, 1325250285126619985386], [-570145974605044885105310437910, -262101277452415919660, -1066982654591033191032], [-631837430319185366782075116364, -7910070767229560509826, 3936105514624972309948], [-946466831833816060140875103538, -6334675596236797916047, 1449281296404158491369], [-1011427539702415817788293478224, 10485402569787966547008, 5340357272045212134206], [-370455801435683352908300968238, 3070228371642844686372, 2425504313373122614788], [-1305182517825389843586075844104, -13842886668027587275106, -1532494108615928807833], [-1325101960393086189812665478068, 2161022256643972520442, -5979817364207887652756], [3780361676880204078085358004034, 9585847069014985544840, 3386823984882640655350], [-234855118841275118748142927814, 13910480529471227995852, -8819063001465491901080], [2995988257547100690978827723110, -9512871897438884240721, -6223515624384862012548], [648774835054505893041978332368, 13524509944056194763274, 12628411975911464143679], [964636611870778743936919108708, 28084649212157929909438, -78009060143989183908], [2260745338534008855383224762848, 63792702899052769621196, -8950078962245511060462], [3039019136887100351839539973672, -78179595670360238926054, -7937063546664539199039], [-2624133028381901118439128802052, -29810359173463797973008, 12238712269505841445012], [-588167840708727564781719113852, 131068879322298704192848, -5421756516046535835408], [7957165013949729488196796632632, -76329049622374085530632, -14613977980963690353202], [-5758954543327996677823037723082, 20977585496127576347059, -11891107779423930012682], [7047034260927540427879229276666, -55387389894214599042432, 46514873279051164420890], [-8606977362946750384008504599012, 59327383906839603587592, 36167731528964616377750], [9315526087243525177329112004118, 332062887445367467218381, -27635653211001613893363], [-7102594638026959774992346332876, 343256498752819236146444, 40691581911991669930074], [22344853148959754319451396717318, -16398933301321794745797, 32502353745801275031780], [36961236458263358748555574888900, -55184916260248829928354, -77893461633620756878072], [65965738850673840247542537987658, -947013976935513984596, -47178486780006286613914], [-34865049772076762218690677065524, -91523931799951602668752, -117314618402403882146556], [76030471574790797663639474880450, 104399393617639527853058, 50838985598561170617782], [49738923791588443916233776666716, -47575489212113402071752, 164979554108186587001796], [42221858866646024279945269752370, 37035223410932497212796, -110953608881254366628536], [51145273585580933572805745408152, -612759630678187931072084, -125796257011432552385474], [43674455870582385525102561539114, 348304794275759717917898, 260428019661878969684294], [-8085162727949527851213124212128, 772551768305709011816194, 12346497147013213940699], [-73939674826744180652595859055090, -121917998238354718444583, -322014112132801087063793], [7535567731450227646200053504410, 1060194121221970129037996, 84670917647446641304172], [-2455704871965464055530248307332, -530910951106776562928000, 313840365389391251849144], [-108045574890563299867005337246024, -1106950529481199392837974, 31074738912933747519209], [101618317088398790130861848617090, -1384524505384064661454340, -357018145574403097412662], [-33529517437589373921103011532140, 457527255195634741198972, -365241466643801682633118], [-13887266366212833954836502239032, -1249769456652431304507460, 143552350608033877453658], [-30704586663662079782130290071386, -298973230765068094951361, 673562936194831394581112], [-960170228188576578877862964444, 1203476373201282488489568, 708967871429952029594988], [-136595816386008286097101076293154, 1489219377812116083195537, -133081415454022028652853], [27273873063447627140079374430050, 981904313168878459749916, -133402022759445883910124], [-129606684482139044393743431329842, 1305828668448063529641231, 214400379073262804108284], [-58269316595839452514572474522692, -2454935157602050578069442, -748782981512857216578900], [-276890892643470657109231522424252, 2114118072538832699418292, 1107706098934404562651238], [68627619118197132782178542096758, 2798602459950977193615759, 986178064137932152159234], [-540445512523685328054390189558354, 4545805816342847026872969, 215403205136178694367917], [-245866630328374171259273293146672, -2709052409211970881012476, 1717344418267916074208430], [204829120808487911324051445002520, -4993260222080893545908574, 1680867924478675495872897], [-595529004073189710420139239684266, 4628704839069117446770349, -1204169007314861435801031], [404359145641840414300152732227572, -155914104562790814165936, 991022474445102515320692], [670314671681529949183349784235816, 1866678224963293322366896, -373272500064496248971996], [1043289588246633459589512124054000, -2312977991225673634982890, -2208715429919269913123467], [-1336067203469485761673849594963074, -7581763529676312414229311, 1816253777489780594492245], [1047546414930573051377717765053322, 4533663185566582846077752, 2319817076113471488443758], [355378196686104427759712068469762, 8696250540934995141842122, -4321189372045843517918602], [-1142792346428048986270211132247698, -897508413959558652460293, -4617389396022282569018558], [970352457432551530267929480636324, -14612995680594765574194448, -569956205621965863877990], [-2130628650106394864767136065763050, 9576347445038463591147955, 1323581864272247374602372], [2344173684491731890966205067076058, 475166887513157409006412, 4887311376191935873851898], [-1595732751766202051157283372690372, 38469994502973112243911352, 7410953745034873001424194], [-870935674429280683387836634830530, -5718211721191862964790797, -5699737678701214510540070], [-2232444868737077859960717916374152, -3746978389462432135074086, -5184280706811017295370315], [-987767184792213109577356748117556, 11745888321125821570010164, 5713399401406239067097896], [-1052191279562364938565917285348106, -5374260355372570004786055, 1730057487499105602689273], [-444669399520391703001954150222456, 26564696259815052266969072, -3711640362243536397423774], [-849322171287000697617449505399010, 23021628628152492704475961, 8682491700722184558528395], [-711068702577088498031336120544726, 57281041770869947348330988, -464321558341742516219450], [-1385183910852455454304689631805716, 5344063316968951171596724, -8061053306836812351742238], [-5109773731633144145029174382443680, -9578189802540665330815860, -2460023026170516462960212], [-1397921237838230399442461719330874, 33845313682328836501867897, -6837786009944399276473401], [-3002825137136301732801861521197038, -51451286936275452584322624, 12365533496116508530759864], [1519597318251606452212482893684996, 72719281247994495122785204, 15352631989061676034595598], [-752154535256436598395312201547848, 69791204056230724824127740, 13215506793703630564048916], [7796246716285253868003076099983260, 58630719486905320210737484, -19199169766087424122363294], [-5922765565854694912909789100183920, 12757679231593983800486028, 13800660560542753966454832], [-521333406195696924646919021615656, -105308793249648062319285166, -17377421832873830131959539], [-8475321945590572562922949408344478, 90059767573765791795677864, -11051573442069146642020526], [-6080453444340064557061703945968038, -139077859321117822145232528, 7042131762041779268492256], [-11021457483735999460414438219246714, 71945961735375669778918383, 11223299973136246898756900], [1788117077562992971669782999392068, 73713170083128304105147572, 58688810858616455523278164], [10336766485626123679737636848826570, -48740554270511305346715696, 19918402474997354087937834], [11275348857199682581630266049093128, 195573853759996865850117494, -26287836076558400457531873], [-17298724769037077686255619831174692, 165215050266989962087166, -50588822510951552109963132], [6475881418238184642434497633998770, -32361670828013794309295432, -26380271959789877490812270], [-10020741704824268116835560774688232, 78054693835282533979510380, -61813450564960433354825028], [18120703729244426739311139602918368, -157792014015492455740295554, -41868139735898558519245059], [24559176653293332590168611766807182, 157135997827826118311243973, -9304535769890680727996757], [-7200113037086504191459060769394030, -43189785018741656003976188, -98426814919721102628595032], [28872374491422821851824082022686334, -90138483400882215263955133, 49494825364962687117321128], [14371987771998654615894535680270476, 413155094511603432462018152, -37026456159834876527404140], [-8571874773776867515283912545860042, -372619133045126882962741091, 31991826246783322231824311], [9888126074340196880549688353808968, -321370515774180210545952616, -71475092856802864034104804], [-4630403911510356580701719809250054, -6318949255497260736645120, 123193885581026285238598272], [25640649679282491612041239391125264, 86181300199961174858555190, 87658740696023638171008873], [-8450631939169504802497467317898134, 199279312095024135427662844, 65693373817054197995336644], [32663149012253229590821527241151916, 286023324287287314386293808, -105105999305520339841529904], [31298265082644545526246914704812622, -170551637384771071911359801, -143826225797356626846390696], [-7271338919364522301810043273352088, 34430377985984470382627198, 118266794273903520149565415], [-57349223198709141186722343886334714, 276067158911227590270123217, -121025256755582943517126085], [1333679749526735407786299812797504, 115005176894233052570894910, -283289242915577461774385355], [48749750949847301901332153166762580, 742793973719356658865230922, -207454153706603530417617084], [-7686455376267000162874276168604114, -731203726508209863149802595, -54629470362900646547657167], [-39292959747412389623303473054325062, -674366028791377048801271468, -64029854954890636807631588], [44829246914842366386879389473795920, 339088110754141218164235004, 61123054049679395272087028], [23690213557645035680041434892288030, 1030057018866070272559590723, 115289314687717087857359104], [8968830074448675603400869026992086, 789640484425910538851930989, 375220229245382459903592577], [-71688877608538365988918872242924172, -707829820920060371774167312, 70089529686428732205893320], [817555068724504931952247448607386, 441167861070487866713493286, 205294997881191162536871582], [-6622411369860649451440479435320192, -1188374145435504994186993176, -66858465832167790836455864], [-69964241848991515350053876522290302, -103269233534108078640123416, -136664404056493307487330272], [85415955227899316052684842906011804, 613191843485349058029956908, -284270849023961736838054524], [-67901687673515955102337190744035036, 1841530559474504125343339536, 71770904961751745891708768], [63388140790196819047482932185736598, 777535542639190037198292471, -351619143913994604081878128], [66183708370626793767839346195473332, -293411575394677433684529984, 314890647225530995409531440], [61229299285441712573651358419104090, 1534069398107156720281413212, 89988145001829544070643372], [-184125140565442925381225557606201134, 2564111200221550606711591970, 358365281189365067177314950], [53706775027825827235813412272870262, 519184729542822745713090189, -498245756228413365450116447], [-164413462035291860385034645874234046, 1028902634675297538712721556, 215024027677466926832062900], [126027121019745854044280196549617416, -2239558570430452400007128092, -247489131433441156018000144], [85282731331844801991321576663300198, -2799970377181806765467379229, 556340526958787425144112], [45759550107365062942402246778513360, 154716627144033655206666618, -265941375033555599781745169], [156728841979632865447185560597485982, -155019581793444717565190515, 461568101306704765744115917], [-60996504361281431146385441670241246, -983829207279446129032627858, -511049936433985820950069894], [83254845058979265513686267476196348, -1906563208140249897930187350, -962379954087534210228670144], [302883547017397161533718933808710966, 1179970247921788526464991875, 487386686463858419253597638], [498797039725682680710067255798199552, 1413463971467842845558889650, -611919142079670007984862933], [-213288963724177999485013047740271340, 670478582079938849966237878, 352268187539294054890033912], [232237641297399170249437223162277882, 6854761819859630140859615012, -970803679930976740646132920], [332113610542342642419339079587348764, -1873585588877139867886288660, 749120309299305002759269906], [67072986804698860111736512854424690, -4350684148424398319242724118, 1292869465465215592908427798], [47564611183812403364237847151753054, 3818368237290818128745023687, 1347041031576826148636289444], [243010397020044288417096867802589016, -4160736907489307902556387770, 348841674661711277311958615], [45110930472862745002306076871359148, 997730482955704576896294940, 1090767833837860939580096644], [-375321832029203285670802562124862104, -1341430665187155801830101896, -1899576135245135262011453734], [-697523418961329732992401429016674342, -5470448238666787200341519708, -130104605566015299107996140], [-130338628707864151020362531617154000, -4369730569341326684693986762, -50656066109837894547971435], [-341791966174343419798318980314975694, -9336998465071970744107897508, -1219256661510762776498642774], [-1291926217713746295995276581852132456, 922302864276898744940009608, -1174436656309503381834854288], [-775068924250389375945062781659175722, 2127152411802244248170499459, -435374740338010787423993648], [-462589831787986478849181191875170546, 2005228531546228070132260453, 108764624121604078909989693], [800600620543826334794223016867391928, 4013028151603153202159298358, 257108159868425267959486391], [-1113191016794045308382524811078912638, -3336420490983040462612987964, -1632385475018051557794382730], [-130753164671479978761461126693959536, -8991145009987954133873743526, -3533571193901314865877388649], [560337227800575444494980956996952612, -17711702254607301467797484414, 343002922005954306975847284], [-2041390147574485962763053454420515618, -4835486921797755632795749967, 2498969115555388816404868299], [-1418083482906556425168311412405781782, 4313691406244397986673269712, 3755900718781448307997348812], [-168147499283925587623315733133646432, -12964149499486828780694683692, 4778998769349094200710417930], [1388696398675846748071608143302962664, 7632818944521293540383838086, 6522142924324027471420488315], [58951053929857057690057490308478652, -15779422499752293657270554744, -8231960563160429989178106372], [-175595739716767832404916440889903738, -16011993306793673688810357183, -3377449117629705514593734015], [-756925122190357385615966304941356732, -1499153569614692629107649708, -1023648582156288314257864190], [-110612298504966758783067273820836416, -2835101355981106329877225742, -2904644533132910695159115857], [780581255120495623648204138587521338, 3751086360210141563540573676, -115966084722845406316290564], [-537316775431089077710370152752751652, -4039450022368631429090043540, 1196773891999950021728040706], [-1051111269598622131786963178777655088, -2642636483068069414169440220, -4427852264576073174082481022], [1488409298253522435499342426543033778, -19737290048047983703847260740, 5767236994686049630652679936], [-1014159728178985490726923757664673122, -7083860077822585106962488729, -13404015336815740515752054104], [246608903191883705050018677153145196, 20459632060892859801279860718, 685058486173329936062579572], [-836196046896636391490753164939546072, 8199967246536142390081609476, -707541252860601681780625374], [-122557230863089049791065903953345660, -21191848473802918610967866354, 7233047817115961494188019944], [866723492406357098740287588782578316, 7228359499802671037333127556, 6209891000513181490209188736], [-3088131139721915244816505628009909176, 36988316254453760745276125714, -1045343601475645155379991783], [1414346262013592832139364792575437606, 27363716160911350472260463061, 4410478744090192827358897919], [3570457804133249445106911222694204530, -12564123296109105845944028204, 6403677993620110890710921132], [934824963543417201596055816343754840, -32953537686863731544128513192, -14518058897046061162552250590], [2368378290804162131989630800765910560, -43329795193837419680333104338, -5082180776891390378147079839], [706607993646534982160555709793496372, -494798843309578389697651532, 11240385130213463916054880864], [-3802849676418151827683761092093811908, -8668310985744759859424462508, -17169591714427891829411300000], [-3253283635548383142860309369821786832, -42488813225446506430687968592, 8978919723357517497220384060], [-3288086732430150338571067053041853450, 36687211827357469310359076057, -485849749847332745558762807], [3869625467136773909796297510101814210, 11401383152836803947883638940, -14993004785187117628500320280], [5553523413710409998408321230007615624, -63377377686314746947265014628, -10429429467498330965027584030], [-2777134905404738040400783241394618182, 20075346427214667485530633656, 17515128369942267804439936416], [2983769395271653581052615913924104422, 22787969495419432066210875003, 3209939230778493001857061050], [2498020538491170150906032996599208164, -1363405047476031907131450284, -9350479749449459909757887616], [-5136618143512489354863161843713280482, 24907520869228395288567263517, 7474997985457334835462599565], [3162707532835089125017540902580220396, -10991196320967267602881019376, -11319005627956954916259892572], [-8525617545542710964479109336026679282, 6088671004248194747970158671, -622356447511705850355446226], [-9048169635713433310915641598618780662, 72883851601182348894887662364, -1055503547180307554414815236], [2481329066746704154374431048735450752, 41582105058831925546634478098, -3142389863177726046888524349], [2724446285699077874791610179155731092, 6068374298379157241932753220, -14469339299219240463744384796], [-17511190931612552212502193350807965202, -37952838327754206093648984795, 3063339791768556118596365085], [-4109472928636222214915211111119667306, -24673634120038245113957408907, 10860840979190479020679298559], [10128545386703222081309753035560416098, 100711150254647604160316762876, -16575318289476272851122691658], [-6380270307605183630310422890873769548, -66387995979587433840274959372, -1463536004932126863067591208], [3323525819720542103492825776023480454, 8050234548741089268514318827, 7643008576725140766609301484], [1333299493826149690713416154144364234, -32838585368285039483816815940, -18803930536007873466692226944], [-6300764267189789377385797286666443444, -4602589358235998368028126736, 5894151460048267060267250626], [13101704376327927305519127028631154094, 26892877667306062498778271927, 59077459980177260939678037176], [-5451496359417761145310551292137333146, 81106714679146388577617896017, 7173259516669460714409577983], [-3615339154942499420111444305003816604, 228687655796110182287880239024, 41829403419916376204632484764], [-4541916563484977899654425870381287510, 132283191210557254668658502600, 34463549742852844728471191128], [-609186624414311289115416415978807584, 97108867593283037184004505166, 8438573850286963409555791117], [940211808205081626357602376346159250, -40809860293389505958997084112, 85955421585830986926743102576], [6310105439606433079124053140544766776, -1915481631607228251097512074, -74319891903645294563076122257], [26677206125388849711756944758904529804, -85049312604705102439264392038, 11113896419404427606559606440], [12303172308568307134362794828990572854, 74683423134226488983641262733, -27653326075900199004394686773], [-2627287476968971599779746264408097286, 141068316043006694944919472482, -61987609213681853578023442722], [34064363176722066540657455150615816100, 111560202894917589703623074820, 13270235734521367624388904112], [-12132698989518528478996024602988372192, -11676977990132260425777937132, 49222753543737420437507724586], [1551791907710925008286288663371016040, -131882640071199438506833532634, 91834349402030343872377543007], [5301090108909745174843857538960369528, -52211780121777119547281590876, -22898478175015465388286666546], [-564229657608530329284795153749931218, -156590162418015504765216737943, 22563458089407487195171981655], [11939210674838064958747154666686140764, -152987706756687270688731598000, -59325042137629076697496330774], [15899990299236344116383954387675386448, 331183521257639731637173671632, 8007863696604859523482135508], [-1590114544158610981991365560228452302, -261479256236720935168261106450, 51354208610973008751543480446], [-15172433202615582132914596665839836386, 69731913843217970710356146927, -66911651156224821761081612300], [-10944822480126778413435774574585367144, -156978852632754200722170352934, 42855612066571077600143810849], [-21593782801915627931860067864003401310, -110585462066683779949894506020, -218079881391260682629106694136], [21574462108854725510403999993387021254, 102588537599820606914375899591, -29949930070584331772648876880], [12980299292767244177237067972415933700, -327521311592898933610952481364, 33063093175395905629466982948], [-22991702268041485277541576628353467382, 216907970058765135853444742264, 95862241739451802522177146084], [30779929882786587709833291035125536668, -98328044598032937551775925324, 174941052366709683382823707932], [77927329521413926302630057523995009958, 151289833423274154072966869297, -65307511662830877507007546261], [-5712023343889934211142958923727449962, 155561541234837652579718089999, 122261186022020926788017783788], [-17359889530645001714004085582867607648, -105605332570299002966516239094, 34779285979641661562367282059], [62941612789786143997063863026844639934, -341738970907867068622189606757, -21257538356484103366133536746], [-48423334545071408287895801681834503604, 172569275934812355030303335050, 11430507314102975365439931936], [15756839301365954558933223904491861460, -254704412531285552639307500928, 43338062163329056988117109906], [41826910232210849258034123396400165434, 832463690432330280437417511602, -180846209396167422195095004226], [-63673331345552255452601502967656383130, -741138811136175040001938895609, 4972809324837126463556974272], [29201293264699218037358134565389107920, -680464296791362181088466947114, 55654745768038843429146028465], [14173685494555836433960138641004127844, 613207701878635584263574986816, 52964361476619614733056453768], [20093583065786498643013209020521898860, 931036174019860488363745052644, 76246689576894204405448553238], [-27594669045086097064259064210749999070, 558893744668058164428060556054, -53785768432974975700540635618], [-47995264930012218449468715650767536388, 218185793370143860596375726510, 205945893634527305438664924368], [-101745795679780774852979867723519755962, -307229729616301493986988585283, 154177646377795239452797257313], [-19830063904927468739745215071403058120, 912344099785179616552356233760, 59972599835306141662898449778], [-16292977645893472724980739304673207186, 590973309703404097203900055881, 46575698357433824491465131231], [-151588276571009857646605269151765273840, 668811170162439454618607307068, 40129445714113846825299162588], [-38060538589467859750602803657082448802, -191382405157308987529484255877, -110715245394102878619082051754], [-75890390680153496772048642718014571038, -25940338103988759901142652396, -358115999243317270436229557414], [16420086874206538146736569751337332532, -981221060859453860437373280320, -244827109506106149742765257106], [-28971043660390891808012026581338693528, -179169722381590422635015013140, 414552364805480200086598400032], [13154179672708527312193828983924078042, 1108330877127077872640436760088, 136979525932831106922162767360], [-33387634066753389107367181160578323516, -626708064527810636575294299656, -349746498820020581230723163284], [62275548805728236384855355266966282304, -1585483970872201201339657922652, -183948006295837218201006440106], [50716314793848112370380705476807298498, -1909653350166712871771810886122, -409245542435249909161950923486], [-14096071711635617585718040630307496910, -768401917040136542390352660144, -54562060947183554385979657396], [175815725733543888349508611638993416932, -674146470652247500138657929232, -73961701620095460942734080056], [10976158696150434082515642557053302058, -35241490160494928082244831566, 34868613737619118847529331998], [-22982820030953796921699998892046015018, -1651010752308657340759177080213, 516130816088150944916860593450], [43528616987236146724258411028225224800, 1002405670674814478130857276902, 196452600313130570305929662529], [292494154532909879301827343450921586330, -180289458382887555310283939884, -10775203116682525923175038818], [-28806414286112837072025875186199125486, 1072029239701543320075105742100, 574047996029021668258623621872], [-85337918520981461390592027447729240940, -2393775014567052711140399778184, 24443114002744397312482299366], [-344150266070607211963481363133210224084, 121461774764130074532969746884, -1453947167557999734726543714], [-258430457297943352996698998842093424480, 1224089906319768438091097748336, -60676322391130842046608136768], [242343138661649257466319106855242153934, 627187974625648697806579244171, 1239036449958350077519045608068], [-174944025376937167577600487526160857978, 1414643069961154935103138382417, 89891352714321974583851002073], [-505130059296026350888256585471609186954, 469317981246921064225687981755, 86298369632046751224412456000], [-143752494947906025289565209991625727808, -167948419842254975743845429894, 662195195950176954860180247391], [18421003620152340577542391378410305236, -938974557014242338323580704284, 407824905684081614912996167976], [-16606170583149578092621142796826949924, -1906199452222718133957817046372, -81349829134985479940608677492], [410470649473632239173081237018216101996, -97575862084605915439344650294, 44742337157899944405274992368], [-301588355521957785192364788948043269802, -188130761988316516634653174875, -423954394980697806413257835633], [131361960139879019679777442011904457762, 1771823523636600371256528086800, 794378923792893488334295944268], [-3714797655990303595679265189109975270, 4213373744726996801452392252190, -258134536882262965969635271006], [-104337565887976160764978670359897462800, -1009665627290092915379432866894, -599166511113823787127402940517], [-49437444773881204923462916018569098882, 2182072701270185736798870214033, 1105004728454758082209970763779], [37344056367299223650340928763480335754, 2530805076069212513794542396080, 1262437223094932943994981076034], [-486476707384454003272622183404429257874, -1714196328265855350626276635961, -633392273002192482380439545342], [133232401962105566051336406858666248008, -1382961951333233437151435409626, -43810278979052228436770250405], [367041323083240124090772310307954423574, -3426410265411492184949659653405, -126188834649478183878526557826], [504690163004349214959330394074551759924, 63507650156397850435600749214, -446808979066461901090905839152], [-427163649471216788553663180958705484978, -5462009940162815684119910895147, 686941806799090421369120992273], [-358551302014733104108702827363929896388, 400627452633635789331188434764, 674278318938161718996835361672], [-408910207520652350346595206303485513680, 114230047772273915544201309220, -147184184174039131328758085570], [-321911433889214163157987186540107216578, 282023685207058857039075865119, -858625832103361954432888740250], [-384162776398755066932103834546135627948, 3378162473529280444178472999840, -839412665462868664933847527854], [-404620685231588061711325772564104602438, -3052820906489066119438181432620, -1543994024379985096041549452368], [-310005640683018320324673773642106594330, -1011951008898302495672313612213, -910596956706877797556183524634], [-362372581329450278861371221167397057456, 3291094584243587869573686282554, 383238219857295350446391138419], [-301937431183568479776876443506493306082, 4141379070899080410351182360361, 1326194456122598767684094649691], [573095455946657442430506819931009771818, -5649520266287940336180497482656, 99539847724716864093503372440], [-37393438266753958101821412227272662688, -474398916023462903004108368788, 752992374714266446235411912656], [-30141622394831720839303788205376456580, -8476751221595623105169806993408, 835798211541528293464999562268], [-459532169971498577500479517062307032814, -3024412428569335761096559228684, 802546682022215403410034659066], [-1139850821320386475928300683575417805384, -5000924619110708245146856395916, 911083691232911197029026524368], [-667833274255490103116364142875276056850, -1812951514856985784512064912595, -2755521806909957741667715302057], [658841309545970555380409997428945575802, -4875704255745202939093402510320, 251587984774496050384743837620], [-549947881280867228371454841115684739952, 1340441647529368809869627193852, -649396654150304664194382607572], [341947910417352185033436990219926773548, 12764104736191965744160578483434, -847135045779482560456347317184], [249922739484960904598856089320631187636, 2354597571653986022538825436160, 533890630478014689004745783540], [-151966786522632103835690992423738481574, -8006761154004627186404294486550, 3438359840759441933347216768710], [686742305200060058160689201238392040326, -3726868844794151860908156937377, -1333856466814855708252303932610], [915307466385042223493739438003687062536, 1840233653757391164744981165578, 909139607276769197924630715045], [-1106309457894247361601968244270258630742, -593265086642581775892820117804, -1236540896085543635077068498388], [1548579244381090521240239237186193136372, -4336519674783407114447537403678, 1102860179107893498675926616600], [1054382899292495405801476167675211190524, -3553572651487914645579523329168, -2139373642073318850877905742994], [-76457933472860957497567826506804000528, 10589754312103911698917128677288, 1765350215017915437652023653744], [686563053143340119464648039495714209406, -10483788474668525202659556552401, 1197064025077634636483484560258], [2256797621493302234409747039252571756088, -108958276081889504483462779534, 1728449729911586004416842762033], [-644188303593434691364145541227960480714, 4493801141451284278552769551285, 1678644021763879000410917422465], [2188785767520278288672813357852233815716, -2387954497184057404013843678842, -863374743278984649364066870368], [-1010411267910387889767786796363182067168, 21325730357603937174475058934228, 5177888944134605136962782287572], [154212883812505316840038100658963287266, 18584538460189590542958137328976, 175701293941435031950096485488], [-24835560991354848734441338193145986478, 5470175543431753779455751102796, -5470934892724235404780652378434], [-616125224723990674012868589882008762806, 9215080895206356475125161986782, -3723490681764283283130672566706], [-183421797124216150511739964476857099274, 16484138067267390486864252080223, 3715194505537379435447868905196], [-1008596967115052629853235501859658638406, 10355908534807255150691402309872, -2727541618473549681106560530522], [44035017353314968160839184387988850840, 17389175250191019651172777630690, -2090854496115880655014249916143], [-402064391883190899030231115418667765086, -4419939689765903342043037404296, -73921289903566507594320909192], [-274374980188426092634176932007056075916, 6579826110665022521041442032156, -3277295074694660728113270277302], [-3527528994520505359802294422205602003288, 2839865773630092228328018327416, 1134588695220734216536050351608], [693216754221841849823235393676637661552, 24726240546860985465726301390150, -3459437630316461010817681744363], [1022042802199137699462138251901081940478, 14112033158176120632925057787649, 3481287988994503071891338716953], [-3800126960125558370005380111420080775412, -3959911407366482675759843857164, -1661173313218368025845757058820], [-476691137478858490055509928154160125312, -6829622268731851888227554742512, -2278970030789451535858155862786], [852028581804236115740497116004379192706, -2498659438938614826183069710440, 4343520010788330131654522144688], [1407933447406377489886480976013523448302, -24391438458217578399364277506965, -6352483751522355101942054202888], [-161117705620472522210773441770108757348, -14409490203860456647196781390536, -8451259541665242888287934100232], [403121559507646936900407283900124592932, 18290106474870506870320909510576, 9537415278102816515376569070214], [-1304788075587768778220447575057460607784, -11609283047872456487919197998816, -2216061141160213417056755839884], [1753945708959901802124427073969824128234, -33035484505482597935007580294068, -5020486969269757684888538496040], [-1578012640817837121728038833657450620256, -4572928377696117659221263765710, 7278191622966928426228961260955], [185745231913695347757339652945818115674, -1117298982695307385020370575040, -4685610002653793454922375432094], [-464735688767695240563726196625139405892, -30334072588005951851932341146752, 4405599013800350508267280934990], [-3314676218393663714749112492098092265026, 14185979579525038530429575041099, -189651880261926027673404843884], [1666075805264756586637719841553747834742, 952370835431746210262848146525, -3881245710813584065662118715837], [-135484425732270298143959190355756489150, 5121803399984780766057369750636, 9867129510736286433225205145222], [-1723744971695224373116876809499654869552, -8127289768676828079724752704182, -5158194012075735875293974141109], [-5145696676315770230435732542309275431254, 7458491142578381367937661588980, 237214169122957375873005670310], [379002333723435239317513015821952509326, 30870847193429581992675018893627, -4289274038807098794285725621266], [5267720035908096159700006236958832090920, 3038924278380029380038686697122, -1946340596400072904157662757187], [264906791805234496859597396169385075270, -18253946371098404411967472264623, -8529531533550966826774779387567], [-1563189632992357219711702345516026795118, -20547693331276137769152372438008, -9369956469525782102939867333558], [-1018533053377322264554408812551851048828, 20087729213670922533865365745328, -5617059706046648793279691390066], [-996016720651762382632681806214167597292, -47073522596497238098454873152106, -2071051798093591205955524349608], [-621378904841862854357279163084481591438, 16382365445191761196379488716010, 8457984931024728721230249677870], [2877496934688703195713410273390969157470, -17747401965272766589967881084273, 41331414406638304131804078116], [-899637090615882619065221758875227163476, -21273248826586708508159903542922, -9587714662890424568412459639088], [3288205475230049795315900682514730413620, -35725575888136358203951240469268, -179927999954787581634123496778], [1215609151842677963529003389125175787226, 17177375408850295134334042498614, 1322887253292648424882659574474], [-904847871523381324795145867539650133498, 46451840187801292419883003873191, 7482807041020664567263103513230], [-3817107605012999528343046370145989463232, -43472532974092110234600975251836, 14259318337853878169201024059956], [4158560957486608312811467365488228603272, 14333991211093515374559953181226, -6454218934976731583371174736083], [6296221810507477318129662116898991545394, -37970980916398912975245926651000, -10131358667018880727832928157422], [2636498148080273169502080150964470747544, -39860243505309672702023288361656, 4036136368676327045473345385258], [5687858062143849958509210946584888390870, 12312312169854110459328196586243, -2984648075706538899155560385080], [2832425462406342729183293717046381858574, -9605427152480056726502896667055, 7782729475730428995745429535915], [-3283498224593992578365646077513019082128, 19388945574096076069135486927808, -18537711618432249823224689489820], [1906754583869086231855044143671857373196, 68645997148127172969334978723142, -13048285095857067754279486826956], [1255055142027946316363938797839521494138, 9686300702699681687523059923098, -14864730347276716284554037125674], [315556867633632996194487772988595570086, 94405964888952486665105452393631, -3037225946553829199786001932378], [-4478888947710696172606608753440408543196, 7790135988791062840648153539326, -13631192391896421142481854476964], [4780614573812994953746872857467006960874, -3709665909119433548432847665368, 20347473451155461393229890612916], [-5026800554923536085195829308703171879636, 90494939170599161539263884140620, 13056362365504847730526823828674], [3139488112521982572044763554194142362616, 20358350174516965865813933280036, -4313418049205998612121862341214]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_48_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_48_24_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_48_24_a_j(:prec:=3)
    chi := MakeCharacter_48_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 24));
    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_48_24_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_48_24_a_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_48_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,24,sign)));
    Vf := Kernel([<5,R![-294258907498613722675000, -18155059753998900, 45012150, 1]>],Snew);
    return Vf;
end function;