
// Make newform 18.32.a.h in Magma, downloaded from the LMFDB on 20 February 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_18_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_18_32_a_h();".
// 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_18_32_a_h();".
// 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 := [-246876762, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0], [-25920, 51840]];
    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_18_a();"
function MakeCharacter_18_a()
    N := 18;
    order := 1;
    char_gens := [11];
    v := [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_18_a_Hecke( : Kf := Kf)
    return MakeCharacter_18_a();
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..prec]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 32;
    raw_aps := [[32768, 0], [0, 0], [13381532850, -140], [-11751851055304, -1426], [-12575568739256292, -7742273], [94662172279854662, -175742324], [-460408414945337586, 219542264], [-50043450866248766500, 33988474927], [-255244189341877916712, -2124888094378], [19684407527748305084490, -33780773426204], [24863516048805381927392, -120544032709704], [940760006888135068295726, 1900971312583196], [14642717173146460784025318, 3878112179147056], [-14547804347621851260913468, -15365484347956071], [-66625942966678538582912976, 33351944455686156], [228091304708360933370584418, 624295281783539044], [1264857521665848747126763980, -577345425925462933], [365272656024564912148677782, 820739538730536492], [10542804249731275411012292396, -11359317798404860893], [-18317509220424535908975353592, 55001779199916380258], [8234994216834821454244898042, -73094498239514508504], [-21929518868456540083752634960, -262109914871379567188], [-205274722783690504554562918812, -257796809041337860095], [-260993539378918068661443788010, 157408697343809393240], [4651556327844051862635212858786, 3235922574683546889640], [11504131545528098778272830679058, -6951436213220320935484], [1158668761282407163858616301272, -26304007283922914432490], [5352342525516195310309301331324, -31176232220299613603177], [13705979823608811676093202104550, -6077397836946148700484], [68656367010867858837346762494318, 75731247054317442245952], [532425029332981682924159278802816, 326797194807863266986912], [-541881790702146496792283859291372, 282768244411846529936941], [850160417140973523049867862100294, 1529778085704281101726576], [475495597805881829709021565469540, 160310028168711199854593], [380969673233053907582100108768450, -6737643214737647617119820], [-1880694245796957314424453213097048, -4172727660939865303665270], [9455495427465390789344453180417846, 4210877731428019608516684], [-9575489392039949361804139988791348, 27058403496102740830784555], [-43916234882986523798928879461523096, 8905604880456701130537018], [-1911343537991463486066989469103782, -27187984295770128886684140], [-1433914349849799873787350189995580, -15099584909769127308202151], [-71383741509441985019430037580850658, -52497803338735103661663124], [-124013401246851446757548113962722112, 171396214538913485911906928], [-263537922575452079238626504880173758, 12678052282561882018216680], [-101624239058426158067025228849419406, -381876491527640476197898732], [16089873055988491323661985039122040, 787904423600464275587741374], [484854774550216728558207763464189212, 1318016568279505264249227295], [2116648575029722803548008883851326752, -2779184054149929010384871928], [-2733516572361639288881476871992950156, -1561448692295020086164111451], [4258742231142613095725987189111965550, -2949042949299372774590781972], [-4799721568469716773554401311856307802, -3425191808133647929516427624], [-52784422656033731866201519808056080, -7362908513465325737254848132], [-351586791977008286524128674754405358, -15000203753386382808429621880], [-6159529794984981505501519034969326452, 20574121306184815751385766555], [-30176035536008916965866286504222466, 12501963460495435677055233024], [-16478702101864297509307454077665711672, -24836729381118542129766661102], [-39511923795411154107190441021714315590, -32912214577255853637561591836], [-3450318428787407617608835307871305488, -9818941135664283279458272836], [-84926222763526251853952469475291733314, 38503895521876847345150825244], [54443934469780579599339465777555701718, 97871235256407844977830754040], [-49869120312780975084505447804270077868, -40477956832933601905214196483], [-169836314925270981237551159883330442542, 207632041694957737199967249620], [159577489277069776281542937082630695356, -33179303234137938670618584345], [290293227647676612927641168463990446328, -199433006508693919076949359906], [111696576861564867536897856467288261642, 817256589498137239991477320784], [41946730269352278360165712517946011754, 223524473518007608933732695908], [765954126237118417219482499376769435812, 1473459183462708499138487395633], [-356491756717104400270940879984806176334, -2725286034166033636752973681120], [-1145908107662587260700531161027759632916, 2639161154242750192098270444147], [-3398229027275204146459267645078740543370, 1897927562587436200121898409148], [-1900289112204282190152117455847085893282, 2447873147643447766440164474464], [-330857708648742823064432951096497477080, -466548780073395136512036692694], [2394596674032787057847228389717018952336, 2962906044995944154458785742116], [8978312279989540018392789193481622124382, -4191995646944972802038664273860], [-2281470865640101626758951964336193923340, 11192046320755314799943592493829], [-6248153932711123902961409755276174657152, 11089234211106880071194280970336], [16858789433012607216966868906034450767410, 2550680220762824109248435926052], [-472240555957517608011233835857674488634, 16852671803381750396440545884988], [-28468781410013334951720468541475796373362, 16390264796585725275302957954104], [16876878180158636158196305509106049353130, 17486933537846739081945079439504], [61430099026710037734154213189868807852340, -2534370235428556352535542635083], [5764169847391167373659960959953633077422, -23540678514868072658156056123060], [-8867470379993510516300842164395035121232, 49741337899202278979630835849260], [10038268614351929799273430470619232869202, 49323097990591369261292673666504], [32672587950736006455362616845190794520200, -151295949405081499122344367116286], [49622311567532155008170864888441366396748, -143095400236165206808186765253781], [4824350961190640060582468084170367824830, -141149123954377740305953374020712], [-130411512397463466669206230806542609231494, 208469645063774437318367529905040], [-156166778555390610644566018870439560150662, -104616338495622461398919083131740], [219091036698893792766780461064640905841712, 13266896606296958193420195544396], [-274064676028492705598273287277747720250396, -20871786221826122925663688403327], [-424640970214205375355221614479271959897120, -25123646544976114574345202895560], [-273104187090283944982893261527523336710824, -469363323223113149149150118827274], [137028771140868330561302101525447205085948, 509231849391995179729823665622039], [692111688336190517808975352443977041638140, -523847491125571281226386414262761], [489573936279401619327774817420330890140088, 738326331922622115965789918247246], [-895128702647674965712099420524851833450710, 551618788061386378654170487786228], [817626475110832618008987114440169341883078, 884769883219460166752200897004720], [-168439432481779363458086848843322107353628, 2242307313639632172882231790871169], [-798447880111639652716374962687831746532938, -109859744884844925496263159232468], [-2347424238261856452025050520552892412884404, -1447607036154311591317594813242069], [-948086109247625388191398812489120616200486, 2317918753961651689776381748386932], [-2030542256605784047466478713054395527676092, 3815838479334414388114642895967321], [3203391836096629642928668480087950703340790, 1698077235170246177722556303306672], [2502214542102429469503312699786300142904372, -847230730654458281703704027750155], [1681136749032359501134459617905810781203906, 9086837491727919760947750808791456], [-4946390770224595906245660204359787761942436, -277470898273217484296220275150257], [183768019377218799614291063915877104152398, 11625686755896842330318505025287104], [7294010588526604248587758771333883840994840, -1573449100241523413953715434731226], [1224396118856553892800873578054670704450282, -2790873140289422762582420430393432], [-387958747275313951822241240587505753125984, 7421900770478517088238824686498536], [-2299196787692820204500523645298371592691218, 7655388870133835104969602289576908], [13879352777366202469876776314344243739067174, -3466812151761138952688720172052040], [-1325350875529962414640918267241110224381820, 21172011364137799763885658959601705], [-88357663635239539102513253767418945034808, -29847260531279382105121161943476334], [-8396337044224054851079665298159009620231042, 16652849623995006949917337248840280], [26068134772951616130625727138041734215133932, 24157954609968434669450043086913939], [-1349768178826586626519179676574036030907576, 24617150576836345396515766686270066], [-17503274447761096860682177636799197999190982, -11813262055474676118939243289053916], [12842326865053400951050559133662767671579300, 87485693987457729722805074606902289], [92692771742879390788071492608882183999074622, 11175593605520495101132447428254316], [-100675370954400898917026575325718885816181918, -1791642781402200562007401634541080], [-13666661734586135887670282056555521130421166, 29244832870294358677245647254554788], [21046611382584213430675289873730795058075068, 62377367716303560558228364811863623], [8697883001173254548014644183735492123026492, 78455988322628356349932968127216935], [-67540024219156466609532156412568879808181782, 33046269632488484402666717909439892], [112670539952307030616272078924353508038829710, -72038933728949303680249620871263908], [-35940088940850084062146808617786532405951280, -10325175900290093397332523202716300], [-12289187055802903786621327057404149670067864, -398162489131048298327667086619385926], [95660417623677852898868362979881744080759542, 280803032383612118184789247797753948], [-31773368430734049918849144639615023093617780, 232662440952663444466602040573220571], [367314284212405139823859117505697199559658408, -151837052057717454766378727387373750], [307658617315146814925031084512751309477611792, -416592389001753813943257601051299196], [185036538051591746865493089382536653518579166, 679222393154574415555172575174483596], [208516889536611884458540523460569251449323958, 622655423955428399947370764704511152], [-237699512131745834032419998590633886736874750, 67359659425425902032034889094034152], [542841611010087217116387016464685241977936818, -358486159270052256222197165747775900], [100289673136929215305829034165392995908929756, 664835099593760757531936021117936399], [306548867908847595536705727283197774307444554, 875635668986436268937438475246055284], [-478619988027148580946273640448399310527286810, 271007558171320548709864310706861488], [-866751130616562756699310741742932547717544508, 1718654942133921050640569368118331513], [-1373427492725698805301352132506295983889940382, -467108068464488761099114852396846396], [-807671773370703387321577399025477057326553848, -1182879399358724690456438617934439518], [1464178799272077863581338213523135163433477324, 508060223982263293724768957845702667], [644010535920081580415580762005113351049273750, -2832583484888755339537535526768255092], [482114131153159189258912027142441466621555720, -3086782833131960725561806331129372062], [3935483743887569584084456205610732715704690302, 86544705173682762159633713526037788], [-1238474399243521068749391721028133168200040426, -1689707080816222570195647873450489552], [-4771793096291580553069364171372453560224522220, 1216203992181632196660234543441429389], [-2217430700288753165860679256621762279474309792, 350781490175245375898262080137083416], [3482610312899248459963320110657867037251087846, 1893000353245745086891271589236053340], [2342909585394824336897974478844478390101879918, 2821970516764330174000671887060727520], [1855540191844356799156930376130943134499986812, 1307244392140289826805015161434613655], [772291654207217432929940007943191154943888184, -7077710736081593711364840104839419410], [9203597871723884540018891676828835407890507876, -2217992457398995946520144126813761663], [674102792742652388553725345241393829800409488, 3254692745749124109723580275186610020], [-2544881164663992343258184612772071515698638680, -520152656825601313344951579907673526], [8292968400159372906784203429908873034144163230, -3558777179134815486609595166776335720], [-1701368619073908187347640620108675283348037734, 13306882660595654900126054799606066920], [2559677255802757227501521732553591963047467098, -11522740602889799278120138828046334076], [197394214722435296889691926861062288787258564, -10484673621986313562989906184073006535], [-1645377361468043298663457590479382251268282762, -13974843581091335603414716854658834704], [-17371538563375288868583942821999335342393279624, 3241749173318839641947866365921671550], [9873750532976043625737328444448791190073675228, 19632558565005122243260014697303165455], [1338865129135740434475486933576901239196984014, -21683621607614447329463932936183602184], [6754682920045452711161105124120926361277079448, 30209216341770779081403207332256504326], [-11461613091951990330588224200772135617271754208, -4147657491311810498877392353010690040], [-11730793293656322766396530787526101304716038034, 27552914066943609261275953649604728028], [38073821031270879231155226086594998186181933330, -40817545288972925518193160303865524216], [9422771249857720219438041466369066519863597858, -74647764092707971294656432682335167724], [-35339845345474647152631046657669408511894216820, 10738591761064984978478368177480788091], [12751478826875958869650907619756958869372994262, -47418420331965261894338291056145580036], [-6787722853131354653843254224936065125194847032, 22743754526229942430446183723465470290], [25254470563809512284032272542811332134638189882, 9856716015057949195433050752117053192], [58790404240640220350902275073016435279329660400, 38825487258302052974701535877099045244], [-6594697165361158263498156302673212209755180330, 109480934373885190165771987086018536312], [-42063895706624679397230385636095336300574173868, 50430297592157486900380325320804165533], [46568266599421559269156359463764604273307482578, -98848333260779662396424757165789429756], [-18305104800461592825848869110663788164268676328, -24352135996943676997540105733820208538], [-66448043463226890184831332935242469985360085210, -11110082520111455323636436622149940564], [-25021623912015891468725420437375517402624378944, 64953618870085315543798573793347522544], [-110383114209461510817781915985935443109898138412, -64595355866004990372355375712148496387], [-6046365757349469852447159847161541604738925298, 38119035677590188038634777418940554956], [176648181518181804387295814043044043895807842054, 60977642524235786176647058731968202744], [-200560613975124759273012562931680621619964027312, 32373115924141197255012397976102978836], [129435081310490805532723173490449982397986066050, 203097754795211341102683711775397790644], [54746952776991357788628065652819314093583378806, -16633077634424135273337607469966937012], [79000444221830488761565147397109998300750835212, -327440957999315044122089242166961591877], [131675635502669797635305839239850358154904799450, -201624076064791142099062896597738263792], [-6479488724202871764525301032357762745400775552, 324200432737058978786739826166929494560], [15056417673422418070285655768428097917778428802, 124078230247979020860575637729544783648], [22447538645567552683778769762658896248933425308, -108416982677166346356670729631601905409], [75111283780886569804195017309684851640552825692, 135403563986482640820324702951542994767], [345144953086599290361939982856810892211770147018, -33464440925431706042182352551867355740], [-41506570944687064186348415917196545518353271756, -897538472471590167676524069444264322219], [-455272533905719075602977179927120541956193597082, 190416902565651981262471200470593514936], [127042374914427165518886926367454023807888448082, -783970036459089153089925390169069675712], [-248218086803958021188156869372168627122506593258, -560671710893246849301380081929227716276], [-562694419475924094011651206441906984283965981506, -111732036452210084358434686923621993088], [701127566276294830890884606151571882725930628488, 120277723795676207029347846876624643202], [-535438553370760388423782965782703598014849922950, -658808040165807050840454294230018974668], [197950430414736600016096505066363705431520155952, 1204883707023716109316988731079282456332], [253474824231039843452652034070683658434564411646, -133391128519655515169880764538436795652], [201859648526515059370753440760109449897741294370, 914915141329280071667271103121925453312], [687246681006790334074316317476592512933481813500, 1090357214836064877178389221040129606199], [-289076583982388814610436147577543445474108819926, 1205949452606680566689804444566808940932], [948654304020376371783950737552799482398655343360, -1384059766625315639613067153238026492736], [-1334548927673992455213429896654688237915376487532, -1788440331253042742582933469195993522707], [-1501870609129564293971686247036230365406006264890, 312336890249744893271082851936163795032], [947771209419684321391560396668859978521220483812, -1302379670607021486366351994159696818943], [-738864964322769994934303363524714907745256064014, 1015714458700513180596747276484154358920], [-64446528939966881848376881563238474077900626622, 1381147925669760999447533598939745155668], [-1957165101807217035384255823665373575260385206488, -349446283988153935743129417531057907926], [-331684926904326283222973108657818506707710559316, -125377114685952191235178315666974483901], [-2036156417969406231049565131353908891998329555480, -785644883857283170717417666652266965030], [451679593853040495922387740930699314896055110682, -1003819849341052976516826991317716779824], [1260527138875945919618505698000181815296168504016, -4006890482413629428261651873239044458508], [4076740640275229903761175289044812056514271278158, 1234943353915915288897223255072216210232], [4621700704224595980140546054603598897154026758424, -3340658388716684922001245664478871128090], [-3855121408974500679666735451917871151934407650422, 4760076187361226903865160043941130629156], [-72168690115873584566328000003048976144142536978, -5491680313047118670516213811162135377876], [-1108459658453948164598894401993940389237726133560, -2095543403897410791157489702566740865966], [-8704255693199088052168838104533435092513423490, -11584016776805534803962444223152761939240], [6009346167810629093873602953663091093938256860272, -709283244043348528913075737209030326436], [4153046386507094318994431967986896968152205702564, 1727188983154289108021104294476661555761], [-10986949343130826389595423005807723793082010435010, 777264546159620470185860415948067954492], [-3875890891293836335334871476586040740475267201962, -14530596378554442826247118764548558634280], [-1330712236633569735164067761026357454270544528480, -6374021166388999316345691075842871191192], [3037921492083153145216419303051308037064779819416, -3940109432864643025993232507002541424442], [14158230476915953464587686506047041348293978788028, -456709512136569006269296414435747925177], [9652935320119144614645334878032015605460875361702, -6252266223937652573622938088690268518052], [-13193237565949552861391265780069129905569835318980, 4604641666676235520541565314511468790023], [7107037456632502689297696119703826420410674626112, -11927287755344766694830957808675285654896], [-1287089000393061259256690394753238284141387370362, -3745849789053764456984319770953108343048], [21340847620202901093363932345998527101905399709732, 6056077244305985166672426722216735676017], [8486139090122267586369509378655715639576639076304, 11309902134154640070708190653569701345972], [23079632761418321004736105621207164114293873437490, 4018962277847411545850940568728835375048], [-11072226190939438972846977461224841626833845464062, 178497924192054787572377300450592779028], [-1812502477614437960010118240456835612531021511060, 15296267998177282072544204154653849866419], [-20445218438268340172379135257645547544077738324312, -8748841929426631069507676313187793727350], [-4533146356904000469377577192246191051399068823292, 22638967745313803572324410280721260150889], [-10774300631204443789666055190992045876842961969548, 29215810894503205958765281810219232702277], [-8717812495829957936995950950439868695526409727688, -16226856251317004744478325689479225572818], [10984411015046093341381865486131258875911763281990, 18577035738509514550852188082961241021804], [-23121699126768774532242486646391263117316590966002, 4725440015372971577189592857115540621152], [10083286671106654836434532469438130885188927275480, -19316315183312085748989622482502767415658], [15407169366292104089187067375864648601540124494816, 8668818920229157659195418394910781722424], [40589908531718086841177863705113945905583108073908, -10236489379262044347247069779744939087467], [748980693432881564562576837586761381617088869060, 50573177957810274046778052502519642633689], [15201592584696962634329489643612987621426270881328, 16009527246372852882019638892811870528844], [-6527059362812657728355933866392621632667091653994, -23249633320423471887632553823830666805188], [-43406331375642709333334827938715658505975094168002, 49915478293184974483874331478580297825760], [73441624969134900724873869552775103365619345426184, 29461216006844169719630522792333639924834], [33854806953311162107393717783360717891384132042490, -77939570652671212545192080565958367668440], [-60744285239714689800503038872271086393251530753542, -38002558303852602320461237877488619639484], [-38589239189781977660380382885522447368232023045020, -27461631109656233764354709399166573861439], [26676449785080491265890767514812634597003597279102, 8589416065730238154609029242896952818188], [52304631488500355143106910732907406705497164170516, 3514277821251305406033040948186154082957], [26356074026741514383568671343115778908636913112594, 931804162112154234792833930576654339556], [81932977120411333909666015947237028690495177368266, 14100859537777222278933950508381573320976], [-56334480029573681402046046127483043027518548528768, 127167244660502585460772304242694861723488], [25762528124905842727201847790718227721556323873044, 133003972268097505779974862483578905910157], [-46007124716084099347679244449823638211308074115890, -54994155148347720518087919694300529624772], [8202561117780072945330308390922381528695186179382, -76832214374527350752652919995338030823556], [-24083115395871931773745756599403151980760200423266, -79043200261502834195161238954904426713768], [59426350578234732656617538750221424397266890056140, 96228273163767899087962843253711072779659], [-48024486427735942824439937867558746649055543717030, 10671796670159906201178361265046425054276], [65432797778291532384302099449355194274089921498998, -101156913586688345738450699110995493569768], [-24852918306778731151492491884099139306028977226828, -239493584496153647232868450286115008761611], [-30843177594993911990068549382150554091112739289742, 73548022236855968085485732451620877120132], [210687413611640540058857567926413463228498945160582, 89606535461259740868935242308634761239564], [-149930400198358523621188289979747531510100280928484, -35164549142464676376970449021941320775617], [-101889811459902317554123404056046295642762903222678, 93469303119561094567162550068631227597320], [-75818015432486107263903271415433384047616725467360, 39135523188981603045085863830538498154440], [103944323233527002197639234128438150617281628008466, -116035491001272003541097953428136245868128], [-137915714419552660135198119621088769582506155278008, -186114922111658349221264431017421180465422], [1801140406752220283429438360472898042400026008204, 140924794744430368717329590205451060906747], [-67393220155862055369984506120437259241620313975850, 271145743364923978145007872083871629756044], [-259318807555710702484197517212209886039374260952518, 39032240750116064327963994287135144928168], [-241794524683915401245643384651721488463014977211612, 219146440222730711336762222287398956827025], [89105588247159647609179087259849461319706237035808, 10811629225332795549454184431861849686664], [379362523203117070958190271724772720974828180338712, 166983165728351264642644081581617732685798], [-253585645837781376480306145392397631146415649534216, 23070097093281948522085648933915624170142], [-168510725733938250627582565080049485383349909007858, -193305600534182204394862044609918264977652], [-164888186226535602035653934210229505317560336659804, 167494463966997981572207880370359157495377], [567911065050979594715602760686849890849272211566928, -463538533250803309397030343415207851817260], [324926495252675169805093920160657953721922579110322, 192828363019208286783178870491884087720584], [-441950516901212226965634532724835083114314232394366, -609653133571325350937233700898393784467292], [-393355086434777004563999920556522453997219162739480, -724122478015439750959197256151394361593510], [295142000328715137842677698897196054543076145364830, 547775924091719179842391427794843342194144], [-344240600929504544788720122097597509924207486376422, -254776391023219680362646446511547447130652], [199672402716575788421963415742861684481228967532164, 76539881172220040856985023133971525522217], [195629876487855027985846541880050890140278972826678, 1435699655149241292644465250033696767506328], [-15647431771475456936654607604874778562954216328292, -575242778269370211709845564506893112609121], [-105481918664473704350734031908690401278873867577658, -177012858200531362066529605646761567936932], [-466989236524922842569058544571808388185433597485110, -885290928339719274605164693088479731811756], [-575758606845119175438654930936125383244396076895648, 592983330145542746805196526102244523738840], [-2611794053827829223384896110130025197830637789982, -782917611981702547005016806821891620143820], [-388570670877282053098322389808297593983224539814580, -774593400026893186467642023964792622877781], [-846089343272592327723184304805555033532025003607124, -640599258936517005715362744930210666242429], [-1829768821986646255928526508812229598542892673188998, -431934263656553697991835591599297265726384], [-621213290577315700792178151253080521369142665731206, 1514894980844812823299503637696576358405748], [-286567525848059361797346353673984865383103093631440, -1954295988674150028767139435686777093773044], [-1242073182867511166863729858320841744491939810911772, 1438235249142126318361133068117119418332385], [656387248561088804405627905949859629018085559838612, 968108639942947094475339063780394952905805], [2154222089138464814295599003207587436296259721068066, 468831495207939779469644053422815722516584], [-1678396617876981019668072336701372036362589707357956, 1238743400474267245813216536652370124829879], [-1107970751346903321664008012853772744704010962822810, -1194308752178294934935768373447921980051028], [278591280382099626688642384701941726296714574180280, -2227341935463184458678716244129573375315826], [-194757332319303637506626783872897745171060222945458, -4705566671902623594152287459002284182296548], [56346600369407602494972703187711711847698728474128, 1300206436476994843950171712327459599224068], [912127140060318501965634816327409197311677560520770, -1212960216745553142916052153058510554676780], [-3490449524387485863147381114217448169644045811697122, 1494199714503174489085548173459084586333336], [2744120814059144339152010142924368800706302372013132, 707016441876225830635058202072197520101227], [2191581506672202994885057796078634370033890646218984, 2402038414128823911679857748715869519968410], [743853997578778511409988433751878127575574037181210, 5947082236322949790081511920411519815362280], [1641507445180891406854920193334460038007176119397700, 5131799581450307492955094796145267624584185], [-1821391937324632064807456741455287385828079014368192, -4161479702497288835493334798214717825654128], [-897613946184067797398325513383444009107418677047358, -4951660427065403701464956402670026323117056], [-1018554658170776476377308736456610508207915852974770, -1773506431329584736071874066618086526930240], [-2344328187804814596968719706878195752531794802421348, 980098689618233973634501055869532123865087], [-365406368994316679313857983964413413934758657668374, -6558610113126365384237487141402837143707184], [457730595259409304620911465508420494677086916687498, 5395452895721210545214341195094845349158084], [-1611748018381719636680165968843925970376245342280288, 4947611046787710537557708484140788747929192], [-1527073787629886972592140598203951142125465757512922, -6453387942468857008986982651003551969812560], [-2864052889614650403408161164294447020292009992919918, -2961700730664006884608944594279358860098488], [8941499290185540698964768067341971496117203814227180, 613456848249520144022237645426759939665011], [-515006442866903509224454071335031057175690648150828, -6936115674836180146666797299572856275381155], [10745188277919469967976005417589631005912444142698144, 1962869540484880877058172428795667282785000], [7898497682656559065520092989928889471233836031356498, -373017026445285770310849153297709103120300], [-6924038592667466698871536570025156866713917499513178, 3017027251049681033212122429163775926073100], [5827036108208671484641224514850962117443965862747114, 905863501874539822418902729203523994110628], [7940389270852486550811987053367240306934563473533760, 7907902616652508825041464604606764559083600], [13700074323593961033827505261286417242849338546429268, 706155365715177439724069482618998922184061], [1863872546644888364154893068596385889526222973588772, -9577377364761663728829523327115131467695823], [-5931345831198807498180112434086336514084205831812756, 3480995065401530435513637464907565871920147], [9268341598407921271122610597343930719681865636824310, -1506867506090272787572189400746428669185892], [8438235186475271204750521472621759899102432733024478, -3798656430131327588795915263273930652103584], [3856024387881328205574103621905522390511699588378202, 16278041772484292188785541630045217433761352], [-1237214250244158164548899227011641752049948576247024, -6873988867620967027912062719210730421955004], [-14482529467789510962233122980383126671211737855002658, -4598501741715038809787934899830612289454740], [-12581788231857598288482336045750373043429084861028426, 5896908716508718577136697777878753752610736], [-5796402641939284773370136247639756172012609037041230, 960167983402983879227479346653055857791396], [-21786303371061967681713384169523647367248488298811848, -2186784664490191908618445600650912028217746], [19888725174562389729531117186613430167286044254164298, 4463969673707420903012888435901427555917716], [-6008913195331706233529680792099668699984273631994700, -87054486986537037537211246823861593747979], [-5819575211332453619291581067370130706040650757073618, 3189611395634589555238272446154005771311884], [-11788513817211273823651807398166853843118021650059324, -27329808568387094297129278250127918707377671], [-17777554602437780493509170920217756290463401382291152, 10210065809811780896182270473497716232503820], [-14879651574107423882195657457891463120290280070833566, 191286442213959517647950034971094863845684], [5035630554916207295062171772252067679967449489479212, -21253498936391646070494640572589517398520701], [16023850467630941994820442194012691180405303864771066, -28444091528045223062745692891094199500304688], [523807991252566764819606377088248591613889264007418, -7087184836901599663877387546000061305939980], [-11305004495420504521811130442971647014680253617398608, 24855479856323540144617028037735125681969388], [-11076705793772384297248650847292811393292543832144770, -6014247850038123905861807910083212889985588], [1311463256220176323048016797629037969353844255855638, -35410089601034107772778722745455348370829832], [2114495581643553202416274059633999795885582671457120, -21515269590793317051956249757607475695705128], [-30452193323632045420531597217921417062969361848193412, -9577331432500808460794960746260180677715145], [28957628544322545243993173348716906503575406424075374, -15000395189533376337111986171696831021658760], [-7429499788078435492854691189880129451080700937334472, 9460127543888716786751370923392844568256366], [10005304434986252987011775895956657531088333198578126, 8484446524159184603877925400137318409173756], [-3854943028835482026291471483667693489767712650360762, 34963223129089827880342783427488863217843288], [27577005495913166141870172181389445647426799827091344, 24282606852499431944488055802766470267738468], [-12022096805130734374775768913873393898958760250870740, -6092702530423226651501372062275527924645245], [-8656099219782473193602835736763010366806842595987764, -3238624948763716008374014072220854247519189], [-5483600066212862745219762447511723830486820470816358, -27460330103786569354118380220274402476695864], [-14159843816684783841384988118016504931086305514855846, 39976523646962950159957169090392739343219380], [34636717636306173896228876912565765057074256411821432, -40120828660241755234180625810182272366076994], [-7236857869972165554848778353304139855324107906907798, 40819961619294992298645651584833991242838608], [-45748505635066338249196953916566744301351503210898572, 56240192631807221756376831778781485822782661], [13650180804541511204509914066484791615156682465582340, 10437406025236314375339197650663674016858313], [40355391007853469766268580811251935821038603027480048, 42442808384467022770410449271814432976148604], [5426519263738527183972003229328939684565615925949730, 121813014475245321408796708150747168366248068], [-70091697246556693961982370730694790885124461242810808, 38509935685398800836100597362834944285899314], [77072041057121919683559524872545156580515820673262806, 2773608651430169829158342815892602259830300], [-18216239152179675026977996420337233307004258798414300, -11242326066834584934065167304614846679370063], [-84557945698095540309952729970024407063190356191463392, -25187576526749887936221362715259071423272760], [-64672917622589661641928291471147501207499765305614878, 7070440591323881953147441525879720427525248], [-24442834267524574623914947744181604127799211050119890, -18813084035096939603547888527602707410230600], [64996823425317375836274986041862630276522671454231306, -34405962259614411891735487824564819998787312], [148439000730369546512391893421068269209367122121978218, 41388876953987300406482831364335937917487844], [-45672646118242298857533758819764484941317951637348602, 83555913228457306442936453144925039395692016], [42472442793375709057777500986365761801154465608051176, 171876360674037318769958552427216295840733594], [-76072581129037373617693440002551047527226249027028386, 81411231322886511890662163378414717187082112], [123937289352438826105329514673066930399805104038012940, 8838406742224276960386611418514552820538235], [-627928269227709834562084397952270601325129711471832, -7857813417734280974586311415465440642021398], [-42802390325620842910177009086995637925234727212955248, 35848044054833877152860409643692483523506148], [96649083813049091597477073616481339745739842466197086, 191693063584066078081916613814640353111739804], [-1576218090642221618062212204140292527734241197390348, 268369179191640647896067938355985676786578949], [17526841111151666981852077588374284618827747470209664, -218473935534776529758616543458246095016144352], [-81018656839347094919305913100313350423680418961252990, 64508799097382473795684685196530291640009120], [44996926063955910629405297826548194088331293105782578, 106305108629487748176124000591292973702151652], [18043028224500288987109354934953690844555692657872540, 330527195033656069829358960763580931281436959], [-78887296404849343941196797647507652124695090144074404, -92625183733730888737499811934431401477994001], [-12450034921558009619003980008797791129315445893142952, -233283393758070845401884607733330327160939594], [25886458501744658866035744917728119654281752429489322, -243757086846415446989442086198712502065558768], [298544063321738807025210856048745305186271841382870880, -14516536553092230289814520218463070275196840], [-87032539682861034148333466204295436441852503858699930, 363722855873763251197889938382234876905584], [-85974591137645615716402837722911867701080185954459068, 180386878027440259693809463200244551705291705], [-25662998588950995180210959927391825739697380159921182, 223201623888719777092117263604867599949327876], [-238788284463650201874380316567744752182928748623447530, -35518058838615642453961430335662794545298628], [122763449246078719210106756186084064046125633467153598, -49901502096816329932689234959029771922743528], [264328436672767979746287941113058330954724197171917616, -157551208068197148273157824296465424997419636], [-137134540110112920326228395239585705792379419611463786, -124560121392456836950263703953667340515484304], [201646144279650183674091512030689343357475361873959570, -276188601494101992935603538515042906050536972], [-42909926754070114173014436814264853759663607679271848, -546930807014713825994746063888121835409265034], [124832153637890406436854660932050864196834357341136486, 111240641392497256808154206450134775409788620], [-117928260194464178760557028336941812638870048884335122, 149293888832935811961081475054457262784829368], [380696704899199861915889784058393998356136805510488572, -70101264788261779517283620822135680857349545], [232988819647041109478509878566901747933848661133152660, -28911549457366705206393016933783737543427891], [-125224630799417894772042200363813475028967265473982478, 427984159039470552471500031092179869349082016], [-76602628244235974428846750567936531911522374756827326, 636329658460945004798290157254527272448676804], [112892360130724037015371769779214733331076830259231148, -151379633468961848322087422559522201788198621], [31113931653768162855095743436083563583383748366664012, 400589462656358446462117785337828147973030091], [352929121409259331934225787175196906884092861055518746, -64286740297461226956086870144119632217852216], [-151979435957486377982732093741765993151865901057234982, -637871151506670465389057063832464708230385932], [408476681709378694946989411052615259741354654256054080, -213648090658274949429308791442245846462476080], [131803187656111296860447072726963877589993683071939576, -1995865277483834399973655157141287143719714], [360279209429563401861068311109143255763594675721878094, 312165420621140844524179968533568095766436408], [183677257837821746040374672832628366291842147262719768, 13205873965895959439226970783645445958744934], [286551138318744027366430885544248261340144783861083530, -816617742120349906596259802225421670513162988], [557974207227351649450413508630874134989288788930680046, 428773823048068001821801294618446929308939452], [616840904937724695652567934190849479379748801417832304, 357571034133493522187145950412011738365882460], [4501473365258294896244347961564977400435116133622540, -433129839064592779436746660629791786126354565], [-841135101130192301598797260215415702226044818508182598, -341475163082150490585700681061535423138086832], [-387701478907641826163965394085601198595965154191093446, 76955656721627659666581799614183837544596116], [-314319590303862966068850183522982561687164681947038812, 520392834090718217037979457471399068585254769], [-223135297263512268136178107057058910918266944560190890, 788296270464462601663634352359954031894767064], [-267094711421669514857858328033261268223151375800589868, 685312502171806027050539242098249608604828381], [-125128780467101840041955335159061298554721461855181960, 1214579523403576413808318421985887150744784254]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_18_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_18_32_a_h();".
// 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_18_32_a_h(:prec:=2)
    chi := MakeCharacter_18_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 32));
    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_18_32_a_h();".
// 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_18_32_a_h( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_18_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,32,sign)));
    Vf := Kernel([<5,R![-12824614473151733437500, -26763065700, 1]>],Snew);
    return Vf;
end function;