
// Make newform 324.8.e.m in Magma, downloaded from the LMFDB on 29 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_324_e();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_324_e_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_324_8_e_m();".
// 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_324_8_e_m();".
// 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 := [5743303187209972810000, 0, 68841856420333385500, 0, 587831501492949925, 0, 2359067894603905, 0, 6820694102626, 0, 8220484645, 0, 7140274, 0, 3205, 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], [15980631613653974979076731515324310604858000, 0, 422426659376113927276690954858626228347825, 0, 1444701351553127502216779467616486819865, 0, 4951339729832065742342218590891779254, 0, 6094596492769935662861576270162585, 0, 5546972304450758349471889011846, 0, 2519359256532069547132907065, 0, 817298120183271892187129, 0], [5153542052912337761521506230418140990727789866126000, 0, 43778287955350154437172464834144479073751897514100, 0, 269306533678821519897495353905507105687877166390, 0, 490068292558089259864351035422379491827182587, 0, 545019146127668641573942310955314578130710, 0, 378898490888787862815172104743534382963, 0, 161091540558080154336682727946233990, 0, 39054056924109785377300104922087, 0], [1487174034519600404964650299604750567968000, 0, -14794086302226485081268207810668262497500, 0, -124961608387649170704973657153944145125, 0, -999511237629327801120985304584310327, 0, -1342532309156943925724292864814225, 0, -1344232911246536731387774274223, 0, -625045772140334739633492725, 0, -215600305430819140449727, 0], [6826715603030879934896682165559671791185797699898000, 0, 368798193784878961134810089321769897338000040758450, 0, 617157412598190688329576681353574824090154151065, 0, 2115147198604534372387848361790668043039182774, 0, 2344211751842583097661043553764449134519385, 0, 2369593599042717235359318839316956776326, 0, 1076237132674583501194306781044974265, 0, 409783760660660440576574981037524, 0], [-48281204930504514783859852975191781067685019523717000, 0, -414656679317384884161353740814366574627761063720950, 0, -1004511521077417428657982726833783120727828052940, 0, -4999642803507322999586798619852472902097512779, 0, -6505773150002726842155684028321250955237760, 0, -6536426497904489582789585838496339063071, 0, -3077313341585121343084743839529910640, 0, -1078098334837173478037472850520029, 0], [-27050472799434657968473318932093747039868950945308500, 0, -230274747426055724423592131373741880068699212402975, 0, -1163333579167757256073920528502179489396264315240, 0, -2616305173017298263150906828118679329776223777, 0, -3011490524247161747005015162980911150311985, 0, -2341900164010581485767036485609933446148, 0, -1014422461763511847716868606479190465, 0, -281688568672232190514075356903902, 0], [-14230664772955783317574803929163734467980500, 0, 47982310665709948201401966192040929410000, 0, 405293479600736724176636067724429249500, 0, 3197743205759872661337602243621471047, 0, 4354294075398672325303930219957100, 0, 4359809712938877631487117300628, 0, 2045135448267342995312427475, 0, 699265951507029569151572, 0], [0, -19370617380759301961247697615073546366029012150678199000, 0, -164868065991701652930950090412797401137839374312709650, 0, -839046869628347165685704186900068200204034265636130, 0, -1870824296630941448961970644056824005124720218113, 0, -2147284039187688972271779540494679501594537520, 0, -1658066665341124469760581484184474315156587, 0, -716091261071177306878413642833314657280, 0, -197023909309283467870007782761473863], [0, -55572111487051902500882496401788795359608422622907000, 0, -473269539934011497721090454957360093895240280357450, 0, -2367637889356792339735112294274379850354629595730, 0, -5392649687634714444830144857967792023359953409, 0, -6247594212647178341267483444451028036347720, 0, -4924676428419181264208533149925323818691, 0, -2152163353109515413555444024118822680, 0, -609648975054622950241082327586159], [0, -11781212231178672470358136826571865725321509673835846000, 0, -191625558936597258714642082399740830974979040167447150, 0, -1065060108060795348549032235109987700533288896249255, 0, -3650217688265741362627118193345841716723738506698, 0, -4575470414249933447851926354393353346390706145, 0, -4089328853771275685878300758738672753259002, 0, -1857317458117804207010576832654608715655, 0, -586971861053641455980663101077236198], [0, 29980891992484290218696465447610542650101000, 0, -94077447993989462750465378473300228357500, 0, -794646521195774941027651409888824972125, 0, -6314961860918539812354440577687070089, 0, -8537331127773314068643598150870825, 0, -8548145469488899370676117503511, 0, -3994027470102188808432031575, 0, -1371029349653283773481639], [0, -21347317241337062054090508146435941476147162338443378000, 0, -2238534755719093671624112964998433121917469690271117850, 0, -1929867280354718602094748549091382792365548902152965, 0, -6614120301230910966896598233726873488111927214014, 0, -6836641702038100492286937394977553409442892235, 0, -7409780813096766889092243222770086289611086, 0, -3365421504875801623341285720060275008165, 0, -1341838299450826900337356092845313914], [0, 32638805501708423372758902045763120853490450500, 0, -44095050751841586748953402255366492094297500, 0, -372458856283396792856658088227075878155125, 0, -2961466368427437804148302376510476202387, 0, -4001533389686470021198175477695872225, 0, -4006602180953288373522097172397663, 0, -1874427847810047485138462945725, 0, -642615313705027114029682287], [0, -46873044808436578960409382338882647698252953398981758500, 0, -399918052290407582207342852903049256063822489691860475, 0, -1719068698552643467143655430020675442766531691113765, 0, -4614722752077477547796453579269448342719807157177, 0, -5496568742591071598593292322247227673090099085, 0, -4647796734413353455236806360763386489655373, 0, -2069524133820644401943764167031914558365, 0, -629694880466993725697626447366729802], [0, -2132419186354375192957488066905332092403871167401620507000, 0, -18316182703590369640162070463369541627527495492853717450, 0, -35862822242732336536337435355677215357790391631886130, 0, -221015048774645874365312103907703530809493938223109, 0, -288015319187805969699735160951730610646388492320, 0, -292331505087867154852130544949211359672838991, 0, -136673180385758107023322892204400461388080, 0, -47960518318739329373242822242770535859]];
    Rf_basisdens := [1, 33416303773565300944144251104415807177721500, 4632535608433131235187661674856267764854709266500, 6112767739571366513823306282228799306500, 4632535608433131235187661674856267764854709266500, 4632535608433131235187661674856267764854709266500, 772089268072188539197943612476044627475784877750, 1018794623261894418970551047038133217750, 510116291058222679093924552988472781194741165589914000, 601694139016540079138858873541487121012905361630000, 510116291058222679093924552988472781194741165589914000, 793953211147252412168161352410835650430000, 364368779327301913638517537848909129424815118278510000, 46743995306294485766400499623187948919066250, 35424742434598797159300316179755054249634803165966250, 2550581455291113395469622764942363905973705827949570000];
    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_324_e();"
