
// Make newform 490.4.c.g in Magma, downloaded from the LMFDB on 13 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_490_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_490_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_490_4_c_g();".
// 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_490_4_c_g();".
// 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 := [9871083181584, 0, 52488428698656, 0, 30509282328120, 0, 5129420990112, 0, 407198911753, 0, 18162509334, 0, 488971671, 0, 8097428, 0, 80439, 0, 438, 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], [-66716324514464981040, 0, -65961169980075538992, 0, -6936866418341702232, 0, -171029525946098840, 0, 7792812480524373, 0, 582862578889557, 0, 15229196603546, 0, 201019280850, 0, 1334144649, 0, 3519121, 0], [9035680095770923897776, 0, 45280968478575078894192, 0, 24793459000244591618376, 0, 3618158633470795065376, 0, 235448611132958744575, 0, 8191457442496945481, 0, 162872092562234982, 0, 1850926325197018, 0, 11148705388355, 0, 27474940397, 0], [9700936205101945122384, 0, -44855136289918877325552, 0, -24793459000244591618376, 0, -3618158633470795065376, 0, -235448611132958744575, 0, -8191457442496945481, 0, -162872092562234982, 0, -1850926325197018, 0, -11148705388355, 0, -27474940397, 0], [2803325955756023909288016, 0, 13440341697726294947441232, 0, 7466505282052453231385856, 0, 1104754814763122332553996, 0, 72875990201431312174155, 0, 2567941764735836058906, 0, 51645761019834045082, 0, 592796271988370508, 0, 3601097196816435, 0, 8937738269222, 0], [0, 79564711446692546532111504, 0, -43765656858364067908245792, 0, -55382807348948544952072896, 0, -8915452589701633015179236, 0, -599294636424089867043345, 0, -21166268205293738866191, 0, -424371048320372557522, 0, -4847357105849586378, 0, -29294618209322925, 0, -72357165941987], [0, 153892016647877905531948944, 0, -43765656858364067908245792, 0, -55382807348948544952072896, 0, -8915452589701633015179236, 0, -599294636424089867043345, 0, -21166268205293738866191, 0, -424371048320372557522, 0, -4847357105849586378, 0, -29294618209322925, 0, -72357165941987], [-9583111141164865199155051738224, 5062725214167735454923503641296, 31866339631494927437280383623632, 4982881924024064777702450078352, 26168204313533426645650387185000, 1276549220539013296724925161544, 4081325203872347924746589731992, 141411276714694430076538434776, 271332694649150882087883899337, 8038291072160653019164886061, 9522049939290991493596027377, 257967153510945097631913237, 190077217732005286487580738, 4858167860850037916632426, 2164272546755920528428570, 53084468586637402345794, 13048960582485602413677, 310410608481424128513, 32174396553452540157, 747729531899914481], [-120770960542128271776178959696, -5062725214167735454923503641296, 12866180846045187715307751083760, -4982881924024064777702450078352, 8559007338216626215125805963512, -1276549220539013296724925161544, 1311410695478102313914744161128, -141411276714694430076538434776, 87477933353878875831446140875, -8038291072160653019164886061, 3092453634234454589120517891, -257967153510945097631913237, 62174009551170265521316326, -4858167860850037916632426, 712140143055663606915150, -53084468586637402345794, 4313418634810582656759, -310410608481424128513, 10671886373794286247, -747729531899914481], [30190683399685737148805121360, -43381736175327171844097552400, 268238432807327565473866719408, -25476762251733345881904358584, 148728659262733124081538675840, -6573404064484722190084619544, 21889585684091646350494156956, -724414518645922144574778938, 1435955309913253010826530451, -40536280814212360632068001, 50328346246231099971305544, -1280547651885244345102515, 1007244184616745279288066, -23819767328326912878130, 11511197224234804064208, -258071064172819617312, 69665037899307522099, -1501161054695456181, 172354733748096180, -3605691086486507], [-4508622321332536674218608923600, -2990654023021862304453232519152, -12562085480852488716098900534160, -4348499697332115610683420882864, -5765923245522075567505962565320, -1628183432558401961718843686232, -801594683332982061079136225560, -215052791192717224875221745192, -51122833735139451978793709565, -13520752941937733358699562095, -1761013009985915409570822645, -464670230756972514608316327, -34824801578292848282033450, -9208565476483520364626574, -394477364896999570236450, -104701651026827663180406, -2371035120856651345905, -631953202962280131915, -5834495638374135025, -1561346476630253979], [0, 347677116907632031152, 0, 87552510851994957936, 0, -71219610758033932776, 0, -14318277637598468888, 0, -1034004059569597533, 0, -37809311648935845, 0, -773368268872522, 0, -8946618728514, 0, -54531944529, 0, -135496097], [6702548001727740875439823905552, -7166607040290656401435841780880, 25276218644301326931802226343120, -8932086135743914813480487257680, 12928388537391426458821846829736, -2976651612520482120610639357224, 1858097372738524248576076418904, -376559436088142788814625588440, 120423217279648615883913634785, -23175998211055333957058470953, 4187746332096100408916492913, -786281003737800266615456793, 83324207143024405183708338, -15445812058501280587344802, 947786118873331158812250, -174501068902986371898378, 5713261998690268347237, -1048178404923442454829, 14087686644458345661, -2580142437588170597], [850768096466309627551306433184, 429886194585087256006821902640, 2699852426229368228561122978368, 461512052865502484382256736880, 1500823916096959964830028181264, 190201097275677529175955578040, 222257095324101073423449214464, 26393272711016798297597651360, 14598387950454273528579410730, 1700310580256780588405261955, 511185856969127331208776924, 59186426011920342330915945, 10212691485268608097667388, 1180781034974525038007230, 116483260531890065055552, 13468770006206876953050, 703583463179258069850, 81392925155257687575, 1737652459256144148, 201115204639732205], [850768096466309627551306433184, -429886194585087256006821902640, 2699852426229368228561122978368, -461512052865502484382256736880, 1500823916096959964830028181264, -190201097275677529175955578040, 222257095324101073423449214464, -26393272711016798297597651360, 14598387950454273528579410730, -1700310580256780588405261955, 511185856969127331208776924, -59186426011920342330915945, 10212691485268608097667388, -1180781034974525038007230, 116483260531890065055552, -13468770006206876953050, 703583463179258069850, -81392925155257687575, 1737652459256144148, -201115204639732205], [33282794566070404972920782928, 119871396263116130639885847216, 210181559098500094880747587248, 3179520147345662488259012976, 116804302454454525662309067528, -21315518524337854205897331480, 17300978770204371675373306152, -3779182133388357963227130256, 1142992302650001781806711429, -264110841478590013950131289, 40341592758497575764509559, -9554402494572406802764659, 812636156208021442903650, -194804641674566186427578, 9341474071841414576766, -2252554356387159685470, 56824388879605953921, -13736617058595155589, 141204334144812531, -34156106883437071], [9419724131204790168559895375856, 17441320867300122528577090244976, 65835756305930824454386463207472, 18815745611525753377489518308592, 38164979115400633997726562244056, 5425851907011881243730400927416, 5665678642882429286328144540456, 642656600459251385431226211256, 372476330498460337896188910735, 38128303617445047404814927855, 13054932381867152370115879071, 1262507391606559407766308951, 261004415420823055033831662, 24366027693552337502698382, 2978149076191963781023878, 271576364145687352544838, 17990723850334296653835, 1614042918125600904555, 44428081807746131667, 3939859458080831947], [-60381366799371474297610242720, -200055848563180550361527704656, -536476865614655130947733438816, -156855849907759570796851626624, -297457318525466248163077351680, -53908341309665365592647824888, -43779171368183292700988313912, -6981509767347178727797924220, -2871910619826506021653060902, -433421113400589347104978713, -100656692492462199942611088, -14732662636599013436005791, -2014488369233490558576132, -289124627318044312436842, -23022394448469608128416, -3259333223529255313554, -139330075798615044198, -19528137863200476213, -344709467496192360, -47949467762574803], [-33282794566070404972920782928, 50329728853636562189682054048, -210181559098500094880747587248, -58697511718753124183544517728, -116804302454454525662309067528, -44385749917009923587921155776, -17300978770204371675373306152, -6843233121173439957347324240, -1142992302650001781806711429, -455574739124544430952601546, -40341592758497575764509559, -16059581782595582856107262, -812636156208021442903650, -322091628989125428924964, -9341474071841414576766, -3682377112807995908748, -56824388879605953921, -22274259407827902066, -141204334144812531, -55057783340214086], [-19201761144035965152448327630800, 4763733892840592534365391191824, -93072970073726085762849673163664, -11156089124901114416026865006640, -50652936216151389350075706597576, -8697057683419591460148417279768, -7397125199330551630912056597528, -1369505481539336015121844131656, -482518860935284048298039398845, -92267582776449940874236675791, -16832503861030940972870204469, -3278627597129714903370120231, -335486802188135313503714346, -66154462057136099687273230, -3819877723216936741302306, -760048814043537670795926, -23041191796236845337393, -4616500874163817965483, -56840504494109404593, -11451021667872373595]];
    Rf_basisdens := [1, 5347553315260584960, 425832188656201568640, 425832188656201568640, 28530756639965505098880, 74327305201185358999837440, 37163652600592679499918720, 278876049114847466967390074880, 278876049114847466967390074880, 829988241413236508831518080, 92958683038282488989130024960, 7607556384043553280, 139438024557423733483695037440, 9959858896958838105978216960, 9959858896958838105978216960, 1659976482826473017663036160, 139438024557423733483695037440, 1659976482826473017663036160, 1659976482826473017663036160, 278876049114847466967390074880];
    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_490_c();"
