
// Make newform 304.5.e.f in Magma, downloaded from the LMFDB on 16 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_304_e();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_304_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_304_5_e_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_304_5_e_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 := [34273490123096064, 0, 34336742150504448, 0, 10365057927217152, 0, 915101881952256, 0, 37911701888064, 0, 861580608848, 0, 11414409521, 0, 89661524, 0, 408854, 0, 996, 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, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [76456656887018284541945328020963796713472, 0, 40244551137216999503608585033015821139968, 0, 4353828936944978660336592305349348956160, 0, 204916299226419925363498434451520373312, 0, 5087982217402337932788988323231547792, 0, 71688787769461832364673746163452457, 0, 587790123766048552377507145752628, 0, 2762453645622673838324578791526, 0, 6877057136442363798278307204, 0, 7015591482736478697048953, 0], [70698692922283364977006427348439266230272, 0, 40186971497569650307959196026290575835136, 0, 4353828936944978660336592305349348956160, 0, 204916299226419925363498434451520373312, 0, 5087982217402337932788988323231547792, 0, 71688787769461832364673746163452457, 0, 587790123766048552377507145752628, 0, 2762453645622673838324578791526, 0, 6877057136442363798278307204, 0, 7015591482736478697048953, 0], [58090622717697780565593410239714409054208, 0, 34960748522456071674010884825018728644608, 0, 4357172388027681444166990554565277116416, 0, 232436557284241687911141751343697094080, 0, 6348511732789677193101321543582364784, 0, 95555342365459310547859333569292151, 0, 819248809664970853004336184445004, 0, 3969323674535653396041654595418, 0, 10093865115949232203052077308, 0, 10455416804468796827256871, 0], [-9398646894548195730109601850383344336896, 0, -5277393403135015289567544539634859573248, 0, -519193082079399066235804477752172296192, 0, -22528723381674710988047329081062250560, 0, -526273740917645490897535374871063696, 0, -7101429163025354149803831900898849, 0, -56499853652885085742913376980116, 0, -259993917040271693274733929142, 0, -637580256755232951101678052, 0, -643312172309955074890481, 0], [-3955144028429171873970587124361719152640, 0, -2203607703171522522839869736233199622144, 0, -226929819092999084567903673382426546752, 0, -10273561523110636706368379785287355344, 0, -248350846952221396150448127622415497, 0, -3438018037140310115727303132963703, 0, -27862778610788824562264188853698, 0, -129922657869745666360708045222, 0, -321672121357164915533942613, 0, -326858064707069045267699, 0], [380377480317245530016520067415011954262016, 0, 204926522714218558841067465735083517149184, 0, 19100515377661570656509089954774492237824, 0, 785408101220240112321856690491480183360, 0, 17469228706108904660959373065879595504, 0, 226347285305475167107772619976906865, 0, 1744536228692261486845893770227988, 0, 7835356762863573048101522959382, 0, 18863078260110627805736419716, 0, 18765241665041430289977025, 0], [-322250322855149837384824380948872964341760, 0, -156342028813703659660921085022631958347776, 0, -1471744953938229746830417462633450924032, 0, 554392432559250613299773920959651654720, 0, 25580063507462217511580478649168985872, 0, 479054233294477260474837587630685073, 0, 4606325962317218964453922339110484, 0, 23883932186162958841250597643862, 0, 63431418977529811606584931620, 0, 67669402085462715252962657, 0], [-2486395785099896932935915635491112963014656, 0, -1369635074731126216680733994200038630162432, 0, -130950749090552781663472710565650872567808, 0, -5491696571065831659876244594123487144640, 0, -123928134836511151628463012123413744816, 0, -1622614672608434508954758940494290379, 0, -12600755952704034603443858077324508, 0, -56905001939647026820676839758866, 0, -137545212550475095237072867020, 0, -137240621828284286426961595, 0], [0, -70468374363693968194408871321538285010944, 0, -40186971497569650307959196026290575835136, 0, -4353828936944978660336592305349348956160, 0, -204916299226419925363498434451520373312, 0, -5087982217402337932788988323231547792, 0, -71688787769461832364673746163452457, 0, -587790123766048552377507145752628, 0, -2762453645622673838324578791526, 0, -6877057136442363798278307204, 0, -7015591482736478697048953], [0, -33103571513741873814383925595772966535168, 0, -8603216675179839177307242219963959205888, 0, 262711646049447987545955679869328945920, 0, 54203015331270985665855140593184110464, 0, 2081934755712703856445202528146229724, 0, 36423013119501783511210139625351659, 0, 338160805602856785259840544633060, 0, 1717351867500227807304918591074, 0, 4500420772583206945097889144, 0, 4757507011033628632965739], [0, 9410768923947637666035789009693922295808, 0, 5277393403135015289567544539634859573248, 0, 519193082079399066235804477752172296192, 0, 22528723381674710988047329081062250560, 0, 526273740917645490897535374871063696, 0, 7101429163025354149803831900898849, 0, 56499853652885085742913376980116, 0, 259993917040271693274733929142, 0, 637580256755232951101678052, 0, 643312172309955074890481], [0, 1993204154558833521222249060232778861248512, 0, 1144268233184962788658118007184657299603456, 0, 112014512994327709551867824101809028872192, 0, 4806122491228111583350687714922428161216, 0, 110827155338421622564330993768844607472, 0, 1478068970425135060871726718929145187, 0, 11648138211081514032945870078408508, 0, 53204034049504430945268855975202, 0, 129726445798216282516267191276, 0, 130314032331384017607966419], [0, 1856441532162924812077690391101440, 0, 1035521777419187138093400013799424, 0, 102698886644271549417058259963904, 0, 4481857070326235379379724216640, 0, 105004302444107628034030635568, 0, 1418607308373456959300506669, 0, 11290193140987889665694404, 0, 51949520568053402047678, 0, 127364482636332577140, 0, 128472238193535293], [3396760456325830704956610267043442511052800, -3336877101768509122411872022072807422689280, 1971082819490521371673497742276095075287040, -1835024744762747502017004013896272477749248, 213767163452324164287355771532702758096896, -177736384736686419055298524862396799473664, 10067556742550107115247062221980737741184, -7566018479420387457857630946671621946816, 250270845195032230074264095160069882720, -173286581159122358912523025054857733936, 3530090551240008804435854378739159942, -2298273089724429172361720769983694055, 28966237799985711984331693035354744, -18033841597222665526797307801015180, 136200991851480339701727952415940, -82101334648667974579891775458810, 339170327404441280638325520984, -199688104766568244479139705980, 346060871401547756311157862, -200210600552828147661370775], [3396760456325830704956610267043442511052800, 3336877101768509122411872022072807422689280, 1971082819490521371673497742276095075287040, 1835024744762747502017004013896272477749248, 213767163452324164287355771532702758096896, 177736384736686419055298524862396799473664, 10067556742550107115247062221980737741184, 7566018479420387457857630946671621946816, 250270845195032230074264095160069882720, 173286581159122358912523025054857733936, 3530090551240008804435854378739159942, 2298273089724429172361720769983694055, 28966237799985711984331693035354744, 18033841597222665526797307801015180, 136200991851480339701727952415940, 82101334648667974579891775458810, 339170327404441280638325520984, 199688104766568244479139705980, 346060871401547756311157862, 200210600552828147661370775], [0, -60047837806541658463437230735853237633024, 0, -33369741090976583217740716963051308398592, 0, -3239537350237690091105302813972978443072, 0, -138283683002747593502755136004565159824, 0, -3176315381116064873338789709726693197, 0, -42235227375263661857820924817733257, 0, -332098957116204928345990160763778, 0, -1514390436249429079633618897186, 0, -3687971553150258167061489921, 0, -3701240537101493545783253], [0, 156288098797745245063055883287489138393088, 0, 86481873506557731474767753474810644463616, 0, 8676395530632321361793554972273649068032, 0, 382839349800472436520069213796808318784, 0, 9051020523449177721835247968625761424, 0, 123124481428295173942584040944498221, 0, 984878840499038787219994418783492, 0, 4548496388545692553789759981886, 0, 11181902569463184778985391060, 0, 11302110714735679635473341], [0, -24244918478947441021245712897205773283622912, 0, -13449774943388775506925322098877529727369216, 0, -1317109410863299598962976095493158704064512, 0, -56717491026505220960927230734516393393600, 0, -1312802631246926504637542608690968487792, 0, -17562698831876423820043913344275387799, 0, -138731991940756946637712262099617996, 0, -634783652976433794767906566229530, 0, -1549799964337629468243093550716, 0, -1558346050875267305097550919]];
    Rf_basisdens := [1, 1, 57579639647349195649389006725245304832, 57579639647349195649389006725245304832, 57579639647349195649389006725245304832, 3030507349860483981546789827644489728, 899681869489831182021703230081957888, 28789819823674597824694503362622652416, 57579639647349195649389006725245304832, 57579639647349195649389006725245304832, 57579639647349195649389006725245304832, 32388547301633922552781316282950483968, 3030507349860483981546789827644489728, 518216756826142760844501060527207743488, 489305261028270253253023236096, 345477837884095173896334040351471828992, 345477837884095173896334040351471828992, 2699045608469493546065109690245873664, 5822660189057783829713495062103457792, 518216756826142760844501060527207743488];
    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_304_e();"
