
// Make newform 320.9.h.f in Magma, downloaded from the LMFDB on 08 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_320_h();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_320_h_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_320_9_h_f();".
// 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_320_9_h_f();".
// 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 := [23585385849201562500, 0, -470478785036343750, 0, 6418092533338125, 0, -45644912663250, 0, 233333110300, 0, -657883370, 0, 1332306, 0, -1394, 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], [0, -15600378681237769019329442161998607773644812500, 0, 128546440640104189063485494528533291167877500, 0, -841293513643417783135408278331730601994875, 0, 3087996930045680461049999999794489311950, 0, -8029237378113581911536791573688260005, 0, 13487135976020823114878383254774609, 0, -13490428946811479953420977991816, 0, 7938363953649339509674880789], [592159681829591177043245198112459072000000, 0, -11777447269120188654880550501573583360000, 0, 74011603854720752597811817350001152000, 0, -436801672080288374002756245605580800, 0, 1263190427114273377250323841720320, 0, -2752286382199345950697937842176, 0, 2929850525792165327462785024, 0, -2234222240540812683677696, 0], [5550014312146481955048861074772100472268618750, -246299878589189033248507478341260947621250000, 81353758818625005361529064576976332398212500, 5378461553692704584270702360164111725993750, -1090659023259708224660952714411399318137250, -56215972427432674673771419265587531516500, 10886746466846855768727926223035706507675, 331775417299725904007821026610753721600, -35979157351246428675249382946265178755, -992961185129211979516793645411932780, 87979575187216578316919321671247052, 2090516180109074213859175107815052, -97269300942818130614488563457923, -2225386125907147101592083041848, 78608944855252253871545552457, 1630559988946046983980996482], [870383621581899214552442169275261605662000000, 0, -17950622439942247407149228813360225683560000, 0, 97116552190540530197310283009210809252000, 0, -611014479402743548756699026323734735300, 0, 1744218316613739893782571378048953820, 0, -4280179302494165003773106912015496, 0, 4668563152865095363987102799204, 0, -3964425662983778785077118516, 0], [114564422926735891967552936471858337440779012500, 738899635767567099745522435023782842863750000, 1597986792308406581528171777372013662563087500, -16135384661078113752812107080492335177981250, -21423210671391787445505392023974776578344750, 168647917282298024021314257796762594549500, 208949978159147083837182610538427003756925, -995326251899177712023463079832261164800, -706718645586601563664169146942308279605, 2978883555387635938550380936235798340, 1728134030727661889347359309285455892, -6271548540327222641577525323445156, -1926132215109723400070352400889333, 6676158377721441304776249125544, 1544071933001264367450105767647, -4891679966838140951942989446], [0, 211677675774590099953044202247534413130507437500, 0, -1819439923280609951900330804045163715940955000, 0, 11428585283196976575851876318089790102764125, 0, -78969788218744582866667368297770048988650, 0, 239318562301709566122829282419613613035, 0, -556005450605326439837557255596679863, 0, 602954863274726658143097418230112, 0, -478998850423008458720268498623], [7406528995477895739568869564036190468326093750, 492599757178378066497014956682521895242500000, 108471678424833340482038752769301776530950000, -10756923107385409168541404720328223451987500, -1454212031012944299547936952548532424183000, 112431944854865349347542838531175063033000, 14515661955795807691637234964047608676900, -663550834599451808015642053221507443200, -47972209801661904900332510595020238340, 1985922370258423959033587290823865560, 117306100249622104422559095561662736, -4181032360218148427718350215630104, -129692401257090840819318084610564, 4450772251814294203184166083696, 104811926473669671828727403276, -3261119977892093967961992964], [-6090369469325696126228683601342115954737678418750, -738899635767567099745522435023782842863750000, 32479041309071593116792234678801064513860262500, 16135384661078113752812107080492335177981250, -435426217361869742028044176994345458971974250, -168647917282298024021314257796762594549500, 4036782557230942694965074311804287658464775, 995326251899177712023463079832261164800, -14364038673148429157718039024564766060015, -2978883555387635938550380936235798340, 35124280652241817158898262202250188156, 6271548540327222641577525323445156, -39570758931369316682073934125193519, -6676158377721441304776249125544, 31383223151476021769517988340621, 4891679966838140951942989446], [194324013919579513498811521733353529108952000000, 0, -3455419010800800498167594673299054307254760000, 0, 31925995331943645291319843184351615327052000, 0, -164002355159272350571967342553661993817300, 0, 473057065986172039008476536294292415820, 0, -922625814285597029219493679411050216, 0, 960799790803755283557225456114484, 0, -653923857862164112389155679236, 0], [5255248863628117950766945388585945466175170000000, -175926777335957257764707261956079755809966375000, -93976027635023242870042440266307834955089600000, 1262675062172684171676521446931527392275527500, 853052734255758574867553676613426249038120000, -8620025133402178320064150030896807616071750, -4405775665538152481268589536430163463078000, -41665545874579298118638592845788032322300, 12738595766505240507861049700974150909200, 191002371349918871730754777499218855070, -24548109703931127987759959072883171360, -661776428405428815757871336528166126, 25443959542788652495765305261710640, 774950164315543979784290168058824, -16939525092315030661787211952560, -729816098827921087373030225146], [46250119267887349625407175623100837268905156250, -147337709789972173786160400527580246722411250000, 677947990155208378012742204808136103318437500, 5217720514983059252182214617967679602577258750, -9088825193830901872174605953428327651143750, -33628650888980629829819041361880283141240500, 90722887223723798072732718525297554230625, 198469566568838643848605104742137588051200, -299826311260386905627078191218876489625, -572214500676116409818578075755866134380, 733163126560138152640994347260392100, 1250556305672786062665929747213720364, -810577507856817755120738028816025, -1331236121867620220267926258402936, 655074540460435448929546270475, 1019593103413813701684198898794], [-416251073410986146628664580607907535420146406250, -1900917362945893704041249637653263645578588750000, -6101531911396875402114679843273224929865937500, 56649666861482892044487293190698144079816116250, 81799426744478116849571453580854948860293750, -433869146319932192100146898493376470454359500, -816505985013514182654594466727677988075625, 2560608860045743702606165658811252886188800, 2698436801343482150643703720969888406625, -7449509861843662542233451810818752469620, -6598468139041243373768949125343528900, 16134390837101665882544349157224932436, 7295197570711359796086642259344225, -17175303334402351118965224941104264, -5895670864143919040365916434275, 13032589446097190146700390693006], [-14895360670021828622975393792055737122150197000000, 2208142148838982827299577404639356608195962062500, 257584088505786231760088535948310701040422360000, -16758085474129608604880015789688966916077510000, -2584781913020390095484085315368329589857992000, 108944946602072973040299821419542559460743875, 12949009538297242057658104025354489665557300, 85681028172537093606499764137423618303450, -37239865526111894601940174093786165514220, -849982948220263345086448364918989796155, 72348957865703199484994462396786075976, 3864140472592758732453247370106734679, -75494449668164170035896701648412724, -4758385238622882279289429928892496, 51642802147107158853378892695396, 4753374879912556480994110394759], [-6443856100833410143365766081312329251616591000000, 2208142148838982827299577404639356608195962062500, 116561656638344646247027950887810419102834080000, -16758085474129608604880015789688966916077510000, -1021233944323933162130384484082870988916396000, 108944946602072973040299821419542559460743875, 5335470422036476201808327849836818219011400, 85681028172537093606499764137423618303450, -15426937456130300901154061174152807866360, -849982948220263345086448364918989796155, 30084847020376411302076009488735986928, 3864140472592758732453247370106734679, -31269112755408547817992174842813672, -4758385238622882279289429928892496, 21135291522725799276361364958888, 4753374879912556480994110394759], [-92581612443473696744610869550452380854076171875, -723378684700770451019620885971263791082182500000, -1355895980310416756025484409616272206636875000, 17174498193165657731598660407026424855312835000, 18177650387661803744349211906856655302287500, -165105384650059567185412505120560534857297000, -181445774447447596145465437050595108461250, 974418933363044611386391620540817182988800, 599652622520773811254156382437752979250, -2924868158623781330483910565845680298120, -1466326253120276305281988694520784200, 6139811571873662898519150155174190936, 1621155015713635510241476057632050, -6535922380193633011524606055233264, -1310149080920870897859092540950, 4749040223896630276560929936256]];
    Rf_basisdens := [1, 732365169290977444168664738256356846392734375, 65403207471803567088464611534459265625, 9764868923879699255582196510084757951903125, 50911725359122519580720524035895505484375, 29294606771639097766746589530254273855709375, 732365169290977444168664738256356846392734375, 3254956307959899751860732170028252650634375, 29294606771639097766746589530254273855709375, 356382077513857637065043668251268538390625, 66578651753725222197151339841486986035703125, 81373907698997493796518304250706316265859375, 732365169290977444168664738256356846392734375, 146473033858195488833732947651271369278546875, 146473033858195488833732947651271369278546875, 81373907698997493796518304250706316265859375];
    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_320_h();"