function MakeCharacter_490_c()
    N := 490;
    order := 2;
    char_gens := [197, 101];
    v := [1, 2];
    // 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_490_c_Hecke();"
function MakeCharacter_490_c_Hecke(Kf)
    N := 490;
    order := 2;
    char_gens := [197, 101];
    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]];
    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 := 4;
    raw_aps := [[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, 1, 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, 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], [5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -1, 0, 0, 1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1], [0, 0, 1, 0, 0, 1, 0, 0, -1, 0, -1, -1, 0, 0, 0, 0, 1, 0, 0, 2], [0, -1, 3, 0, 0, -1, 0, 1, 2, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, -1, 1, 0, -19, 0, 0, 0, 0, 0, 0, 1, -1, -1, 0, 1, 1, 0], [-11, 0, 0, 1, 0, 0, -2, 0, 0, 2, 0, 0, 0, -2, 0, -1, 0, -2, 1, 0], [0, 2, -3, 0, 0, -6, 0, -3, 9, 0, 4, 0, -2, 0, 0, 0, 2, 0, 0, 0], [1, 0, 0, -1, 1, 0, 69, 0, 0, 2, 0, 0, 0, -4, 4, -3, 0, 3, -1, 0], [0, 7, -17, 0, 0, -5, 0, 0, 8, 0, 4, 0, -3, 0, 0, 0, 1, 0, 0, 0], [-4, 0, 0, 4, -4, 0, -45, 0, 0, 5, 0, 0, 0, 1, -1, 3, 0, 1, -5, 0], [0, 0, -2, 0, 0, 5, 0, 0, -4, 0, 11, -5, 9, 0, 0, 0, -3, 0, 0, -5], [1, 0, 0, -1, 1, 0, -45, 0, 0, -6, 0, 0, 0, 5, -5, -3, 0, -5, -1, 0], [0, -25, -3, 0, 0, -8, 0, 2, 7, 0, 9, 0, -10, 0, 0, 0, -1, 0, 0, 0], [0, -24, -26, 0, 0, -3, 0, 8, -7, 0, 9, 0, -15, 0, 0, 0, -6, 0, 0, 0], [-11, 0, 0, 11, -11, 0, 97, 0, 0, 0, 0, 0, 0, 7, -7, 6, 0, -11, -16, 0], [-96, 0, 0, 14, -2, 0, 6, 0, 0, -6, 0, 0, 0, -6, -12, 3, 0, 6, -3, 0], [0, 0, -3, 0, 0, 42, 0, 0, -17, 0, 14, -11, 11, 0, 0, 0, 0, 0, 0, -3], [-321, 0, 0, -4, 3, 0, 2, 0, 0, -2, 0, 0, 0, -11, -13, 1, 0, 2, -1, 0], [0, 0, 9, 0, 0, 47, 0, 0, -6, 0, 3, 13, 12, 0, 0, 0, 4, 0, 0, 13], [0, 19, -2, 0, 0, -7, 0, 9, -5, 0, 14, 0, -21, 0, 0, 0, -7, 0, 0, 0], [0, 0, 4, 0, 0, 18, 0, 0, 7, 0, -9, -7, -5, 0, 0, 0, 2, 0, 0, 6], [0, 52, -5, 0, 0, -10, 0, -2, 23, 0, 5, 0, 0, 0, 0, 0, 5, 0, 0, 0], [0, 0, -3, 0, 0, -46, 0, 0, 42, 0, 3, -7, 0, 0, 0, 0, -16, 0, 0, -19], [-2, 0, 0, 2, -2, 0, -14, 0, 0, -8, 0, 0, 0, 4, -4, 18, 0, -10, 14, 0], [-179, 0, 0, -25, 2, 0, -6, 0, 0, 6, 0, 0, 0, 8, 14, -3, 0, -6, 3, 0], [13, 0, 0, -13, 13, 0, -290, 0, 0, 11, 0, 0, 0, -10, 10, -4, 0, 24, 22, 0], [17, 0, 0, -17, 17, 0, 265, 0, 0, 10, 0, 0, 0, 17, -17, -5, 0, 27, 29, 0], [0, 33, -71, 0, 0, -8, 0, -34, -11, 0, 3, 0, 2, 0, 0, 0, 5, 0, 0, 0], [-6, 0, 0, 6, -6, 0, 47, 0, 0, 19, 0, 0, 0, 4, -4, 33, 0, 13, 21, 0], [0, 15, 47, 0, 0, 36, 0, 44, -55, 0, -15, 0, -6, 0, 0, 0, -21, 0, 0, 0], [-1388, 0, 0, -26, 24, 0, 12, 0, 0, -12, 0, 0, 0, 10, -2, 6, 0, 12, -6, 0], [-417, 0, 0, 20, 31, 0, -12, 0, 0, 12, 0, 0, 0, -37, -25, -6, 0, -12, 6, 0], [0, 0, 6, 0, 0, 213, 0, 0, -61, 0, 19, 24, 25, 0, 0, 0, 16, 0, 0, 22], [-13, 0, 0, 13, -13, 0, -280, 0, 0, 25, 0, 0, 0, 10, -10, 13, 0, 12, -13, 0], [0, 0, -1, 0, 0, 120, 0, 0, -62, 0, 31, -33, 30, 0, 0, 0, 10, 0, 0, 9], [0, 0, -27, 0, 0, -215, 0, 0, -101, 0, 2, -38, -25, 0, 0, 0, 24, 0, 0, -3], [-1546, 0, 0, 40, 2, 0, -16, 0, 0, 16, 0, 0, 0, -40, -24, -8, 0, -16, 8, 0], [0, 24, -98, 0, 0, -60, 0, -29, 124, 0, 29, 0, 2, 0, 0, 0, 31, 0, 0, 0], [-367, 0, 0, 54, 43, 0, 6, 0, 0, -6, 0, 0, 0, 27, 21, 3, 0, 6, -3, 0], [6, 0, 0, -6, 6, 0, -1265, 0, 0, -3, 0, 0, 0, -57, 57, -22, 0, 3, -10, 0], [13, 0, 0, -13, 13, 0, -49, 0, 0, -16, 0, 0, 0, -7, 7, 1, 0, -3, 27, 0], [0, -150, 13, 0, 0, 14, 0, -37, -33, 0, -20, 0, 26, 0, 0, 0, 6, 0, 0, 0], [-977, 0, 0, 18, 37, 0, 28, 0, 0, -28, 0, 0, 0, 25, -3, 14, 0, 28, -14, 0], [0, 0, 50, 0, 0, 115, 0, 0, -16, 0, -33, 171, 17, 0, 0, 0, 33, 0, 0, 83], [0, 0, -24, 0, 0, 381, 0, 0, 20, 0, -122, -26, -146, 0, 0, 0, 26, 0, 0, 2], [0, 192, -80, 0, 0, 104, 0, 47, -144, 0, -75, 0, 46, 0, 0, 0, -29, 0, 0, 0], [-16, 0, 0, 16, -16, 0, -333, 0, 0, -13, 0, 0, 0, 58, -58, 21, 0, -29, -11, 0], [-1405, 0, 0, 58, -43, 0, -8, 0, 0, 8, 0, 0, 0, -23, -15, -4, 0, -8, 4, 0], [0, 149, 110, 0, 0, 60, 0, 26, -100, 0, -38, 0, 16, 0, 0, 0, -22, 0, 0, 0], [0, 217, 259, 0, 0, 16, 0, -18, 29, 0, -37, 0, 58, 0, 0, 0, 21, 0, 0, 0], [0, 0, -48, 0, 0, 453, 0, 0, -223, 0, 34, 169, -14, 0, 0, 0, 47, 0, 0, -1], [8, 0, 0, -8, 8, 0, -2026, 0, 0, -26, 0, 0, 0, -18, 18, -40, 0, -18, -24, 0], [0, -96, -136, 0, 0, -4, 0, -23, 122, 0, -43, 0, 90, 0, 0, 0, 47, 0, 0, 0], [0, -186, 219, 0, 0, 133, 0, -6, -310, 0, -76, 0, 19, 0, 0, 0, -57, 0, 0, 0], [-13, 0, 0, 13, -13, 0, 1109, 0, 0, 46, 0, 0, 0, -25, 25, 9, 0, 33, -17, 0], [-117, 0, 0, 1, -2, 0, -66, 0, 0, 66, 0, 0, 0, -71, -5, -33, 0, -66, 33, 0], [0, 0, 52, 0, 0, 121, 0, 0, 188, 0, 2, -96, 54, 0, 0, 0, -46, 0, 0, 6], [0, 0, -11, 0, 0, -185, 0, 0, 33, 0, -74, 342, -85, 0, 0, 0, 10, 0, 0, -1], [0, 0, -26, 0, 0, 113, 0, 0, 204, 0, -20, -170, -46, 0, 0, 0, -70, 0, 0, -96], [0, -142, 131, 0, 0, 55, 0, 36, 44, 0, -76, 0, 97, 0, 0, 0, 21, 0, 0, 0], [0, 0, -9, 0, 0, -165, 0, 0, 121, 0, -7, -253, -16, 0, 0, 0, -41, 0, 0, -50], [-58, 0, 0, 58, -58, 0, -454, 0, 0, 30, 0, 0, 0, -8, 8, 121, 0, -28, 5, 0], [-4140, 0, 0, 108, -8, 0, 60, 0, 0, -60, 0, 0, 0, -37, -97, 30, 0, 60, -30, 0], [45, 0, 0, -45, 45, 0, -161, 0, 0, -74, 0, 0, 0, 64, -64, -11, 0, -29, 79, 0], [-83, 0, 0, 83, -83, 0, 300, 0, 0, 45, 0, 0, 0, 126, -126, 173, 0, -38, 7, 0], [0, -154, -137, 0, 0, 102, 0, 6, -333, 0, -23, 0, -56, 0, 0, 0, -79, 0, 0, 0], [0, 0, 39, 0, 0, 597, 0, 0, -105, 0, 3, -241, 42, 0, 0, 0, 47, 0, 0, 86], [2280, 0, 0, -30, -58, 0, -56, 0, 0, 56, 0, 0, 0, 0, 56, -28, 0, -56, 28, 0], [0, 0, 77, 0, 0, -124, 0, 0, 366, 0, 143, 151, 220, 0, 0, 0, -144, 0, 0, -67], [100, 0, 0, -100, 100, 0, -1366, 0, 0, -122, 0, 0, 0, -104, 104, -139, 0, -22, 61, 0], [2932, 0, 0, 12, 8, 0, 48, 0, 0, -48, 0, 0, 0, 33, -15, 24, 0, 48, -24, 0], [0, 0, 35, 0, 0, -39, 0, 0, 266, 0, 90, -68, 125, 0, 0, 0, -107, 0, 0, -72], [871, 0, 0, -21, 16, 0, 122, 0, 0, -122, 0, 0, 0, 192, 70, 61, 0, 122, -61, 0], [0, 0, 9, 0, 0, 377, 0, 0, 95, 0, 70, -44, 79, 0, 0, 0, -52, 0, 0, -43], [-2463, 0, 0, -107, 56, 0, 108, 0, 0, -108, 0, 0, 0, -44, -152, 54, 0, 108, -54, 0], [0, -131, -78, 0, 0, 11, 0, 175, -85, 0, 72, 0, -155, 0, 0, 0, -83, 0, 0, 0], [0, 283, 45, 0, 0, 24, 0, -166, -37, 0, -75, 0, 126, 0, 0, 0, 51, 0, 0, 0], [-5155, 0, 0, -127, -82, 0, -38, 0, 0, 38, 0, 0, 0, 15, 53, -19, 0, -38, 19, 0], [-3759, 0, 0, -46, 115, 0, 76, 0, 0, -76, 0, 0, 0, 171, 95, 38, 0, 76, -38, 0], [0, 0, 113, 0, 0, -402, 0, 0, 177, 0, -58, 221, 55, 0, 0, 0, -2, 0, 0, 111], [0, -70, -74, 0, 0, 25, 0, -83, -321, 0, 46, 0, -117, 0, 0, 0, -71, 0, 0, 0], [14, 0, 0, -14, 14, 0, 604, 0, 0, 132, 0, 0, 0, 18, -18, -84, 0, 146, -56, 0], [2103, 0, 0, -69, -26, 0, -98, 0, 0, 98, 0, 0, 0, -227, -129, -49, 0, -98, 49, 0], [-109, 0, 0, 109, -109, 0, 1764, 0, 0, 99, 0, 0, 0, -24, 24, 106, 0, -10, -112, 0], [0, 70, 214, 0, 0, 45, 0, 200, 287, 0, -89, 0, 133, 0, 0, 0, 44, 0, 0, 0], [118, 0, 0, -118, 118, 0, -2256, 0, 0, -112, 0, 0, 0, -56, 56, -290, 0, 6, -54, 0], [0, 0, 20, 0, 0, -291, 0, 0, 104, 0, -90, -148, -70, 0, 0, 0, 2, 0, 0, 22], [0, 284, -308, 0, 0, 379, 0, 165, -535, 0, -272, 0, 165, 0, 0, 0, -107, 0, 0, 0], [31, 0, 0, -31, 31, 0, 1913, 0, 0, -168, 0, 0, 0, -67, 67, -107, 0, -137, -45, 0], [-1463, 0, 0, -106, -109, 0, -104, 0, 0, 104, 0, 0, 0, -175, -71, -52, 0, -104, 52, 0], [7707, 0, 0, 212, -89, 0, 84, 0, 0, -84, 0, 0, 0, 13, -71, 42, 0, 84, -42, 0], [0, 0, -28, 0, 0, 799, 0, 0, 132, 0, -331, 199, -359, 0, 0, 0, 57, 0, 0, 29], [0, -212, -558, 0, 0, -296, 0, -47, 672, 0, 155, 0, -14, 0, 0, 0, 141, 0, 0, 0], [0, -409, 38, 0, 0, 285, 0, 127, -125, 0, -296, 0, 307, 0, 0, 0, 11, 0, 0, 0], [0, 0, 75, 0, 0, 901, 0, 0, 362, 0, -89, -127, -14, 0, 0, 0, -66, 0, 0, 9], [-3945, 0, 0, -115, -36, 0, -94, 0, 0, 94, 0, 0, 0, 5, 99, -47, 0, -94, 47, 0], [-86, 0, 0, 86, -86, 0, 2713, 0, 0, 61, 0, 0, 0, 179, -179, 191, 0, -25, 19, 0], [176, 0, 0, -176, 176, 0, 2358, 0, 0, -64, 0, 0, 0, 32, -32, -169, 0, 112, 183, 0], [0, 0, -57, 0, 0, 75, 0, 0, 198, 0, -105, -161, -162, 0, 0, 0, -50, 0, 0, -107], [1608, 0, 0, 134, 162, 0, 234, 0, 0, -234, 0, 0, 0, 53, -181, 117, 0, 234, -117, 0], [-1828, 0, 0, -190, 66, 0, 36, 0, 0, -36, 0, 0, 0, -175, -211, 18, 0, 36, -18, 0], [0, 0, 73, 0, 0, 607, 0, 0, -63, 0, 1, -103, 74, 0, 0, 0, 45, 0, 0, 118], [0, 0, -173, 0, 0, -611, 0, 0, -118, 0, -169, 39, -342, 0, 0, 0, 38, 0, 0, -135], [0, 0, 54, 0, 0, -1166, 0, 0, -227, 0, -391, -195, -337, 0, 0, 0, 224, 0, 0, 278], [5767, 0, 0, -98, -119, 0, -246, 0, 0, 246, 0, 0, 0, -1, 245, -123, 0, -246, 123, 0], [0, 523, -794, 0, 0, 201, 0, 123, -447, 0, -78, 0, -45, 0, 0, 0, -123, 0, 0, 0], [0, 0, 326, 0, 0, -287, 0, 0, 700, 0, -47, -161, 279, 0, 0, 0, -109, 0, 0, 217], [-68, 0, 0, 68, -68, 0, -2780, 0, 0, 414, 0, 0, 0, -69, 69, 115, 0, 346, -21, 0], [9, 0, 0, -9, 9, 0, 2057, 0, 0, 0, 0, 0, 0, -172, 172, -265, 0, 9, -247, 0], [0, 57, -297, 0, 0, 40, 0, -116, -21, 0, -85, 0, 130, 0, 0, 0, 45, 0, 0, 0], [-11365, 0, 0, -32, -29, 0, 210, 0, 0, -210, 0, 0, 0, 237, 27, 105, 0, 210, -105, 0], [3804, 0, 0, 438, 390, 0, 106, 0, 0, -106, 0, 0, 0, -127, -233, 53, 0, 106, -53, 0], [0, 0, -214, 0, 0, 557, 0, 0, 216, 0, 2, -92, -212, 0, 0, 0, -144, 0, 0, -358], [0, 0, 55, 0, 0, -83, 0, 0, 206, 0, -430, -32, -375, 0, 0, 0, 93, 0, 0, 148], [140, 0, 0, -140, 140, 0, 1920, 0, 0, -276, 0, 0, 0, 39, -39, 1, 0, -136, 281, 0], [-2835, 0, 0, 538, -33, 0, 72, 0, 0, -72, 0, 0, 0, -114, -186, 36, 0, 72, -36, 0], [0, 644, -121, 0, 0, -350, 0, -140, 417, 0, 281, 0, -212, 0, 0, 0, 69, 0, 0, 0], [-204, 0, 0, 204, -204, 0, 1201, 0, 0, 87, 0, 0, 0, 194, -194, 9, 0, -117, -399, 0], [0, 0, -20, 0, 0, 1198, 0, 0, -387, 0, -296, -56, -316, 0, 0, 0, 221, 0, 0, 201], [50, 0, 0, -50, 50, 0, 3382, 0, 0, -310, 0, 0, 0, -208, 208, -230, 0, -260, -130, 0], [0, -1037, -127, 0, 0, 455, 0, 5, -510, 0, -435, 0, 415, 0, 0, 0, -20, 0, 0, 0], [-1445, 0, 0, 43, -204, 0, -98, 0, 0, 98, 0, 0, 0, -98, 0, -49, 0, -98, 49, 0], [5013, 0, 0, -671, 80, 0, -58, 0, 0, 58, 0, 0, 0, -48, 10, -29, 0, -58, 29, 0], [0, 806, 623, 0, 0, 822, 0, -1, -1525, 0, -588, 0, 354, 0, 0, 0, -234, 0, 0, 0], [0, 0, 100, 0, 0, -658, 0, 0, 792, 0, -296, 386, -196, 0, 0, 0, -132, 0, 0, -32], [0, 0, -160, 0, 0, -1620, 0, 0, -405, 0, 116, 284, -44, 0, 0, 0, 43, 0, 0, -117], [5047, 0, 0, 434, -7, 0, -232, 0, 0, 232, 0, 0, 0, -240, -8, -116, 0, -232, 116, 0], [147, 0, 0, -147, 147, 0, 7563, 0, 0, 234, 0, 0, 0, -261, 261, -309, 0, 381, -15, 0], [-4377, 0, 0, -328, 219, 0, -208, 0, 0, 208, 0, 0, 0, -175, 33, -104, 0, -208, 104, 0], [22, 0, 0, -22, 22, 0, 1494, 0, 0, -70, 0, 0, 0, 135, -135, -91, 0, -48, -47, 0], [0, -797, -409, 0, 0, -253, 0, -324, 496, 0, 64, 0, 125, 0, 0, 0, 189, 0, 0, 0], [0, -435, 864, 0, 0, -115, 0, 155, -9, 0, 208, 0, -301, 0, 0, 0, -93, 0, 0, 0], [0, 0, -275, 0, 0, 949, 0, 0, 121, 0, -576, 24, -851, 0, 0, 0, 60, 0, 0, -215], [0, 0, -294, 0, 0, -2419, 0, 0, -456, 0, 192, -184, -102, 0, 0, 0, -10, 0, 0, -304], [0, 0, 36, 0, 0, 2216, 0, 0, -879, 0, -282, -354, -246, 0, 0, 0, 399, 0, 0, 435], [-14843, 0, 0, 43, -236, 0, -204, 0, 0, 204, 0, 0, 0, 74, 278, -102, 0, -204, 102, 0], [0, -1325, -487, 0, 0, -128, 0, 162, 539, 0, 45, 0, 38, 0, 0, 0, 83, 0, 0, 0], [-1591, 0, 0, -205, -344, 0, -90, 0, 0, 90, 0, 0, 0, 275, 365, -45, 0, -90, 45, 0], [175, 0, 0, -175, 175, 0, 3439, 0, 0, -130, 0, 0, 0, 151, -151, -168, 0, 45, 182, 0], [157, 0, 0, -157, 157, 0, -6175, 0, 0, -180, 0, 0, 0, -309, 309, -396, 0, -23, -82, 0], [0, 114, -697, 0, 0, -535, 0, -397, 468, 0, 425, 0, -315, 0, 0, 0, 110, 0, 0, 0], [0, -584, -402, 0, 0, -163, 0, 209, 1041, 0, -60, 0, 283, 0, 0, 0, 223, 0, 0, 0], [0, 0, 77, 0, 0, -838, 0, 0, 577, 0, 13, -1540, 90, 0, 0, 0, -171, 0, 0, -94], [0, 0, -30, 0, 0, -981, 0, 0, -1287, 0, 612, -67, 582, 0, 0, 0, 215, 0, 0, 185], [0, -291, -1257, 0, 0, -543, 0, 191, 962, 0, 467, 0, -391, 0, 0, 0, 76, 0, 0, 0], [-61, 0, 0, 61, -61, 0, 5253, 0, 0, 12, 0, 0, 0, 29, -29, -82, 0, -49, -204, 0], [-116, 0, 0, 116, -116, 0, 3042, 0, 0, 70, 0, 0, 0, -493, 493, 315, 0, -46, 83, 0], [0, 2521, -697, 0, 0, 14, 0, 55, -181, 0, 60, 0, -134, 0, 0, 0, -74, 0, 0, 0], [-102, 0, 0, 102, -102, 0, -1426, 0, 0, 186, 0, 0, 0, 484, -484, 450, 0, 84, 246, 0], [0, 0, -17, 0, 0, -2925, 0, 0, 1022, 0, 92, 470, 75, 0, 0, 0, -377, 0, 0, -394], [-227, 0, 0, 227, -227, 0, 379, 0, 0, 284, 0, 0, 0, -19, 19, 608, 0, 57, 154, 0], [-4420, 0, 0, 502, -186, 0, -68, 0, 0, 68, 0, 0, 0, -236, -168, -34, 0, -68, 34, 0], [-7431, 0, 0, -396, 213, 0, 66, 0, 0, -66, 0, 0, 0, -171, -237, 33, 0, 66, -33, 0], [0, 2297, -1553, 0, 0, -637, 0, -130, 1098, 0, 440, 0, -243, 0, 0, 0, 197, 0, 0, 0], [0, 0, -89, 0, 0, -419, 0, 0, -459, 0, 85, 943, -4, 0, 0, 0, 95, 0, 0, 6], [0, -468, 1352, 0, 0, -129, 0, 446, 989, 0, -9, 0, 147, 0, 0, 0, 138, 0, 0, 0], [365, 0, 0, -365, 365, 0, -5812, 0, 0, 21, 0, 0, 0, 374, -374, -519, 0, 386, 211, 0], [-175, 0, 0, 175, -175, 0, 7701, 0, 0, 372, 0, 0, 0, -247, 247, 572, 0, 197, 222, 0], [60, 0, 0, -60, 60, 0, 8080, 0, 0, 210, 0, 0, 0, -236, 236, -389, 0, 270, -269, 0], [0, -1743, 663, 0, 0, -386, 0, -422, 441, 0, 227, 0, -68, 0, 0, 0, 159, 0, 0, 0], [-452, 0, 0, 452, -452, 0, -5429, 0, 0, 125, 0, 0, 0, 130, -130, 519, 0, -327, -385, 0], [0, 0, 196, 0, 0, 375, 0, 0, 68, 0, -181, 335, 15, 0, 0, 0, 103, 0, 0, 299], [-10512, 0, 0, 128, 4, 0, 14, 0, 0, -14, 0, 0, 0, 184, 170, 7, 0, 14, -7, 0], [0, 0, 174, 0, 0, 1130, 0, 0, -269, 0, -316, -676, -142, 0, 0, 0, 253, 0, 0, 427]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_490_c_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_490_4_c_g();".
// 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_490_4_c_g(:prec:=20)
    chi := MakeCharacter_490_c();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    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_490_4_c_g();".
// 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_490_4_c_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_490_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![1411200, 0, 5017216, 0, 479776, 0, 15801, 0, 214, 0, 1]>,<19,R![-86627868800000000, 0, 563374160025600, 0, -700579963008, 0, 218838208, 0, -25424, 0, 1]>],Snew);
    return Vf;
end function;