
// Make newform 169.4.c.l in Magma, downloaded from the LMFDB on 16 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_169_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_169_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_169_4_c_l();".
// 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_169_4_c_l();".
// 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 := [16777216, -14680064, 32440320, -9093120, 28218112, -7349264, 13815033, -990441, 3391249, -318018, 490851, -21896, 39895, -2731, 2016, -106, 62, -4, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [26532704040712808988967908407987142656, -15551524690656007872693435388538519552, 25442412692851612676245942539730366464, -37123889665400960006571677425372898560, 18239349843222469179980755823126078576, -11462451787834029748669326514957129229, 4484831495997100413890099605106652605, -2975259901274323318341287929256404261, 833443895340636287258423298714167498, -385049642469343782162104038381925279, 68204039289190924930485302554573576, -32629038859958909128265112139223427, 4696131522316015973018378408613255, -1592996430633758348840090913039008, 162837708489280155176994192115058, -50166706932882848379697710395542, 4285297737447674527908968425076, -711249714637290827571578049685], [61316730759741599941227875747601842176, -206888464086963362638129792868208181248, -181946970896679484826970379040226437120, -211094523555935431670867532527198252928, 1281651065343614672492619944645992360, -138906095108859210342295021658387577809, -11271238373294049414542286460786924415, -36237782377887737370613009890898646913, 943096376032091177684321322291090122, -5664506154947605320093798591702205795, 15991046356927536036093631209045872, -467173678774801680744216537192156895, 21808037534339475936211492135295979, -24203285187629383122368504313775184, 939754939124052382883624930017082, -750127928141938797504226460309278, 44917119059773943942491776099932, -12651779194218067640766100124353], [2599087734976794519273894105830992156033024, 6522074138620945066585397055593793639030784, 2712727364491795489702095019789702470600704, 2258191324996135762071731931986683479328128, 690671849239127310309957336545395030292536, 1441813290609311053090549939103144498485989, 352690940965214664018349957675572965032619, 335959658732320175568039706610120108797269, 32514139657645504867248569306389928990958, 52717491362834119015154326272039276649055, 3433675407919571495164999244838388531408, 4173533399952083102198762591134908177803, -15354167051679635108738493354098018695, 217309089474140768403743756010528051344, -2808978745738213780637911694949231426, 6621642885397649298909767620564678134, -320614849714159981826179081453090700, 118007779678858866612478098179893141], [-56257437146803960534402804708263521415069696, 21703591305861043848356051644067338487726080, -35393540456660728824487845661347423286874112, 44353601303841539795601088045420380810715904, -25320970631828034751354836484029634027801872, 16068651465757069698985604779054391894068219, -6321928745140232164374799256562243954827211, 4194866195774517958733943979385199520405667, -1138210106839484370947919698266745309812422, 555163656240564885925941330061194001395001, -91835034505274786807365503827961305955896, 46534596203765692949143700690045800184565, -6345574889185206289952304908888729507729, 2275152098127642585649435081355885217376, -219881584713740791043545881041180226654, 70902572229780289878065138334737811162, -5849589827225077299988475096330329004, 1016307484260578505484980209366569651], [13825405354643063030064557956352133149753344, 9471183939750438403083172112141999268732928, 18836133515939225678523301287180653059319808, 4322832533597781869982749758187049612587904, 19146678982018916574314882128559135375756140, 1958246394653877459358060165299460799138889, 4783755701501548478332466022769625965511847, -217770343527850547124824440780029451613179, 809107364632082763713151759601291519829754, -46033455825647628850151305236526668137401, 64406356339012425982780122534488643512988, -7728871619479777457028918312336155090089, 3649426900716668087329815617121948271857, -413235241985539394670453079377967489592, 115442656865926015460897929129773065894, -15838978496990500064562355075524691018, 2413525906713471817358130585642181288, -177691654540904251311026442474551507], [74075717290491787695880247727153237983232, 1214589260097936271956688338238309316132864, 254802575768249803558222997396342205126656, -245070131911008950308452147251396178347904, 608089547363818674788543749726530118415312, -188595237743998451832473237141185779267105, 127342973514537594045025385106490861874705, -72474488554776367306129550789146990158265, 26647701266064860618579088398335655901906, -11572290921995019040471400842368493502811, 2012084543486787416423993516249225339784, -1075591498650541643639794277436875437743, 151690118676422500719495266250707329379, -56046049808463866129043206693162446176, 5246749590736422313598667412512079738, -1832422854018323615791356508410572654, 155254474042413323626490328654528356, -28139812436185648679237440776410409], [9097772444703935900792378768610487877763072, 788047500277438524211730672670244345495552, 10857074857319097234363075911204336655482880, 5516515428197706065710942696333710451645440, 8439830767309468805557333858306074830537033, 3267428414261633479044627729446492827709384, 2126333990222684040290325022056423568217568, 600724040878286286259192867449174011907063, 306532638805414133251070522221220719124545, 80644233898562337402479881898454561037523, 24042261272325099248793588819535593364335, 4918371168908491010320706212565092574660, 1025633998810678629429714589510037231437, 236508807988146513892700680252435625206, 27459915676943125788530355723516869956, 5970867959345733675058440589482295642, 208762668878921528318117901981632781, 126543990587135484431278081497488601], [-33369315757511301070812726371968962218950656, 63907562749483982777268337802484624061169664, -45233608156891968874802524856536244262379520, 51409467699972493238562180643771722320105728, -20938810689915491486132037300875465314673328, 19652173586414008578555301429370187925338533, -4505551816399528272767732367965737307768277, 4743082101359712049371294322411979819684797, -845369517032290016120165082415172976483898, 635518063228994775555517404603644648440167, -66572803851034804539013281741347473826568, 51635044008805966411747083060418263545963, -5275704376245447799859936703981860050959, 2538464679783797345560143763278040040224, -190428205265845402485314659171011695842, 78038453009644682719692071792251152998, -5708009226111751553667517509771323284, 1174879701303891867766139357917140013], [-14369516879043468653025303486590610729074688, -5749855363898295696247885635724054809960448, -16230860036109278134481850505909962348267520, -10319285628213579530710248568389862967276928, -9912478331455532601740400780271678901435178, -6356294989556584074344479434767795936427525, -2755989465187598295503495963177192997012187, -1341852249996864486539973456932659426203123, -353392775576513420512249746699519779260848, -196663888416885237906004605055053833487957, -29286431284736725064973198428459284626126, -14193726199362127888903410059943838516995, -875353039359605776741669412581871995459, -718209994068326062119446034878717794492, -17538951417583583968934665454829256742, -20688679229576576947600577417633267786, 549126297426276748488848303735312082, -384071564307516721592547461227563447], [11153916621750214171391831799148523168989184, -1710540694122861681881504124250024053178368, 2320528285141117853699148319743340293206016, 898878422583056771408729893412350759195648, 1466760687146123292328737178580157974312048, -1600619114644585114880807083406416314554637, -294306646182844919104799500940817593077827, -534193159827217602254681604792661366994725, 2564799438334923276865049303356877986250, -104389771652272883099542926166433106541983, -2877782553640734297079972844909505921272, -9132915465743580982422430022566338937219, 309969775247531561339975353595730218119, -499147698784537477280674978463382204064, 14243038048673131656517216561759800690, -15851895151229034138888112700673379734, 922917945235906094328772575013491572, -283386522853573915493505895465138069], [17294780962891408816821048740807625716269056, 26340775116206097293322381133251734017064960, 19340791810620906362792721102302808911878144, 12773823236491175899930875360103644176822400, 10188349469789344194362566389348438197108362, 7920139677272588326558062736761574808552559, 3197074129171623690606273159159324335901457, 1629617287281676494108938659688170253675469, 402026405885752536360289742783667585513660, 254799096655607790054337375718611570618563, 35873180562787452489345431329271645277950, 18947183886667039934824006641942726304953, 979548815676939611745034392641506027141, 984227546139020585727656098582400720764, 19048705181033080143211010801245792802, 28910570748270878212749344219370285398, -903210169940456487025043771200964538, 544108253089501070672719752439766769], [-63956989119658928877595847785747344167796736, 26272566816218076696135269843448631593402368, -39776635883462283136873623960877591603703808, 16051344637338108828113781253477304988439424, -27184387228200022824729924321474990615476272, 21625205686790869768410633167428690198856609, -2968051447120212142601522728161943368025745, 6400760175667716899922031217061085517921945, -802705174307464372727970285225939186043186, 1073363852919683529471361518377680305807547, -43802060754305513023589587213698003644456, 91648758037148187486624855518198847870127, -6202063625651382837081810878669539923139, 4812407387201767703872836279372860472096, -237176869929281004018956130692827318778, 150915309780882846586472963768918625966, -9779844476526703698583236030022668100, 2526101201559938792790164790670253897], [18032768319747167911601667131812467337330688, 8864023191813075697570211578971510434906112, 18349203984893883422860340975921296885598208, 16465950114000161654220726253247440589132160, 7239338401340576670162528424686958194117926, 10584339341328188665033733337644526842984525, 2121462789475260173023454963118714495312243, 2612901457795379527735258171713046316795039, 149335915145167375983582497383119774823420, 394388692053959817886675924623671819696865, 13925282455253679973115434956976201332018, 31231071441784520660293801761149009541771, -661007291825740054188270969943949623817, 1596081452269776566444571718893636825508, -39764153625926950265646984695248413178, 48402340843779342979068812486389482962, -2526049958113068269366480842665290118, 825753501135630129085795503232402331], [10690180481949166050526829113202256453304320, -6267849711517167260526406456563825604689920, 9358954096265896818509466826870611292680192, -2942720444972489420463496923859102416599552, 6337914271649795064332715881666789122132400, -5251787060373312155364080845829026827296681, 523371894659278543760765596432363241071769, -1583431260785808443892994573018348951246049, 167084364447262475113479091442675627739458, -272945656294509180517913364851788213903635, 7596780855236692501949644337069988453224, -23372804537171037295980782611633131687847, 1417072421960578955357698600769665576155, -1236090985596955915904490374730454332960, 55452066070262313497576729623758776010, -38810549945351714188409116366605955742, 2451801148764874020658433614961260260, -658198158967893195258812670233283729], [-194053852976520331065252356819550434486124544, 156110715560274548457649667690239946328506368, -245326051901109728761441014936126101585915904, 185617872038882365734339330822787656564153088, -171679206264280312183515547306181301994448944, 122150430464187604967080714839068716272641185, -30958681938187058069275998679417604347465489, 34173172853494245424774812056705473057099545, -6457603152352019366315568300090198117252274, 5202886962510511752362507690016154014315579, -458640953280196289270353239326517493706280, 441730065860045844550420489286177747335471, -41411852123832535955401523022908455855811, 22610906473944704662369582187380446101792, -1503711931048240360048270630871145122042, 708594854860328328968158364573861304878, -50568380418876469661711381365192146884, 11256256425619544356587544350379342921], [-143660479853767440950495408050924542217945088, 338099740428245975139439597528701226691592192, -49182353744158907085739985935770257056681984, 302733271356295543973420905588837976745711616, -62808837596537205986495947429680461009297792, 160390105433273353505806814319362567833134455, -4796420232910280832040013165003676105741319, 39317479749852131149933187521174038961446895, -2760998229088752629072493335641612136993710, 5789377017832424998113481693311440813841853, -170990757103446116197351253748027599367912, 469480572188092181691100091159098870313721, -28055247336305069243185709373104046064373, 23856277602215105834847009699508289780416, -1121528874569025290395574106392407130166, 732776371491698166464198774254903206978, -45619635032407385389370974893016086924, 12001098732949906459355905537631920863]];
    Rf_basisdens := [1, 1, 32233705447512037582042597281595850752, 257869643580096300656340778252766806016, 2032592998109214065848442099382871156719616, 16260743984873712526787536795062969253756928, 2032592998109214065848442099382871156719616, 312706615093725240899760322981980177956864, 1016296499054607032924221049691435578359808, 8130371992436856263393768397531484626878464, 2032592998109214065848442099382871156719616, 1250826460374900963599041291927920711827456, 2032592998109214065848442099382871156719616, 8130371992436856263393768397531484626878464, 2032592998109214065848442099382871156719616, 1250826460374900963599041291927920711827456, 16260743984873712526787536795062969253756928, 16260743984873712526787536795062969253756928];
    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_169_c();"
