
// Make newform 45.9.g.b in Magma, downloaded from the LMFDB on 09 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_45_g();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_45_g_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_45_9_g_b();".
// 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_45_9_g_b();".
// 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 := [60370178541549816384, 0, 1971352965206494164, 0, 26986219156502761, 0, 201214811046486, 0, 888292333775, 0, 2360769624, 0, 3660359, 0, 3006, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [361230024837072772626083400177656832, 0, 9611615643580840833656061204960020, 0, 103525530164574421151136295070793, 0, 581036034257096178126784836070, 0, 1822504272605670244024873830, 0, 3174209659729445955511372, 0, 2826948515803565060265, 0, 995329221158539058, 0], [0, 324422814414067113347076065610526370448, 0, 8643221789320050452149288271682778120, 0, 92668181029165381626336761979198147, 0, 516112384527425984850584917291985, 0, 1605104965686943137832576153890, 0, 2773114596101827282641930638, 0, 2453029845223746558352395, 0, 859037017871762114137], [351727461764514124883836536912595925062362704064, 13791459362931863056027541132933511444871531008, 9317424697191528270417104593308889984808375820, 373437159878653541827197313013446977629395460, 99654433496203752812559858200007277003689411, 4089447384145983669869958839031869426277597, 555647821169802012462613255660829261509755, 23363452094068830868497361241774502309085, 1735545156814293789558053171705295349170, 74611888872575840136018839151954714990, 3017019603712732162103238607000767534, 132075987032625788778229025828548498, 2685673648816112307580592295109995, 119186067473381892832007109752085, 945779675224438735172418999531, 42391377660993404129643622637], [-351727461764514124883836536912595925062362704064, 13791459362931863056027541132933511444871531008, -9317424697191528270417104593308889984808375820, 373437159878653541827197313013446977629395460, -99654433496203752812559858200007277003689411, 4089447384145983669869958839031869426277597, -555647821169802012462613255660829261509755, 23363452094068830868497361241774502309085, -1735545156814293789558053171705295349170, 74611888872575840136018839151954714990, -3017019603712732162103238607000767534, 132075987032625788778229025828548498, -2685673648816112307580592295109995, 119186067473381892832007109752085, -945779675224438735172418999531, 42391377660993404129643622637], [-36261994189247933110774796469535716484898863638336, 373271009464048237344859451364745888815598204992, -1257278362254832990893010396798542576369111986340, 10332133156032266899364710445308074507256420820, -16464959932117786960465232443967133710054905929, 113214542259940957802148965573226628224164373, -106912096570224032612288415709557379520897745, 645152683111601639906124620156738300215765, -373650734406056024219041221506329302717030, 2053266721183616370901000504766768296110, -704224393537729546944814485423679181466, 3622822098903481181986449658093695202, -663243456020279849066497520640554865, 3260872264250205279474981826513245, -242902567830036655314855784950609, 1157647614177069803818757246933], [0, -247302017847395549511793984925625171047009136, 0, -7257509301178015776208248055448733417907840, 0, -84871948995844025265854190609967690789779, 0, -510194787094555275580939108362106057520, 0, -1693383781936072539740810851702987980, 0, -3085034348957682702769848277670966, 0, -2842306734341892250093640192265, 0, -1026032575159415366738122834], [-3308582189770118032248214277061237809797880640, 9488568651942269495413828899536303550421056, -88588356988055489576304172170685177565941380, 163710764968603801129333800651854896158680, -960581166228710258995044835927870107497625, 874658443748181905172824396111547556434, -5430484069705546898964210659553263451135, 551118935579395278263023510306242190, -17158691430787640571795581347792070790, -9531067899239426747032460695617540, -30082919151807462359027158791648750, -31941696971440288498420098187844, -26935850236716372693275976251745, -38599987501544573875417331790, -9522986334801436690148464335, -16192955323301668832384866], [4082619746431834229093477498067681343220640722496, 6895185135714413130069412969999300479603343600320, -15119290076173171106094904406091526714019409900, 183949855404806267342474924340686975122566603740, -1432242793120031584431827994137486152404339291, 1988288071458169045790873657010676637256443415, -14453769743481547690425180373066744513017555, 11207643263506272608943585102747109992791575, -62490995005564952938641833748645579893970, 35321080338332494718673753661596421366650, -132990693994899778299249822095240620974, 61792264492059070258928149540963921270, -134837504842009311521901045580122675, 55235744789867547464703952560600015, -51758696749953772176604155385011, 19503825577762796975827818693815], [28726252488283141802788457193641620233236366753472, 11722433953349478224270891196064753376622809429184, 835489517689970860516468166250682044178466415420, 312973264898860418781265084447332412238942759500, 9677269739620098059628406779440612690303850543, 3383837217424714403293062126947902988341811811, 57561825064894210067717247774185947516260615, 19078355958459430333685395103027309518384355, 188923554807558121593463051484514349049610, 60137829192846467658208897986969274855170, 340514927835203562546764152996546523382, 105226220903323936834500243639230934254, 310905697369932070932538091240393895, 94074574735981540103713899339006075, 111437388037036583013529593248103, 33221619202174716956752677824131], [-328503045653858530503458516513639736904950648000, -31399568452845813469791058620770764231876543776, -8736882551719225306705042820756868137386420500, -861076355388541946044837520399713628364455440, -94154886949124222453704668090816961053424125, -9490025265110834169103578821264424804781614, -528752883435329183712790015224708017617875, -54219193905653804623203047951002634407820, -1659482486171782750746221420849390862750, -172487695573607636721202937531062530180, -2891768835258164108396252337176097750, -303763211724979351754566417623114056, -2576428263344579389653165126985125, -272790986003265163378489030686990, -907383324990830920500091063875, -96636171376343507153385045244], [328502797723589463799474433325152856464202408000, -31399568452845813469791058620770764231876543776, 8736882551719225306705042820756868137386420500, -861076355388541946044837520399713628364455440, 94154886949124222453704668090816961053424125, -9490025265110834169103578821264424804781614, 528752883435329183712790015224708017617875, -54219193905653804623203047951002634407820, 1659482486171782750746221420849390862750, -172487695573607636721202937531062530180, 2891768835258164108396252337176097750, -303763211724979351754566417623114056, 2576428263344579389653165126985125, -272790986003265163378489030686990, 907383324990830920500091063875, -96636171376343507153385045244], [-125997653110026953183586881570777884106407889299392, -6623302041883672697243522532610416000155910543744, -3480227785412153042876387625198756886074669478380, -176617434477768903536556555841069919081909025520, -38559207748706890412734295477045985410307935163, -1910787023012685641180027140083443020690629156, -220959458852857846990895424068950993601851515, -10783640047888401489825848753593923004369580, -703508325074113842439535349288331530205410, -34027806940798731097739114237715901074120, -1238082271943572421052517966693951427502, -59599108996661265784422910578729346664, -1110394255063602229942773744442767555, -53326345811719117549132389181686420, -392804008832554772532906641850123, -18843655262525773161498965991676], [1823445860676157079191755042969014467379252985600, 5380973752750708592813223380815047598231625664, 48841008297079955087975451374997463343596713000, -78699739253158323455096100196939413479276840, 529771735888408678735224258507226644393616650, -3048336235941720212744792062199040990096954, 2996064718216897902049089722129850321986250, -27854636911039558337784070991748379676395, 9470115403686009113980533965248069057500, -115132370269151320792561824564212005980, 16608610465904118306736022565574034100, -238408882601323546808031121108582666, 14875075291193034125106387565136250, -237441307767095982567157182808890, 5260055389990714812098573062650, -90046889740538583966484030259], [32423800207247937126932808125712087957723840848640, -4506162392532695275770978500869905493253084714688, 881579422574060727453306486316024947298734354320, -120189096627525056959677160060585631401491876420, 9627312669695597451035296232535124240001361540, -1299691698156951562323633599031373219315690857, 54465877929321212307726058764921682028530300, -7330427770464891366256477952113677665720385, 171528256755518573615357432601272393718600, -23116295759710408605470955966437440813590, 299189114702789619501917937899134968040, -40463791162906778681117020039897755978, 266496185897890053003411884400791220, -36187363533862221671278780580762145, 93788873598506063173125682867340, -12782493613429523379108928228497], [-78643015763884634100379032305030764448046603375552, 27954011552321700757622511331361947807228972606272, -2084679708505050451172862268204185600344753675340, 746131554775257336269264407808055974997522835780, -22244119026362605278048394673795317051160496243, 8066366828092617140965643593615933177249938033, -123335203689352807658580575387186410544144715, 45475725737136692075680465031145178271382065, -382043484824176462154810984431728093481410, 143337588074513595245596015151152453762710, -657835317803084703242242126562506912062, 250791880067139762217699047821949380282, -580379333459448434663654844321020715, 224203851423720395138290792068913305, -202846984318109676739262588041803, 79172949925228257707130032022193]];
    Rf_basisdens := [1, 1276375069714461816936501406800, 4446860656934103097234072656319560000, 27867362243097527810950385925361540102176000, 27867362243097527810950385925361540102176000, 55734724486195055621900771850723080204352000, 30991283633337998010398560860055093530000, 106636674867399563046532682529221827200, 111469448972390111243801543701446160408704000, 111469448972390111243801543701446160408704000, 247930269066703984083188486880440748240000, 247930269066703984083188486880440748240000, 27867362243097527810950385925361540102176000, 123965134533351992041594243440220374120000, 9289120747699175936983461975120513367392000, 55734724486195055621900771850723080204352000];
    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_45_g();"
