
// Make newform 169.8.b.e in Magma, downloaded from the LMFDB on 15 January 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_169_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_169_b_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_8_b_e();".
// 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_8_b_e();".
// 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 := [113340278793830400, 0, 9796730453852209, 0, 333227942883751, 0, 5819167911653, 0, 57017400035, 0, 319862003, 0, 998837, 0, 1591, 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], [-2732739322239963418976256, 0, -228150751650104194799097, 0, -6118494553301365453766, 0, -78487120466504551367, 0, -526101710398367316, 0, -1845052138525815, 0, -3169890760198, 0, -2095593961, 0], [3255604300568294757138432, 0, 230782282706344344778233, 0, 6118494553301365453766, 0, 78487120466504551367, 0, 526101710398367316, 0, 1845052138525815, 0, 3169890760198, 0, 2095593961, 0], [-28273262610744761704001218674688, 0, -2134554189150583319304020702701, 0, -60894684614700435578075502054, 0, -841893193346867977892734811, 0, -6031186549828366467355764, 0, -22241128752957613787987, 0, -39587201368684887238, 0, -26826373825789573, 0], [690361009548557509804155524874240, 0, 48901878319725440263979595560733, 0, 1306382396820646784281734167366, 0, 16288883713074149134767287531, 0, 103503493101364585249881780, 0, 343636104523239485815971, 0, 563762665508213080870, 0, 359364760365374581, 0], [0, 235844508380848105588574008, 0, 14565264498912586259608807, 0, 373892256456907993404386, 0, 4687427913553165181705, 0, 30959176260878942516, 0, 107600514547780169, 0, 183841063433362, 0, 121102446247], [907288213423680075502778149945344, 0, 64203183630609050347597023423805, 0, 1599260640351233256224408501646, 0, 18813061461728885749280193395, 0, 115912158030841958109167748, 0, 379757259368320411122131, 0, 620234694782662585230, 0, 395162198847276829, 0], [-26900248081899185370408774746112, 0, -2276767436354414215520337956619, 0, -70165211501451806230911657346, 0, -1013923891994056888910964133, 0, -7439101889221766797615836, 0, -27781648165267828849701, 0, -49790545860058735874, 0, -33875102754872459, 0], [0, -213660701576743641264457528, 0, -14565264498912586259608807, 0, -373892256456907993404386, 0, -4687427913553165181705, 0, -30959176260878942516, 0, -107600514547780169, 0, -183841063433362, 0, -121102446247], [5398151817054690094281025178222592, 0, 385856134524979244016829632227847, 0, 10468789899162998341130394952010, 0, 138927413113720929553398731081, 0, 964936774617793274181406284, 0, 3483493925858862923730345, 0, 6112869675431836793674, 0, 4102599392014344679, 0], [0, 66268281926086016723442277033964624, 0, 3020238858096653799903266649540011, 0, 80141675921619651069805206848218, 0, 1335708474798850692303689233645, 0, 11589687078285808141881884188, 0, 48664508476358318912771797, 0, 94033453511006223465626, 0, 67198961820066881651], [0, -11619493213452554698539062381259280, 0, -1083044899551066230073651751403191, 0, -36130592410581154637659531122386, 0, -545607618154055235217865219921, 0, -4093393673184697738435466156, 0, -15461127746840404936669673, 0, -27878519808022909363666, 0, -19033912172945629807], [0, 150623146981901027468393087872552808, 0, 11424434346291067633536090185222957, 0, 327526006369434918345237723208246, 0, 4550607557507092860086090006755, 0, 32733702050691350532146331196, 0, 121064454786749259094516579, 0, 215909611162649022796742, 0, 146509088144634924077], [0, 75563269274905810016147765704368400, 0, 6012239829169352154517504718070667, 0, 176749541018099307002526203542346, 0, 2484390902860590674840261359037, 0, 17957775231450284159150792252, 0, 66533575373791366246492757, 0, 118717973173522471364170, 0, 80559532995626212675], [0, -47694665405114434975182347509663748, 0, -3304782871922206764323343467898087, 0, -89836298793540982131575298279206, 0, -1195075114327251591076712381665, 0, -8316688153181249831201752456, 0, -30072279885111018241725849, 0, -52839009155340118298542, 0, -35498425483608845567], [0, 622363120851441425509544556142192264, 0, 41447924729196980478101046138499441, 0, 1041649920914212293973154038203398, 0, 12903329885988433013275520643095, 0, 84858803817728956347714162908, 0, 294784113490499069320490447, 0, 504059278115513429573686, 0, 332401356068878691401]];
    Rf_basisdens := [1, 2631531056240149979136, 404850931729253842944, 4923913898660144415827591168, 14771741695980433247482773504, 22183806804104464324116480, 7385870847990216623741386752, 284071955691931408605437952, 1706446677238804948008960, 7385870847990216623741386752, 62262891248557526138139890319360, 12452578249711505227627978063872, 31131445624278763069069945159680, 12452578249711505227627978063872, 5188574270713127178178324193280, 31131445624278763069069945159680];
    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_b();"