function MakeCharacter_304_e()
    N := 304;
    order := 2;
    char_gens := [191, 229, 97];
    v := [2, 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_304_e_Hecke();"
function MakeCharacter_304_e_Hecke(Kf)
    N := 304;
    order := 2;
    char_gens := [191, 229, 97];
    char_values := [[1, 0, 0, 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, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 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+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 := 5;
    raw_aps := [[0, 0, 0, 0, 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, 0, 0, 0, 0], [0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [11, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [30, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0], [-29, 0, 0, -3, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, -1, -1, 0, 0, 0, 0, -1], [0, -20, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, -2, -2, -1, 1, 2, 0, -1], [0, -16, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 2, 0, -1, -1, 1, 0, 1, -1], [0, 26, 0, 0, 0, 0, 0, 0, 0, 0, -2, 1, -2, 4, 2, -1, 1, -1, -2, 0], [61, 0, 1, 17, 0, 4, -2, 3, 1, 2, 0, 0, 0, 0, 0, -2, -2, 0, 0, 0], [191, 0, -4, 1, 0, -7, -6, 4, -2, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0], [0, 17, 0, 0, 0, 0, 0, 0, 0, 0, -10, -3, -2, 0, 0, -5, 5, 4, 1, 2], [0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 6, -1, 5, -2, 0, -1, 1, -5, 0, -1], [25, 0, 9, 38, -1, -20, 11, 3, 1, 0, 0, 0, 0, 0, 0, -4, -4, 0, 0, 0], [0, 85, 0, 0, 0, 0, 0, 0, 0, 0, -10, -1, -6, -14, 0, -5, 5, 0, 0, 3], [0, -70, 0, 0, 0, 0, 0, 0, 0, 0, 14, 3, -6, 10, 0, -1, 1, -4, -4, -1], [62, 0, -13, -42, -11, 18, -3, 6, 1, -2, 0, 0, 0, 0, 0, -2, -2, 0, 0, 0], [0, 36, 0, 0, 0, 0, 0, 0, 0, 0, -7, -6, -2, 20, -14, -2, 2, 6, 8, -2], [834, 0, -27, -2, -12, -30, 33, -1, -3, 2, 0, 0, 0, 0, 0, -3, -3, 0, 0, 0], [0, 84, 0, 0, 0, 0, 0, 0, 0, 0, -8, -13, -2, -8, -20, 1, -1, 9, 2, -6], [0, -130, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 3, -23, -7, -7, 7, 16, 3, 1], [-1440, 0, 60, 46, 12, 114, 40, -4, 6, -2, 0, 0, 0, 0, 0, -6, -6, 0, 0, 0], [0, -106, 0, 0, 0, 0, 0, 0, 0, 0, 26, 13, -10, 22, 26, -1, 1, 0, 4, 5], [0, -63, 0, 0, 0, 0, 0, 0, 0, 0, 10, -15, -13, -6, -10, 5, -5, 1, 8, 5], [0, -399, 0, 0, 0, 0, 0, 0, 0, 0, -7, -12, 1, 9, -3, -12, 12, 22, 2, -7], [0, -324, 0, 0, 0, 0, 0, 0, 0, 0, 16, 15, -2, 16, 2, 9, -9, -1, 0, 2], [0, 300, 0, 0, 0, 0, 0, 0, 0, 0, 7, 15, -22, -50, 8, 9, -9, 0, -8, -13], [1243, 0, -105, 231, -24, 0, -58, -15, 9, -6, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0], [-1320, 0, 73, 216, -3, -170, 25, -8, -7, -6, 0, 0, 0, 0, 0, 22, 22, 0, 0, 0], [-2839, 0, 54, 67, -32, 210, 43, 18, -10, -6, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0], [1252, 0, -42, -363, -78, 168, 46, -12, -6, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -496, 0, 0, 0, 0, 0, 0, 0, 0, 20, -20, 20, 8, 10, 16, -16, -8, 16, 0], [-1585, 0, 43, 239, -37, 158, 27, -27, -1, -10, 0, 0, 0, 0, 0, -2, -2, 0, 0, 0], [-3792, 0, 196, -310, 92, -294, -12, 48, 2, -4, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0], [0, -308, 0, 0, 0, 0, 0, 0, 0, 0, 37, 2, -12, -52, 2, 8, -8, 4, 0, 30], [0, 799, 0, 0, 0, 0, 0, 0, 0, 0, 73, 34, -22, -9, -59, 22, -22, -40, 6, 5], [0, -102, 0, 0, 0, 0, 0, 0, 0, 0, -26, 16, 19, -80, 66, 17, -17, 15, -8, -28], [0, 611, 0, 0, 0, 0, 0, 0, 0, 0, -55, 4, 32, 5, 129, -36, 36, 14, -2, 13], [-2594, 0, -92, 172, 84, 115, -16, 64, 14, 4, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0], [0, 1450, 0, 0, 0, 0, 0, 0, 0, 0, -45, -10, 5, -67, 51, 50, -50, 23, 19, -23], [6763, 0, -95, -333, 153, -284, 9, 11, -13, 16, 0, 0, 0, 0, 0, -8, -8, 0, 0, 0], [722, 0, -129, -34, -88, -297, 17, -27, -35, 6, 0, 0, 0, 0, 0, 14, 14, 0, 0, 0], [0, 1873, 0, 0, 0, 0, 0, 0, 0, 0, -88, -22, -93, -72, 152, 6, -6, 31, 24, -2], [0, -2062, 0, 0, 0, 0, 0, 0, 0, 0, -125, -14, -66, 40, -214, 20, -20, 10, 12, -2], [0, -2537, 0, 0, 0, 0, 0, 0, 0, 0, 100, 15, -49, -6, 114, 35, -35, 5, -4, -29], [-6367, 0, -85, -218, -131, -86, -135, 45, 13, -62, 0, 0, 0, 0, 0, -34, -34, 0, 0, 0], [-6360, 0, 6, 429, -81, 636, -149, -34, 9, 4, 0, 0, 0, 0, 0, 60, 60, 0, 0, 0], [6088, 0, -285, -708, 180, -405, 17, -55, -15, -4, 0, 0, 0, 0, 0, 24, 24, 0, 0, 0], [0, 2130, 0, 0, 0, 0, 0, 0, 0, 0, 110, 15, 28, 42, -50, 13, -13, 33, -22, 4], [5065, 0, 205, 945, 60, -230, -142, 35, -49, -34, 0, 0, 0, 0, 0, 34, 34, 0, 0, 0], [0, 1936, 0, 0, 0, 0, 0, 0, 0, 0, 155, -35, -105, 127, 321, 103, -103, -4, -3, -9], [1941, 0, 302, -1945, 132, 89, -2, 30, 46, 11, 0, 0, 0, 0, 0, -13, -13, 0, 0, 0], [0, 2976, 0, 0, 0, 0, 0, 0, 0, 0, 85, -49, -58, -102, 235, -63, 63, 82, 25, 1], [-1205, 0, 286, 1069, 68, 70, 246, -66, -4, 71, 0, 0, 0, 0, 0, -36, -36, 0, 0, 0], [1249, 0, -215, -588, -201, -110, -185, -3, 55, 26, 0, 0, 0, 0, 0, -106, -106, 0, 0, 0], [0, 446, 0, 0, 0, 0, 0, 0, 0, 0, -24, 100, 34, -94, 318, 40, -40, -92, -36, 32], [1811, 0, 379, 735, -72, -38, 220, -195, 37, 32, 0, 0, 0, 0, 0, -28, -28, 0, 0, 0], [0, 530, 0, 0, 0, 0, 0, 0, 0, 0, -39, 79, 29, -266, -381, -63, 63, -18, 17, -7], [0, 4166, 0, 0, 0, 0, 0, 0, 0, 0, 152, 64, 5, -200, -398, -71, 71, -35, 52, 0], [6854, 0, 25, -106, -108, -71, -347, 187, 11, 76, 0, 0, 0, 0, 0, -56, -56, 0, 0, 0], [-10202, 0, -63, 135, 88, -256, -200, 168, -16, 72, 0, 0, 0, 0, 0, -12, -12, 0, 0, 0], [0, 5550, 0, 0, 0, 0, 0, 0, 0, 0, -143, 51, -43, 84, -241, -43, 43, 38, -31, -107], [0, 2557, 0, 0, 0, 0, 0, 0, 0, 0, -14, -67, 94, 18, 618, -51, 51, -80, -4, 29], [0, -9128, 0, 0, 0, 0, 0, 0, 0, 0, 77, -7, -27, -181, 625, -21, 21, 80, 33, -55], [9509, 0, -814, 2027, -12, -142, -59, 210, -8, -72, 0, 0, 0, 0, 0, 32, 32, 0, 0, 0], [-2320, 0, 506, -2179, -64, -220, -140, -120, 72, -68, 0, 0, 0, 0, 0, -108, -108, 0, 0, 0], [4219, 0, -672, 4, 93, 288, 533, -121, -141, -40, 0, 0, 0, 0, 0, 108, 108, 0, 0, 0], [-4020, 0, 598, 798, -12, 397, 148, 38, 20, -80, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0], [-21892, 0, 217, 452, 4, -710, -451, -189, -27, -64, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0], [0, -1532, 0, 0, 0, 0, 0, 0, 0, 0, 407, -1, -57, 44, 175, -23, 23, -220, -57, 59], [0, -5997, 0, 0, 0, 0, 0, 0, 0, 0, -24, 60, -3, 148, 756, -48, 48, -27, 72, 120], [0, 6394, 0, 0, 0, 0, 0, 0, 0, 0, -157, -100, -52, 284, -926, 94, -94, 204, -52, -56], [-35539, 0, -35, 452, -105, 1126, 807, 101, -61, -18, 0, 0, 0, 0, 0, 34, 34, 0, 0, 0], [14677, 0, 615, -1424, -25, 1016, -865, -153, -47, -12, 0, 0, 0, 0, 0, -32, -32, 0, 0, 0], [0, 6226, 0, 0, 0, 0, 0, 0, 0, 0, -173, -74, -173, 127, -1175, 98, -98, 5, 109, 153], [0, 4984, 0, 0, 0, 0, 0, 0, 0, 0, 145, 68, 361, -175, 1391, -64, 64, 23, 29, -33], [-48406, 0, 99, 1402, -204, -150, -201, -223, -9, 90, 0, 0, 0, 0, 0, 57, 57, 0, 0, 0], [0, 9593, 0, 0, 0, 0, 0, 0, 0, 0, 302, 43, 242, 130, 1042, -51, 51, -164, -65, -42], [0, 10704, 0, 0, 0, 0, 0, 0, 0, 0, 288, 62, 0, -252, 512, 202, -202, -92, 8, 70], [0, 160, 0, 0, 0, 0, 0, 0, 0, 0, -678, -181, -58, -4, 366, -7, 7, 347, 112, -104], [0, 8004, 0, 0, 0, 0, 0, 0, 0, 0, 137, 27, -272, 366, 1508, 39, -39, -10, 8, -105], [-25157, 0, -1656, -1083, 24, -1086, 135, 20, 150, -50, 0, 0, 0, 0, 0, 198, 198, 0, 0, 0], [0, -12372, 0, 0, 0, 0, 0, 0, 0, 0, 68, -40, -150, -470, -30, 156, -156, 134, -134, -188], [-64678, 0, -107, 614, 361, 1392, 881, 216, 39, -64, 0, 0, 0, 0, 0, -20, -20, 0, 0, 0], [-22439, 0, 209, -1198, 129, -2848, 333, 75, 139, -100, 0, 0, 0, 0, 0, 152, 152, 0, 0, 0], [22521, 0, -242, 3635, 600, 829, 670, -210, -110, -253, 0, 0, 0, 0, 0, 175, 175, 0, 0, 0], [-63957, 0, 1051, 1955, -300, 1252, 144, 201, -121, -84, 0, 0, 0, 0, 0, 136, 136, 0, 0, 0], [79528, 0, -1275, -1304, 168, 2430, 209, -217, -195, 32, 0, 0, 0, 0, 0, 321, 321, 0, 0, 0], [0, -7476, 0, 0, 0, 0, 0, 0, 0, 0, -196, -159, -374, -830, -308, -57, 57, 204, 104, -35], [40570, 0, -414, 5704, -840, -1638, 338, -230, 156, 106, 0, 0, 0, 0, 0, 189, 189, 0, 0, 0], [42261, 0, -1261, 2597, -296, -2350, 510, -351, -41, 244, 0, 0, 0, 0, 0, -96, -96, 0, 0, 0], [-39881, 0, -1621, 5035, 672, 860, -565, -223, -71, -49, 0, 0, 0, 0, 0, 188, 188, 0, 0, 0], [0, -10795, 0, 0, 0, 0, 0, 0, 0, 0, 529, 64, 338, -189, 815, 376, -376, 22, 78, -75], [0, -672, 0, 0, 0, 0, 0, 0, 0, 0, -196, -167, 36, -248, -1828, 55, -55, -193, -66, 150], [0, 3219, 0, 0, 0, 0, 0, 0, 0, 0, -258, -96, 63, -244, -2532, 236, -236, -33, -24, 12], [-100988, 0, -322, 1951, -796, 2634, 100, -114, 90, 310, 0, 0, 0, 0, 0, -10, -10, 0, 0, 0], [0, -6182, 0, 0, 0, 0, 0, 0, 0, 0, -54, 260, 104, 248, -850, -351, 351, 72, -164, 44], [-103524, 0, -166, -2109, -252, 2738, 676, 246, -14, 134, 0, 0, 0, 0, 0, 302, 302, 0, 0, 0], [0, -3652, 0, 0, 0, 0, 0, 0, 0, 0, 424, -124, 153, 260, -120, 209, -209, -299, 36, 228], [0, -32, 0, 0, 0, 0, 0, 0, 0, 0, 507, -21, 43, -301, -1349, -31, 31, -52, 107, 291], [-110388, 0, -2001, 5380, -672, -1002, 1179, 645, 111, -144, 0, 0, 0, 0, 0, -41, -41, 0, 0, 0], [29687, 0, -122, 4007, -908, 3134, 1544, -579, 66, 50, 0, 0, 0, 0, 0, -194, -194, 0, 0, 0], [78057, 0, -594, -5633, 372, 1872, -197, 470, -144, -206, 0, 0, 0, 0, 0, 354, 354, 0, 0, 0], [99374, 0, 1806, -7008, -150, 3306, 258, -566, 60, 206, 0, 0, 0, 0, 0, 66, 66, 0, 0, 0], [0, 168, 0, 0, 0, 0, 0, 0, 0, 0, 227, 299, 180, -578, -2736, -69, 69, -190, 88, 79], [0, -16472, 0, 0, 0, 0, 0, 0, 0, 0, 410, 266, 186, 56, 474, -318, 318, -228, 186, 174], [0, -9026, 0, 0, 0, 0, 0, 0, 0, 0, 14, -643, 66, -2, 824, 15, -15, 544, 228, -119], [27928, 0, -336, -2157, 680, -5460, 1592, -876, -212, 180, 0, 0, 0, 0, 0, 156, 156, 0, 0, 0], [-109270, 0, -692, 627, -417, -2372, -1185, -156, -355, -284, 0, 0, 0, 0, 0, -32, -32, 0, 0, 0], [-149938, 0, 3452, 7168, -544, 1678, -836, -336, 78, 118, 0, 0, 0, 0, 0, 17, 17, 0, 0, 0], [175857, 0, -984, -2281, 132, -1253, 1086, 612, 72, -231, 0, 0, 0, 0, 0, -499, -499, 0, 0, 0], [0, -12894, 0, 0, 0, 0, 0, 0, 0, 0, -343, 79, 153, -89, 3059, -239, 239, -298, 117, -39], [142383, 0, -1761, 12743, -836, 1378, -1526, 213, -61, -366, 0, 0, 0, 0, 0, -154, -154, 0, 0, 0], [-149160, 0, -1895, -5492, -540, -491, -825, -329, -103, -128, 0, 0, 0, 0, 0, -56, -56, 0, 0, 0], [25965, 0, -191, 3500, -771, -4118, 61, -83, -55, 66, 0, 0, 0, 0, 0, 478, 478, 0, 0, 0], [0, -1319, 0, 0, 0, 0, 0, 0, 0, 0, 522, 396, -23, 200, 1012, -244, 244, 197, 332, 0], [0, -6116, 0, 0, 0, 0, 0, 0, 0, 0, -15, -235, -487, 486, 1437, 83, -83, -364, -83, -35], [0, -9902, 0, 0, 0, 0, 0, 0, 0, 0, -1525, -367, -591, 691, -3397, -393, 393, 436, 225, -53], [0, 12781, 0, 0, 0, 0, 0, 0, 0, 0, -247, -36, -983, 237, 335, 532, -532, 268, 136, 29], [0, -2628, 0, 0, 0, 0, 0, 0, 0, 0, 888, 306, 528, 204, 2436, 381, -381, -196, -288, 10], [57259, 0, -714, -5459, 372, -418, 27, 138, 258, -312, 0, 0, 0, 0, 0, -560, -560, 0, 0, 0], [135668, 0, -1650, -2704, 0, 5370, 176, -92, -138, -138, 0, 0, 0, 0, 0, 234, 234, 0, 0, 0], [-206524, 0, 1918, -2448, -40, 6890, -1584, -540, 134, 158, 0, 0, 0, 0, 0, -70, -70, 0, 0, 0], [197440, 0, 1440, -7094, -348, -1215, 712, -240, -264, -218, 0, 0, 0, 0, 0, 378, 378, 0, 0, 0], [-63872, 0, 1873, -8780, -264, 1663, 1777, -33, -71, -214, 0, 0, 0, 0, 0, -546, -546, 0, 0, 0], [-98125, 0, 1045, 4193, 63, -1306, -341, -1179, -473, -34, 0, 0, 0, 0, 0, 310, 310, 0, 0, 0], [248465, 0, -696, -9829, -68, -2192, -959, 204, 98, 438, 0, 0, 0, 0, 0, -634, -634, 0, 0, 0], [0, 460, 0, 0, 0, 0, 0, 0, 0, 0, 91, -431, -408, -46, 2890, 123, -123, 22, 128, -175], [0, -7170, 0, 0, 0, 0, 0, 0, 0, 0, -1268, -411, 44, 622, -3908, -565, 565, 490, -260, 201], [207195, 0, 1405, 3784, 279, 8102, -773, 351, -305, 38, 0, 0, 0, 0, 0, -54, -54, 0, 0, 0], [-203742, 0, -3667, 4058, 21, 5540, -795, -740, -17, 52, 0, 0, 0, 0, 0, -400, -400, 0, 0, 0], [-245440, 0, -1487, 666, -601, -4332, -189, 234, 425, -100, 0, 0, 0, 0, 0, -508, -508, 0, 0, 0], [0, -8168, 0, 0, 0, 0, 0, 0, 0, 0, 2387, -29, 655, 3060, -441, 981, -981, -864, 83, 427], [0, 6873, 0, 0, 0, 0, 0, 0, 0, 0, 172, -3, 89, 198, 3072, -719, 719, -241, -476, -251], [0, -18473, 0, 0, 0, 0, 0, 0, 0, 0, 77, -1066, -259, -1, -3287, 586, -586, 510, -52, -275], [-161039, 0, -258, -1869, -1224, -6054, -652, 579, 42, -546, 0, 0, 0, 0, 0, -198, -198, 0, 0, 0], [0, -9507, 0, 0, 0, 0, 0, 0, 0, 0, 1312, -150, -445, -216, 1466, 294, -294, -789, -320, 458], [322483, 0, 729, -4834, -435, -1296, -1771, 777, -93, 348, 0, 0, 0, 0, 0, 264, 264, 0, 0, 0], [-330226, 0, 1346, 4988, -1164, 4063, -2608, 294, 254, -434, 0, 0, 0, 0, 0, -294, -294, 0, 0, 0], [0, -9535, 0, 0, 0, 0, 0, 0, 0, 0, -750, 620, -290, 272, -2318, 276, -276, -350, -56, 360], [0, 30160, 0, 0, 0, 0, 0, 0, 0, 0, 43, -259, 739, 964, -795, -117, 117, 196, -355, -445], [0, -10872, 0, 0, 0, 0, 0, 0, 0, 0, -1354, -267, -664, 2018, -2936, 327, -327, -222, 48, -439], [135591, 0, 2337, -15339, -85, 2342, 767, -1023, 355, -138, 0, 0, 0, 0, 0, 390, 390, 0, 0, 0], [0, -42370, 0, 0, 0, 0, 0, 0, 0, 0, -1140, -522, -478, -2264, -3964, -758, 758, 1336, 94, -444], [403079, 0, 2299, -3773, 696, -8298, -1124, -99, -311, -604, 0, 0, 0, 0, 0, 552, 552, 0, 0, 0], [0, 4328, 0, 0, 0, 0, 0, 0, 0, 0, 1329, -463, -1066, -758, 2452, 1391, -1391, -72, 408, 573], [0, -10676, 0, 0, 0, 0, 0, 0, 0, 0, -846, 26, 566, 1015, 2550, 214, -214, -1000, -182, 82], [112258, 0, 1424, 4679, 1089, -3028, -2479, 592, -53, 52, 0, 0, 0, 0, 0, -256, -256, 0, 0, 0], [-366149, 0, -2450, -10971, -516, -1406, 91, 1098, -2, -16, 0, 0, 0, 0, 0, -184, -184, 0, 0, 0], [0, -36896, 0, 0, 0, 0, 0, 0, 0, 0, 278, -62, -446, 3396, 312, -360, 360, 774, -256, -422], [0, 28367, 0, 0, 0, 0, 0, 0, 0, 0, 2392, 46, 894, 556, -980, 426, -426, -694, -360, 470], [0, 8402, 0, 0, 0, 0, 0, 0, 0, 0, 196, 1269, 444, -34, 2158, 145, -145, 566, -68, -579], [150183, 0, 1799, 6099, -1540, 3108, -2153, -1035, 213, 211, 0, 0, 0, 0, 0, -248, -248, 0, 0, 0], [223816, 0, 1213, 1103, 870, 1108, 838, -86, -346, -508, 0, 0, 0, 0, 0, 316, 316, 0, 0, 0], [-282997, 0, -580, -95, 2144, -1774, -4760, -1407, -90, 118, 0, 0, 0, 0, 0, 398, 398, 0, 0, 0], [0, -34932, 0, 0, 0, 0, 0, 0, 0, 0, -130, -346, 1110, 1099, 2154, 282, -282, -572, -2, 290], [267624, 0, 2599, 18292, 1332, -3224, 1171, 721, 557, -252, 0, 0, 0, 0, 0, -389, -389, 0, 0, 0], [0, -18120, 0, 0, 0, 0, 0, 0, 0, 0, 2676, 639, -522, 2574, 1338, 1209, -1209, -865, 60, -422], [160382, 0, 3289, -9694, 168, -4, -4571, -321, -485, -790, 0, 0, 0, 0, 0, -17, -17, 0, 0, 0], [0, -21534, 0, 0, 0, 0, 0, 0, 0, 0, 2030, 294, -704, 1032, 2206, 925, -925, -708, -1052, 66], [0, -26488, 0, 0, 0, 0, 0, 0, 0, 0, 587, 816, -171, 703, 507, -16, 16, -1037, -247, 513], [0, 21302, 0, 0, 0, 0, 0, 0, 0, 0, 1410, -462, 256, -496, -3154, -4, 4, 860, 212, -738], [0, -41060, 0, 0, 0, 0, 0, 0, 0, 0, 625, -226, -476, -260, -616, -60, 60, 1592, 8, 558], [-419627, 0, -771, -6832, 2383, -1686, -1841, 225, -1081, -534, 0, 0, 0, 0, 0, 182, 182, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_304_e_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_304_5_e_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_304_5_e_f(:prec:=20)
    chi := MakeCharacter_304_e();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 5));
    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_304_5_e_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_304_5_e_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_304_e();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,5,sign)));
    Vf := Kernel([<3,R![34273490123096064, 0, 34336742150504448, 0, 10365057927217152, 0, 915101881952256, 0, 37911701888064, 0, 861580608848, 0, 11414409521, 0, 89661524, 0, 408854, 0, 996, 0, 1]>,<5,R![1386394827776, -692665586688, 49729423104, 10460647104, -1014011772, -21809988, 3312217, 6348, -3478, 0, 1]>],Snew);
    return Vf;
end function;