function MakeCharacter_45_g()
    N := 45;
    order := 4;
    char_gens := [11, 37];
    v := [4, 3];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_45_g_Hecke();"
function MakeCharacter_45_g_Hecke(Kf)
    N := 45;
    order := 4;
    char_gens := [11, 37];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..prec]];
    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 := 9;
    raw_aps := [[0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -4, -7, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [-264, 3, 265, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, -127, 128, -1, 0, 0, -1, 3, 0, 0, -1, 0, 1, 0], [-2367, -6, -2366, 0, 0, 0, 8, 3, 0, 0, 6, 1, 0, 1, 0, 0], [0, 0, 0, -1177, 0, -15, 0, 0, -32, -32, 0, 0, 0, 0, 14, 0], [27, 2, -26740, 0, 0, 0, -70, 2, 0, 0, 27, 29, 0, 4, 0, 0], [0, 0, 0, 75, -5187, -75, 0, 0, 122, 328, 0, 0, 4, 0, 0, 5], [0, 0, 0, -4229, -4436, -200, 0, 0, 621, -493, 0, 0, 18, 0, 18, 7], [-59168, 484, -30, 0, 0, 0, -30, -60, 0, 0, 40, -70, 0, 30, 0, 0], [664366, -3198, -664276, 0, 0, 0, -3232, -17, 0, 0, -17, 124, 0, 51, 0, 0], [0, 0, 0, -26081, 26209, -93, 0, 0, -1448, 384, 0, 0, 272, 0, -272, -35], [253232, -2312, 253306, 0, 0, 0, 2460, 222, 0, 0, -1000, 74, 0, 74, 0, 0], [0, 0, 0, 23831, 275, 495, 0, 0, 1480, 3130, 0, 0, 0, 0, 300, -275], [0, 0, 0, -1475, -272286, 1475, 0, 0, -1270, -7580, 0, 0, 140, 0, 0, -490], [0, 0, 0, -52716, -49669, 2270, 0, 0, -9141, -3887, 0, 0, -1703, 0, -1703, -777], [2007437, -21690, -462, 0, 0, 0, -462, -924, 0, 0, -1599, 1137, 0, 462, 0, 0], [4712140, 2882, -4720038, 0, 0, 0, 1970, -456, 0, 0, -456, -6986, 0, 1368, 0, 0], [0, 0, 0, -1030068, 1031052, 1126, 0, 0, 4896, 2952, 0, 0, 1766, 0, -1766, -2110], [-12401783, 42750, -12401969, 0, 0, 0, -43122, -558, 0, 0, 6, -186, 0, -186, 0, 0], [3748, 698, 15715050, 0, 0, 0, 57680, 698, 0, 0, 3748, 4446, 0, 1396, 0, 0], [0, 0, 0, 7975, -455419, -7975, 0, 0, 55070, -7220, 0, 0, -6830, 0, 0, -6365], [0, 0, 0, -872755, -878545, -11965, 0, 0, 17370, -55330, 0, 0, 2860, 0, 2860, -6175], [41390339, 69776, -41383811, 0, 0, 0, 70472, 348, 0, 0, 348, 5832, 0, -1044, 0, 0], [0, 0, 0, -1368527, 1400278, -13296, 0, 0, -1211, 95253, 0, 0, -2476, 0, 2476, -18455], [-5908889, -214365, -5909727, 0, 0, 0, 212689, -2514, 0, 0, -19697, -838, 0, -838, 0, 0], [0, 0, 0, -1211873, 14175, -3895, 0, 0, -57868, 27182, 0, 0, 0, 0, 7206, -14175], [13400, -7300, 53044778, 0, 0, 0, -129696, -7300, 0, 0, 13400, 6100, 0, -14600, 0, 0], [0, 0, 0, -5350, 2828229, 5350, 0, 0, 76380, -108480, 0, 0, 1630, 0, 0, -22585], [98558382, 502685, -98549071, 0, 0, 0, 518361, 7838, 0, 0, 7838, -6365, 0, -23514, 0, 0], [0, 0, 0, 7740937, -7756368, 49321, 0, 0, 273151, -46293, 0, 0, 18781, 0, -18781, -33890], [0, 0, 0, -6549695, 67650, 35495, 0, 0, -185000, 220900, 0, 0, 0, 0, -28190, -67650], [47955, 10430, 104951512, 0, 0, 0, -217574, 10430, 0, 0, 47955, 58385, 0, 20860, 0, 0], [0, 0, 0, 14221414, 14241151, -5525, 0, 0, -59211, -91437, 0, 0, 12862, 0, 12862, -25262], [-266121047, -498650, -378, 0, 0, 0, -378, -756, 0, 0, -50231, 49853, 0, 378, 0, 0], [236330604, 1265434, -236331498, 0, 0, 0, 1241992, -11721, 0, 0, -11721, 22548, 0, 35163, 0, 0], [-284632442, -35702, -284641676, 0, 0, 0, 17234, -27702, 0, 0, 36098, -9234, 0, -9234, 0, 0], [0, 0, 0, -21452969, -13925, -88645, 0, 0, -195760, -279310, 0, 0, 0, 0, 51560, 13925], [0, 0, 0, 164150, -3657545, -164150, 0, 0, 650640, 334260, 0, 0, 45800, 0, 0, -103485], [0, 0, 0, 16903832, 16658013, -89490, 0, 0, 737457, 446499, 0, 0, -16669, 0, -16669, 156329], [-33606512, -2281700, -11668, 0, 0, 0, -11668, -23336, 0, 0, -42286, 30618, 0, 11668, 0, 0], [0, 0, 0, -24188230, 24337320, -22610, 0, 0, 122750, 447270, 0, 0, 35910, 0, -35910, -126480], [-259423619, -358334, -259406157, 0, 0, 0, 393258, 52386, 0, 0, -148374, 17462, 0, 17462, 0, 0], [0, 0, 0, 7954308, -326275, -28760, 0, 0, 826228, -1131422, 0, 0, 0, 0, -181916, 326275], [104275, 36350, -331542532, 0, 0, 0, -3125606, 36350, 0, 0, 104275, 140625, 0, 72700, 0, 0], [-413463007, 2975526, 27770, 0, 0, 0, 27770, 55540, 0, 0, -191435, 219205, 0, -27770, 0, 0], [267621079, -1616525, 267603797, 0, 0, 0, 1581961, -51846, 0, 0, 98047, -17282, 0, -17282, 0, 0], [0, 0, 0, -69437998, 261750, 493110, 0, 0, 1154712, 2725212, 0, 0, 0, 0, 114636, -261750], [202645, -63630, -100808248, 0, 0, 0, -328754, -63630, 0, 0, 202645, 139015, 0, -127260, 0, 0], [0, 0, 0, -190900, -133784675, 190900, 0, 0, -2840920, 1695520, 0, 0, -257870, 0, 0, 743715], [0, 0, 0, 13799248, 13858932, 469410, 0, 0, -179052, 2486996, 0, 0, -242466, 0, -242466, 409726], [883558378, 573796, -29960, 0, 0, 0, -29960, -59920, 0, 0, 1053930, -1083890, 0, 29960, 0, 0], [0, 0, 0, -119119379, 117862756, 328083, 0, 0, -1510097, -3769869, 0, 0, 91223, 0, -91223, 928540], [0, 0, 0, -126559621, -478950, -593595, 0, 0, 905960, -1967740, 0, 0, 0, 0, 682270, 478950], [0, 0, 0, 66625, -181994317, -66625, 0, 0, 1242902, -843152, 0, 0, 520744, 0, 0, -537785], [0, 0, 0, 152067438, 149967067, -984545, 0, 0, 6301113, 1122511, 0, 0, -375746, 0, -375746, 1115826], [3532252203, 1537106, 40770, 0, 0, 0, 40770, 81540, 0, 0, -1012885, 1053655, 0, -40770, 0, 0], [-2646078866, -7856174, 2646775804, 0, 0, 0, -7665968, 95103, 0, 0, 95103, 506732, 0, -285309, 0, 0], [0, 0, 0, -33723635, 35918015, -1450585, 0, 0, -4477820, 6583140, 0, 0, -135930, 0, 135930, -743795], [-446012826, 5847154, -445910078, 0, 0, 0, -5641658, 308244, 0, 0, 2928074, 102748, 0, 102748, 0, 0], [0, 0, 0, 1418825, 90160662, -1418825, 0, 0, 2499978, 6012972, 0, 0, -529064, 0, 0, 348950], [-5279965862, -2921208, 5277795038, 0, 0, 0, -3163676, -121234, 0, 0, -121234, -1928356, 0, 363702, 0, 0], [0, 0, 0, -17380492, 16627288, 1140534, 0, 0, 9847244, -2259612, 0, 0, -745646, 0, 745646, -387330], [-824331275, 14916462, -824503255, 0, 0, 0, -15260422, -515940, 0, 0, -1407874, -171980, 0, -171980, 0, 0], [0, 0, 0, -91680925, 1412200, -639705, 0, 0, -11543140, -3069940, 0, 0, 0, 0, -1667760, -1412200], [1424513327, 29952090, -269602, 0, 0, 0, -269602, -539204, 0, 0, 71971, -341573, 0, 269602, 0, 0], [-3212606097, -5825930, 3215682171, 0, 0, 0, -6151306, -162688, 0, 0, -162688, 3401450, 0, 488064, 0, 0], [0, 0, 0, -235282736, 1271500, 3253820, 0, 0, 5886200, 13515200, 0, 0, 0, 0, -1021540, -1271500], [-2481355, 243770, -1491263328, 0, 0, 0, -25167314, 243770, 0, 0, -2481355, -2237585, 0, 487540, 0, 0], [0, 0, 0, 828350, -64679583, -828350, 0, 0, 8929028, -3958928, 0, 0, 932166, 0, 0, -2284165], [0, 0, 0, 546106316, 550472494, 3317890, 0, 0, -13098534, 1099942, 0, 0, -903072, 0, -903072, -1048288], [3633061052, -33957109, -3630294275, 0, 0, 0, -34404429, -223660, 0, 0, -223660, 3214097, 0, 670980, 0, 0], [-6742385117, 9129948, -6742042476, 0, 0, 0, -8444666, 1027923, 0, 0, -4184552, 342641, 0, 342641, 0, 0], [1858665, -35510, 4655418328, 0, 0, 0, -18907250, -35510, 0, 0, 1858665, 1823155, 0, -71020, 0, 0], [0, 0, 0, -881475, 393953243, 881475, 0, 0, 7992742, -13281592, 0, 0, -1462636, 0, 0, -1707605], [0, 0, 0, 395817674, 391420841, -5588725, 0, 0, 13190499, -18413667, 0, 0, 1077992, 0, 1077992, -1191892], [-6754010998, 34406776, 6747389210, 0, 0, 0, 35311646, 452435, 0, 0, 452435, -7526658, 0, -1357305, 0, 0], [0, 0, 0, 316294828, -308455792, -7150186, 0, 0, -37056836, 23517108, 0, 0, 843114, 0, -843114, -688850], [-5701063, 330962, 15800784370, 0, 0, 0, 2584550, 330962, 0, 0, -5701063, -5370101, 0, 661924, 0, 0], [0, 0, 0, -885380168, -883598337, 1069860, 0, 0, -5345493, -4356151, 0, 0, -1001469, 0, -1001469, -711971], [989574323, -59234670, -538558, 0, 0, 0, -538558, -1077116, 0, 0, 5624359, -6162917, 0, 538558, 0, 0], [0, 0, 0, -943217882, 942090648, 4310104, 0, 0, 24902794, -3381702, 0, 0, 1549084, 0, -1549084, -3182870], [-21514986123, -32067476, -21515091199, 0, 0, 0, 31857324, -315228, 0, 0, 10510588, -105076, 0, -105076, 0, 0], [1146545, -771630, 25814151412, 0, 0, 0, 9925790, -771630, 0, 0, 1146545, 374915, 0, -1543260, 0, 0], [0, 0, 0, -5748850, -48524954, 5748850, 0, 0, -13535220, -20957880, 0, 0, -7375900, 0, 0, 4197330], [0, 0, 0, -27862964, -28182426, -3181590, 0, 0, 958386, -30810258, 0, 0, -1738712, 0, -1738712, -2862128], [3313202323, 51596164, -3309357695, 0, 0, 0, 52447104, 425470, 0, 0, 425470, 2993688, 0, -1276410, 0, 0], [0, 0, 0, -701286969, 695198266, -1704522, 0, 0, -36486597, -18266109, 0, 0, 1146078, 0, -1146078, 7793225], [-29071098127, 695557, -29070056791, 0, 0, 0, 1387115, 3124008, 0, 0, 1568425, 1041336, 0, 1041336, 0, 0], [0, 0, 0, 928567709, 1545625, 13334535, 0, 0, 32913300, 42187050, 0, 0, 0, 0, -7121170, -1545625], [0, 0, 0, -377516208, -371009572, 13933430, 0, 0, -19519908, 79179804, 0, 0, 61386, 0, 61386, 7426794], [1015437326, -17161199, -1028753107, 0, 0, 0, -14819427, 1170886, 0, 0, 1170886, -15657553, 0, -3512658, 0, 0], [0, 0, 0, 1024479083, -1036490412, 11289739, 0, 0, 48764009, -36033987, 0, 0, 1379979, 0, -1379979, 721590], [10459773, -55802, 19097470620, 0, 0, 0, -43300650, -55802, 0, 0, 10459773, 10403971, 0, -111604, 0, 0], [0, 0, 0, -13821225, 156813685, 13821225, 0, 0, -28922990, -54004360, 0, 0, 5776180, 0, 0, -2567955], [0, 0, 0, -2530077975, -2544649450, -8800540, 0, 0, 43714425, 2743855, 0, 0, 72700, 0, 72700, 5770935], [0, 0, 0, 1561981030, -1550793020, -8647200, 0, 0, -23884130, 33564030, 0, 0, -2932360, 0, 2932360, -2540810], [-29229315302, -65711030, -29230390286, 0, 0, 0, 63561062, -3224952, 0, 0, -13810126, -1074984, 0, -1074984, 0, 0], [27356320578, 30936296, -1279660, 0, 0, 0, -1279660, -2559320, 0, 0, -15681120, 14401460, 0, 1279660, 0, 0], [-24501043430, 9302044, 24484746634, 0, 0, 0, 6777360, -1262342, 0, 0, -1262342, -13772112, 0, 3787026, 0, 0], [0, 0, 0, -1340380530, 4182125, -15633230, 0, 0, -55940180, -30847430, 0, 0, 0, 0, 11660620, -4182125], [0, 0, 0, 3193200, 2793087652, -3193200, 0, 0, -34642872, 53802072, 0, 0, 14955756, 0, 0, 2779440], [0, 0, 0, 1784979144, 1748545496, -17842630, 0, 0, 109300944, 33940008, 0, 0, -1371798, 0, -1371798, 18591018], [6509320397, 86192910, 4577090, 0, 0, 0, 4577090, 9154180, 0, 0, 22143505, -17566415, 0, -4577090, 0, 0], [-25932895385, -117647946, 25957645859, 0, 0, 0, -123887130, -3119592, 0, 0, -3119592, 30989658, 0, 9358776, 0, 0], [0, 0, 0, -2891572963, -17124875, 7198275, 0, 0, 96002732, -6746518, 0, 0, 0, 0, -644934, 17124875], [0, 0, 0, 3068650, 2007790999, -3068650, 0, 0, 748980, 17662920, 0, 0, 8659150, 0, 0, -2982495], [0, 0, 0, -3022955072, -3014207498, 4012810, 0, 0, -26242722, -57032094, 0, 0, -11349176, 0, -11349176, -4734764], [68736389687, 88870074, -3880750, 0, 0, 0, -3880750, -7761500, 0, 0, -13746725, 9865975, 0, 3880750, 0, 0], [-84678471848, 53545775, 84688930509, 0, 0, 0, 58386271, 2420248, 0, 0, 2420248, 5618165, 0, -7260744, 0, 0], [-61711358593, 64085530, -61712153724, 0, 0, 0, -65675792, -2385393, 0, 0, 43504566, -795131, 0, -795131, 0, 0], [0, 0, 0, 8008273387, 12328100, -4012795, 0, 0, -70412768, 3555832, 0, 0, 0, 0, -2524594, -12328100], [-50198435, -680110, 43539086208, 0, 0, 0, 98517734, -680110, 0, 0, -50198435, -50878545, 0, -1360220, 0, 0], [98103092322, 248095280, -5000770, 0, 0, 0, -5000770, -10001540, 0, 0, -13401990, 8401220, 0, 5000770, 0, 0], [0, 0, 0, -309552521, 303527819, 12496727, 0, 0, 4276102, -18074106, 0, 0, 19405902, 0, -19405902, -6472025], [-4837716958, 207877814, -4838369404, 0, 0, 0, -209182706, -1957338, 0, 0, -25645122, -652446, 0, -652446, 0, 0], [0, 0, 0, 724506115, 23661575, 29184635, 0, 0, 8757000, 150726450, 0, 0, 0, 0, -6667620, -23661575], [0, 0, 0, -70550, 2520750841, 70550, 0, 0, 48464240, -48887540, 0, 0, -9542760, 0, 0, -7379955], [0, 0, 0, -1413433356, -1379086329, 11704590, 0, 0, -103041081, -12481307, 0, 0, 16404277, 0, 16404277, -22642437], [67286803697, 219280014, 3277810, 0, 0, 0, 3277810, 6555620, 0, 0, -43445755, 46723565, 0, -3277810, 0, 0], [32319039221, -285215904, 32320112263, 0, 0, 0, 287361988, 3219126, 0, 0, 14726136, 1073042, 0, 1073042, 0, 0], [0, 0, 0, 5077979049, 8491300, -1250255, 0, 0, -72544340, -21596540, 0, 0, 0, 0, -16789060, -8491300], [0, 0, 0, -8511225, 1189872677, 8511225, 0, 0, 81165158, -132232508, 0, 0, -29546874, 0, 0, -9773465], [156214197997, -493350746, 7012270, 0, 0, 0, 7012270, 14024540, 0, 0, 46890465, -39878195, 0, -7012270, 0, 0], [0, 0, 0, -3857418484, 3883813701, -275867, 0, 0, 38284283, 79185651, 0, 0, 9673608, 0, -9673608, -26119350], [12750987, -2609838, 97515653620, 0, 0, 0, 471938050, -2609838, 0, 0, 12750987, 10141149, 0, -5219676, 0, 0], [0, 0, 0, 1050118972, 1033164848, -12765220, 0, 0, 50862372, -86849236, 0, 0, -17374524, 0, -17374524, 4188904], [-100833521254, 266280833, 100882480465, 0, 0, 0, 259031333, -3624750, 0, 0, -3624750, 56208711, 0, 10874250, 0, 0], [11361754989, 11265984, 11359766542, 0, 0, 0, -15242878, -5965341, 0, 0, 24148284, -1988447, 0, -1988447, 0, 0], [-9174695, -16560670, 57848257112, 0, 0, 0, -627690674, -16560670, 0, 0, -9174695, -25735365, 0, -33121340, 0, 0], [0, 0, 0, 51437525, -1999545365, -51437525, 0, 0, 181620310, 127004840, 0, 0, 47208180, 0, 0, -43290405], [-66533453032, 500758140, -8105818, 0, 0, 0, -8105818, -16211636, 0, 0, 33892864, -41998682, 0, 8105818, 0, 0], [-29461853362, -297829634, 29385378512, 0, 0, 0, -298252676, -211521, 0, 0, -211521, -76051808, 0, 634563, 0, 0], [0, 0, 0, -3434237626, 3442180564, -20204448, 0, 0, 42670382, 23828814, 0, 0, -45119288, 0, 45119288, 12261510], [-51412737, 11623438, 82900753680, 0, 0, 0, 617951370, 11623438, 0, 0, -51412737, -39789299, 0, 23246876, 0, 0], [0, 0, 0, -54171050, 6530290599, 54171050, 0, 0, -48467560, -276558740, 0, 0, -41290660, 0, 0, 5676695], [109415915716, 36505766, -109422004962, 0, 0, 0, 15258318, -10623724, 0, 0, -10623724, 15158202, 0, 31871172, 0, 0], [0, 0, 0, -6365529553, -30475950, 44834775, 0, 0, 274614332, 91758632, 0, 0, 0, 0, -13314284, 30475950], [0, 0, 0, 4204532043, 4288087937, 112376795, 0, 0, -250667682, 523329266, 0, 0, 10523594, 0, 10523594, 28820901], [219145879303, -1128655070, 1977082, 0, 0, 0, 1977082, 3954164, 0, 0, -69593061, 71570143, 0, -1977082, 0, 0], [0, 0, 0, -1779804490, 1733762785, 67074195, 0, 0, 355083125, -138125115, 0, 0, 10846330, 0, -10846330, -21032490], [-49773922349, 247299927, -49764798087, 0, 0, 0, -229051403, 27372786, 0, 0, 91036339, 9124262, 0, 9124262, 0, 0], [0, 0, 0, -7328332896, -28524600, 48800680, 0, 0, 281238480, 110090880, 0, 0, 0, 0, -14031320, 28524600], [111708722, 10780672, 211204680430, 0, 0, 0, -233595940, 10780672, 0, 0, 111708722, 122489394, 0, 21561344, 0, 0], [0, 0, 0, 14859381160, 14868367990, -16416050, 0, 0, -26960490, -86489830, 0, 0, 22443180, 0, 22443180, -25402880], [-152547147013, 415887014, -152543998544, 0, 0, 0, -409590076, 9445407, 0, 0, -181766462, 3148469, 0, 3148469, 0, 0], [0, 0, 0, -21180841099, 51014700, 65908515, 0, 0, -30602160, 275486040, 0, 0, 0, 0, -45088710, -51014700], [-84944185, -3911010, 137718464072, 0, 0, 0, 894468690, -3911010, 0, 0, -84944185, -88855195, 0, -7822020, 0, 0], [0, 0, 0, 7290725, 17998441255, -7290725, 0, 0, -176615650, 220360000, 0, 0, -58052240, 0, 0, 76825395], [375795737248, 95271218, -375833235366, 0, 0, 0, 97483704, 1106243, 0, 0, 1106243, -39710604, 0, -3318729, 0, 0], [0, 0, 0, -8168224067, 7951804613, 107425439, 0, 0, 426672334, -649258362, 0, 0, -54131796, 0, 54131796, 108994015], [-49322034974, -1582874450, -49322799632, 0, 0, 0, 1581345134, -2293974, 0, 0, -42523882, -764658, 0, -764658, 0, 0], [0, 0, 0, 2578637761, -81874675, -149978335, 0, 0, -295243160, -786491210, 0, 0, 0, 0, -11414260, 81874675], [147681677132, 432029996, -147583127960, 0, 0, 0, 456971836, 12470920, 0, 0, 12470920, 73607332, 0, -37412760, 0, 0], [0, 0, 0, -9160151318, 9435670752, -151406024, 0, 0, -204292754, 826558302, 0, 0, -45099284, 0, 45099284, -124113410], [-18490390, -5240190, 306379645782, 0, 0, 0, 176800276, -5240190, 0, 0, -18490390, -23730580, 0, -10480380, 0, 0], [0, 0, 0, -2206858036, -2278679274, -6672270, 0, 0, 215463714, 542078878, 0, 0, 59087712, 0, 59087712, 65148968], [2591457893, 1148095432, -2324308837, 0, 0, 0, 1135640764, -6227334, 0, 0, -6227334, 279603724, 0, 18682002, 0, 0], [0, 0, 0, 3457686293, -3422455602, -34823576, 0, 0, -435440071, 105692073, 0, 0, 65635884, 0, -65635884, -407115], [0, 0, 0, -15756377238, -114039150, -131111510, 0, 0, -104874928, -789109828, 0, 0, 0, 0, -18292744, 114039150], [0, 0, 0, -111921250, -28222846287, 111921250, 0, 0, 49280212, -720807712, 0, 0, 22369934, 0, 0, -79465645], [22303487382, 1146820045, -22389939111, 0, 0, 0, 1168439161, 10809558, 0, 0, 10809558, -108070845, 0, -32428674, 0, 0], [0, 0, 0, -27750085641, 27614361424, -25261143, 0, 0, -286187463, -407172651, 0, 0, -80768583, 0, 80768583, 160985360], [0, 0, 0, 7589213723, 27068650, 16645845, 0, 0, 103790728, 266202628, 0, 0, 0, 0, 72740974, -27068650], [0, 0, 0, 95848625, -30029383801, -95848625, 0, 0, 626168350, -51076600, 0, 0, 11421460, 0, 0, -114328505], [423471961297, -450271370, 20294638, 0, 0, 0, 20294638, 40589276, 0, 0, -313775799, 334070437, 0, -20294638, 0, 0], [359604586800, -453493644, -359250512744, 0, 0, 0, -442079750, 5706947, 0, 0, 5706947, 342660162, 0, -17120841, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_45_g_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_45_9_g_b();".
// 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_45_9_g_b(:prec:=16)
    chi := MakeCharacter_45_g();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 9));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 1;
    while true do
        trunc_vec := Vector(Kf, [0] cat [f_vec[i]: i in [1..prec]]);
        B := Basis(S, prec + 1);
        S_basismat := Matrix([AbsEltseq(g): g in B]);
        if Rank(S_basismat) eq Min(NumberOfRows(S_basismat), NumberOfColumns(S_basismat)) then
            S_basismat := ChangeRing(S_basismat,Kf);
            f_lincom := Solution(S_basismat,trunc_vec);
            f := &+[f_lincom[i]*Basis(S)[i] : i in [1..#Basis(S)]];
            return f;
        end if;
        error if prec eq maxprec, "Unable to distinguish newform within newspace";
        prec := Min(Ceiling(1.25 * prec), maxprec);
    end while;
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_45_9_g_b();".
// 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_45_9_g_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_45_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,9,sign)));
    Vf := Kernel([<2,R![8352100000000000000, 0, 0, 0, 10236982600000000, 0, 0, 0, 244480702500, 0, 0, 0, 1136125, 0, 0, 0, 1]>],Snew);
    return Vf;
end function;