function MakeCharacter_169_c()
    N := 169;
    order := 3;
    char_gens := [2];
    v := [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_169_c_Hecke();"
function MakeCharacter_169_c_Hecke(Kf)
    N := 169;
    order := 3;
    char_gens := [2];
    char_values := [[-1, 0, 0, 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 := 4;
    raw_aps := [[0, 1, -1, 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, 1, 0, 0, -1, 0, 0, 0], [-2, 0, -3, 0, 0, 1, 0, 1, 0, -1, 0, 1, 1, 0, 0, 0, 1, -1], [4, 1, 0, -4, -2, 0, -2, 1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0], [0, 2, -2, 21, 0, 0, -1, 0, 0, 2, -2, -2, 0, 2, 2, 0, -1, -3], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [7, 8, 0, -7, 5, 0, 7, -2, 5, 0, 7, 0, 1, 0, 2, 0, 0, 0], [14, 4, 0, -14, 0, 0, -10, 0, 1, 0, 1, 0, 3, 0, 1, 0, 0, 0], [0, 8, -8, 22, -1, -1, -3, 0, 0, 0, 2, -6, 0, -2, 6, 0, -3, -14], [0, 29, -29, -16, 6, 6, -8, 0, 0, -3, 6, 3, 0, -6, -3, 0, -8, 5], [-82, 0, 21, 0, 0, 2, 0, 1, 0, -1, 0, -7, 1, 12, 0, 8, 4, -1], [0, -28, 28, 12, -9, -9, -12, 0, 11, -14, 13, -16, 0, -13, 16, -11, -12, -4], [0, 14, -14, 150, 2, 2, 7, 0, -2, -6, -12, 3, 0, 12, -3, 2, 7, 21], [70, -14, 0, -70, -25, 0, 11, -2, -5, 0, 5, 0, 21, 0, 3, 0, 0, 0], [-92, 0, -25, 0, 0, -25, 0, -1, 0, 1, 0, 23, -7, 10, 0, -4, -5, 7], [-18, 0, -18, 0, 0, 36, 0, 12, 0, -12, 0, 12, 6, 13, 0, -3, 43, -6], [158, 49, 0, -158, 8, 0, 34, 1, 22, 0, 22, 0, -13, 0, 30, 0, 0, 0], [-4, -6, 0, 4, 17, 0, -18, 52, -13, 0, -51, 0, -18, 0, 16, 0, 0, 0], [0, 45, -45, -102, -37, -37, 22, 0, 31, 57, -9, 28, 0, 9, -28, -31, 22, 3], [264, -11, 0, -264, -27, 0, 26, -11, 23, 0, 27, 0, 17, 0, 71, 0, 0, 0], [-52, 0, 85, 0, 0, -45, 0, -5, 0, 5, 0, -50, 39, 19, 0, -15, -2, -39], [44, 0, -5, 0, 0, 3, 0, -77, 0, 77, 0, 3, -9, -5, 0, -21, -38, 9], [-444, 0, -21, 0, 0, -10, 0, -85, 0, 85, 0, -88, 16, -25, 0, -13, 10, -16], [0, 42, -42, 210, 18, 18, 13, 0, 29, 44, -17, -9, 0, 17, 9, -29, 13, 46], [-157, 96, 0, 157, 87, 0, -8, 68, 6, 0, 20, 0, -17, 0, 54, 0, 0, 0], [0, 5, -5, -164, 5, 5, 38, 0, -47, -89, 1, -39, 0, -1, 39, 47, 38, 45], [416, 0, -82, 0, 0, -64, 0, 14, 0, -14, 0, 76, 4, -9, 0, -27, 21, -4], [0, 131, -131, -180, -13, -13, 137, 0, -35, -41, 19, 48, 0, -19, -48, 35, 137, 24], [-246, 0, -72, 0, 0, 94, 0, 152, 0, -152, 0, 102, 44, -76, 0, -32, 46, -44], [142, 38, 0, -142, 88, 0, -25, -164, -51, 0, 51, 0, 54, 0, 11, 0, 0, 0], [0, 59, -59, -68, -29, -29, 121, 0, 26, 27, 52, 93, 0, -52, -93, -26, 121, -7], [-116, 0, 13, 0, 0, -81, 0, 89, 0, -89, 0, -106, -6, 2, 0, 2, 8, 6], [-184, 121, 0, 184, 67, 0, -57, -115, -46, 0, -84, 0, 153, 0, -126, 0, 0, 0], [-1213, 88, 0, 1213, -39, 0, -21, 80, -53, 0, -59, 0, 43, 0, -92, 0, 0, 0], [828, -453, 0, -828, -118, 0, -221, 69, -41, 0, -63, 0, -73, 0, -33, 0, 0, 0], [-390, 0, 144, 0, 0, 75, 0, 52, 0, -52, 0, -126, -108, 64, 0, 70, 137, 108], [-412, 0, -189, 0, 0, -134, 0, -77, 0, 77, 0, 205, 3, 92, 0, 2, -222, -3], [533, 146, 0, -533, -179, 0, 93, -6, -29, 0, 129, 0, -93, 0, -38, 0, 0, 0], [0, -126, 126, 1246, -94, -94, 66, 0, 16, 158, 4, 62, 0, -4, -62, -16, 66, -90], [-910, 320, 0, 910, 2, 0, 2, -76, -48, 0, -72, 0, -96, 0, -152, 0, 0, 0], [0, -100, 100, 57, -78, -78, -220, 0, 3, -268, -81, 136, 0, 81, -136, -3, -220, -33], [288, 0, -297, 0, 0, -26, 0, 53, 0, -53, 0, -133, 135, 125, 0, 95, -235, -135], [140, 524, 0, -140, 56, 0, 169, -256, 13, 0, -161, 0, -52, 0, -246, 0, 0, 0], [0, 68, -68, -1734, -87, -87, 16, 0, -16, 176, -44, -225, 0, 44, 225, 16, 16, 61], [0, -26, 26, -706, -101, -101, 131, 0, 22, -130, -104, -202, 0, 104, 202, -22, 131, -218], [1064, 18, 0, -1064, 253, 0, 330, -266, 15, 0, 219, 0, -4, 0, -44, 0, 0, 0], [0, 678, -678, 1759, 208, 208, 27, 0, 190, -134, 116, 30, 0, -116, -30, -190, 27, -277], [0, 295, -295, -1554, 260, 260, -2, 0, 58, 119, 10, -51, 0, -10, 51, -58, -2, -99], [1034, 225, 0, -1034, 17, 0, 4, -335, 63, 0, -373, 0, -253, 0, -122, 0, 0, 0], [1384, 0, -170, 0, 0, 24, 0, 232, 0, -232, 0, 230, 216, -133, 0, -1, 179, -216], [-1254, 0, 272, 0, 0, 138, 0, -354, 0, 354, 0, -121, 132, 159, 0, -47, -153, -132], [-1166, 0, -497, 0, 0, 334, 0, 179, 0, -179, 0, -39, -45, -161, 0, -71, 263, 45], [-1364, -407, 0, 1364, -95, 0, -167, -3, 158, 0, 302, 0, -153, 0, 287, 0, 0, 0], [-553, 485, 0, 553, -319, 0, -262, 53, 72, 0, 196, 0, -84, 0, -231, 0, 0, 0], [0, 547, -547, 160, 71, 71, -140, 0, 10, 167, 388, -14, 0, -388, 14, -10, -140, -258], [0, -952, 952, -258, 79, 79, -106, 0, 209, 56, -291, -460, 0, 291, 460, -209, -106, 246], [2946, -781, 0, -2946, -357, 0, 61, 499, -80, 0, 48, 0, 189, 0, 221, 0, 0, 0], [0, 322, -322, 1632, -108, -108, -121, 0, -259, -106, 179, 162, 0, -179, -162, 259, -121, 172], [-1284, -960, 0, 1284, -212, 0, -115, 206, 5, 0, 177, 0, 256, 0, -178, 0, 0, 0], [-45, 0, 312, 0, 0, -276, 0, -298, 0, 298, 0, -576, -381, 221, 0, 117, -250, 381], [0, 434, -434, 1398, 221, 221, 450, 0, -84, -218, -556, 209, 0, 556, -209, 84, 450, -87], [-1514, 183, 0, 1514, 210, 0, 337, 125, 103, 0, -47, 0, 109, 0, 45, 0, 0, 0], [437, 0, 175, 0, 0, -231, 0, -653, 0, 653, 0, 27, 328, 126, 0, 106, -520, -328], [-2254, 0, -589, 0, 0, -278, 0, -701, 0, 701, 0, 85, 163, -172, 0, -60, -236, -163], [107, 0, 375, 0, 0, -32, 0, -315, 0, 315, 0, -209, -224, 803, 0, 209, 82, 224], [316, 0, 150, 0, 0, -108, 0, 54, 0, -54, 0, 132, 294, 402, 0, -202, -326, -294], [-272, 414, 0, 272, -328, 0, 59, -190, -161, 0, -383, 0, 402, 0, -426, 0, 0, 0], [52, 0, 19, 0, 0, 706, 0, 781, 0, -781, 0, 284, 454, -33, 0, 163, -382, -454], [-2776, -552, 0, 2776, -640, 0, -645, 344, -17, 0, -471, 0, 92, 0, 64, 0, 0, 0], [0, 794, -794, -732, 303, 303, 322, 0, 257, -88, 631, 454, 0, -631, -454, -257, 322, -566], [0, 636, -636, -195, -139, -139, -356, 0, -308, -260, -498, 854, 0, 498, -854, 308, -356, 99], [-4808, 0, -6, 0, 0, 13, 0, 30, 0, -30, 0, 154, 368, -346, 0, -20, -189, -368], [0, -181, 181, 4678, -734, -734, -913, 0, 81, 1035, 31, 629, 0, -31, -629, -81, -913, 377], [928, -202, 0, -928, 894, 0, 141, -1080, -227, 0, 461, 0, -372, 0, -214, 0, 0, 0], [0, -1386, 1386, -172, -165, -165, -78, 0, -217, 246, 155, 351, 0, -155, -351, 217, -78, 238], [4484, -8, 0, -4484, -398, 0, 186, 876, 96, 0, -260, 0, 144, 0, 320, 0, 0, 0], [-1496, 0, -622, 0, 0, 20, 0, 670, 0, -670, 0, 292, -288, -542, 0, 338, 912, 288], [-1444, 955, 0, 1444, -207, 0, 706, -871, 87, 0, 471, 0, 141, 0, -349, 0, 0, 0], [0, -1004, 1004, 227, 100, 100, -329, 0, -134, 612, 330, 448, 0, -330, -448, 134, -329, 167], [-1914, -750, 0, 1914, 422, 0, -2, 50, -348, 0, -378, 0, -368, 0, 785, 0, 0, 0], [0, -367, 367, -378, -267, -267, -50, 0, 189, 721, -259, 267, 0, 259, -267, -189, -50, -121], [410, 0, 1688, 0, 0, -12, 0, -550, 0, 550, 0, -82, -820, 413, 0, -179, -665, 820], [0, 240, -240, 4282, 775, 775, 771, 0, 28, -592, 374, -860, 0, -374, 860, -28, 771, 56], [166, 1314, 0, -166, 358, 0, 880, -302, -334, 0, -164, 0, -804, 0, -147, 0, 0, 0], [0, 1081, -1081, -1242, 798, 798, -165, 0, 197, 325, -281, -1207, 0, 281, 1207, -197, -165, -5], [551, 0, -1155, 0, 0, -729, 0, -923, 0, 923, 0, 265, -580, -232, 0, -340, 266, 580], [-2954, 548, 0, 2954, -197, 0, -311, 182, 291, 0, -1041, 0, -27, 0, 1047, 0, 0, 0], [0, -1809, 1809, -2728, -239, -239, 1046, 0, -59, 609, -419, 387, 0, 419, -387, 59, 1046, 451], [2368, 258, 0, -2368, 508, 0, -837, -228, 225, 0, 737, 0, -752, 0, -224, 0, 0, 0], [-194, 0, 814, 0, 0, 203, 0, -378, 0, 378, 0, 304, 530, 1013, 0, 525, -918, -530], [6816, 0, 250, 0, 0, 37, 0, -374, 0, 374, 0, -125, -410, -125, 0, -261, -826, 410], [0, -205, 205, 812, 52, 52, -1103, 0, 129, -245, 251, -283, 0, -251, 283, -129, -1103, -971], [2020, -1941, 0, -2020, -626, 0, 882, 191, -306, 0, 454, 0, 207, 0, -619, 0, 0, 0], [0, 178, -178, 2948, 418, 418, -17, 0, 425, 262, -793, 511, 0, 793, -511, -425, -17, 1398], [-1079, 0, -758, 0, 0, 962, 0, 1046, 0, -1046, 0, 622, -141, -723, 0, -451, 592, 141], [1174, 1263, 0, -1174, -992, 0, 861, -81, -197, 0, 561, 0, 391, 0, 265, 0, 0, 0], [0, 1302, -1302, 758, -258, -258, 751, 0, -73, -1368, -713, 320, 0, 713, -320, 73, 751, -276], [2212, 0, -1369, 0, 0, -458, 0, -665, 0, 665, 0, 420, -483, -208, 0, -356, -1004, 483], [0, 989, -989, -6583, 155, 155, 391, 0, 87, -471, -1003, 251, 0, 1003, -251, -87, 391, 36], [-836, 0, 728, 0, 0, -715, 0, 392, 0, -392, 0, 1398, 32, 534, 0, -560, 391, -32], [-2002, 0, 923, 0, 0, 24, 0, -1041, 0, 1041, 0, -712, -227, -109, 0, 125, 599, 227], [0, -531, 531, 1380, -706, -706, -353, 0, -629, 295, -143, 239, 0, 143, -239, 629, -353, 869], [8522, -1711, 0, -8522, -519, 0, 495, -219, 586, 0, -952, 0, -165, 0, -279, 0, 0, 0], [0, -805, 805, 932, -389, -389, -690, 0, -129, 1329, -1207, -806, 0, 1207, 806, 129, -690, 457], [-408, 0, -194, 0, 0, -1172, 0, -162, 0, 162, 0, -31, -1082, 383, 0, -243, 579, 1082], [-2302, 0, 2388, 0, 0, -298, 0, -302, 0, 302, 0, -2087, -489, -99, 0, -417, 576, 489], [0, -437, 437, 1068, 132, 132, -163, 0, -30, -1913, 1652, 894, 0, -1652, -894, 30, -163, 38], [3081, 0, -513, 0, 0, -109, 0, -1025, 0, 1025, 0, -523, -1354, -714, 0, -90, 60, 1354], [-2800, 0, 680, 0, 0, 1047, 0, 1492, 0, -1492, 0, 536, -854, -403, 0, 369, -532, 854], [0, -2168, 2168, -1854, 176, 176, -925, 0, -130, -980, 656, -941, 0, -656, 941, 130, -925, -119], [-3088, -1275, 0, 3088, 831, 0, -104, -151, 419, 0, -753, 0, 29, 0, -103, 0, 0, 0], [0, -886, 886, -1796, -374, -374, -2215, 0, 495, 1384, -685, -1148, 0, 685, 1148, -495, -2215, 18], [4352, 1601, 0, -4352, -424, 0, 606, 797, -12, 0, 2120, 0, 1247, 0, -406, 0, 0, 0], [-3436, 0, -2340, 0, 0, 924, 0, 464, 0, -464, 0, -960, -620, -459, 0, -817, -223, 620], [5594, -1871, 0, -5594, -1361, 0, -1216, 1753, -473, 0, -477, 0, 89, 0, -1167, 0, 0, 0], [-1118, 1208, 0, 1118, -1108, 0, -1378, 1026, 479, 0, -135, 0, 455, 0, 361, 0, 0, 0], [232, 2125, 0, -232, 323, 0, 1718, -1359, 1080, 0, 324, 0, 516, 0, -760, 0, 0, 0], [0, 946, -946, 3602, 86, 86, 156, 0, 576, 646, 1180, 718, 0, -1180, -718, -576, 156, 1748], [0, 2595, -2595, 5436, -322, -322, -1733, 0, -431, 1613, -1637, 1003, 0, 1637, -1003, 431, -1733, 1177], [3756, 986, 0, -3756, 723, 0, 1035, -1174, 152, 0, 1318, 0, -74, 0, -1687, 0, 0, 0], [0, 379, -379, 5294, 495, 495, 1673, 0, -28, -2681, 1148, -657, 0, -1148, 657, 28, 1673, -767], [0, -369, 369, 8100, 38, 38, 439, 0, -859, 661, -1455, -1644, 0, 1455, 1644, 859, 439, -977], [1940, 0, 2238, 0, 0, -98, 0, -3722, 0, 3722, 0, 14, -1476, 318, 0, -466, -966, 1476], [-1750, -2884, 0, 1750, -966, 0, -1228, -1028, 127, 0, -805, 0, -1007, 0, -289, 0, 0, 0], [0, 1810, -1810, 822, 370, 370, -38, 0, 127, 850, -357, -839, 0, 357, 839, -127, -38, -3103], [7688, 0, -2166, 0, 0, 1043, 0, 2530, 0, -2530, 0, 1106, 602, -1160, 0, 338, 1283, -602], [-1722, 597, 0, 1722, -697, 0, -55, 2053, -54, 0, 1990, 0, 809, 0, 187, 0, 0, 0], [-5618, -315, 0, 5618, 373, 0, 1475, -791, -434, 0, -1104, 0, -777, 0, 1799, 0, 0, 0], [-7682, 0, -1027, 0, 0, -644, 0, -675, 0, 675, 0, 251, 1655, 508, 0, 144, -536, -1655], [-3242, 0, 710, 0, 0, 958, 0, 2400, 0, -2400, 0, 582, 18, 749, 0, 1009, -355, -18], [0, -2769, 2769, -7702, -2603, -2603, -2273, 0, 402, 2339, -2212, 250, 0, 2212, -250, -402, -2273, 1889], [0, -1067, 1067, 2836, -2076, -2076, -1682, 0, -90, -71, -1034, 87, 0, 1034, -87, 90, -1682, 291], [0, -212, 212, -11880, -212, -212, -716, 0, -298, 2000, -138, 1976, 0, 138, -1976, 298, -716, -362], [0, -1894, 1894, -5734, -301, -301, 393, 0, -664, 222, -682, -2798, 0, 682, 2798, 664, 393, -674], [9417, -563, 0, -9417, -28, 0, 2570, 2075, 223, 0, -1203, 0, 156, 0, -535, 0, 0, 0], [0, -296, 296, 3355, 296, 296, 1822, 0, -233, 438, 1083, -1236, 0, -1083, 1236, 233, 1822, 1809], [1102, -3648, 0, -1102, 16, 0, -471, 1118, 1087, 0, -273, 0, -370, 0, 206, 0, 0, 0], [-13665, 2404, 0, 13665, 203, 0, -1325, -192, 281, 0, -1317, 0, 691, 0, -1748, 0, 0, 0], [-6074, -3109, 0, 6074, 240, 0, -746, -973, 374, 0, -1568, 0, -331, 0, 1143, 0, 0, 0], [0, -3072, 3072, 1754, -1159, -1159, -1236, 0, -44, -96, -1716, 1259, 0, 1716, -1259, 44, -1236, -487], [7805, 0, -3360, 0, 0, 479, 0, -1008, 0, 1008, 0, 356, 1117, 1362, 0, -422, -644, -1117], [0, -2644, 2644, -394, 1317, 1317, -342, 0, 13, 374, -2129, -2546, 0, 2129, 2546, -13, -342, 154], [-3364, -638, 0, 3364, 681, 0, -2539, 834, -64, 0, 258, 0, 558, 0, -836, 0, 0, 0], [9856, 0, 1458, 0, 0, 498, 0, -406, 0, 406, 0, 81, 626, -2383, 0, 623, 607, -626], [0, -2092, 2092, -400, -1059, -1059, -2968, 0, -9, -874, 525, 186, 0, -525, -186, 9, -2968, 262], [15322, -1522, 0, -15322, 516, 0, 518, -2522, 1372, 0, 1784, 0, -1268, 0, -40, 0, 0, 0], [-7030, 0, 402, 0, 0, 812, 0, 1462, 0, -1462, 0, 1984, -110, -2108, 0, 324, 1208, 110], [-3637, 0, 2381, 0, 0, 2335, 0, -705, 0, 705, 0, -2953, -404, 999, 0, 371, -473, 404], [10778, 0, -2719, 0, 0, 135, 0, 165, 0, -165, 0, 444, 511, -736, 0, -2214, -99, -511], [2398, 0, 536, 0, 0, 845, 0, 1984, 0, -1984, 0, 496, 1430, -2110, 0, -1328, 363, -1430], [-2954, -3297, 0, 2954, 338, 0, 604, 151, 420, 0, -1042, 0, 391, 0, 295, 0, 0, 0], [0, -1325, 1325, -5697, -1937, -1937, -111, 0, 943, 3189, 1867, -1981, 0, -1867, 1981, -943, -111, 1172], [-3663, 0, -708, 0, 0, 22, 0, 1828, 0, -1828, 0, 1328, 1013, -1997, 0, -633, -34, -1013], [0, 5177, -5177, 5464, 898, 898, 2757, 0, 183, 1153, 241, -87, 0, -241, 87, -183, 2757, -1753], [0, 2100, -2100, 4760, 2349, 2349, 1025, 0, -520, -4040, 390, -991, 0, -390, 991, 520, 1025, 572], [1584, 0, -4518, 0, 0, -2370, 0, -2006, 0, 2006, 0, -68, -1852, -827, 0, 487, 2105, 1852], [-4262, 2468, 0, 4262, 768, 0, -2309, -448, 911, 0, 985, 0, 2736, 0, -2796, 0, 0, 0], [12888, -3349, 0, -12888, -1237, 0, -2393, 1385, -1005, 0, -3679, 0, 1088, 0, 1182, 0, 0, 0], [-1448, 0, -1437, 0, 0, 1172, 0, 973, 0, -973, 0, 2016, 798, 2093, 0, 1145, -966, -798], [-1286, 0, 1700, 0, 0, 2939, 0, 1232, 0, -1232, 0, -1442, -508, 1168, 0, 466, -805, 508], [0, 864, -864, -12914, -584, -584, 619, 0, 930, -1160, 1796, -1261, 0, -1796, 1261, -930, 619, -609], [3100, 3149, 0, -3100, 2211, 0, 1014, -2427, 356, 0, -1810, 0, -2372, 0, 608, 0, 0, 0], [2984, 0, -2127, 0, 0, -2272, 0, -1371, 0, 1371, 0, 1121, -1433, -889, 0, -227, -2837, 1433], [15010, 6992, 0, -15010, 2030, 0, 531, 2192, -446, 0, 460, 0, -1579, 0, 839, 0, 0, 0], [0, 3964, -3964, 4310, 1194, 1194, -2262, 0, -229, 346, 625, 1989, 0, -625, -1989, 229, -2262, -1243], [4414, 0, -4741, 0, 0, 1933, 0, -485, 0, 485, 0, 1463, -1871, 1668, 0, 254, 651, 1871], [0, 1454, -1454, 6848, 1038, 1038, -3419, 0, -1639, -966, -1929, 3368, 0, 1929, -3368, 1639, -3419, -924], [-11298, 2659, 0, 11298, -2038, 0, -2000, -585, 1572, 0, 2678, 0, -1689, 0, 1893, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_169_c_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_169_4_c_l();".
// 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_169_4_c_l(:prec:=18)
    chi := MakeCharacter_169_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_169_4_c_l();".
// 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_169_4_c_l( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_169_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![118336, -503616, 4172208, 7769856, 35832012, -817290, 14351885, -2514618, 4613216, -861638, 596508, -82227, 48373, -6060, 2303, -200, 67, -5, 1]>],Snew);
    return Vf;
end function;