
// Make newform 20.18.c.a in Magma, downloaded from the LMFDB on 18 December 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_20_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_20_c_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_20_18_c_a();".
// 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_20_18_c_a();".
// 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 := [129749232836567172546933042968, -53508982948055868249424962, 4452658897796563124186, 2482001120988967319, -249513269598475, 47438777752, -10513788, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [-5598966028242627342480067878395006099870171354878715226434790052, 1888254294593796848487623993466787486620666183901339255530566, 143318381548533379753935656379399403791538786393537885012, -61494978494651041793092875238159027112673074677952229, -354338916811329825971614079736374036977572751654, -1537555406911657953913305877927756935611629632, 725678896828386206255993235808940862421050, 165000089573394275231789409991087774439], [12999652040101298282092861691155743471244619909811341885673255102, -1971000520371565955575654236674249342266581017894517335428966, -690070827897878739933934406111951418511663472981561776812, 107919943708855666618495217742297735407308297605113829, -20505377188918629097378956169861446628791461285246, 1669516743968234123446874378259036262684064932, -505028984649664180154526875905489945364550, -348600643618624258705744384140909909539], [-2808211405075939296675026884127745763759124129895836876920546695242, -182998463290434705580011748757961537941558314021787727727932614, 98757056848184174532002565423287887725194381284451425602052, -16672418577806288066847537673204190644719849365952619259, -3576777303469259645164544326408978330887383535465334, -1446283895238391396049767964673246973685220814372, -259519880547125746347162061749236076480266350, 4502211197091141894173285136134427034869], [-91439682533920416907251079074372178956636620756212994026112186977, 51919161377964834667850924768282900888558640648195428515116326, 3240955124931284244454760382258223326384718433317812712492, -916425632770259197870221281206496897367230732589826209, 47960078667892208749212453992413645597029520001486, -20320762859234125348097569033895664067173722172, 8877787880078641175552216838559534900491270, 2607674560648105136367628864741692848159], [3610576808086492088483996526373567467950166133318628438451413430733, -1233230867190519281555763456580145657817517340913854481509940764, -243337845110639370159876490665191187886702288245661380494848, 15110214669356488288240699428523688735258193119514006366, -1448137396375521151648524571811285992641444629521784, 820878810927936301010420444550018641074385705628, -339780209390113649881736351700533191043614800, -114306003363004867249670941394492966767406], [-14601415482828385476918295288461224910561286256626162973405711713498, -225360881818801768326055395474303595772580133410023696377505366, 131713091238447707033787324965217469576538152784866139969188, -21957948974461047261914250746693156499634996123888528771, -5924912054314059682487417459268261136464251889022246, -7484456326631961807018654983541261365364241120868, -920828711725442358569428986682062648935537950, 66848000127417020899166464091785658453261], [96084139246413006031492098046482267051189466167485214281405103050599, -25576884021034985257791950340723578168400040484729894867434650992, -7539467091158349563261175080192551306100981866886880394876944, 1359768659827599020956922686963990085292220242069263224148, 38716405187424096242171805458291575814079456637385448, 8390566737917413175213547869585282078260223444784, -7751002708420122169543997628432999891658897400, -4887681055225733068564254558249368882020268]];
    Rf_basisdens := [1, 271633350592854974876499766403318596862622748758152094318750, 12934921456802617851261893638253266517267749940864385443750, 12934921456802617851261893638253266517267749940864385443750, 5432667011857099497529995328066371937252454975163041886375, 135816675296427487438249883201659298431311374379076047159375, 12934921456802617851261893638253266517267749940864385443750, 45272225098809162479416627733886432810437124793025349053125];
    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_20_c();"
