
// Make newform 207.8.a.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_207_a();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_207_8_a_a();".
// 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_207_8_a_a();".
// 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 := [127016, 42284, -474, -455, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [-76396, -37904, 467, 142, -1], [117124, 2560, -3585, -10, 11], [-399588, -5664, 5137, 10, -11]];
    Rf_basisdens := [1, 1, 1552, 1552, 1552];
    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_207_a();"
function MakeCharacter_207_a()
    N := 207;
    order := 1;
    char_gens := [47, 28];
    v := [1, 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;

function MakeCharacter_207_a_Hecke(Kf)
    return MakeCharacter_207_a();
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 := 8;
    raw_aps := [[0, -1, 0, 0, 0], [0, 0, 0, 0, 0], [54, -2, 1, -1, 1], [-96, 3, -1, -12, -4], [220, 117, -4, 29, 5], [-172, -372, -13, 82, -27], [1126, 1103, -65, -76, -160], [-1208, -598, 121, 127, 125], [-12167, 0, 0, 0, 0], [33850, 3746, -286, -540, -496], [-39540, 4906, -744, -1400, -430], [-40902, 13985, -660, 1431, 177], [-107914, -8482, 2772, -422, 434], [-180296, 25824, 5109, -1083, 2975], [-20306, 9026, -99, 7350, -3311], [61330, 10232, -2343, -8805, 5451], [634970, 39800, -12851, 6800, 5535], [23102, 50535, 7862, 20597, 4461], [-96120, -38948, -32053, 1711, -6131], [-322352, 18550, -7316, 14726, -2758], [-11110, -15000, -14012, 11284, 2604], [-782888, 122297, 21401, -7904, -8456], [-3176088, -72749, 178, 25355, -27507], [-221606, -375585, 12543, 33662, 37888], [-3153854, 490412, 4426, -782, -16134], [4121526, -309240, 78806, 48188, 67986], [-11766776, -407285, 27521, -42218, 21162], [3878412, -100113, 70008, -41589, -7317], [-7502050, -820487, -26384, 22989, 92821], [2366130, 219159, -37421, -45390, -67628], [-3357308, -393198, -230396, -78592, 142654], [2938304, -1121794, 60378, -130390, -62956], [5441470, 224849, 36281, -274804, 105768], [-12746632, -152040, -4946, 222044, -137510], [9028450, 556530, 344899, -28005, 185659], [-10400064, -898964, 392528, -102860, 264788], [-13881926, -1178107, -41464, -269901, -199319], [-24871644, -3215796, -490814, 435802, -252134], [-12196652, -1465902, -143466, 209054, -478460], [-14746518, -2177910, -460414, -107820, 208440], [14423222, 1042754, -62861, 681226, 470883], [22303034, 1690497, -17222, -743687, 257003], [23807620, 2214200, 1155492, -138158, 818276], [-2087224, -545590, 78463, -718176, -1007337], [-45207686, 1961472, -203870, -631754, -160018], [-16244616, -1240571, 891361, 104016, -127876], [-67563488, -3005336, -694740, -39314, -202884], [5848228, 3577428, 1223098, 1305740, 928810], [73037684, -8062113, 164606, -1129203, 133261], [-3632730, 3769441, -494936, 857517, -1026507], [19404706, -10774864, -1060982, 944552, -1059618], [40931300, -18459252, 373738, -1301064, 927322], [-64894258, 2536052, 938088, -612562, 1029932], [146621672, -4586835, 1174364, -767609, 610077], [-12933322, -13139518, -362180, 1295994, 397694], [-44986188, -10587070, -1081708, 2902208, 724790], [-22541974, -10438444, -1954858, -1034366, -847794], [-58438556, -12165566, 1460848, -1263780, -1490126], [15773798, -4651394, 3010156, -187514, -1311494], [-180914818, -5813449, 1569241, -4375950, -386874], [110434752, -1768734, 1119879, -3324279, -836433], [-310275818, -16058244, 328815, -1323737, -552303], [29115768, 828264, 5342380, -2472254, 2318804], [-198173746, 23567588, 916909, 5365244, -2225421], [192473470, 1341654, -840478, 774858, -2932972], [-372683002, 29524318, -1060476, -4726568, 887106], [-171362140, 29412892, -2259522, -3663814, -1290570], [-145852870, -20322950, 6281666, -943516, -665832], [-224929274, 42987682, -142429, 1501702, 698563], [-120801228, 26075834, -2235801, 8248748, 4306935], [-339665306, 45590878, 1746098, 5100376, 6115852], [172474572, 16379684, -3662480, -5688942, 3056180], [138678256, -46508027, -48923, 3450404, 4854056], [-388135614, 17127681, 2639120, -2140985, 2186493], [-141425176, 69541526, -3716859, 4700059, 6066429], [-81379280, 100566930, -1788042, -1647740, -2063924], [522908686, 79426034, 2836951, -529887, -1711977], [-922696234, 50644768, -9045384, -3872144, -7529720], [136526622, -6624465, -699337, 10313616, 11929192], [240259428, -98433126, 3774221, -4143192, 8732481], [111590464, -85893777, 6321822, -3339561, -7985251], [-1055835838, 5079375, 8823930, 6357915, 5121377], [1135318780, -753114, -6854174, 9734886, 6516132], [17144498, 39489270, -4083504, 3955286, 3209102], [-838745580, -10538988, 13896142, -7290100, -941402], [-950004332, -79148844, -1919156, -12108928, 4029576], [-188969606, -126485498, 5397918, -8944702, 9681032], [-397217210, 47428460, -8894220, 7704194, -16117272], [-1130136386, -24706988, 2551264, -1123354, -16623236], [-206473648, -106835932, 3085248, 449240, 17564364], [946222720, -144467879, 6212488, 5226047, -9375843], [-1164765556, -94497336, 8272026, -23591120, -21019146], [-1224178040, 106190252, 632748, 14519420, 408376], [2072429026, 69993142, 4252869, -1813030, 20274269], [-1518686532, 45123956, 5826070, 1946530, -12138914], [927138748, 96923006, 5318698, 16544786, -1629628], [1580435766, 30487138, 11295104, -210824, 21976554], [-1486358086, 130955233, 3980007, 8281960, -355518], [953358096, 24660420, -3605969, -38874709, -19047023], [434886888, 72807270, -4445843, 19029968, 15266005], [467305192, -206141960, -23298480, -20456474, -13364152], [-198842, 16013050, 10218115, -48459435, -19319485], [377216836, 202331423, 14749134, -20419059, 35463421], [-3504812014, -72057425, -15518631, 2001984, -28392402], [-2885530608, -7702024, -8651037, -7907341, -2988383], [625318568, 99699798, 18152407, 32317956, -16893469], [3037547864, -52684774, -14691758, -32063858, 7870248], [-3334858366, 237561810, -2223306, -21586862, -1161748], [4365644476, 57804040, -39108078, 37967444, -9017778], [-838401816, 62959654, -23266125, 42135884, 11705159], [-4513411144, 18637360, -8025436, 5986308, -59520860], [-15814670, 162843591, -7668356, -73999039, -34983361], [-806568806, -248021925, -26856461, -33983010, -26501528], [-1759225088, -94624394, -59850513, 24880165, 8507899], [870732840, 38751459, 25097257, 11030254, 27873818], [-5081862498, 87702771, -3568829, -5722976, 34026560], [1418581536, 118421792, 63708301, 9259365, -40013113], [3942929642, -163495464, -20437493, 20310980, -15893983], [-2338178038, 29472088, 19886928, 85580340, 17113504], [-2767636712, 300856229, -59050340, -26637037, -35696747], [7806550458, -141426049, 11689788, -31392195, 33007287], [5816055252, -460973106, 8199301, 2297912, -18728699], [-7594041670, -100896394, -12109913, 60641527, 30508443], [-368834512, 47966046, 67296514, -43231026, -16038004], [-3164930504, -389119732, -3923236, -22368434, 17979472], [1847769222, 368977840, -15486403, -10830111, 76712639], [-4755999690, 102775087, -55696904, -25350605, -75390069], [929157818, -334844236, -51035969, -21983472, -1637335], [1681045632, 469485191, -71548429, -520812, 13447452], [4059069290, -201469517, -35248866, -76002997, -32636287], [-5937271620, 195045876, 76404144, -54791392, 66598036], [3667757064, -120147566, -57304858, 20237876, -60124052], [1605849632, 584656509, -42281137, 99456162, 58178158], [-8186109726, -102582403, -40639418, 5083637, 52480795], [-5598568818, -448569114, 53618730, -76725848, -63968132], [6123813862, 46509442, -64643350, -1170682, -18870216], [-9233384710, -342163604, 23049031, -30577259, -72380951], [-2655364768, -267775884, -3498651, -45790599, -1217901], [2004015762, -818869410, 20911037, -136587463, 3271317], [10448798466, 355443150, -91495568, -31271384, -33381594], [2720340928, -527542388, -139701636, -64846506, -5796640], [6701749606, -364302096, -141759838, 86489096, -83620834], [12658099024, 984365402, -73304890, 83587140, -76814884], [1089405792, -128337423, -92441164, 167219391, -113077127], [-6371208576, -1026774006, 28657673, -81228164, -88438243], [-657769460, 1445129074, 19105940, 19998620, 41669862], [1653380510, 1127265480, 23269312, -80097064, -50701096], [-1064742966, 94613120, 9216802, -97743364, 32837526], [-1243162832, 47405528, 53891434, -290054924, 23945046], [2417749190, -121142360, 3807217, 164355996, -14701661], [-10531079602, 444852694, 182971272, 100881786, 123785142], [12747668654, 610936791, 89620181, -116285446, -96916166], [20997862220, -560739956, 18632186, 33623798, -14855814], [-900432350, -812276718, 45362587, -93301022, -164316133], [20324006104, 706265910, -129065761, 39656953, -108716645], [2021253060, 372207082, 164424986, 33879750, 211656608], [18232744760, -1032429855, -107955659, -69746824, -56914396], [-13582247178, 419618666, -56410240, -101704378, -45654910], [6468748290, -1361498932, 115101256, -191219728, -99779740], [27967305070, 461513698, -15587871, 132710571, -41342763], [4766046854, -489918650, 99540787, 216314758, 96340327], [-5363377390, 718934903, -74726915, 226059812, 164478626], [19538862780, -22564686, 86273576, 72214372, -64550614], [13617276180, 734694771, -195057602, 114101421, -170460751], [-2477891358, 1065617793, -211383605, -106716332, -313664370], [-16912488596, 1509305030, 655442, 68651042, 165628420], [19048091464, 424942550, -17132642, 229531984, 114425632], [-12260800740, -982146046, -180107369, 259798348, -279715457], [-7210417510, -2725725136, 250082782, -146010626, 52659210], [3355216162, -785982192, -147218452, 201906776, -216038900], [-3000824768, 1458445293, 59188056, 114376567, -38467439], [-5173390410, 599060282, 145337868, 263339982, 191985606], [15991602680, -191860038, -130742066, -356443908, -116419060], [-5431437338, 522229658, 139315452, -231076216, 164120598], [4204537364, 407667286, -103635488, 39112336, 162168294], [22243688686, 58232829, -124251145, 349249810, 139049422], [-15141740792, -1047547232, -105978414, 306406720, -225173594], [26154550446, 1113044950, 162237702, -245990330, -210915664], [5150835800, 70128279, -194891335, -49639814, -194746002], [-12532907490, 1523904965, -207342482, 200842771, -305404421], [9500272444, 679514034, 402345408, -21699648, 209781170], [-23821699444, 284463577, -246113554, -141500421, -94872433], [-14606813986, -1070420490, -101249152, -427830970, -100106386], [31021980266, -1564607282, 443907312, 408013804, 242260374], [-22692120652, -450460962, 163440218, 135465778, 249068676], [-22756542206, 1341500274, -14872035, 97413153, 105314633], [-9519099714, -1626840152, -102137820, 280547880, 251019668], [26839089792, 1585558960, 71805001, -309964143, 435194171], [-16732335158, 2566485468, -283187428, 67235416, -37005272], [-9847583470, 17423494, 622826559, 96906262, 333434715], [2418499098, 3389143116, -366176148, -55469292, -231729720], [-40423001784, 2239103554, 60767766, -128927254, 39858092], [-18764606128, -1144183380, 296388441, 109201485, -14042617], [-30932446918, -1175720546, -358209408, 185150442, -158738650], [2908846688, -1297551445, -428094810, -10424525, -74367807], [-28293730982, 994497641, 79716565, -448301206, 246742148], [-10240436962, 860596404, 240865866, -76862908, 268140994], [5561058978, 173180239, -409887410, 431071275, 176198125], [-2173401226, 1016304261, 330574835, 375469230, 187443050], [-63770438504, 997892136, 303206228, 138394500, 190818516], [-33215722986, 1880653486, 475006055, 320673309, 123686531], [-2761511064, -2060960426, -63893986, -286443520, -307996992], [-28348648474, -1295833430, -130138692, 50588674, -426538442], [-39439686646, 1467445162, 18689754, -22648484, 182246400], [36251543260, -326708127, -376953680, -170876251, -137909379], [23076610262, 228730402, -456683860, -226045860, -427038930], [24261149800, 5021382295, -370215541, 20509124, -193966956], [19803332338, 2467533088, 254165437, 286214560, 300163735], [31533376714, -1425451222, -173871566, -404198986, 189157256], [8579401820, 1066342864, -183412994, -449728902, -310928030], [-38391532854, 3060105728, -308227612, -76261680, 13083956], [-13483951050, 5941838222, -347916690, -307731462, -345000640], [13053993032, 733472249, 93925451, 232327058, 330288302], [-19248549600, -4912163711, 202397578, 266122393, 299989035], [-38150133784, -946737558, -78913720, 441702354, -490875982], [-63261910826, 1381218570, 189896942, 292935358, -79654452], [40244944680, -5287113332, 162599684, -131594056, 215001856], [-40808996398, 6159985270, -97815644, 567796488, -212013782], [6807529240, 1530504420, 199955568, -850392948, -769095724], [8003073654, -3006470262, 19115226, 866754478, -460270640], [-75875683812, -6155251728, -430706237, 700795238, 25652937], [29189053504, 1186135061, -149051297, 1077592798, -529656266], [40511824506, -5488078930, 169808708, -74211020, -129674990], [-8484616680, -4811479545, 319758901, -155336670, 773512338], [50729422528, -960728476, -47195610, -46749516, 152937158], [37686054064, 4319228708, -456962819, -57196970, -530254421], [-64899643510, 4206003935, 1140028467, 69997410, 630176796], [-45874156594, 4551764926, 393120169, 1158150350, 648872241], [101625345576, -4714630507, 24484095, 532478986, -86693962], [13836914180, 4349339112, 251663060, 1017709764, -391476700], [-14228299344, 2878593906, 411832249, -33058012, -692806155], [-14988324936, 9501047450, -53485129, 303516649, 68087255], [37134613304, -11898366011, -236253649, -238193554, -243882490], [14089072738, -7787211504, -276228404, -379460186, 403991140], [-51624021072, 1112393790, -776754177, -690916531, -1091463149], [9445700012, -2620865026, -1024305010, -794570422, 113389392], [-46299659910, -2817390152, 1236104010, -947222102, -324644762], [82411424674, 6612042222, -1155605651, 1189239565, -212774027], [-4686914412, -2377684862, -900048308, -90643618, -515425554], [-22811916490, -3118849526, -465355215, -592512006, -539978907], [54863711964, -1413079921, -99433810, 113850385, 495205421], [62725290804, -1758109316, -504678646, -1879603906, -1300263998], [54886187344, -6235792194, 4028382, 1502343384, -365577576], [-65038198912, 4852071932, 80038961, -1026300810, 496628543], [18371247466, 85841020, 46736546, -1287142788, -1545129742], [36748337968, 3023741660, -808727832, 197466520, -313270748], [82032205128, 3411555158, 927457718, -593210904, 690105320], [-39972041872, 3948437387, 158607342, 410875219, 1128961017], [-20347361840, 9568365806, -1146172713, -692157691, -670210005], [-84218995248, -3215616660, 646128276, -1621130776, 225823656], [-97491381514, 5155990841, 607991692, -1251946131, 428457577], [-25985497146, -1891424535, -1520773729, -795204498, 723901794], [-80190098448, -3848975390, 4363462, -486629608, 86935404], [-127847180770, -7751472354, 739818200, 237185332, 837858798], [-38257757274, -1954775514, -1653434078, 823944938, -4983500], [174638227172, 2776175640, 597093248, -267633052, -481080552], [-50340166446, -2348593311, -998037310, -538615403, 560835603], [40594340376, 3335136500, 1169589527, -206970441, 839165673], [-182187476466, -4333329712, 350730328, 416780054, 103064000], [19412812928, 2509387962, -313671561, 2879104320, -373406993], [8337067016, 3753966219, 998397317, -1653888298, 872062662], [145902712436, -4094613637, 945570952, 506081959, -708702057], [24898212542, -7945797442, 738021968, 1305727678, 18177622], [-205515311046, 1868925763, -591188812, 57963557, -6775757], [28628607226, 6543750540, 997315034, 1240516412, 135504058], [-78039988296, -5049727862, -8620249, 1471043345, -822664937], [-132749280798, -1539937766, -533199515, 1748742733, 1313944169], [-64965285186, -666421799, -1187220125, -290318998, -594053602], [6332878448, -9022888218, 477990135, -1675027187, 1443885859], [14719940438, -11825658224, 998567760, 387172002, 1779831416], [28579114686, -15994523074, 453322488, -1842588374, -796875794], [13273761240, 2147597500, -754394671, 2932843169, 1341763167], [-92453794198, -5191454462, 144086218, 1951711464, 1115623368], [37099780144, 95593381, -203358677, 581283702, 181524538], [-238751669438, -5398533004, 1140901916, 127972416, 359789400], [83589463812, 3048792432, -316181194, -1337643704, 566620538], [119534232994, 5568123932, 579529357, -2044730712, -276350301], [20911234054, 4727103552, -848328376, -824860240, 789583704], [-3146676494, -3462548844, -1024151152, 1472448328, -1164456988], [131382068756, -2560119919, -992461256, 1672051301, 136757637], [30567200638, 6635314652, -1365529159, 2628694228, -1341884001], [84733614328, 3043252583, 1067394829, -564183906, -989968310], [-208381494404, 5257930036, 1619021300, -637185666, 1259104048], [187140791722, -6113348253, 939456192, 970229869, -912804041], [100712709160, -9912532228, -475460420, 40324434, 379076008], [-120903043686, -5891658572, -2252278181, 2028410940, 1476543357], [-107107782146, 1446446704, -54436424, -1194707150, 1046883848], [-217126400626, -13099738694, 603980803, 1040956469, 424733427], [228837535448, 1095379952, 1062784460, -1431816048, -857316100], [-165529388306, 6961994752, 889042626, 502413350, 484878406], [62836298130, -2126706254, 1116138139, -1879131337, -1020349165], [7289479060, 4746228355, -2030758252, 1327368843, 521773795], [75042033494, 13179339828, -1615852750, 1183255026, 1816153994], [62660910300, 6471374043, 3115300182, -1128132415, -224768799], [77579246084, 4252549178, 2123614455, 118585036, 2369102151], [-74126684442, 5270312606, -3003082835, -2754683497, -2334987483], [216727143712, 311187079, -1087237509, -973453280, 457620116], [154370926038, 737655228, -2522231130, -537975096, -2244203610], [-17598758396, 15536011020, -446284312, -1453350828, 58814660], [80450291444, 10925838824, 1611295280, -778719424, -519470272], [7781235334, 13052246726, -2136541870, 1382050782, -318441692], [-249538205794, 2946109958, 1419332543, 187403977, -2227795261], [270937763688, 13135554559, 2846948339, -1568403340, -543754380], [353459569374, -20439100140, 253323099, -552034432, -385251595], [-123546007456, -12231749962, 1178650261, 3681434215, 2481605293], [89671249400, -2996717962, -1881751369, 379351260, -2313039589], [27849777736, -7666800340, 283393946, -992149928, 753714234], [35664511182, -15554041751, 42327896, -1692835059, 1429976557], [188706580372, -10597591766, 1527385784, -259252172, -2092029542], [-135842939040, 23826005952, -1011590611, 3257275586, 418476695], [170890594094, -10150136784, -870917715, -3969080868, -3569990561], [-176123341178, -11540060224, 300517403, 3960787311, 326980553], [215082933154, 24970141877, 1566426247, -3056152860, 1462822310], [-276372419212, 4445592852, -1651054340, 590579168, -1364825376], [-87138196128, -3022354514, -2516487304, 1490369474, -2958560498], [85117640766, 501913746, -535754908, -4587924612, -3439507498], [398693741896, -14412027740, -527478802, 680257120, -138999394], [265110244850, 654788554, 2438401731, -1682124258, 1507885435], [-177128517202, -3160625738, -1774707556, -1590909628, -769455918], [161650926670, -4198715990, 2364098044, 994639486, 1451390454], [45499821144, 16377515124, 166991301, -2252695883, 893429459], [346659870370, -16038677334, -319380056, -1337007818, -916390950], [-127981984998, -9796351254, -1463490584, -1480287098, 473060378], [-88858813832, -6227941808, -934503120, 3736117264, -487853032], [-295012342358, -17767696597, 2434428473, -2750838024, -4410448294], [84704577442, 5984770532, 2917696830, -3593216338, 3309527118], [77612939736, -30415007736, -1978607923, -1279932719, -988065921], [-90715552232, 8117394112, 497633554, 805160784, -1300915042], [-37102681020, -3960402304, 261566122, -2952300716, 1928814398], [-142457356574, -11534763278, 593697737, 1587436141, -1450163619], [57066812294, 3301343314, -3727028304, 3798546490, 2115668346], [-8781034226, -13130716700, 2076876818, -4835399980, 2523468930], [46062582904, 30693814448, -1168492556, 4291059668, -2983821740], [620523476420, -6108065794, 1772714252, 3374389926, 1281004474], [122364674392, -5838280954, 6252048407, 1011991241, 5498144787], [-111179553922, -19035430662, -3155008641, -2890718026, -445282737], [130425363218, -27915499339, 1307467952, -1512107793, -989202527], [-213339373578, -16685308665, -2269216887, 3272208714, 2387595942], [-58728436304, -14396081638, 1882626671, -6745623528, 2437829831], [198025332568, -15219034977, -1879812591, 1109793702, -799591522], [-306187909880, -2139949424, -1676012887, 727498522, 3350521515], [-229936125690, -3683595981, -2118304173, 2886713576, -811429584], [584160626766, -1307002990, 164858666, -1856917658, -363227000], [369589686152, -11716826921, -4852374281, 1326257220, -2369360600], [-27986856270, -22291473428, -225635681, -4245642675, 88008417], [454842888916, -6854743732, 920023128, 442464856, -2455956748], [-260000318332, -1438062648, -642736121, 7444491638, 922020413], [-203271046816, 8190546764, -488475108, -1307454338, 535614776], [71586367092, -19954909946, 1444092994, 5166957770, 2064283492], [-212093128610, 4124791056, 3549724063, 5888713503, 2354572101], [-167035806836, 3253002624, 3120776712, 4404502708, 3621975032], [-332513156604, 32295854314, 3088247125, 2869616136, 874136993], [657236321974, 7004452832, 1705417368, -2722056794, -708217872], [-30403358488, -2921566159, -4437124483, -352556796, 3005391948], [-245754062782, 23512861983, 987239148, -3246727639, -46574585], [-209866626486, -11779800514, -2152891264, 7051936692, -2624516106], [-295173169176, 12910359626, 125272430, -4792486728, -932599284], [-56186871036, 42306483793, 3620328418, -2268732761, 1803184963], [170731376374, 23251168478, 2725953222, -2567561588, -4141914504], [-143420762626, 45173893530, -1456756699, 2344842258, 4321269601], [17805524382, 9820387547, -3083481442, -1207886259, 253989257], [60226055622, -10597580912, 1216796422, -4783598662, 1611405682], [30174384508, -14437948450, 5782842222, -4769572246, -857564616], [536674503008, 451246283, -2103296408, -6306489027, -3473278553], [-299233342728, 3029041496, 2661040646, -10911768128, 1548131970], [-552781552598, 6761305504, -2190372488, 5163288128, -5024882928], [693103594014, 27513546878, -4601784246, 342753022, -4244240860], [21710511984, 8588584697, 1795650217, -1961316992, 888240232], [162868283214, -39450138458, -1417407314, -1308560586, 2208842808], [-77535342366, -22932414218, -966098943, 3356806442, 4485193265], [684944731924, 24319650424, 2096414906, -58050550, 5035096110], [36176274828, 19912659806, 4716954842, 9801758502, -1947248340], [-239691592170, -34612085540, -461073419, 3301383401, -221826621], [209473160504, 3915723207, -922281155, -7590630714, -2345679094], [-97588066226, -14405294712, 2627086620, -4097472072, 1135181132], [171766736144, -10250337222, -4437225826, -2171276902, -6577435828], [-209939911400, 1958435942, -6837789932, -6641182282, -1939692902], [179407020630, 41717630992, -1650910906, 1043146624, -2676942814], [-202243044942, -4277442519, 158447223, 8956000232, 2160725530], [-19411767144, 10656575926, 910877307, -1001573476, -2300915609], [-141664101326, 67991875242, 1267515901, -714480939, 2380577361], [-523877556850, -19630321475, -2035975755, -2019435852, -1194342856], [668992897316, -20400940342, 1874787980, 580477284, -2579200994], [466954450106, -9440205810, -11046859654, 4281729670, -6830273580], [116973270328, -65286476790, -4163730871, 1822384343, -3239296307], [-1195163314884, 8737587104, -4167408002, -479013632, 1593565802], [466977753312, 51077249362, 2005111110, 2946500640, 3715942580], [233937478566, -1375005682, 5132015092, -5527263362, 7209796818], [-387532343288, -82251148224, 6624776883, -6317086689, 1347340201], [-746505037824, 31345733434, -5417404336, -5419796606, -4124392078], [655494711358, -41128561126, 137436300, -8244491696, 8375957670], [295934902482, 22814795180, 6502579426, -3954757634, 7469681018], [-564594743066, -14971214684, -1396934617, -4844217724, 5224432233], [-103645855656, 74549187956, -2940788348, 2705876446, -8156727568], [-666223690168, -31056589594, -100064496, 6288284726, 6156093710], [412407064398, -2225275404, 3004578920, -10699598278, 3464993708], [-476399639992, -11028412431, 5122983199, 2395453106, -649538750], [26198371466, -50374280639, 9954977679, 2703910040, 12365843706], [932279750808, 2040703584, 3955268761, 4885892489, -3448579333], [202525707054, -27522250034, 6964547366, -5680953098, -4462580984], [152523335222, 28141781820, -3232774200, -13407173868, -9720452972], [816889101566, 16639701504, 3185206806, -1720229790, -826878398], [47969666336, 21452633681, -7752905547, 8933796800, 2260068740], [106928260082, -3440313205, 1228185385, -7219421604, 5347527690], [749014000666, 37443864082, 3362024444, -3827238690, -3319048002], [549563121848, -23616650256, -6189923196, -338877776, 6570179620], [6627958666, -70505420255, 4220326306, -3872151987, -6500496189], [-781682269278, 28434376116, 3285389816, 6720992426, -6507364836], [-589515411832, 22026320962, -5423333733, 8348148181, 1157230811], [593133541970, 13520259730, 1704587925, 10866511578, 504722569], [-180551622980, 1988630082, 5231966313, -369856260, 8298223189], [88720855398, 33702320586, -9921156150, 8848891858, -1158874560], [-75827094072, 40018002995, 12659939738, -9261092257, 9875905733], [-415732927584, 29424270276, 6915883311, 5794180223, -5519459183], [-412817910642, 11032183778, 3871223480, 3029323152, 6856640338], [288643265426, -26839076654, 9910235126, -626361956, -2905666564], [412599348046, -28612567070, -7512492539, -11228390146, -8519301687], [-430993012816, -33048540010, -874146298, 6797508168, 1159382040], [-858614933654, 50696705841, 451368163, 6826088792, 8460036966], [342808027752, -46962967788, -1193106886, 7881356258, 706067362], [318712429082, -113794522210, -775985463, -2247907543, -4481303911], [92396523590, 38198971325, -2713626882, 12534297995, 5653112371], [-364309710752, 50436497244, -2134192164, 5971917272, 2491436064], [316440532606, 5118004272, -7104561341, -4624795544, -2302487191], [448914979026, 57998581668, -3153139660, 12037552132, -1272400080], [136086478114, 79657553168, 9266734260, -19543575980, 8200877396], [-482913960520, 80269623951, 405740072, 5615901993, 8148575227], [649253068558, 39549221544, -7569034356, -6596288128, -4028074260], [-1328468054708, -18108130204, -5053626246, 3203127906, -8988353998], [-917614200910, 73055077686, 1295142487, 10907161418, -5459723485]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_207_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_207_8_a_a();".
// 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_207_8_a_a(:prec:=5)
    chi := MakeCharacter_207_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 8));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(2999) - 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_207_8_a_a();".
// 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_207_8_a_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_207_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<2,R![-127016, 42284, 474, -455, 0, 1]>],Snew);
    return Vf;
end function;