function MakeCharacter_169_b()
    N := 169;
    order := 2;
    char_gens := [2];
    v := [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_169_b_Hecke();"
function MakeCharacter_169_b_Hecke(Kf)
    N := 169;
    order := 2;
    char_gens := [2];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..prec]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 8;
    raw_aps := [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [4, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 4, 0, 0, -2, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, -5, 0, 0, -2, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -51, 0, 0, -52, 0, 3, 0, 2, -2, -1, -1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2946, 44, -9, -189, -3, 0, 4, 4, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 793, 0, 0, 680, 0, -2, 14, -22, -27, -1, 7], [-9211, 104, -105, -248, -13, 0, -6, 2, 0, -1, 0, 0, 0, 0, 0, 0], [27517, -309, -260, -171, -27, 0, 1, -47, 0, 6, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8174, 0, 0, 452, 0, -51, -164, 86, 153, -15, -23], [0, 0, 0, 0, 0, 1750, 0, 0, 3765, 0, 67, -28, -268, -231, -76, 64], [0, 0, 0, 0, 0, 5794, 0, 0, -2879, 0, -192, -738, -90, -64, -15, 49], [49468, -1081, 626, 998, -103, 0, -101, 107, 0, 14, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -3104, 0, 0, 5556, 0, 315, -1022, -720, 43, 168, 56], [208976, 1676, 1869, 263, -20, 0, 117, 469, 0, 18, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 21581, 0, 0, 62768, 0, -429, -562, 352, -276, 244, -420], [-225357, -3335, -1734, -7275, 117, 0, 159, 687, 0, -72, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -29605, 0, 0, -85908, 0, -274, 1102, 1858, 1095, -245, 419], [0, 0, 0, 0, 0, -78411, 0, 0, 83638, 0, 276, 1362, 1640, 509, -196, -212], [0, 0, 0, 0, 0, -61694, 0, 0, 19246, 0, -407, -2541, -1278, 405, -1119, -387], [791401, 4816, -17221, 12539, 261, 0, -184, -2032, 0, 37, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -120560, 0, 0, 98092, 0, 1122, -6288, 4016, 5090, 848, -2336], [0, 0, 0, 0, 0, 75028, 0, 0, -166853, 0, 4125, -3849, 496, -967, 1366, 898], [0, 0, 0, 0, 0, -206660, 0, 0, 168041, 0, 15, 11113, -540, -9897, 2288, -1164], [-3220440, -38039, 17575, -45370, 340, 0, -901, 3387, 0, 319, 0, 0, 0, 0, 0, 0], [-7201828, -22697, -39978, -43707, 973, 0, -125, 2595, 0, 266, 0, 0, 0, 0, 0, 0], [262922, 18178, 10394, 75273, 1104, 0, -902, 6058, 0, 182, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -26122, 0, 0, 503986, 0, 2074, 25222, 1782, 15942, 1133, 2757], [-2135908, 29488, 29027, 128611, -535, 0, 1036, -9300, 0, -303, 0, 0, 0, 0, 0, 0], [-258940, -9952, -87860, -6239, -462, 0, 3190, 5398, 0, -1186, 0, 0, 0, 0, 0, 0], [9947630, -86499, -21436, 96817, -3643, 0, 2153, -11351, 0, 604, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 917984, 0, 0, -685097, 0, 19044, 34648, 10548, -15384, 3966, 126], [10888151, -41165, -30329, 227461, -5236, 0, 1467, 4051, 0, 2301, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1383440, 0, 0, -1072269, 0, 5781, -84386, -1226, 6151, 1483, -9889], [0, 0, 0, 0, 0, 1070886, 0, 0, 158572, 0, -13455, 55508, 350, 11517, 6269, 1525], [-4435382, -14626, -90981, 298575, 604, 0, -11885, -1101, 0, 2792, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 750223, 0, 0, -1818700, 0, -36057, -38736, -12562, -4440, 2017, 18193], [0, 0, 0, 0, 0, 2058505, 0, 0, 1939986, 0, -25263, -13648, -5772, 3146, -12090, 11494], [13212692, -27011, 145322, 13275, -8490, 0, 6028, -12596, 0, -745, 0, 0, 0, 0, 0, 0], [31221598, 181123, -172624, 641266, -2161, 0, -6561, -6433, 0, 2328, 0, 0, 0, 0, 0, 0], [40325458, 161766, -134655, -474591, -15132, 0, -14775, -855, 0, -1020, 0, 0, 0, 0, 0, 0], [43183065, 125700, 235211, -368772, 7863, 0, -5694, 44778, 0, -5505, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3009562, 0, 0, 283203, 0, 61506, 34894, -91134, -77058, 19055, -7017], [0, 0, 0, 0, 0, -2568378, 0, 0, -65857, 0, 1881, -67881, 74404, 26155, 17248, -4012], [-14073048, 200446, 85040, -185971, 18848, 0, 4216, 56408, 0, 6206, 0, 0, 0, 0, 0, 0], [-28529836, 291884, -227668, -658471, -1068, 0, 5840, 19760, 0, 15808, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3160137, 0, 0, -3867402, 0, -44470, 100768, -16254, 32241, 3419, -8589], [0, 0, 0, 0, 0, -6221951, 0, 0, -2843776, 0, -2052, 192546, -57374, 43795, 31627, -22813], [0, 0, 0, 0, 0, 4393334, 0, 0, 3853998, 0, 76562, -148074, -51234, 16806, 10329, 10161], [-280075, -146942, 85141, -531777, -519, 0, -20066, 160318, 0, -5617, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1058760, 0, 0, -1633136, 0, 90822, -133112, -15728, -69666, 58000, -56064], [0, 0, 0, 0, 0, -176810, 0, 0, -138709, 0, 32792, -303850, 58590, -93708, -5579, 35541], [-3411234, -482850, 557958, 3699577, -37780, 0, -41550, -1630, 0, -23138, 0, 0, 0, 0, 0, 0], [24594534, -596590, -59985, 2271145, -32281, 0, -4058, -32826, 0, -739, 0, 0, 0, 0, 0, 0], [109521387, -563595, 427731, -603113, -63040, 0, -7245, 50507, 0, 13627, 0, 0, 0, 0, 0, 0], [107943471, -84437, -961501, -1632710, -41287, 0, 35552, 175696, 0, 15528, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -2943871, 0, 0, -10624354, 0, 113341, -338192, 241704, -74142, 23612, 31068], [-45625590, -789749, -307399, 1126502, 83524, 0, 66669, 121325, 0, 2781, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -946330, 0, 0, 5196926, 0, -23397, -347725, 409470, 145263, 92679, 27579], [-23496672, -1031571, -367154, 2738014, 21355, 0, -66967, -1991, 0, -39950, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -2250352, 0, 0, -3760323, 0, 115281, 614778, -18862, -264081, 52781, -166959], [0, 0, 0, 0, 0, -2930038, 0, 0, 10490520, 0, -53941, 886896, 301218, 173175, -138201, -55113], [-251060932, -637763, 2393978, 3241295, -109049, 0, 33505, 72065, 0, 7222, 0, 0, 0, 0, 0, 0], [285276321, -43986, 185141, 1633379, 95693, 0, -35918, 401042, 0, -13033, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8961198, 0, 0, 11639710, 0, -172314, -247761, -86958, 18770, 85071, -90857], [0, 0, 0, 0, 0, 24739093, 0, 0, 4926424, 0, -51555, -572052, -505654, -240408, -98501, -29765], [-93800960, -2166421, -2366959, -8631862, 28781, 0, -68774, 122810, 0, -6136, 0, 0, 0, 0, 0, 0], [377395500, -564710, -1633400, 7860341, 134854, 0, 10622, 21150, 0, 5692, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -38472184, 0, 0, -29773355, 0, -107919, 392735, 96126, 489855, 28831, -38589], [0, 0, 0, 0, 0, -23701608, 0, 0, -23946563, 0, -627486, -686700, 380584, 544874, -9296, 33400], [0, 0, 0, 0, 0, -374676, 0, 0, 24673200, 0, 536742, 1018872, 132540, 157710, 85842, 260466], [333364937, -929548, 172835, 3755786, -168357, 0, -6802, -369898, 0, -54581, 0, 0, 0, 0, 0, 0], [474637738, -1768755, 1717999, 164338, 204064, 0, 91247, 174415, 0, 44407, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 55096161, 0, 0, -14881752, 0, 343044, 1434272, 600188, 126453, -78910, 205474], [0, 0, 0, 0, 0, -35043915, 0, 0, 7563422, 0, -398343, 882264, 485084, 673126, 260618, 209018], [54991307, -148478, 3324628, -8415912, 147477, 0, 23437, -598979, 0, -94231, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -31804092, 0, 0, -46789987, 0, -610935, 906495, 774, -833733, -182541, 190695], [0, 0, 0, 0, 0, -35660842, 0, 0, 16498795, 0, -81360, 1860358, 800686, 1150572, -156971, -140475], [0, 0, 0, 0, 0, 22071342, 0, 0, -52199719, 0, 565146, 631462, -81638, -487902, -175013, -290989], [-526744139, 4786090, -286913, 5937994, 149507, 0, 570, -187150, 0, 15633, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -9303124, 0, 0, 12061590, 0, 518470, -2392119, 104072, -140466, 55648, 461800], [0, 0, 0, 0, 0, -26498839, 0, 0, 16545082, 0, 314481, -619898, -317454, -2181336, -89781, -462237], [176778762, 3157538, 1657647, -2577255, -158197, 0, -54790, -1000134, 0, 157897, 0, 0, 0, 0, 0, 0], [28683998, 9243431, -2597324, 3196108, 248873, 0, -35211, -356603, 0, -55302, 0, 0, 0, 0, 0, 0], [-326360636, 4663230, 3345520, -15647986, 388738, 0, 22114, 533858, 0, -133708, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1951454, 0, 0, -63336737, 0, -1821, -2847831, 954110, -1433929, -13609, 191179], [0, 0, 0, 0, 0, 65033084, 0, 0, -37118303, 0, -433248, 183444, 780424, 1054836, -571372, -321052], [0, 0, 0, 0, 0, 53647678, 0, 0, 45587175, 0, 217491, -1109396, -187120, -1944563, 252470, 246578], [0, 0, 0, 0, 0, 41566032, 0, 0, 39243744, 0, 183238, -424060, 987720, -168210, 500020, -13980], [-164846093, -3479888, -483207, 14106601, 354515, 0, 294564, -398452, 0, 279531, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 78509485, 0, 0, 50348546, 0, 248286, 2761334, 628764, -1521789, -105462, -564054], [0, 0, 0, 0, 0, 64997803, 0, 0, 2172122, 0, -97403, 2710442, -29962, 735882, -1077535, 865129], [-365455665, 723727, -3401897, -3925039, -260972, 0, -349501, -610533, 0, -73919, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 61242394, 0, 0, 30457904, 0, -120287, 4709432, 210410, 494181, -466405, -218981], [1307344345, -844859, 2050093, 17338907, -974054, 0, 32775, 265711, 0, -227, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 27024818, 0, 0, 14671975, 0, 237525, 1550444, 530272, 1701787, 626194, 408182], [93054626, 4781193, -7936811, -29409496, 90601, 0, 432674, 764802, 0, 292730, 0, 0, 0, 0, 0, 0], [-63585583, -3053211, -6032979, -20636673, 1275248, 0, -47563, -98211, 0, -28361, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 45379002, 0, 0, 3273738, 0, 558822, 1122421, 2853790, -1481454, -212351, 369161], [-2035294, -3499483, -8220292, -16126375, 134953, 0, -1173387, 214901, 0, -130992, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 151479620, 0, 0, 68777049, 0, -354567, -1254290, 1746982, 3516607, 1396147, -285625], [-3261455399, 812845, 7656501, 28366811, 211768, 0, -66651, 1363405, 0, 227239, 0, 0, 0, 0, 0, 0], [-2445003230, 7463415, -707480, -12622427, -201004, 0, 275296, -1454592, 0, 63271, 0, 0, 0, 0, 0, 0], [-770588880, -10044362, -10940992, 24561662, 416950, 0, -881418, -1467274, 0, -288936, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -72336018, 0, 0, 92090362, 0, 281715, -1404975, -197202, -6926265, -294897, -1303965], [0, 0, 0, 0, 0, -93987051, 0, 0, 40900724, 0, -188955, -11827142, 1881584, 2640950, 317372, -1141244], [0, 0, 0, 0, 0, 48928266, 0, 0, -176838962, 0, -125877, 9406779, -996246, -2960401, 708633, 296173], [859447343, -553293, -1033281, 5569386, -1129560, 0, -518497, -685321, 0, -258231, 0, 0, 0, 0, 0, 0], [-287571650, 15855342, 11048089, -31150757, -1047391, 0, 968586, -1900502, 0, 276987, 0, 0, 0, 0, 0, 0], [-1058302804, -2648652, 15981252, 23156733, -482730, 0, 650706, 1616658, 0, -606210, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -203821654, 0, 0, -147026573, 0, 3933403, 7975936, 164988, 176205, -394336, 155052], [0, 0, 0, 0, 0, -24219428, 0, 0, 216815713, 0, -1357056, 5495432, 2189616, -2218100, 420768, -1465936], [0, 0, 0, 0, 0, 113281996, 0, 0, 170364244, 0, -402910, -6109304, -3242428, -4275966, -1252602, 426550], [0, 0, 0, 0, 0, 10592597, 0, 0, 214220222, 0, -2293299, -4437942, -1031702, -2673672, -824713, 126623], [-1339849112, -26104202, 2461249, -42623969, 1678205, 0, 1019262, -32194, 0, -33657, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 18263177, 0, 0, -80681796, 0, 4989151, -8019672, -2651710, -3169242, 1197583, -34289], [-3705836290, -16295538, -19008102, 39923585, 683074, 0, -479644, 435636, 0, 481016, 0, 0, 0, 0, 0, 0], [-598842215, -30285645, 7374185, 11770412, -856997, 0, 618184, -5100520, 0, 352514, 0, 0, 0, 0, 0, 0], [-43276090, -6852751, -5110244, 15476028, 1275573, 0, 827361, -700767, 0, -380000, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 153283878, 0, 0, 69510773, 0, -2940407, -16485284, -5018932, -4298673, 78612, 1131064], [1260310591, 12463744, 6513070, -18453746, -1120442, 0, -1594588, -5066588, 0, -44738, 0, 0, 0, 0, 0, 0], [1797159669, -26901930, -4355675, 54825659, 792565, 0, 1298490, 1968394, 0, -471001, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -78182817, 0, 0, -99340852, 0, -596088, 878586, 4627570, 2310661, 2696611, -1416133], [0, 0, 0, 0, 0, -106685177, 0, 0, 382097920, 0, 1953557, -7300828, -3432498, -9257010, 1974337, 392241], [-1432031111, -11984020, -19742887, -14413419, 2748183, 0, 765536, 476528, 0, -557357, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 227962594, 0, 0, 48339653, 0, 5574827, -6671812, 7503036, 2275365, -1469168, 719868], [-4079531225, -18285023, -2837973, 197183, -896420, 0, -1619961, -559073, 0, -654053, 0, 0, 0, 0, 0, 0], [6201731692, 10858290, 30239220, 62568942, 49258, 0, 921454, 991086, 0, 107720, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 12132638, 0, 0, -174920674, 0, 4816462, -22944445, 811330, 117690, 944655, 1898855], [0, 0, 0, 0, 0, 174002863, 0, 0, -4033560, 0, 1747781, -27996282, -1817576, 9510672, -667960, -1426384], [0, 0, 0, 0, 0, 222523905, 0, 0, 722968246, 0, 2328471, -5148766, 4170510, 8096914, 1476549, -1671667], [-455924781, 8877037, 18605939, -57628819, 681640, 0, -1655877, -223021, 0, -127701, 0, 0, 0, 0, 0, 0], [-3522260923, 18273167, 22123493, 55319360, 1852191, 0, -104968, -7223512, 0, 270994, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -536150514, 0, 0, 100497491, 0, -985197, 1151977, -11075014, -11300269, -1665415, 1002109], [0, 0, 0, 0, 0, -132670086, 0, 0, 112412737, 0, -6783187, -9066337, 9566266, 7492521, 1104045, -856519], [0, 0, 0, 0, 0, 171698572, 0, 0, 616441047, 0, 6335985, 16677685, 4804382, -4824581, -2245873, 565235], [0, 0, 0, 0, 0, -43543567, 0, 0, -123745456, 0, -7464556, -30817528, -9464656, -4155111, 1842416, 2141344], [103095620, -46757895, -1755198, 9767335, 675458, 0, -189616, -4216976, 0, 1240903, 0, 0, 0, 0, 0, 0], [4116122, -73029548, -37083187, 21223725, -732369, 0, -1398164, 5932588, 0, -1387957, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -678766924, 0, 0, 18241944, 0, -3045143, 20930154, -2307196, 7985673, -2340182, 5026], [0, 0, 0, 0, 0, 192952138, 0, 0, 483931919, 0, 6417465, -12788157, 1578936, -10373213, -646266, -2237110], [2528895056, -1164185, -14007090, 43428708, -1721593, 0, 1482461, 8506173, 0, 1296664, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -161951268, 0, 0, 1751108, 0, 4409340, -35482796, 1097452, -2728684, 2866, 1610818], [6475141043, 12780575, 43361152, 107990473, 2419545, 0, -2287991, -1967783, 0, -659218, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 294938971, 0, 0, 280836730, 0, -382764, 22226094, 5712216, -15413797, -4624908, 3488740], [0, 0, 0, 0, 0, -586132648, 0, 0, -656580166, 0, 9469948, -5385965, 11735220, -2688180, 2774150, -4813290], [-7334455640, 11508613, 2202757, 76630176, -496005, 0, -4008564, -2025876, 0, -446404, 0, 0, 0, 0, 0, 0], [-1359141958, -13242037, 67360796, 190715159, -1818725, 0, 2038167, -3653449, 0, 83676, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 159470824, 0, 0, -542721696, 0, 6116340, 4512860, 11327896, 3192260, 4796356, -1885340], [0, 0, 0, 0, 0, -502186816, 0, 0, -13669785, 0, 11547427, -39792462, -1203094, -5051343, 3307789, -924119], [-973789862, -40104994, -24335157, 44157289, 7012679, 0, 4184642, 1025026, 0, 625409, 0, 0, 0, 0, 0, 0], [1984571632, -25084733, 12867058, -87376139, -3425663, 0, -3097645, -5780861, 0, 514978, 0, 0, 0, 0, 0, 0], [-719689480, 64386209, 7635066, -3545718, -2105043, 0, 2465679, 2668815, 0, -729428, 0, 0, 0, 0, 0, 0], [-12512561120, 3078755, 26155190, -3970084, 554037, 0, 1558571, 5613659, 0, 111910, 0, 0, 0, 0, 0, 0], [757808620, 79904040, 49677736, -153411784, -5044436, 0, -6096572, 857924, 0, 121052, 0, 0, 0, 0, 0, 0], [-1940496133, -55260122, -105409199, -73197488, -1545029, 0, 75548, -985196, 0, -594983, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 53094950, 0, 0, 1611737885, 0, 4920150, -69190062, 8630910, 10512586, 1057737, 1794353], [7980042212, -38660397, 40367307, -287264592, 3845057, 0, -552688, 4286352, 0, 1032400, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -140535716, 0, 0, -499204494, 0, 15044358, -12533920, 3685972, 1507838, -8273606, -3895886], [0, 0, 0, 0, 0, -300357717, 0, 0, 616735108, 0, -3346416, -13266324, -2172868, 18317027, -429982, 1020322], [2219673054, -114550855, 48789200, 234103711, -282154, 0, 4277338, 482298, 0, -311209, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 421769566, 0, 0, 1639634844, 0, 2058241, 8879112, -4266234, -27946995, 3135633, 3174969], [7627558680, -12253318, 14297552, -343612675, -4066526, 0, -8612654, -7786702, 0, -244416, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 902581432, 0, 0, -1001620843, 0, -10560798, 14186632, -10026656, -8007022, 4348036, -1843796], [0, 0, 0, 0, 0, -1266181550, 0, 0, 836994516, 0, -418845, 25950804, -24994726, -23572089, 2426423, -4925217], [15543868804, -79649802, 416224, -15603407, 8589984, 0, 3032200, 4821160, 0, -555034, 0, 0, 0, 0, 0, 0], [-1837961293, -33942163, -96763414, -3629299, -19195, 0, 2923279, 1129343, 0, -1440484, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_169_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


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


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_169_8_b_e();".
// 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_8_b_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_169_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<2,R![108558883865493504, 0, 9370045529997312, 0, 321870267658240, 0, 5706960529664, 0, 56816563968, 0, 322391392, 0, 1009056, 0, 1601, 0, 1]>],Snew);
    return Vf;
end function;