function MakeCharacter_20_c()
    N := 20;
    order := 2;
    char_gens := [11, 17];
    v := [2, 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_20_c_Hecke();"
function MakeCharacter_20_c_Hecke( : Kf := false)
    N := 20;
    order := 2;
    char_gens := [11, 17];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := ISA(Type(Kf), Fld), 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 := 18;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0], [159600, -4, 1, 0, 0, 0, 0, 0], [0, 298, 3, 0, 0, 1, 0, 0], [-49525080, 2, 68, 1, 2, 0, 1, 0], [0, 56233, 41, 0, 1, 21, 0, -1], [0, 541916, -96, 0, 0, -21, 0, -11], [1477705824, 338, 11024, 287, 338, 0, 119, 0], [0, -3943812, 32125, 0, -1192, 3069, 0, 90], [192964107654, -18528, -585726, 7074, -18528, 0, -612, 0], [-1715317876664, -81236, -2485472, -23828, -81236, 0, 1288, 0], [0, -163741929, 5336827, 0, -486793, -1298834, 0, -5246], [3728120627196, -1155753, -36142440, 341537, -1155753, 0, 3920, 0], [0, -3035354233, 46514970, 0, -2448696, -28990, 0, 25572], [0, -1002045554, 112341627, 0, -5429712, 3011043, 0, 47990], [0, -14683210817, 199132799, 0, -11570417, -6721557, 0, -180151], [11817443143968, -12359978, -390025184, 259245, -12359978, 0, -943803, 0], [-422603403371128, -10172515, -301597291, -5579434, -10172515, 0, 1167320, 0], [0, 23165601727, -1147554602, 0, 42837128, -112494274, 0, 1277884], [2519450757512328, 133916432, 4092526976, 24040826, 133916432, 0, -4977370, 0], [0, -541572427370, -2820234782, 0, 167088818, 119710451, 0, -1559531], [-454257240015768, 265109412, 8336793000, -38857848, 265109412, 0, 11363340, 0], [0, -1740766657417, -4882741306, 0, 306243352, 313673766, 0, -1712972], [12935993630456946, 186828824, 5330549546, 154139790, 186828824, 0, -43857744, 0], [0, 1529696707584, 33086810996, 0, -1157836244, 3686369099, 0, 9605021], [-24986646771317154, -2031150336, -62602626906, -55638674, -2031150336, 0, 43913548, 0], [0, 2423792195428, 67463001453, 0, -3024899640, 3382692817, 0, -52723386], [0, 806739087081, 67915921476, 0, -3919826208, -2118955140, 0, -67970352], [10670499198178688, -1939662315, -59717267541, 688326624, -1939662315, 0, 157227264, 0], [0, 11239471881572, 16589908948, 0, -1659001852, -4989470088, 0, 12428008], [0, -21238538083232, -196781848635, 0, 7686973176, -16846656797, 0, -63129300], [-189939937655675760, 9966208082, 317754775472, -2535842869, 9966208082, 0, 895211723, 0], [0, 25956712911318, -495713949570, 0, 38762066574, 80802624924, 0, -547519812], [453941638942019144, 11447317058, 361742180876, 930993497, 11447317058, 0, 1115192225, 0], [668733920045662296, 16985495825, 544746654029, -12025492982, 16985495825, 0, 881541496, 0], [-300972606670198160, -48798610172, -1533490835312, 11377464298, -48798610172, 0, -1336636526, 0], [0, 68851136162529, 23190154301, 0, -2768578631, -9168533710, 0, -635746186], [0, -259114057553515, 4488346045796, 0, -203016208784, 212116635688, 0, -1770609388], [0, 242719793933528, 3854630420209, 0, -252044408968, -308580024963, 0, -2824425098], [0, -548272795051291, -333680326143, 0, 45024801093, 175063138782, 0, -1132840574], [9358021631128630152, -216781775146, -6698485677148, 40876123087, -216781775146, 0, 8946496495, 0], [-2161323641572612930, 247512064720, 7606445280418, -24770287934, 247512064720, 0, -13028430548, 0], [-4983321186342967632, 18786204584, 498313737872, 79400183192, 18786204584, 0, -665488720, 0], [0, -375560321951976, -17567961760636, 0, 886325550796, -248522156491, 0, 5930057987], [0, 158575090524395, -17536869187069, 0, 1034441974483, 711648223953, 0, -5805447917], [27747152944403795112, -41051218144, -1114190290000, -145294937830, -41051218144, 0, 1871790662, 0], [-21390135470697121776, -359322937606, -11502316005280, -11376918889, -359322937606, 0, -53525979769, 0], [0, 1648467307483012, 21545712104233, 0, -1636117082392, -3213401006977, 0, 33230186572], [0, -2813508632281491, 36540068225660, 0, -2595262280912, -4289780258064, 0, 33141887508], [131531573432761694206, -166105452112, -4749448614394, 231333750158, -166105452112, 0, 90164878748, 0], [0, 7492574026661998, 53319355036858, 0, -1617449331478, 7494783065355, 0, 34489514237], [114882639969505429224, -4561669698492, -140665979093136, -1120537138040, -4561669698492, 0, -53536511132, 0], [-62000960603056280036, -998759495205, -32264890938576, 159256311165, -998759495205, 0, -163441468008, 0], [-66969215673748369800, 639237285506, 19863356790476, 1297665921125, 639237285506, 0, 192095265845, 0], [0, -13982383628771576, 13643133051992, 0, -161915933744, 3390201492636, 0, 132041944316], [0, -19242977026340106, -48468503355185, 0, 5088204645248, 16041515012937, 0, 27613288572], [359258690640250932552, 781257742869, 24591035532909, -1197804031914, 781257742869, 0, -117965503992, 0], [-52803099462707623400, 14293183733228, 443687987086088, -293320684048, 14293183733228, 0, 43710095996, 0], [0, -8446684117949893, -151406418026833, 0, 7652231778139, -1886262887858, 0, -118408526206], [-221546639808832553244, -3596129847609, -111957978820362, -1504782970605, -3596129847609, 0, -283248073584, 0], [0, -31194489194808735, -363540462857900, 0, 20559171670592, 9167611628392, 0, -139678667276], [0, 21418851600797847, 436587411290595, 0, -16479158838657, 41469413852916, 0, -308282734212], [0, 52997875022630011, -247231003345078, 0, 14509948172824, 9260534161914, 0, 225469817612], [304064158431787483632, -10030083951164, -325860735266456, 6536225308858, -10030083951164, 0, -1198843924502, 0], [0, 60745863345982362, 157876652862242, 0, -22505509990094, -89855598563416, 0, -53747086432], [0, -114138543090734283, 1146879088849373, 0, -57333581850515, 19521536585247, 0, -341192022051], [111227590106191776208, 43490859294294, 1372135226791608, -12595841321751, 43490859294294, 0, 1617535335249, 0], [0, -142888463833469084, -473146232389764, 0, 39270921257844, 91587187781830, 0, -586763945406], [0, 91650158649185759, -890996727664022, 0, 29672607905864, -108957774326394, 0, -114618157808], [-981340409045357196010, 121360795844320, 3723397090291366, 12158689513390, 121360795844320, 0, -3804127338452, 0], [0, 181998439122676088, 385473089752560, 0, 16530107652192, 232493521165962, 0, 688190548774], [-4367854985114869886064, -2382287181620, -85587440854856, -14604673668962, -2382287181620, 0, -3763030270514, 0], [0, 241237777752999856, -3226409281229235, 0, 158828559942600, -69691964124041, 0, 136416684096], [0, -142627931917768781, -3702299800070089, 0, 216099546775603, 133174469435730, 0, 1356060119726], [-6085023044181485340392, 149895629527234, 4677871320020692, 16086814968349, 149895629527234, 0, 6741945663541, 0], [0, -553238052492468136, 3741263577553197, 0, -214656682489272, -111870087097881, 0, -534376149776], [-8099515652704338335304, -105166235946311, -3315750998858435, 16612217132162, -105166235946311, 0, -5569352484376, 0], [0, -108602200523287679, -4141064654047815, 0, 218188022199705, -1091531939225, 0, 2594121188085], [22803240726370469370, -225573808852600, -6938658105719770, -32921998422990, -225573808852600, 0, 3029710041120, 0], [-5469745345124676614516, 383030744641919, 11869924430887364, 55118888953373, 383030744641919, 0, 7298605134464, 0], [-6747767777747524727976, -391529563882858, -12380662696769716, 103530752661651, -391529563882858, 0, -19959351962781, 0], [7041610175625111364456, 540894130397273, 16742463451569185, -23887425596386, 540894130397273, 0, -7020288048952, 0], [7734485339218554640536, -255611636116660, -8026635190842448, 192691018057360, -255611636116660, 0, 12859506690196, 0], [0, 1417330337945712612, -17261368748945680, 0, 960500456742112, 338323110324689, 0, -8943133939873], [-2549953105876422920688, 525392059768596, 16337187764333496, -60088296025926, 525392059768596, 0, -1436340645558, 0], [0, 1602476602417038901, 36260560650104, 0, -48972388395728, -298166221077648, 0, 94614788072], [-3575934505364740782756, 222845390863475, 7213788254000120, -117880868869795, 222845390863475, 0, 26814324051800, 0], [0, 457834199607538070, -23516838964515370, 0, 1451739510066550, 1353225684280774, 0, 2178224635586], [-4605328088619290626650, 36829364343968, 928574237695790, -64969514316826, 36829364343968, 0, -39729367326292, 0], [0, 3183107767942373406, -14925994321441845, 0, 989509092032928, 1289858897209263, 0, 1700578518666], [0, -2751460135338814767, 1844225019443112, 0, 40070620243056, 865548073972008, 0, 2974194048384], [17762522821038524307744, -972480580211760, -29973031803032904, -87223391919440, -972480580211760, 0, 12377541658888, 0], [0, -2235269369506269530, -3756662917064113, 0, 405710956504000, 1335420170796537, 0, -18138418625908], [-43243393075891061474400, -767129563252834, -22706463455179576, -322834612736551, -767129563252834, 0, 107388341845961, 0], [48977048501108544995544, 798928560348478, 25195364252812156, -389430333363425, 798928560348478, 0, 5592649806559, 0], [0, -1216302509940189628, 28587740719213765, 0, -1683573455219416, -1123971496001823, 0, -9413480649890], [59998034941713069203814, -2192941245868544, -67349175288421070, 297219658289218, -2192941245868544, 0, 132746141684716, 0], [-53748007505817691442166, -2474702235792048, -77670822743210328, -20885006711240, -2474702235792048, 0, -139419777195440, 0], [0, -3631293261493478819, -49444802863004280, 0, 2895027487323216, 1823405814694660, 0, 30167317350948], [-108617238967483852646906, 553629983161360, 19751245791692986, -531548684890262, 553629983161360, 0, 293881089828652, 0], [0, -5314851745331831351, -102447505939542552, 0, 6148211740715280, 4791272550648244, 0, -1766839298988], [0, 3169751905374571661, -30277492972974887, 0, 1179878904390581, -2533664235347022, 0, -86267027837594], [0, 1510839267413780909, -160245165533345964, 0, 6519684340894944, -12186892071487560, 0, 63171052706884], [149888610128355551347020, 1032478411572031, 29147066109602956, 295637708272565, 1032478411572031, 0, -366303848693920, 0], [37201850302428599660488, 4437902528212042, 137190332326196500, -755870904390971, 4437902528212042, 0, -162930993252539, 0], [0, -12138517625521787136, 53009230321424776, 0, -1363016195776168, 8907215123508142, 0, 130092410384386], [0, -15892370118470804633, -55884088902939334, 0, 3842880289247704, 5681424631172430, 0, 28787566416584], [0, 12644822962399858212, 14305435977616980, 0, -1466416231987668, -4618346122293120, 0, 99521978910216], [-179516023677046078789560, -7645891947680632, -235218914512270888, 207603879356318, -7645891947680632, 0, 287334249312146, 0], [29955080089368109661300, -4230365874399385, -133640189352157558, 3084629124445295, -4230365874399385, 0, 83683125524096, 0], [0, -24071201967637961650, 296289581533636515, 0, -17244839456785296, -10468110455337997, 0, 13987740243294], [0, 28083947542784609515, 174905247966894547, 0, -9002140790135749, 1384562995133429, 0, -96372010361657], [0, -26000863997655214922, -37829042195350310, 0, 33136010689154, -12315297723859707, 0, -84521606892421], [-162393556638000799321280, -4846446460087778, -154828682305190096, 3536807629205137, -4846446460087778, 0, -150290630466263, 0], [-12316659749525822706928, -26202189801579420, -809092135341707952, -1626156757617438, -26202189801579420, 0, 221370249948090, 0], [-162545956109646425440308, 7923486478231299, 252002851456873884, -5031019784223847, 7923486478231299, 0, 191964406782824, 0], [0, -28037363892378818749, 9072420576750010, 0, -4656662429850664, -26592316909895730, 0, 124261713091528], [0, -11920193577076978510, 189190967244761467, 0, -8523150363599920, 8772308406311541, 0, 311395039142788], [0, 3622153374945990569, -318918225101680975, 0, 21568447132007497, 30173372375009523, 0, 120717760477633], [-396190008888908184711336, 25274091121625566, 779780792963820100, 3014894312476575, 25274091121625566, 0, -100162499156553, 0], [44433091291944492701648, 756308325415697, 16795262509539347, -1951877677739668, 756308325415697, 0, -1228881893726704, 0], [0, -10541436407643048752, -210592257402819052, 0, 4436471674564396, -41517709043499609, 0, -582056151865567], [0, -51082623241775390181, -620048490945352645, 0, 31007573177646019, -10157133266150409, 0, -144400257209019], [0, 2339817931112044827, -325869013705180754, 0, 31312595767722392, 89993217250887714, 0, -303115290372816], [731917937355005486968288, -4522129458565694, -144025307747581472, -1575681903676601, -4522129458565694, 0, -773568062245937, 0], [31497148321897448679840, 23370776700841533, 727503533179094355, 6338495836642784, 23370776700841533, 0, 1335421612807088, 0], [-152188474921890423179826, -29499268157690064, -938953487618296494, 6038976718152354, -29499268157690064, 0, -2633885430250308, 0], [-449829679338091390959096, -28953036460827244, -916236165618355864, 11656946134379448, -28953036460827244, 0, -1005012742618836, 0], [0, -38530134840721982946, 1462484919754768719, 0, -83244331603461792, -39205210665787383, 0, -513916237881060], [0, 129387281731989368401, 1310509634777656677, 0, -61392153147576063, 47561506192474036, 0, 458068798763124], [-1054367576982332726733400, -7200383323942850, -193794668270019836, -7013347876070045, -7200383323942850, 0, 3200552413734067, 0], [0, 144437985532878306746, 478042494734033587, 0, -38546244519053776, -83589391753701843, 0, -1189325288960876], [580004496316895598794576, -67660505032798240, -2100568008760541608, 1853963864786228, -67660505032798240, 0, -176912697001420, 0], [0, -165379502058702456261, 1163407889965580551, 0, -51172628900251045, 64046398094753344, 0, -337084474483112], [-1375634652248219309974398, 3897607698320056, 114623303452926982, 9429576985234378, 3897607698320056, 0, 461005970034232, 0], [1357873679090189631895938, -32965017770576864, -1010444336198980592, -1268601144147176, -32965017770576864, 0, 1457516220679288, 0], [0, 97584675772784321067, -326901352837844277, 0, 6316365951410283, -70416614221460577, 0, 1453147634444277], [0, -180525812956342482129, -2123375894580219746, 0, 133876854487681400, 137797784840675302, 0, 2296995387900316], [0, -19871968264566479715, 501876511090114685, 0, 18508474315302061, 284582107074446937, 0, -69599380828989], [3576812670313849341758826, -5432139696946416, -133544569483549608, -8727632991473016, -5432139696946416, 0, 3732018304330896, 0], [1415837229287141887331224, 151746261282095530, 4752951799906997452, -21363783973444871, 151746261282095530, 0, 3921988026941593, 0], [-5107263925865110893055584, -34286206371160671, -1052884786383160617, -2222780974439144, -34286206371160671, 0, 1109261449768720, 0], [0, -41093583530434953968, 625795240514591201, 0, -16987944685875560, 102542398156100781, 0, -1534300995115594], [0, -108560909406943288645, -2556699104031689274, 0, 101980198428628968, -204532118959066374, 0, -1826325670179920], [4368103659437950635279048, -64115167503878323, -2004493823198085667, -28643853163001314, -64115167503878323, 0, -6509640534408424, 0], [783599252804459334883248, -141625623761766212, -4334186117745152768, -1963521326366754, -141625623761766212, 0, 7749242506176150, 0], [0, -28431677160237612017, 1563939484796402607, 0, -41020477049665305, 261582799756690699, 0, -65992805770095], [0, 20089289528313162258, 2668465194427028898, 0, -144149428994371470, -28038538986526530, 0, 4580553497850186], [3196653867513009842768704, 107984917246719846, 3342317852361485352, 7051147982895261, 107984917246719846, 0, 262366528009341, 0], [0, -347079000832448869630, 3656169461659463383, 0, -262312302628765072, -444877784876811765, 0, 2289688781120770], [0, 157435044441593008277, -472784615490553095, 0, 68807023826604093, 277023968253727580, 0, 1158977484580644], [-6491330911402137458206668, -71686383859190973, -2304260888011417182, 11024211004777971, -71686383859190973, 0, -10136968195959864, 0], [0, 498922932098816032897, -1925271843390629848, 0, 179360841492199600, 495692852755384176, 0, -1498137768329992], [0, -273236306124481567830, 6558254816100514299, 0, -271302803878767120, 471027378918958533, 0, -3193531450978860], [0, -216562953389338950999, -6776074646998089660, 0, 343997600579966448, -73273660170080280, 0, -6766418489495436], [5710313098144628361634152, -176634918797967436, -5369165376323119744, 10684673234272208, -176634918797967436, 0, 16743111378306140, 0], [-8494007814995557783577784, 173642025445809352, 5553587704886653288, -30574584966114338, 173642025445809352, 0, 20015761585778434, 0], [4763337003803269202942652, 258928824310290259, 7869912572235842440, 60278219721837229, 258928824310290259, 0, -13800394523045480, 0], [0, 248726741495175782758, -11916249370106379902, 0, 553880137670456714, -465446725397175529, 0, 1271140607941417], [-3567924786733586925638538, 237370648012886032, 7230060503277251986, 55844877947814018, 237370648012886032, 0, -10369243882057284, 0], [0, -828141432612073952881, 1116282966080134750, 0, -83081528436415000, -158814912637600230, 0, 4726221233683480], [0, -50243656200191374518, -222980506840841494, 0, 119382388300503562, 682647129098048610, 0, -885505475139882], [0, 168414475105061746248, -1666781629064963647, 0, 73336460311474120, -84011675135479375, 0, -7117952580172414], [11173084595025171121106496, -369406609442692290, -11195403057503556696, -15150103592964879, -369406609442692290, 0, 34435961660991345, 0], [0, 1232266556259093060988, 4378198612456319912, 0, -186581541143662184, 283995020124085665, 0, -6278576548506193], [0, -298982626591945464434, 13031144195090732911, 0, -592533178599452944, 595890240960716877, 0, -4885640393674552], [29144191786209668040813856, 30352683669622176, 757812914457115008, 99618276972097272, 30352683669622176, 0, -11928857475582168, 0], [0, 256079638827433959859, 5202292409456518835, 0, -88411900716282125, 1171103532269065647, 0, 3051899679987173]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_20_c_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_20_18_c_a();".
// 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_20_18_c_a(:prec:=8)
    chi := MakeCharacter_20_c();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 18));
    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_20_18_c_a();".
// 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_20_18_c_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_20_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,18,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;