function MakeCharacter_324_e()
    N := 324;
    order := 3;
    char_gens := [163, 245];
    v := [3, 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_324_e_Hecke();"
function MakeCharacter_324_e_Hecke(Kf)
    N := 324;
    order := 3;
    char_gens := [163, 245];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, -1, 0, 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+1)]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 8;
    raw_aps := [[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, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0], [0, -70, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, 0], [-185, -185, 2, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 4, -22, 4, 1, -2, -2, 0], [-3454, 0, 0, -21, -1, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -133, 0, 133, 12, 5, -3, 0, -5], [0, 0, 0, 0, 0, 0, 0, 0, 335, 11, 0, 0, 0, 0, -10, -5], [30928, 30928, 74, 0, 0, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0], [13775, 0, 0, 66, -5, -5, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -796, 0, 796, 33, -15, -14, 0, 15], [0, 112130, 101, -101, -35, 0, 15, -15, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 240, 192, 0, 0, 0, 0, 56, 36], [0, 0, 0, 0, 0, 0, 0, 0, 0, 530, -102, 530, -56, -4, -4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 3164, 0, -3164, 70, -70, 236, 0, 70], [0, 61871, 694, -694, 146, 0, -91, 91, 0, 0, 0, 0, 0, 0, 0, 0], [-587270, -587270, 1131, 0, 0, -105, 183, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 3740, 7237, 3740, 105, -43, -43, 0], [1340765, 0, 0, 68, 215, 215, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1110914, -2055, 2055, 100, 0, 260, -260, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -10294, 5662, 0, 0, 0, 0, 78, 164], [0, 0, 0, 0, 0, 0, 0, 0, 0, 12119, -3032, 12119, 120, 308, 308, 0], [0, 4208030, 1180, -1180, 15, 0, -197, 197, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 19614, 13807, 0, 0, 0, 0, 1254, -395], [-5803760, -5803760, -262, 0, 0, 20, -860, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 33220, -4930, 33220, -210, -1350, -1350, 0], [8550893, 0, 0, 10710, 285, 285, 0, -1030, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -37336, 0, 37336, 10667, -296, 2508, 0, 296], [13298690, 0, 0, 7289, -1300, -1300, 0, 1380, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 41447, 0, -41447, 31445, -990, -3027, 0, 990], [0, 0, 0, 0, 0, 0, 0, 0, 7938, 62102, 0, 0, 0, 0, 2262, 95], [-20407976, -20407976, 21386, 0, 0, -314, 386, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -62021, 0, 62021, 46031, 1005, -2334, 0, -1005], [0, 24969092, -27794, 27794, 1034, 0, -874, 874, 0, 0, 0, 0, 0, 0, 0, 0], [-37321475, -37321475, 18426, 0, 0, -1290, -2171, 0, 0, 0, 0, 0, 0, 0, 0, 0], [35424320, 0, 0, 16788, -950, -950, 0, -3382, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 122787, 0, -122787, 75940, 3849, 5861, 0, -3849], [0, 0, 0, 0, 0, 0, 0, 0, 87333, 148196, 0, 0, 0, 0, -7296, -558], [0, 0, 0, 0, 0, 0, 0, 0, 0, 239398, 48824, 239398, 210, -2076, -2076, 0], [53421242, 0, 0, -34244, 1976, 1976, 0, -2144, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -170217, 149346, 0, 0, 0, 0, 5823, -2135], [-52807835, -52807835, 72412, 0, 0, 1090, 704, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 224481, 179225, 224481, -3587, 14178, 14178, 0], [47010476, 0, 0, -8308, -1478, -1478, 0, 3042, 0, 0, 0, 0, 0, 0, 0, 0], [-35951558, -35951558, -91179, 0, 0, 8101, 10441, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 51556850, -5055, 5055, -7740, 0, 10892, -10892, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 644755, 95679, 0, 0, 0, 0, 11367, -3818], [-55642865, -55642865, -83914, 0, 0, 3011, -9214, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 142890, -368392, 142890, 5079, -7534, -7534, 0], [0, 0, 0, 0, 0, 0, 0, 0, 62918, 0, -62918, 119892, 8050, 18362, 0, -8050], [0, 56627309, 95420, -95420, -8205, 0, -22995, 22995, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 125675, 633835, 125675, -250, -41565, -41565, 0], [0, 0, 0, 0, 0, 0, 0, 0, -458064, 0, 458064, -142168, 15303, 20174, 0, -15303], [0, 0, 0, 0, 0, 0, 0, 0, 83364, -135844, 0, 0, 0, 0, -15924, -7940], [0, 0, 0, 0, 0, 0, 0, 0, 0, -368993, 118581, -368993, 3265, 32226, 32226, 0], [-52866766, 0, 0, -7203, 14382, 14382, 0, 20502, 0, 0, 0, 0, 0, 0, 0, 0], [0, -55985230, -185232, 185232, 2310, 0, 24398, -24398, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 161432, -276868, 0, 0, 0, 0, 61162, 2305], [174842860, 174842860, 60420, 0, 0, 5370, -4346, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1836209, 0, -1836209, -501477, -4903, -14214, 0, 4903], [-232246960, 0, 0, -114218, 38260, 38260, 0, 20048, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1515778, 0, 1515778, -82244, -32850, 24818, 0, 32850], [0, -97489105, 400036, -400036, -2795, 0, 20371, -20371, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1041501, -685250, 0, 0, 0, 0, -11612, -27848], [0, -492361678, -51737, 51737, 3087, 0, -59927, 59927, 0, 0, 0, 0, 0, 0, 0, 0], [232209010, 232209010, -549252, 0, 0, 5645, -15665, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1724047, 0, -1724047, -78175, -10426, 122941, 0, 10426], [0, -191300362, -120264, 120264, -35941, 0, 13151, -13151, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -612064, -995658, 0, 0, 0, 0, -15052, -12626], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1327284, 39217, -1327284, 45025, -61743, -61743, 0], [0, -545822860, -324138, 324138, -35040, 0, 2520, -2520, 0, 0, 0, 0, 0, 0, 0, 0], [311644930, 311644930, 747328, 0, 0, 37520, -50448, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-598454896, 0, 0, -373742, 14828, 14828, 0, 23488, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1735701, 0, 1735701, 562308, 18017, -134899, 0, -18017], [0, 0, 0, 0, 0, 0, 0, 0, 2198482, -957418, 0, 0, 0, 0, -6828, -21340], [-113026705, 0, 0, -911150, 38095, 38095, 0, 112528, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -43010, 0, 43010, -1909815, 35290, -173480, 0, -35290], [-87240185, -87240185, -1205924, 0, 0, 15156, 26646, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 2906234, 0, -2906234, 1392666, 61480, 57966, 0, -61480], [0, 22749077, -184854, 184854, 86639, 0, -146884, 146884, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 525168, 840290, 525168, -82730, -294190, -294190, 0], [396286355, 0, 0, -944920, 52655, 52655, 0, -202629, 0, 0, 0, 0, 0, 0, 0, 0], [0, -783643204, 2033608, -2033608, 55112, 0, -46432, 46432, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -4687484, -1152224, 0, 0, 0, 0, -158960, -81944], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1436595, 481024, -1436595, 137905, -125106, -125106, 0], [0, 322451945, -696072, 696072, 145680, 0, -48034, 48034, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -226338, 1108694, 0, 0, 0, 0, 333992, 16640], [-168566360, -168566360, -1785164, 0, 0, -189010, -122250, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 2837184, 5328922, 2837184, -75622, 111946, 111946, 0], [0, 0, 0, 0, 0, 0, 0, 0, -562861, 94258, 0, 0, 0, 0, 211859, 43925], [-87201880, 0, 0, -328774, -113750, -113750, 0, 131394, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 4321119, 0, -4321119, 5055483, 6580, 24841, 0, -6580], [863690746, 863690746, 57729, 0, 0, 194169, 4149, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 6313388, -188862, 6313388, -124362, 434290, 434290, 0], [0, 0, 0, 0, 0, 0, 0, 0, -4803346, 0, 4803346, -2631044, 53610, -256564, 0, -53610], [0, 0, 0, 0, 0, 0, 0, 0, 0, 2259883, -4455232, 2259883, 71335, 122178, 122178, 0], [-255785050, 0, 0, -761161, 33155, 33155, 0, -16601, 0, 0, 0, 0, 0, 0, 0, 0], [3563061737, 0, 0, -2049962, 81173, 81173, 0, 217348, 0, 0, 0, 0, 0, 0, 0, 0], [0, -37832620, -1218384, 1218384, -192600, 0, -239460, 239460, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 4497038, 1441255, 4497038, -69036, -719056, -719056, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1422380, 0, 1422380, 9880208, 28184, 195224, 0, -28184], [0, 0, 0, 0, 0, 0, 0, 0, 9901586, 8473345, 0, 0, 0, 0, -78124, 96360], [-595568600, -595568600, -1287376, 0, 0, 307354, -279286, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2575478015, 0, 0, 1044016, -123815, -123815, 0, -318481, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -2722291, 2228833, 0, 0, 0, 0, 624437, 111966], [0, 0, 0, 0, 0, 0, 0, 0, 0, 2787217, 10241768, 2787217, -380090, 506232, 506232, 0], [0, 0, 0, 0, 0, 0, 0, 0, -7982498, 0, 7982498, 11530014, -153300, -181062, 0, 153300], [0, 3113147123, 805912, -805912, -41917, 0, 451027, -451027, 0, 0, 0, 0, 0, 0, 0, 0], [1159545070, 1159545070, 1158689, 0, 0, -207080, -149080, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3545696150, 0, 0, -499972, -15820, -15820, 0, 250996, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -779484, 0, 779484, -6261228, -165637, -525126, 0, 165637], [0, 112402292, 6941218, -6941218, 83642, 0, 59438, -59438, 0, 0, 0, 0, 0, 0, 0, 0], [-1690711708, 0, 0, -2848122, 223078, 223078, 0, 211718, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -11802286, 8303616, 0, 0, 0, 0, -817966, -363515], [1161729400, 1161729400, 2446686, 0, 0, 445770, 822078, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 13343436, 5094247, 13343436, -93701, 352087, 352087, 0], [0, 0, 0, 0, 0, 0, 0, 0, 16682646, 0, -16682646, -9372940, 27682, -452472, 0, -27682], [0, 0, 0, 0, 0, 0, 0, 0, -15650025, -1185315, 0, 0, 0, 0, -475405, 315040], [-1743915359, -1743915359, -5113558, 0, 0, -89233, 122392, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2259287675, -2224000, 2224000, 81230, 0, -726000, 726000, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 2660478, 5517370, 0, 0, 0, 0, -450064, -226076], [0, 0, 0, 0, 0, 0, 0, 0, 0, 10066884, -10415836, 10066884, -333556, -1702000, -1702000, 0], [0, -435250558, -9359341, 9359341, -70829, 0, 275469, -275469, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -13224236, 13551437, -13224236, 326250, 1374332, 1374332, 0], [0, -569028871, -749582, 749582, -193503, 0, -573872, 573872, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 4899430, 11149939, 4899430, 607405, -1015301, -1015301, 0], [0, -4508927290, 7216101, -7216101, -370530, 0, 858234, -858234, 0, 0, 0, 0, 0, 0, 0, 0], [-2090693570, -2090693570, 8896404, 0, 0, 291210, -444410, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-8840573548, 0, 0, -6628680, 120390, 120390, 0, 42410, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 2960760, 0, -2960760, 8678246, -28662, 379448, 0, 28662], [5085858610, 5085858610, -1355597, 0, 0, 347088, -1043952, 0, 0, 0, 0, 0, 0, 0, 0, 0], [5055248330, 0, 0, 10836020, -42100, -42100, 0, -707684, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 15621890, 0, -15621890, -22196562, -255125, -11990, 0, 255125], [7330855333, 7330855333, -9784664, 0, 0, 838136, 1406046, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -30535022, -9843167, -30535022, -53822, -354560, -354560, 0], [5539677910, 5539677910, -4573429, 0, 0, 544925, 1188457, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -892913, 0, 892913, -26079483, -488605, 98042, 0, 488605], [0, 0, 0, 0, 0, 0, 0, 0, 0, -37680791, 18069730, -37680791, -548280, -1275220, -1275220, 0], [-1180465504, 0, 0, 8957420, 68540, 68540, 0, -1300980, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1578543, -10733760, 0, 0, 0, 0, -2732372, 328330], [19087996180, 19087996180, -1083412, 0, 0, 164910, 778046, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -22551703, 35279889, -22551703, -528382, 1813049, 1813049, 0], [-4561889614, 0, 0, -2371876, 194254, 194254, 0, -883566, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -53985093, -21904554, 0, 0, 0, 0, 1113067, -13755], [0, 5082413630, 8456432, -8456432, 579550, 0, 1008646, -1008646, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -32151866, -17429267, 0, 0, 0, 0, 2829252, -24914], [956057284, 956057284, -12034408, 0, 0, -962588, -2000848, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -15347460, 9439527, -15347460, 60551, -1042681, -1042681, 0], [11755547425, 11755547425, -11790458, 0, 0, -125865, -1658382, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -36768311, -39596788, -36768311, -91935, -1286338, -1286338, 0], [-9362232520, 0, 0, 7943090, 197650, 197650, 0, 1320078, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 71299319, 0, -71299319, 5651670, 625083, -2873263, 0, -625083], [0, 6365203820, -7884818, 7884818, -406050, 0, 784570, -784570, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -46755319, -14840702, 0, 0, 0, 0, 1025681, -760825], [7032757538, 0, 0, -1639979, 1038826, 1038826, 0, 434306, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 13791506, -4254578, 0, 0, 0, 0, -3040154, -945835], [-1726937365, 0, 0, -13683320, 1393355, 1393355, 0, 36109, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 27879747, 0, -27879747, -6501432, 805990, -4097732, 0, -805990], [0, 0, 0, 0, 0, 0, 0, 0, -28782595, -17251701, 0, 0, 0, 0, -2681503, -675508], [0, 0, 0, 0, 0, 0, 0, 0, 0, -11662347, 39365702, -11662347, -434920, 3058188, 3058188, 0], [-825470570, -825470570, -7432307, 0, 0, 2210320, 2180936, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 4395491, -38308421, 4395491, -788750, -1646041, -1646041, 0], [0, 0, 0, 0, 0, 0, 0, 0, 38134608, 0, -38134608, -3528451, -64127, 2447966, 0, 64127], [0, 0, 0, 0, 0, 0, 0, 0, 56022090, 26780040, 0, 0, 0, 0, -2008510, 728290], [-4994047738, 0, 0, 5869713, -620802, -620802, 0, -1969002, 0, 0, 0, 0, 0, 0, 0, 0], [0, 5498655875, -2740826, 2740826, -1881115, 0, -1117660, 1117660, 0, 0, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_324_e_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_324_8_e_m();".
// 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_324_8_e_m(:prec:=16)
    chi := MakeCharacter_324_e();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 8));
    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_324_8_e_m();".
// 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_324_8_e_m( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_324_e();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<5,R![3237043572974873515963599875390625, 0, 18844494584936808673858402687500, 0, 108514072079403600384923096250, 0, 6884217621639614627118000, 0, 320570544364638675075, 0, 6685175886392880, 0, 102624277914, 0, 351468, 0, 1]>,<7,R![49163158366477529094400, -95033081226886566400, 613919371015002880, 955787065614080, 3423043183696, 1400490560, 2018704, -280, 1]>],Snew);
    return Vf;
end function;