
// Make newform 48.22.a.i in Magma, downloaded from the LMFDB on 19 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_22_a_i();".
// 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_22_a_i();".
// 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 := [-797544, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0], [-2880, 5760]];
    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_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 := 22;
    raw_aps := [[0, 0], [59049, 0], [14413950, -5], [-254834864, 207], [38025427644, 3446], [-404663021650, 33282], [415692948834, -1929874], [-14908784326460, 143838], [-31340320703064, -22074626], [-1056895947359226, 547532665], [-3287869157112824, 289904427], [17405774448553142, 7047881424], [55814268374687610, 1690273114], [-125429554629416324, 1031839722], [-386859448444267296, -43854405654], [-294875840337624162, -14778035435], [1432854062031494556, 643295215144], [-8697352015552368178, 121916423484], [7878964908823948324, -1576742198616], [-4567238120207698920, 5491929813670], [7181199501557041322, -5603775213456], [173513604897848152, -5712837137433], [-160342937059221871164, 5174196765054], [345689834375681029530, 29653481787764], [-587028445708294081342, -12960102665916], [-208685105955867534642, -86132679033859], [688536882020405409184, 117914887255905], [-1242519991174869862932, -355632705481180], [-1787255216282683435282, -235556381339082], [112222923137037304722, 230639888385540], [-3845506057574675653064, -3059345099903967], [-30284998971988000353372, -643590238354480], [9732061372329978387642, 5386430370089038], [-3860158231609787737556, 10666042459018848], [-27281932199736983272242, -2905229928603157], [4101524401980682845280, -2758610643226785], [-121828199298659755804402, -3312443967542784], [-72782236319699261666060, -27444426584664294], [-18231046082943194206872, -67865194697784120], [-144665602304807196731034, -39121483544777001], [-228866750294431938869484, 7568228153898104], [81048919480849305983510, 129096886073186286], [61811842698944232230016, 137202194853965752], [-274533794151925166414974, -92996643082048272], [-1908247867739053932017394, 19713493149654689], [493584571845012421716832, -171038389851935307], [926344261594190556980020, -218526292460137032], [-2359600057436777283505160, -290115601870255083], [-3349522068188159145735180, 1116811173457190202], [-1140407868012553089937114, 1331221118250563082], [8460531694136026428189930, 880953579777424852], [-4417753829939889202993968, -2284270086389634252], [-876652613674824940117102, 777894735837308508], [13860563435037385783562412, -482165350512565930], [-2431203679107714577041918, 2894408679468275040], [4776749565698746212583176, -1590302557562452208], [38543271342263112728529846, -4991861910363203255], [13021512890718670589806696, 6233812789414585293], [9283119420259393837500278, 7158404921222463390], [23015410152354380853399546, 5948682527830779760], [-6343066316615993582239172, -9853142543113294368], [32440416715946413703795022, -11287973000141513707], [-53955385094569471438508012, -27448144764184295352], [134076784382873154967040856, -4832150124966181108], [78358113383033962661757146, -33967463690951111232], [-308312985869598145616941626, 183010066163049413], [104436194487271014362739148, -32112229829071727772], [-94334293860268828548938158, -9849503202244112880], [-501650004360640378680444852, 47664483325283622462], [120189005054095194875164526, -1663740635065689924], [486218424503299219852886082, 96438474723400606564], [122497558068249485275033656, -120334821714700934010], [89555772071584171213059736, 42437486049662131299], [-699057087709786373677574746, 184097501584093114740], [659298488465544868876418092, -167557672924213157586], [-1020219496522711461750822912, 191074527862914001184], [245833655954808881772875646, 196994761651897895579], [-775765258563812206310167138, -484974271049192752572], [-304873464051922804044876414, 626246894596182017050], [523551506278792710183419546, 153039584819183734332], [1899755677461399361937811828, 468013861722952934274], [3260049819449512250725321670, -244387805479642474578], [3772113112450518471850989312, -864291244949466383114], [3997137285688625314890907826, 330361521161771394648], [-2615479622787872068656336848, 274198215179414058201], [7165743868974468071672761644, 380522916678967667214], [1781567068306329554035651218, -1301670779642490453642], [-2149600201644396363601751350, 1244153129498197570260], [-6067826632694843831783313594, 893541662471051502607], [-9683104144429871411057666072, 1510325932253746063797], [6388902172551976480393587108, 2492102939050205198402], [616245600834963459585846576, 2454858323136830864166], [-6176967314724693043879013648, -3245767908834414423177], [324767152945728746146574316, -3428113431569470427324], [-15379355720157874369933995884, -1206801315419764660992], [-1003058659335464485371315576, 513142250400996574254], [33160394451354052799346286662, -2194876079597892130979], [46978423674822517878687465882, 2698098713271382183058], [-1157529149959633348352721092, -1448362786153714187778], [-43509759435791250726204389602, -1816328441884784222322], [-10006567714384281294674364908, 2804689716231463017318], [17995559263959779127785154438, -11002039897853313647053], [-11171110646019596695143509340, 10932963079629923249070], [58080863689037113132231614666, 9763159715143798216442], [-31149478520009648716689438020, -21296991419839994927436], [107229366402695062178031154178, -14262895208536576795872], [142911174332474470409632531596, -14976844526368518520100], [114322352858754029781819968754, 23821679448844774836164], [131088794503334001135938479944, 5931905112437184844306], [95036579146510383493581809978, 16638266865623867044920], [41067324258336571843934693848, -43186256288732526208119], [-87437551541305529575593605098, 18506413778734714217724], [143662587307432001467529621706, 10437703280179197145192], [122814760913294175620131413196, 20071980415211915092536], [205262258765247324854468826688, -52547080992431996320641], [85264886199882731714679200274, -44723151271699625458130], [158021321572823579808158846644, 7205267623558483706526], [84786087989474524008886802328, -55678957376859343837650], [13624759478719483313420265894, 52111241071589895467771], [-316298916348766596424604168748, -46357937030190043057748], [-206926019256707330093451353242, -91340317457318215119600], [517875704720114922336077399330, 44862550731126627444576], [-241084485904963562943699868866, 32676802931357273841191], [-769080038759123730454442112516, 17489007257002962661122], [481579183428802018033011057412, -76824229847588428503366], [-125037546501878809350558619194, -84265501854754245406283], [-953501191082159315890960408186, -44381160179063444384406], [14759588978504732059951064832, -162870785427541910632374], [1131722811246537314276404655392, 161583221746320066518031], [498564988528532126233470814334, -220228346269766001663558], [859905293174821162350982717540, 92131079868636211104228], [-659516319012175898514109584696, 36037057254453917456580], [-134233287177537426690794067272, -261536133248516376968049], [897761838093473076182126142326, -89134540440100515659574], [1032677450331950603782562306922, -395275805620821882493842], [865486294402525563126160976642, 391048891471420539259752], [-870727180340003084015066589042, -16308114476167238397111], [-237903756900320818915001739548, -108179296458568567874406], [-1271236893563631789114537877002, -438738642668005005388581], [-3150113103177924254649038175654, -242259798776060287908418], [329907987445042992020481282940, 73719483343333373505114], [-2323282919230316128154790020994, 682175293934990143287113], [2304402220687618930292249184928, -36490676093814738950325], [-689241506121728234005331974788, 90693002805461867912236], [936317481655425681767285119742, 3746539607949636774678], [2643720325605391774066111280376, 304260260736058162773066], [-4374611812013371935297447201562, -208065512254194405679464], [-1912261514750584925031173863062, 1960668862449102901816410], [4606176071116152411905583302860, -88182920467955203659450], [-4335349825916696224329432771168, -887922839764182346595384], [8348312946524217907985423723006, -377308300022019737695692], [9885156177389600440253322368370, 1032235862642966424497368], [-10601534171289122436032925324668, -442624356708763658789214], [-10936290950069196745642173158664, 1144233733543587608604608], [5698211114940779109986072036668, -316198520820476003198754], [-3521916697063135114459751333328, -2109268940346078972531108], [1654796096463954643127222146432, -1058523252085811606845221], [-17911938063763638776555039180142, -968268740817823735714974], [-1426299693962416339461504529078, 2167749412192871734220496], [5832431164251567137030255098470, 1885945423049315466075671], [7977325082119525828944607222548, 2005070349349912460773848], [-3263594862023951289904899737334, -1809011360588481137144238], [-20275597256130448277409036601280, 3286166361536399409285849], [23285603970652431954952433490012, -3281745253475387059578918], [2678688961393234741227100001538, 3021420315037496873826002], [-21140590704791782759274288939112, 4665947642149128132299704], [-43923885142260451280938067710808, 1835231312240279529769071], [6673281766171836090539926007126, -4395583008804855271901580], [-2312780965846362322579323934894, -8672836197475792330180884], [51354185959725588924393635705934, 1831808751194414459787367], [21291429894586429000756445663292, 8565914158010868219281372], [28902875728605650550501285362222, 3227257966792951586821176], [26254268427111449624344003045608, 10093364461583490039600836], [-25857359844900634413017005024342, -10311029742733087006495872], [48739440366925688850488151943096, 3542616880158514904072019], [-19657519370287247958167202640902, -3427686363119848742011984], [51189099231337970318678142516796, 4795775865212885675929152], [84702913673584459572908709550110, 2561850303320196272935515], [-90719987118631480374920385786080, -1551159954763036945821783], [-77501484436911392414295209181346, -1675995381046477755256896], [103089576589855045753437609018184, 3678668924743699260178023], [-75270019550201579083754341313676, 1638559909555687807118182], [89397889033777002992051854638662, 4514651656312717103674770], [38133756018946337103816613211754, -8229849855129766352936448], [-90026077031508044417493856849200, 793855163993782692989216], [-63645065036121810300753069954450, 7121788571079137250681119], [139998596303971982233688912106686, -4169256686925197222210814], [-50190991668690045389460008746172, 16932468803819938616815416], [-98608928502289450540567279015702, -21473401591291828645906740], [28291660516331019865373400020736, -2000317104350146032195056], [16650736980638327134050026064194, 31003903208445787936141128], [-16181494631531147719179172989396, 22844473487697946012311072], [-108128928593157616557694063759436, -23769221537453176614343248], [-9690889603672452874564552461066, -53464398478470112376874181], [-66397840419632561109107859136572, 4171285407986620730622832], [-97032346788277197255133692286326, 45417998919328642971600728], [248130406949002656803485266813362, 21822199106660667772505424], [-133955932492044518425507015530850, 34250562546908053012203906], [164131767482138789063236005749634, -12457257025207282222629448], [-298575420714474897945387218304600, 27778998948038390556598420], [-298177783930151391614870970643194, 11915475299390432638989447], [190526835463095332682291809789416, 5654658012463207456063893], [215523817132409518622108738436278, 19176615945898610967959742], [-420858633071496328017289854224734, 1619534732884862256153792], [-209482250468277639954567452027076, 86094995949735787345775474], [-125830575134507959734926902587066, 7502319505244870197407677], [-6941657001313409150768023472264, 55781719560828781319702313], [-264294313668899095834596105696204, 5830489017709924752882038], [363665027994989573668766509121994, -45962791140182489157792244], [179030854906700424015050804572732, 1363821662613260523746862], [239722633756456075334358457861202, 96636098297435343331972392], [-326462241059416528898316239734290, 60525595652142728143936535], [19245847262074628177157658265296, 166787396328643294230583569], [-391519404275761745936837721717444, 90726337723163592149644240], [-170370805253784849997708689579816, 72314709333327030356854314], [187387425428901486839196479710730, 70175288294218600347933288], [-36298265720206849901552075854088, 7804796388437916838642383], [-394612515301949121598140659573214, 46967136349499837816293902], [281385155974810970693149048864152, 174076680057458339929538360], [-1050053769449681651377799791764906, 74313601429284196455399575], [-411376127691267999417322208953018, -116168374623573134637709050], [206670567235177165162274502936496, -21118896014850132016318335], [97970343454487190095262733270770, -333083887273037382452635694], [-704642310748397037827048561601176, -341932651117344647078721219], [891930825545674423355244365035140, 120256096040385068913503694], [-128836089290135743678385424076186, 93972044106310982239541808], [-8429378281112377154897788329702, -13772852412540599695700244], [-1069514383845463335328959821455632, -10674766407930614641158586], [263443008325485516010236878485312, -277210120514639505248912715], [-168729429833142532197106502063700, -197077394819085766780383964], [-176540818143404535935056937627986, -403267400894189620462931226], [-1372242944242630633739452875151580, 343362894285751679197219158], [708398262417574146499823764567960, -378215828816336866847080899], [998402799037833311161654855186218, 151029182628213804979348600], [566317233539636508367841542934908, -347017326585129563022801378], [527627029894284290281188861848544, -22360279032705873633469810], [-310307921382858767596424723366350, 619390470450452478452756892], [1219798425155589276973271517343374, 125032625987497480674027003], [-1340845004543281825283198043724692, -21693875064577900602817638], [535879288418426646388056703200888, 691567610711257226929699166], [-428054173741723418544423951945756, 270398387311195644473712382], [2633875916800341764252225863314172, 108314156500960127545760148], [2508450785683633972861759134708112, 473047251802705783783615239], [1546573342702974911624443717336958, -774481581690458794701748200], [-1115661969102596198252410479033774, 680702632795455211522412240], [1164223175998012748285768304701832, -626038531405011391527719278], [-43201976214195316872899740806200, 243013460214083344203795219], [2444018966911878319940748663218724, 28526936025007852669510532], [-3594628631185001111845897846816340, 36717040972661407220906820], [3868346368112218330157852776473168, 299991612222260134257407964], [4945049499385877980105461953236862, -316639558612297257143639994], [-437592015179519845438845831179358, -405395789994700179408791484], [2465969618824492641217616958498072, -821070419142864812851196426], [4469978843507396055336676338665258, -621699009290332283234192040], [-3576016773620066424067438560892938, -231689376716530626273575655], [-5898602022356185985240937238043052, -111958655033008585114184060], [2394991821623077804945173123955382, 588178378721799490093415118], [-4637307580726744748388388168356644, 787756282512337082987044020], [-1427787918149797785080401644811410, 658038214266901981224524793], [-1834511278677944348936761485682534, -1367153724693341130701104728], [-8908405766641902398507228944322504, -469979904422641476738333375], [568961092391618389012280702398692, 1204995990073699111505600184], [-4056920329662901916844847521589018, 6712195614118366684606182], [-8031645245419692740773671165918130, -326857077074613980222433864], [-3890872725533062859945811855011886, -1888100356675450689945949238], [-10068670416003812409101011062227228, -903894354069590661345136260], [5787704222920096531127871801819462, -686181126567072115696465813], [-4861509075158448493281888905054022, 1025663542641733964525927100], [10608098000576357575878181635901516, -170032573048934988859113198], [2939790049918986886822942688699838, 1628393249853594881483094027], [7887198328248934883108798924254046, -353328125091656875152619356], [-2253622858833718299800871561604076, 106530590018733718406013036], [1142485675807587635614343037843386, -64546467764871061609618752], [-10259510873823770035564853623883096, 1884249592257780064184939343], [-9375326794862307045372086280716110, 2196773438525776893005118432], [4054658631754001584420683312138352, 3103552927537286875905724569], [-17446320742460424738873565638960756, -1579238455397467350911793238], [18116950638942649331785563604498190, 1943696889966867586139828700], [-16725059840362649155884655333302742, -1260137815310269288913185656], [-216599385665494929048424651960812, -769942698862840678469579996], [6909777195860482801810712362925424, 1814478946006300544544531494], [-6214165748031821912528246148799712, -1698428939650340734618243479], [21224059442958457196013756072346344, 2186711187452134880356089626], [16782290762544832716948681380670902, -1818399069304859581854593004], [6628231480109788840228025428020124, 1017714836523742175442987450], [22249061648985903626161311359927472, -2900836119491789671515902220], [24601522873101080269363616013223346, 2722875997079983374537045588], [-18967327750647029325371930321816466, -5368666556945554259360524945], [4217725526257421683072050274100704, -1945417361973393547651843161], [-4230330088172991120901743552740286, -3496341576189083557283240412], [23199747047521188953742414098630406, -242709010999630471405108677], [-8861055754495388660885224450785132, 4290506496042556194018393920], [13963015186084689374799231492932730, 6455091995822077434627455948], [11112269826043208928575788261811244, -4857097860457040511788226336], [-4171845784187565758833243069510978, 5888012206369393732991166288], [-45703847678156364853529787912627114, -333727336997069792738040337], [-33359200745598621329556659216713640, 379713879254152685292567489], [-39224858141884008112561814365404450, -3588306592143508715371053619], [-4604027245182050108452983641646324, -11118961497476728290222891054], [13453039592102024132173516888894036, 8164717501642405538891906178], [39075413314159964881660546364553962, -7539408950173148087968961736], [8054800094219582186499796726212198, -11816283943897001136196942485], [-9521829136638127958083133820185288, 1641669270452576761665809691], [-14270679470921402254739133237231564, -9988490191904951291899143928], [-56524087318837868529909749083041236, 3694152123794810791974624426], [-12575331350360123424487015961649598, 6407537260221652572424671516], [-79439267376701150883114677861424996, -4009596686766138099259477546], [-91780679825120420737967741047724530, 1610904959132675529195183186], [-13933432168956426716188657133229144, 13787923661547164560929132970], [27282375433805046789424616971299638, -3484660264707931438630992516], [-46240158113034906442882496115332016, 2503414315379984336950766312], [40624902177955702611937100251458750, 8509769257410216314027159181], [59884836470851463059152643377810930, 12814605720635084395528901526], [-19167779297897458055262317366943020, -18789076122513132320690430978], [74810950769165977669000693375913544, -4700171383883237202437868788], [4760620533138239989889641141852298, 698866719908145533239444632], [63456235557253847096839042491846324, -229071678489541228635749020], [35710213322153112920107279177553712, 895044690590206893346766482], [-36724338212781489489100561677725950, -9683515015956068062499462160], [-44816332737231383453945598045138894, -6345933993276619132562780724], [101433157172306232406613455924155700, 2818641469337123826396132792], [-19208968585158089688176054486996038, 13112438066095605086866459032], [-76391727244613321023593922324794426, 3951548027716684088391365353], [-50202341137365046878730228768621496, -5482800733949116929815864085], [124931474568759956897371146348951738, -3218509502424238353141728998], [77653732775926416643176351631824914, 19802994365968404357704476644], [-17317910905065065307101967683058764, 19878134812407471822579095886], [-45527037737677943134282092220396628, -4408522919651829358911067758], [31164589740293430907732371391790880, -7737107581904157102101288400], [84556954946635309372336554334808862, 11918962130373513705778077403], [-4688917723146822431909814354130066, 28192644834110400387840623694], [29525016719531086296835424044282614, 9844739853473720124384411455], [58637905387544093679635503676135896, 44195892879267529529051108277], [93679266446474125743570138616461060, -37895166245112580864516254468], [-140792908848711563234278551882063188, -33463055250043287215037446952], [-69977949498094313533156064662272084, 30284520611151881308442461730], [29260633902266752727956232684398478, 12919407496863212532359714616], [56007676868235044694856536883950594, 2693852415749341356476157772], [-69440121673819143137680308374572918, 13404953776674799626176527992], [-306835739501687767486498119616542872, 1145672961392801416846646601], [-77078558426020747670269656263224954, 4223585694694699388436665544], [-50175241763034033726086688187749750, -32141786255977391596587437078], [9891570740704956778449301599756078, 7665282895941406289150914245], [299852509347066627855398861032390048, 14797967886443625761661305877], [145045005298051747065422179236782886, 3877702856221270782546971765], [-126843216034625380053811789817488812, 18396819755223973592635289366], [59385800566047033574059312418728422, -63726062216601556575624854070], [-14108262606827058400855766087985236, -19643629811253903205131396924], [-129974199778685677748154648401878560, -67961249521168229930105285126], [-139081397961655499759777201072278338, 15703983093368214336588193585], [47326701506788642393150211068763860, 19960722960635724592078417122], [406214635821860930425798313943761354, -3656421055581263645588068860], [-160786570954028664034349760073904874, 21743031516699416947165662389], [-84775029405194178492459466719269432, -18793064026759190505360121431], [116228231380264342102405279892002790, -3271384321686189473147523432], [32992866696993632863255162150237818, -23117824433708164101900025832], [-453124801075107170249760919774378752, 17988090659886025199058902940], [-143361080262016791686039980949224788, -58016280103270853395839338468], [-283197238674914138218270050238320510, -65604358332668874889079075914], [424032444244644988027359096951066072, 23336875956191840540411996996], [213257067379035395410165899855421142, 37886447815503309134804628072], [-509947077922941807103796817904429686, 40997595526454586628777016884], [408702604348405327531851244341717840, -50037656710367595112930340040], [-270407360838797444412851198078378772, -39153465830406708359908748654], [-120083641056359598216910849149562460, 75279315697619125667715030996], [-491764366845931522108357288360907830, 33648544993701673607172405336], [-215724370011249390727896854792235882, -54683687759568367601709157519], [2556934544759207042135533199781808, 51230482049970255224469802203], [-303307670113036723057496870952681670, 60698158060102641372388571856], [267860072721897317076430241634900660, -130395444026337047623901068654], [-66506825525575856112562920931517156, -123746299258935933303688307682], [-183986523448479178761056377031249616, 7301294774704755432591983000], [439088039637091535378615069756147742, 130595857944248719972988843357], [116910524676438121854986946172272448, 77307799054835461675337008047], [103320827022458310154560645725413790, 61087444198944550191955945962], [-397583425863538995438901066727625084, -2498103583480588134064590642], [87231413030099892832526965031646432, -207508366484190913305705508584], [-496766852610497958117346559467609438, 107016766422848008270837763328], [748544907754039401308386050520281570, 56122494663903100733713360418], [125950036231680483891902009540916410, -80614435245348633187113833292], [346523871667636312166887142196738294, -56048806741685231131085303393], [-14566309832113134816591587952186246, -196916559620798067500541639394], [343442433697322292228859382199271456, 62124907988772644817306087711], [-267078599148942680815845795430545822, -45450011094316659413690424688], [527962793458663182985455084479706196, -227832623180006026500879529050], [365604655684546905168308371292864232, -182120378442793611968637465968], [-522654444995935103459281030335781448, -34569730683604370060789892129], [-616241032271180621113509767898291754, -96257909495847041698730183730], [-17781315220553370023398206260975588, 160534126513333930738479014016], [-98807404533972194826494968375261872, -221363926351076628327420550170], [620637766433184566424824116758004034, -21429887620318739431782907320], [-494124463287037447626714500791147554, -5694828756704715004745664049], [-776420931387857153213976766775800020, -58883934643043772456023024240], [-1075662007313873066959638913910717948, 166017752685129940469459657766], [-472244957042020765869632832984933000, 243638095286449880388989408004], [-992823473169601048250160263618609062, 139055337964260254556155565252], [-1725409868235034675739053459147919720, 39147535292331894906134364345], [1127133435748872207292195521583190394, -119177142466892688952445089734], [-825988211006758699787297657216978852, -152063758622855483102905866162], [-913739480895240862933870794692257938, -52627377659789046868639815749], [538210256424499060014350746223804558, -298699079661242408023071842268], [262282721539045212714357857029541490, -130153626167774945496559077238], [-1957408775373830254879728629639952632, -104632542305976732840944611983], [-1167613298851520087246642517344683350, 142640605216097426033272091202], [301773942598400544359673459225915534, -35860323015558072153926176875], [62671589989676626958855622817565776, 476587194174778479768851790411], [152301772400313032076810266564399342, 270276774360233279275323774342], [1208182514412165070321834181077415778, 175481986931096197245243968122], [573829411371283216889802849745004068, -135971060428426326160895136594], [101943877288247344679084371392845364, 319154232140834385273403234870], [781199014570488696771543876763165202, 174646780209153890322699812256], [-2170527519457339951795474345679244114, 116890547418933205860813368575], [185093942378831564625997908371129484, -129875740816330565343174897058], [495072889515806963398606238906592820, -93088812103431802437485688894], [797690763053239466908597940236611530, 238465771797490111848103733016], [-650983686533976013401359725285888170, -258278300966063649659911771927], [-3245808830076961564914551708290157184, 23325496763465373617154284840], [-438903968194023931416016172306582288, -134205067764908780242389134877], [1440186124077263022257402990687735298, -177400045238884164801385381982], [-552072238485263765981147858941154808, -619127707337780623798129187350], [-44008698903204536934542440691898474, 417529936935023935987924704463], [464731534844447497179882219353790326, -424951438045568775074421459408], [-559903706967504125666342575165463856, -118093121830036054149943964108], [-2478617667410234515634624215878715572, -286334647055149536379570679214], [286297264876196843303084011184699306, -191703757771885695618410014248], [-2282489325258294837107501571928689738, 35357973623502404606628320249], [-51682412640046916511453439654365852, -119783431814009974227769823230], [1544195581766555753224039341861229338, 358828546731424048771128211212], [-1096772726250345593938015673566630580, -133508007934934985065656038114], [-4461177663716790906228631716783044280, 244786568218524538433485517662]];
    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_22_a_i();".
// 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_22_a_i(:prec:=2)
    chi := MakeCharacter_48_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 22));
    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_22_a_i();".
// 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_22_a_i( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_48_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,22,sign)));
    Vf := Kernel([<5,R![-453753148117500, -28827900, 1]>],Snew);
    return Vf;
end function;