function MakeCharacter_320_h()
    N := 320;
    order := 2;
    char_gens := [191, 261, 257];
    v := [1, 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_320_h_Hecke();"
function MakeCharacter_320_h_Hecke(Kf)
    N := 320;
    order := 2;
    char_gens := [191, 261, 257];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 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]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 9;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-37, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -4, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1], [-1, 0, 0, -3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 3], [0, 0, 7, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0], [0, -65, -1, 0, 0, 0, 40, 0, 0, 0, -1, 0, 0, 0, -2, 0], [218832, 0, 0, 372, 0, 97, 0, 46, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 32, 0, 3, 0, 0, 0, 0, -3, 0, 0, 0, 6, -6, 0], [-416, 0, 0, -850, 0, 0, 0, 231, 0, 0, 0, -18, -36, 0, 0, 46], [-136500, 0, 0, -1725, 0, -137, 0, -266, -8, 0, 0, 0, 0, 0, 0, 0], [0, 10752, 6, 0, 11, 0, -505, 0, 0, -11, 39, 0, 0, -22, -10, 0], [0, 10970, -39, 0, -5, 0, -861, 0, 0, 5, -54, 0, 0, 10, -68, 0], [-2043, 0, 0, -3928, 0, 0, 0, 930, 0, 0, 0, -14, 144, 0, 0, -183], [0, 0, -809, 0, -77, 0, 0, 0, 0, 23, 0, 0, 0, -133, 133, 0], [-1418536, 0, 0, 10056, 0, -556, 0, 1767, -10, 0, 0, 0, 0, 0, 0, 0], [0, -138700, -54, 0, 55, 0, 651, 0, 0, -55, 111, 0, 0, -110, -218, 0], [0, 0, -389, 0, 921, 0, 0, 0, 0, -61, 0, 0, 0, 8, -8, 0], [-6013, 0, 0, -13523, 0, 0, 0, 2592, 0, 0, 0, 615, -882, 0, 0, -829], [0, 0, -808, 0, -1331, 0, 0, 0, 0, -59, 0, 0, 0, -176, 176, 0], [0, 120746, -266, 0, 33, 0, -7, 0, 0, -33, -167, 0, 0, -66, -598, 0], [-5868462, 0, 0, 46782, 0, -2366, 0, 8186, -32, 0, 0, 0, 0, 0, 0, 0], [-19449, 0, 0, -34301, 0, 0, 0, 9960, 0, 0, 0, 419, 5016, 0, 0, 471], [-18227808, 0, 0, -61800, 0, -13259, 0, -8054, 217, 0, 0, 0, 0, 0, 0, 0], [0, -151059, 177, 0, 240, 0, 11442, 0, 0, -240, 897, 0, 0, -480, -126, 0], [0, -709099, -352, 0, -232, 0, 28684, 0, 0, 232, -1048, 0, 0, 464, -240, 0], [-770164, 0, 0, 14142, 0, 2024, 0, 1965, -328, 0, 0, 0, 0, 0, 0, 0], [-33976, 0, 0, -65436, 0, 0, 0, 16856, 0, 0, 0, -3632, -1116, 0, 0, -264], [0, 363151, 1518, 0, -493, 0, 77778, 0, 0, 493, 39, 0, 0, 986, 4022, 0], [0, 0, 25503, 0, -3377, 0, 0, 0, 0, 147, 0, 0, 0, 273, -273, 0], [-51964, 0, 0, -106816, 0, 0, 0, 21098, 0, 0, 0, -3934, -6822, 0, 0, -9768], [0, 0, -22576, 0, -259, 0, 0, 0, 0, 476, 0, 0, 0, -1666, 1666, 0], [-47990136, 0, 0, 533268, 0, 32752, 0, 83579, 958, 0, 0, 0, 0, 0, 0, 0], [0, 0, -40491, 0, -5068, 0, 0, 0, 0, -2020, 0, 0, 0, 3038, -3038, 0], [-233152, 0, 0, -438868, 0, 0, 0, 115347, 0, 0, 0, 872, 28308, 0, 0, -2458], [0, -2616429, 4254, 0, 460, 0, 136222, 0, 0, -460, 5634, 0, 0, -920, 7588, 0], [0, -3736909, -3471, 0, -350, 0, 245664, 0, 0, 350, -4521, 0, 0, 700, -6242, 0], [-266540, 0, 0, -525158, 0, 0, 0, 133237, 0, 0, 0, -20414, -12492, 0, 0, -66], [0, 0, -25428, 0, 29969, 0, 0, 0, 0, 6774, 0, 0, 0, 4074, -4074, 0], [563102128, 0, 0, 1102764, 0, 20057, 0, 181110, 3953, 0, 0, 0, 0, 0, 0, 0], [0, 0, -172120, 0, -41434, 0, 0, 0, 0, 3838, 0, 0, 0, 5632, -5632, 0], [-227479, 0, 0, -421275, 0, 0, 0, 99048, 0, 0, 0, -14651, 19032, 0, 0, -29383], [-431101, 0, 0, -848542, 0, 0, 0, 228770, 0, 0, 0, 25544, 39204, 0, 0, 26439], [0, 0, 101075, 0, 77809, 0, 0, 0, 0, -329, 0, 0, 0, 436, -436, 0], [0, 0, 317229, 0, 7591, 0, 0, 0, 0, -6257, 0, 0, 0, -3215, 3215, 0], [0, -14065235, 1974, 0, 1957, 0, 643592, 0, 0, -1957, 7845, 0, 0, -3914, 34, 0], [0, -5462013, -1954, 0, -6476, 0, -645410, 0, 0, 6476, -21382, 0, 0, 12952, 9044, 0], [-1275954104, 0, 0, 1872096, 0, -158063, 0, 337290, -6419, 0, 0, 0, 0, 0, 0, 0], [-1188277, 0, 0, -2391963, 0, 0, 0, 612728, 0, 0, 0, -14129, -29538, 0, 0, 37179], [0, 0, 179222, 0, 22159, 0, 0, 0, 0, 18685, 0, 0, 0, -10562, 10562, 0], [-1404265256, 0, 0, 3136575, 0, 475769, 0, 443958, 2942, 0, 0, 0, 0, 0, 0, 0], [0, 0, 601060, 0, -55093, 0, 0, 0, 0, -32098, 0, 0, 0, -11554, 11554, 0], [-308308, 0, 0, -312422, 0, 0, 0, 186554, 0, 0, 0, -96366, 207828, 0, 0, 64800], [0, -51200748, -2054, 0, 5870, 0, -742837, 0, 0, -5870, 15556, 0, 0, -11740, -15848, 0], [-1541854608, 0, 0, 550320, 0, 72104, 0, 80375, 4034, 0, 0, 0, 0, 0, 0, 0], [0, 0, -650628, 0, -276681, 0, 0, 0, 0, -5373, 0, 0, 0, 41580, -41580, 0], [-2205816, 0, 0, -4644794, 0, 0, 0, 1123227, 0, 0, 0, -19402, -252564, 0, 0, 40638], [-3532968636, 0, 0, 1854261, 0, 53753, 0, 297556, -15172, 0, 0, 0, 0, 0, 0, 0], [0, -25436447, 11454, 0, 14786, 0, 1059036, 0, 0, -14786, 55812, 0, 0, -29572, -6664, 0], [288590, 0, 0, 893428, 0, 0, 0, -129649, 0, 0, 0, -161016, 155232, 0, 0, 29292], [0, 22219306, 89106, 0, 2881, 0, 348953, 0, 0, -2881, 97749, 0, 0, -5762, 172450, 0], [0, 0, -928989, 0, 416450, 0, 0, 0, 0, -5052, 0, 0, 0, 29904, -29904, 0], [3174304, 0, 0, 6196924, 0, 0, 0, -1473378, 0, 0, 0, 47362, -104322, 0, 0, 227548], [-1256407, 0, 0, -2863114, 0, 0, 0, 520934, 0, 0, 0, 212384, -137916, 0, 0, -214539], [0, 0, 1060855, 0, -303873, 0, 0, 0, 0, 114129, 0, 0, 0, -14787, 14787, 0], [1448718, 0, 0, 2347072, 0, 0, 0, -603846, 0, 0, 0, 323324, -227040, 0, 0, 241026], [0, 73176672, 992, 0, -14459, 0, -3377741, 0, 0, 14459, -42385, 0, 0, 28918, 30902, 0], [-6773982680, 0, 0, -3283512, 0, -1424743, 0, -308382, 8477, 0, 0, 0, 0, 0, 0, 0], [764706, 0, 0, 1725018, 0, 0, 0, -353496, 0, 0, 0, -131814, 63792, 0, 0, 57714], [0, 0, 63389, 0, 27918, 0, 0, 0, 0, 70420, 0, 0, 0, -35408, 35408, 0], [0, -42932655, 18828, 0, -31333, 0, -3829144, 0, 0, 31333, -75171, 0, 0, 62666, 100322, 0], [-1029876, 0, 0, -2464882, 0, 0, 0, 640383, 0, 0, 0, 253918, -151212, 0, 0, 250890], [0, 0, -81450, 0, 908841, 0, 0, 0, 0, 49962, 0, 0, 0, -20436, 20436, 0], [0, -98158503, 66676, 0, 40787, 0, 5269904, 0, 0, -40787, 189037, 0, 0, -81574, 51778, 0], [9390749664, 0, 0, -15043308, 0, 3650028, 0, -3126829, -67638, 0, 0, 0, 0, 0, 0, 0], [7474529, 0, 0, 15787142, 0, 0, 0, -3766086, 0, 0, 0, -24112, 813972, 0, 0, -57643], [6677230986, 0, 0, 15032466, 0, 65290, 0, 2480654, -83252, 0, 0, 0, 0, 0, 0, 0], [-2468747708, 0, 0, -22925937, 0, 618535, 0, -3937038, -77756, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1686012, 0, 274725, 0, 0, 0, 0, -134052, 0, 0, 0, 162696, -162696, 0], [-9613643104, 0, 0, 6211152, 0, -1598784, 0, 1287591, -84390, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1314478, 0, -669743, 0, 0, 0, 0, 23195, 0, 0, 0, -263134, 263134, 0], [5019517, 0, 0, 9162763, 0, 0, 0, -2331774, 0, 0, 0, 447031, -429240, 0, 0, 355969], [0, 0, -1501273, 0, 52802, 0, 0, 0, 0, -271144, 0, 0, 0, 4148, -4148, 0], [0, -176518469, -2428, 0, -47634, 0, -7272686, 0, 0, 47634, -145330, 0, 0, 95268, 90412, 0], [-16056524040, 0, 0, -4329993, 0, 337137, 0, -769154, 52206, 0, 0, 0, 0, 0, 0, 0], [22130782, 0, 0, 44766674, 0, 0, 0, -11315478, 0, 0, 0, 189636, 694746, 0, 0, -500174], [-4292891304, 0, 0, -29849280, 0, 3518329, 0, -5571398, -60779, 0, 0, 0, 0, 0, 0, 0], [0, -378107712, -166425, 0, -109817, 0, -3681251, 0, 0, 109817, -495876, 0, 0, 219634, -113216, 0], [0, -146340477, -65016, 0, 22122, 0, 2069010, 0, 0, -22122, 1350, 0, 0, -44244, -174276, 0], [0, 0, 403958, 0, 588618, 0, 0, 0, 0, 257548, 0, 0, 0, 473146, -473146, 0], [0, 88343628, 94290, 0, -270802, 0, 4930547, 0, 0, 270802, -718116, 0, 0, 541604, 730184, 0], [0, 0, -6221443, 0, -1124719, 0, 0, 0, 0, 226483, 0, 0, 0, 178093, -178093, 0], [0, 0, -901002, 0, 482381, 0, 0, 0, 0, 301280, 0, 0, 0, -690304, 690304, 0], [0, -299198071, 318861, 0, -146408, 0, -1920714, 0, 0, 146408, -120363, 0, 0, 292816, 930538, 0], [-14699125560, 0, 0, -37160436, 0, -3892107, 0, -5539922, 28797, 0, 0, 0, 0, 0, 0, 0], [44654799210, 0, 0, -30820080, 0, -2558476, 0, -4725736, -92812, 0, 0, 0, 0, 0, 0, 0], [0, 401443895, 723414, 0, -28484, 0, -10258518, 0, 0, 28484, 637962, 0, 0, 56968, 1503796, 0], [-16561887368, 0, 0, 35675076, 0, 4537301, 0, 5165574, -144331, 0, 0, 0, 0, 0, 0, 0], [0, -537954929, 566598, 0, -38556, 0, -6755582, 0, 0, 38556, 450930, 0, 0, 77112, 1210308, 0], [25382872, 0, 0, 50426432, 0, 0, 0, -12227501, 0, 0, 0, -1868460, -2207772, 0, 0, 927870], [0, 776821813, -392978, 0, -26810, 0, 29067824, 0, 0, 26810, -473408, 0, 0, 53620, -732336, 0], [-58444453308, 0, 0, 50887815, 0, -375345, 0, 8492890, -305820, 0, 0, 0, 0, 0, 0, 0], [0, 0, -6167628, 0, -3597805, 0, 0, 0, 0, 504896, 0, 0, 0, 557024, -557024, 0], [-17410442, 0, 0, -30763466, 0, 0, 0, 8324520, 0, 0, 0, -2157098, 1900320, 0, 0, -761402], [0, -139377994, -67492, 0, -251041, 0, 12228961, 0, 0, 251041, -820615, 0, 0, 502082, 367098, 0], [-58427888, 0, 0, -117869666, 0, 0, 0, 29826070, 0, 0, 0, -725558, -1739448, 0, 0, 1224252], [0, 0, 2081163, 0, -3655997, 0, 0, 0, 0, 1432839, 0, 0, 0, 812406, -812406, 0], [44977654300, 0, 0, 28148601, 0, -3744127, 0, 5293848, -129640, 0, 0, 0, 0, 0, 0, 0], [0, -162070550, -91395, 0, 120031, 0, -22224181, 0, 0, -120031, 268698, 0, 0, -240062, -422852, 0], [-18776889, 0, 0, -31244536, 0, 0, 0, 11121048, 0, 0, 0, -3862838, 2446404, 0, 0, 3465207], [-29398139, 0, 0, -62452455, 0, 0, 0, 14709406, 0, 0, 0, 1766627, -1889550, 0, 0, 20673], [0, 0, -1063247, 0, -1286281, 0, 0, 0, 0, -468913, 0, 0, 0, -377149, 377149, 0], [0, 0, -2825015, 0, -8100584, 0, 0, 0, 0, -647816, 0, 0, 0, -1006178, 1006178, 0], [-1471718352, 0, 0, 179460795, 0, -11131223, 0, 31812706, 284218, 0, 0, 0, 0, 0, 0, 0], [0, 1439435210, 252588, 0, -118757, 0, 24410949, 0, 0, 118757, -103683, 0, 0, 237514, 742690, 0], [0, -1484458162, 206062, 0, 37056, 0, -19996075, 0, 0, -37056, 317230, 0, 0, -74112, 338012, 0], [5728605, 0, 0, 11848988, 0, 0, 0, -3316416, 0, 0, 0, 1842706, 2234484, 0, 0, -904227], [0, 0, 2789260, 0, 6101375, 0, 0, 0, 0, 234704, 0, 0, 0, 205478, -205478, 0], [-25020596908, 0, 0, 195733554, 0, -19423976, 0, 35931345, 430540, 0, 0, 0, 0, 0, 0, 0], [-84987757, 0, 0, -175021609, 0, 0, 0, 44897040, 0, 0, 0, 2351039, -2695056, 0, 0, 4806323], [-50520735, 0, 0, -91547094, 0, 0, 0, 20675136, 0, 0, 0, -4495992, 4998384, 0, 0, -9170463], [0, 1572504318, 191648, 0, 169423, 0, -39916103, 0, 0, -169423, 699917, 0, 0, -338846, 44450, 0], [0, 0, 7333949, 0, -11124563, 0, 0, 0, 0, 157081, 0, 0, 0, -680891, 680891, 0], [-16556810988, 0, 0, -30361626, 0, -45636908, 0, 2571053, 151036, 0, 0, 0, 0, 0, 0, 0], [-131825490536, 0, 0, 390149796, 0, 25052645, 0, 60803718, -274843, 0, 0, 0, 0, 0, 0, 0], [0, 0, -4724440, 0, -4462903, 0, 0, 0, 0, -2175623, 0, 0, 0, -1058504, 1058504, 0], [0, -1320913208, -355254, 0, -96390, 0, 15660175, 0, 0, 96390, -644424, 0, 0, 192780, -517728, 0], [-845166, 0, 0, 1521110, 0, 0, 0, -2249013, 0, 0, 0, 3613966, 6825408, 0, 0, -5343192], [0, 0, 3301272, 0, 5917273, 0, 0, 0, 0, 2176870, 0, 0, 0, 2271046, -2271046, 0], [0, 1216428730, -814666, 0, -280500, 0, 57246721, 0, 0, 280500, -1656166, 0, 0, 561000, -1068332, 0], [0, 0, -9461584, 0, -6074264, 0, 0, 0, 0, 2260510, 0, 0, 0, 3405706, -3405706, 0], [-96727614, 0, 0, -197535762, 0, 0, 0, 47872821, 0, 0, 0, -2775450, -6855984, 0, 0, -981972], [27031454958, 0, 0, -303533706, 0, 28227872, 0, -55164418, 775070, 0, 0, 0, 0, 0, 0, 0], [-106576868458, 0, 0, 430408380, 0, 25289654, 0, 67425384, -566422, 0, 0, 0, 0, 0, 0, 0], [-31208647, 0, 0, -44414612, 0, 0, 0, 17776622, 0, 0, 0, -5840442, 12162240, 0, 0, 4344597], [0, -3458463258, -469566, 0, -387471, 0, 53425677, 0, 0, 387471, -1631979, 0, 0, 774942, -164190, 0], [50534387, 0, 0, 81477304, 0, 0, 0, -28882906, 0, 0, 0, 5887062, -13704408, 0, 0, -7231425], [-246907629558, 0, 0, -366992928, 0, -9052172, 0, -59708248, -308732, 0, 0, 0, 0, 0, 0, 0], [0, 0, 55177182, 0, -5643797, 0, 0, 0, 0, -2705570, 0, 0, 0, 1459090, -1459090, 0], [313334118516, 0, 0, 6098622, 0, 10193036, 0, -554059, 770060, 0, 0, 0, 0, 0, 0, 0], [0, -28261673, 2146569, 0, 536326, 0, -121933948, 0, 0, -536326, 3755547, 0, 0, -1072652, 3220486, 0], [0, -1008396236, 1195096, 0, -541235, 0, 25144703, 0, 0, 541235, -428609, 0, 0, 1082470, 3472662, 0], [-380944822264, 0, 0, -541421280, 0, -1252908, 0, -90206049, -1067922, 0, 0, 0, 0, 0, 0, 0], [0, 0, -54289, 0, 6594516, 0, 0, 0, 0, 273904, 0, 0, 0, -1444706, 1444706, 0], [102953685, 0, 0, 226316558, 0, 0, 0, -52959276, 0, 0, 0, 516268, 20925456, 0, 0, -2964867], [171892342, 0, 0, 356355246, 0, 0, 0, -90480638, 0, 0, 0, 5005772, 17576334, 0, 0, -9068934], [0, 0, -4499903, 0, -13698023, 0, 0, 0, 0, -3035285, 0, 0, 0, 4155265, -4155265, 0], [0, -2458536670, 3034635, 0, -757991, 0, 14146719, 0, 0, 757991, 760662, 0, 0, 1515982, 7585252, 0], [231766162, 0, 0, 440395512, 0, 0, 0, -107076795, 0, 0, 0, 5723732, -17413080, 0, 0, 17612572], [-84038536248, 0, 0, -5063235, 0, -35033621, 0, 4958416, -219890, 0, 0, 0, 0, 0, 0, 0], [0, 1366965683, -2344212, 0, -581794, 0, -224124998, 0, 0, 581794, -4089594, 0, 0, 1163588, -3524836, 0], [0, -1650400134, -846970, 0, 456892, 0, -41915999, 0, 0, -456892, 523706, 0, 0, -913784, -2607724, 0], [0, 3237769523, -6191994, 0, 907172, 0, 109400494, 0, 0, -907172, -3470478, 0, 0, -1814344, -14198332, 0], [0, 0, 6329338, 0, 23159323, 0, 0, 0, 0, 1120181, 0, 0, 0, 5852594, -5852594, 0], [0, 0, -7460709, 0, -16208233, 0, 0, 0, 0, 427223, 0, 0, 0, -5194654, 5194654, 0], [-426978808728, 0, 0, -264487209, 0, 65770537, 0, -54891698, 907558, 0, 0, 0, 0, 0, 0, 0], [-47018953, 0, 0, -134268537, 0, 0, 0, 20871882, 0, 0, 0, 22507729, -17722902, 0, 0, -5275189], [366596855904, 0, 0, -516740940, 0, 21070409, 0, -89583170, 312329, 0, 0, 0, 0, 0, 0, 0], [0, 484398448, -1656476, 0, 2132245, 0, -80527741, 0, 0, -2132245, 4740259, 0, 0, -4264490, -7577442, 0], [434525146, 0, 0, 859641518, 0, 0, 0, -211712498, 0, 0, 0, -4865100, -14273874, 0, 0, 11100150], [0, -3955257835, -3121125, 0, 998966, 0, -72550082, 0, 0, -998966, -124227, 0, 0, -1997932, -8240182, 0], [0, 0, -27519719, 0, 33525757, 0, 0, 0, 0, 3603743, 0, 0, 0, -3010459, 3010459, 0], [286389885, 0, 0, 580425371, 0, 0, 0, -145196982, 0, 0, 0, -20575937, -12930336, 0, 0, -4004079], [0, -4280757806, -6349852, 0, -205434, 0, 147087157, 0, 0, 205434, -6966154, 0, 0, 410868, -12288836, 0], [0, 0, -10129604, 0, -34273436, 0, 0, 0, 0, -2711636, 0, 0, 0, -3730544, 3730544, 0], [-117840695, 0, 0, -210114908, 0, 0, 0, 61686174, 0, 0, 0, 10113718, 35680200, 0, 0, 5531653]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_320_h_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


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


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_320_9_h_f();".
// 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_320_9_h_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_320_h();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,9,sign)));
    Vf := Kernel([<3,R![687963618902016, 0, -1579444964352, 0, 428847744, 0, -36788, 0, 1]>],Snew);
    return Vf;
end function;