
// Make newform 207.6.a.f in Magma, downloaded from the LMFDB on 24 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_6_a_f();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_207_6_a_f();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [2197, 1404, -257, -113, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [0, 2, 0, 0, 0], [5941, -499, -700, -13, 7], [4511, -419, -56, 13, -1], [18005, 11821, -1676, -221, 23]];
    Rf_basisdens := [1, 1, 468, 117, 468];
    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 := 6;
    raw_aps := [[-2, 0, 1, 0, 0], [0, 0, 0, 0, 0], [-18, 3, -3, -1, -1], [52, -5, 5, 0, -1], [-212, 0, -14, 5, 6], [-182, -22, -33, -10, 1], [-478, -13, -71, -8, -5], [400, 35, 53, -9, 23], [529, 0, 0, 0, 0], [-198, -90, -242, 96, 26], [-1344, 50, -316, -36, 20], [-1442, 114, -530, -9, -30], [-3754, 132, -1036, -34, 204], [-784, 135, -295, 361, 19], [-540, -1116, 921, 102, -161], [1846, -235, 1461, 55, 335], [-14872, -1416, -419, -324, -261], [-9650, 242, 1860, 133, 44], [-2152, -563, 4643, 47, -31], [-6648, 4352, -2272, 58, 64], [7914, 1156, 3552, -88, 64], [11836, 4233, -4569, 624, -251], [-21124, 1080, 7684, -781, -332], [-59454, -2883, 8269, 558, -161], [20826, 1122, -7270, -958, -242], [11250, 1932, 7186, 2664, -1026], [-15228, -6963, -4461, -2450, -487], [-43092, -6188, 1082, 1299, -642], [96358, 932, -1126, 2477, -1042], [-61334, -8895, 10609, 106, 1995], [-7056, 7778, -3788, -440, 1476], [12340, 4236, 6306, -5974, 270], [79954, 7437, -23673, 712, -1339], [-43772, -4932, 26562, -1796, -1458], [-138754, -15169, 11651, -2657, -1575], [-66920, 16160, -280, 6232, 4552], [-102826, -206, 3346, -6765, 3550], [22332, 17730, -38098, -4454, -6678], [-95824, 19996, 694, 3178, -150], [27834, 1574, 28454, -2080, 2242], [-109928, 6104, -52569, -154, 4177], [38982, -4200, -30812, 1, -1628], [-53472, -4106, -10228, 2610, 3356], [-223762, -8646, -21725, 6260, -515], [548514, 12690, -2370, 978, 314], [-101780, 17697, 32891, -9644, -1103], [-164924, 38370, -68, -1658, -10084], [-436472, -19824, -37606, -4152, 6694], [-265108, 17394, 85600, 8661, -2096], [-335618, 53396, 31194, 773, -5618], [78462, -8520, 65930, -13664, 9446], [-566264, 44044, -25330, -8184, 946], [-344014, -22802, -76112, -506, 16696], [145852, 55046, -100974, -2185, -9362], [-20498, 9040, 14500, -31210, 3660], [-509784, 30194, 48256, -2040, -13336], [889834, 15242, -79774, 9270, 3702], [443808, -59218, 35864, 18092, 6992], [-500954, 11032, -162528, 11614, -15024], [-57694, -34427, 53643, 24470, -9263], [175136, 22025, 40667, 21625, -13591], [451974, -983, -27561, 45567, 13197], [282116, -142930, 43864, -19614, -13312], [-1107220, -16416, -97643, 19200, -23661], [-519966, 64236, -96322, -13318, 17778], [-1424846, -53450, -6248, 8300, 12256], [2052852, 8834, -94874, -17758, -9662], [-458678, 72926, 91222, -18324, -18318], [-486960, -72228, 21975, 10562, -43663], [-2132774, 38110, 78327, 1456, 4361], [134, 81838, -24930, -41544, -44438], [-320616, 81250, -145680, 26746, -1112], [1598076, -111367, 29579, -21980, -7487], [-1455762, -114398, 215346, 47143, 24830], [-113616, -126713, -49875, -51673, -27473], [235928, 69902, -100878, 4796, 41654], [-466922, -209387, -22677, -58879, -18887], [-70818, 146704, -40384, -25592, 16320], [-1867166, -9081, 118233, 60428, 26315], [942974, -45454, 262233, -54588, 14103], [1667132, 22280, -277368, -2921, 21424], [-577594, -60308, 83432, 8363, -12768], [465592, -172800, 342086, 69046, 39962], [471890, 31352, 161668, 53574, -63508], [-12688, -243616, 77242, -9020, -14874], [-596780, -207116, 53572, 27896, -13268], [-6362, 32212, 279534, 6782, 12258], [-136950, -260254, -57980, -52926, -46284], [-233038, 27990, -28084, 178114, 22764], [-1465232, -189436, 12796, 95112, -6012], [3047220, -130022, 101502, -4729, 20530], [1320200, 87216, -321102, -16504, -34370], [-3004696, 27456, 446440, -73204, -23800], [-3343256, -159204, 348601, -64930, -5505], [1566332, -124574, -472334, 6186, -28154], [638544, -381252, -279850, -60582, 18554], [1261778, -74014, -53252, -154628, -7348], [-2696078, 220029, 340001, 2240, -33509], [-1356464, -158095, 536759, 13067, -4675], [328658, -176202, 684813, 64468, 15651], [3708884, 133218, 18672, -32194, 80232], [5273182, -367647, 739047, -45283, 11181], [976300, 476122, -867872, -63595, 62960], [-6805094, -311661, -619321, -16224, -120003], [-1507688, -11031, -71825, -35689, 136229], [-2122514, 19634, -25613, 48628, -59267], [-2641844, 302724, -68518, -17194, -65450], [1693894, -54168, 451774, 37622, -166686], [4295424, 162172, -19034, -71900, 28058], [-1440042, 531050, -711025, 32876, 35361], [-5585024, -77172, 452268, -76152, -50540], [-3998146, -109618, 233114, 17505, -22666], [359650, 606361, 565369, 103502, 73283], [295432, -439707, 98167, 116825, 142013], [3187804, 368841, 675247, 14146, 108397], [-42126, -189645, -907555, 131084, -6249], [10116504, -17193, -162983, 33913, 86035], [717268, -424180, -274085, -37360, -70995], [-4467054, -694892, -113308, -131104, -82084], [-8028236, -245742, 1419346, 183715, 41598], [1195134, 189314, -879462, -45947, -201370], [2090790, -498058, -995415, -92688, 68551], [-6430482, 316079, -1340729, 23523, 85461], [5613484, -138728, -1396822, 31558, -65066], [3423716, -1008634, 500844, -88282, -45604], [-4877274, 169011, -258547, 128169, 48767], [12297854, -99452, -1040778, -159501, -68190], [10327164, -601092, 549015, -47196, -56719], [-261956, -706725, 419861, -262156, 19567], [4437598, -534040, 1372404, -73629, 227300], [11049972, -792868, 318304, 149264, -21232], [4794080, -186810, -646782, -374276, -42138], [3771340, 278959, -382055, -188474, 86379], [3985606, -34600, 1413232, -46611, -10472], [-10571234, -425170, -108114, -273592, -99046], [3929114, -43132, -249970, -102338, -29758], [-3816082, 19503, -94869, -32895, 241825], [1768424, 267063, 1152129, 355125, 184779], [-7196514, 270413, 644525, -177747, -189753], [7060598, 260318, -729860, 47512, 63740], [7576876, 356246, -2595628, -138818, -87596], [-4081502, 386656, 75246, 339452, 250674], [-6694416, 598230, 802138, 167592, -329122], [5122876, 1167962, -1811774, -130033, -54130], [8676674, -77234, 887497, 360520, 229831], [3589672, 461134, -1460576, 171692, -105512], [-14338762, -602496, 1505108, -23936, 159148], [-5935170, -931572, -11054, -296892, -245298], [14759076, -181564, -368286, -24604, -191810], [5819668, 116004, 794545, 552512, -26617], [13538910, -108948, 492360, 212626, 381368], [-5913558, 1257213, 1397943, -353754, -43739], [3291132, 765950, -1215094, -318290, -73138], [11780948, -915848, 97431, 15706, 116641], [1732416, 1329701, -1198461, 86577, -233231], [-9853576, 112556, 196342, -448946, -246950], [6950060, -801563, 1292479, 421060, 313309], [-14622210, 1349292, 509256, 74850, -201928], [-6465526, 52940, 459240, 134064, 59816], [-8352986, -558957, -1149851, 720707, -27017], [2211480, 830464, -858425, 52802, -225775], [-18312022, -521561, -1693893, -60076, -134055], [-11518216, -765722, 2016556, -283928, -13220], [668148, -740834, 4499560, -242523, -76360], [12916506, 1637257, -1138523, 48564, -316089], [10209680, 831660, -560602, -533246, -396246], [-10602632, 1006886, 4096682, 587132, 3086], [-2578558, 787302, -2722585, 239976, -215591], [-8586550, -1134942, -561602, 361390, 201770], [-13700118, -1007744, -2655320, 69548, -230968], [-7000036, -2277002, -2060954, -241129, 54266], [-23547234, -2151588, 2088236, 60886, 102068], [-3616784, 843694, -518638, 33772, -223754], [-9964694, 805330, 410728, 342752, -110624], [-7639984, 317526, 3071760, -5056, 160408], [13703242, 82395, 4490653, -167938, 204839], [-2892460, 1298104, -2878462, 175264, 15918], [-15491614, 1098128, 2284122, 237538, -138650], [-5268084, -2300271, 6855, 91710, 228693], [-5473170, 886786, 1859712, 95435, -459904], [-8969392, 606890, -3626556, 243220, -451916], [7933724, -806850, 4193876, -133701, 213788], [-26507946, 2687232, -1207152, -117434, 68608], [-19573882, -1281422, 5040108, 295900, 285404], [34927032, -211692, 3356094, -586134, 107154], [21502918, -1633567, -919067, -557347, 21951], [-7335522, -1482880, 5237060, -510224, -149924], [1945944, -670653, -5071611, -318979, 354807], [-10157062, 1167620, 1759804, 217804, 116484], [-69988, 1492616, -1738069, -519626, -916819], [34751506, -2827560, -69748, 1135976, 482980], [-39126660, 628912, -3614706, 780074, 287538], [29719816, 1593923, -7071667, -503967, -74833], [18577442, -470724, 3451780, -1293338, -663620], [-23969588, -193672, 3481336, -194381, -127456], [4746890, 2861219, -5594057, 240826, 101821], [-19659926, -598752, 3001714, -532500, -180002], [-399682, -3299588, -2802588, -210949, 73892], [752050, 851311, 1694425, 1113746, -621189], [-28875240, 260420, 420132, 217620, -796020], [11339982, -77555, 712147, -1346043, -866767], [-17166872, -200266, -481762, 135520, -290854], [-32631482, -2275608, 4781456, 209034, 361696], [6810378, -2527874, 1653830, -923652, 90594], [-69302964, 1620364, -2995714, 27741, 388362], [16537762, 2024606, -5516360, -326128, 400384], [43949556, -427413, -5567979, 179004, 46959], [-9913888, -3068480, 5654581, -423316, 301763], [34025422, 1898980, 3840954, -142894, 44214], [44494180, 1032894, -5822870, -999934, 415358], [-20485582, -567104, -2051448, 882036, 687752], [-5430574, -1107356, 10238066, -860378, -131138], [8804348, -841289, -1585879, 14538, 98075], [17322292, 2994328, 980704, 130729, -88024], [1337208, -1402488, -1147164, -809106, 1078172], [-42223214, 846892, -8430078, 756622, 230606], [-57312320, 275020, 3842988, 726404, 113108], [-2401794, -2133850, 1054104, -878424, 302944], [7929336, -1416816, -1006256, -321828, 1018160], [-4357990, 3910060, -11477418, 991282, -625350], [-15883134, 2305594, 7685407, 754442, -553247], [42105660, 2591119, 1624165, 494622, 522943], [-8424786, -2854142, -4818784, -1063164, -529208], [-36845644, -2138919, 2934963, -1366138, -261911], [-25528348, 3650472, -5814950, -428380, 407958], [50212730, -1988386, 7200745, -1178654, 40887], [69064098, -2374015, -2708791, -235686, 359283], [4805764, 2595112, -2234451, 1528550, -254309], [403156, 287135, 3159857, -1096538, -106733], [-29130876, 4486900, -5705620, -231516, -362332], [-32091278, 546782, -3773095, 196600, -1030921], [23387432, 2616545, -6588949, -2160487, -487047], [7510476, -3217965, 3053881, 1883346, 270299], [39637014, 8205234, -11241312, 168026, -281032], [22542600, 2859605, -3034217, 487913, -176035], [20617576, -4944140, 384522, 488498, 73414], [16054922, 4734550, -2766998, -1035894, -479186], [-44243930, 1179377, -3859155, 2678425, 768375], [-46242588, 2532260, -1571072, -1177970, -424288], [-36162308, -2043112, 872325, 1156626, -379869], [61604620, 5937862, -7309520, 575265, -401872], [71721316, -272666, -759522, 1201526, -801046], [34936496, 889342, -10961966, 236204, -96218], [76047394, 123846, 8854381, -1072254, 363059], [9718678, 1737888, 2515970, 2126628, 768782], [10190584, 2587108, 5391808, 955840, 1532304], [-9227384, 17094, -9372538, 254992, -917198], [105263212, -575416, -1062176, 975403, 523640], [24349248, -1727407, -8363789, -2252571, -163599], [-46480736, -3590284, 5764644, 776016, 573996], [5746550, -2518404, 896422, 922077, 186082], [-15589406, -3590765, -3671563, 153418, 923855], [68901632, -264822, -1760942, -1668880, 330790], [69766266, -1419974, 6018284, 473196, -1322916], [-6871174, -4081740, 275166, -1012562, 410034], [-36825908, -4432156, 8535096, 63964, 394616], [-56157050, 1545524, 3119140, -1480059, 491220], [71252888, 7757401, -11070093, 644923, -552223], [-31751414, -193926, -8515692, -882638, 2494996], [-73917306, 2297002, 6167131, -115692, 517957], [-116471244, 4232497, 249107, -1077070, 174313], [-49423100, -4598484, -1994830, -931705, 11014], [50059222, -3222368, -14251488, -1556954, -151728], [-9774234, -4039130, 4972282, -688299, -128426], [36447286, -694744, -557998, -743132, -203586], [74540928, -2088347, 2844031, 651525, 1071925], [50585134, 2440981, -4507259, -2677023, -1066609], [58338922, 6405735, 4900121, 2045582, -1656261], [2335408, -3924095, 2718291, 2007157, 1595217], [5015050, 4782014, -8384364, -822274, -454236], [15251678, 2050852, 3257240, 2418578, -1967224], [-34800488, -1817433, 3785029, -2969459, -802585], [-15927054, 27802, -8049602, -283672, -327686], [32372468, -811969, 2706225, -450426, 270835], [-49852878, -6190188, 5081464, 1028776, 2525144], [-37722000, -6179216, 6375210, 2292816, -1141834], [78990056, 2791748, 1111477, -1208084, 910067], [41382814, -67008, 6271468, 33456, 1473588], [44651018, 5175236, 6895048, 936224, 1598568], [-119477836, -1061924, -5444250, 1061565, 830562], [53446004, -5420304, -5827951, -496136, -784681], [56181124, 309177, -12345425, 518430, -220499], [69626184, -6328306, 6804340, 37614, 1396564], [-7858546, -2541250, -9435666, 2369381, 1420898], [61009964, -6978134, 8725256, 825122, -1027648], [34563180, -1406960, -1528333, -1378128, 2400933], [92440594, 221990, 11061904, -1966862, 1496344], [64218358, 3508185, 434095, -623899, 1103269], [-44247368, 1081328, 10184096, 1269840, -295408], [-40740458, -758638, 6938846, 1482898, -1597782], [3045542, -6259541, -6124101, -1425725, -675503], [-75830028, 5094568, -12246610, 107283, 422842], [49801806, -7231886, 2682206, -297546, 2466218], [-179293644, -2086774, 6882736, 393505, 532736], [37481898, -4643058, 17663479, -1061944, -1333175], [-101591258, 7496259, 6746769, -1408657, -2165621], [-18813556, -4736445, 22746993, -3266644, 296787], [-16465550, 1074748, 4206586, 2607716, -2049674], [-63379676, 9292824, 6319960, 1388452, 803080], [-180637596, -363112, -3121956, 1449272, -221484], [-56978510, -3408744, -2818482, 1057726, -397806], [-37150450, -8093175, 17078163, -3250511, -580991], [-2870428, 6292275, -11658195, 262476, -3720009], [-27211384, -7298188, 15430763, -2038700, -517139], [118333528, -3360505, -2426391, -1810905, -1787693], [6396814, 6356298, -5018549, 1188720, -1112587], [-83452836, -1998756, -12636650, -2113344, -366198], [13187014, 9944332, -7893390, -1124267, -2309994], [34933064, -11236498, -4222660, -1059444, -969668], [-132819190, 639134, -1896159, 3468054, 3762047], [32148052, 8356364, -15052363, -1452088, -2035837], [-116803946, 8362189, 1783499, 1404239, -173367], [36280442, 16381581, 8037033, 3981540, 2003507], [-115313452, 3365764, 10259920, 2376608, 1827952], [-69401800, -2402732, 30918356, 1733194, -204660], [62697322, 1454326, 6932216, -167748, -1427296], [28280324, -7044852, 12490162, 630808, 2568046], [-190344340, -2790012, 2865511, -1883586, 1977025], [-41255838, -8172566, -9165120, 2790004, -1297432], [-115646514, -3427796, 5351388, 1081506, 2138628], [64589416, -404037, 11247233, 4221417, -118405], [-30159862, 11731580, -21854020, 1748774, 1249732], [-21614110, 336876, 10886652, -3668550, -712156], [-38842528, 7120536, -20658504, 2875988, -342504], [-28024422, 5826143, -9078865, 3129000, 2405381], [118879274, -6468682, 17092334, -4525178, -1898998], [-105408168, -987693, -13585463, -3351923, 2679251], [-56563436, 20796184, -4344058, 2053064, 1968858], [31728328, 5638620, -11024190, -1041580, 112830], [16288758, -4909235, 21392081, -3379295, 2589347], [-96331202, -7212792, 1845392, -3991126, -2209760], [6755114, 2130624, -21707594, 2834176, 2984810], [-94078768, -5859356, 28900280, -920436, 386920], [140655260, 13104504, 9780792, 2019934, 720312], [-5729104, -7413923, -2039549, -2763111, -4655151], [144068224, -3504828, 9598459, 1886858, 2533645], [-44065866, -8429202, -2894278, -4609089, -504794], [27579802, -7843659, 8549675, -548026, 2276401], [-141500746, 347538, 353123, 6008812, 2550205], [75872668, 5529697, 13108379, 1348814, 197985], [94609386, 8022566, -16312931, -1942274, 2745443], [71744698, 4386227, 15180141, 2528700, -2621241], [-103800094, -2977116, -1324442, -4719278, -1543350], [121682084, -6976185, 17005173, 2034904, 3284607], [240106470, 4704487, -27643213, -3272775, -2093031], [129042908, 7790756, 1073312, -1073024, 4101520], [50085778, -8417982, 26468955, -623878, -1882875], [-165517556, -6314770, -11414288, 3247158, -2761912], [-52962072, -654396, -17028954, 3049682, -1311958], [-90475978, 3884965, -10400385, -4730697, 2749269], [21827316, -12525884, 23497320, 321596, 2759112], [-61131090, -8262478, 4826257, 1603928, 3691407], [183766578, 1943282, 23214940, 317914, 298220], [-67128772, -3958123, -1209245, -2309124, -994791], [237692222, 7162478, 8543986, 1557161, 1669214], [-77684858, 16654738, -6587084, -1341220, -1173932], [103955912, -2717510, 11572410, -5001896, -923074], [-107103340, -9354358, 10306640, -3363449, 3088848], [68496470, -4873966, -14114662, -953572, -722018], [24511484, 2551152, -21864407, 7703874, 1347871], [180968102, 4040054, -21716716, -142539, 48428], [6552510, -5520098, -19989886, 1807142, -1375018], [-84000088, -8202068, 5319942, -5591138, 1208282], [-29584788, -11228362, 6172450, 1020245, -3808498], [-88043460, 4206456, 3164634, -3765640, -5486138], [-98894422, -3755952, 15703112, 4946892, -1356600], [166983690, -1929600, 5199374, -520486, 1169106], [-63697084, -10635511, 12437223, 1387920, 533701], [-80499694, -303976, -13518310, 3172726, 2960102], [-143939008, -25470580, 23503389, -1649154, 1475195], [-11387068, 13813070, -10102066, -5842670, -1950310], [23427864, -1730368, 4437778, 1150050, 1798974], [-159777010, 18336927, -17667179, -3621847, -5303897], [148260732, 656125, -12844653, -7218070, -2302215], [123360686, 11110576, 9732376, 9425992, 3934216], [-78987468, 6446808, -8103474, 7747258, 3632050], [-279265168, 23234632, 17358560, -3621522, -1984112], [155336314, -17193536, -37310226, -2589800, -747614], [59883610, 15388549, 24822457, -606800, 3373155], [-71632202, 9824346, 10992231, -2120928, 77881], [-208460898, -708963, 19112229, -263047, 1731247], [89987202, 2428049, -6514589, 6247368, -2965159], [139776296, -310826, 1699124, 902764, -1550700], [-138299322, -3501536, -12398062, 4110618, -2300466], [-159669784, 11389383, -43943271, 2796051, 4616515], [-368298272, 6325352, -27535286, 972656, 4845798], [-3276840, 3717194, 7886966, -7176296, 802354], [95259654, 12091024, 41322816, 391846, -1939216], [6256600, -3315611, -3501217, -6380453, 298725], [89965776, 12246080, 19184100, 5957978, 3543276], [135246946, -17479846, 60741696, -4912416, -459288], [-55537150, -1587274, 9692190, 3143122, -2270582], [-1895840, -28647280, 21252351, 6604520, -855671], [-68910684, 14398494, -29379548, -4694994, 4230212], [-90303640, -17528840, -9785684, -2656946, 1492132], [-120536390, 8466058, -19000984, 5159290, 5561680], [-53276772, 13086739, -46412223, 3817766, -1431661], [-120973982, 6365221, -16181591, -2751680, 2969075], [-14973352, -11743241, -23516479, -3365671, 489675], [136860930, 1759680, -7692286, 5531434, -2904258], [34041790, -19108312, 12392972, 1193396, -2749708], [64102438, -33187194, -16920302, -1550578, -236986], [129300076, -2782159, -566141, 2028800, 4553769], [112364586, 13826971, -31205665, -7435076, 2367077], [-175835302, -2032060, -29590528, 1267866, 1426848], [101776136, 12616768, -25031572, -663804, -1820540], [12103870, -999876, 9838476, 4482165, -3764820], [71219966, -1035198, 45602396, -7413650, -679876], [283944360, -7851115, -12995249, 5065157, -126843], [8445488, 24764728, -1889079, -3102234, -2955329], [-298648890, -4793130, -8107499, -10708228, 585179], [-47991502, 12205424, 33619718, 9366126, 5125242], [-246762972, -20100404, -1149436, -7186761, -2967388], [110831080, 11539781, 7245807, 6549031, -7223883], [-6792198, 3019610, -24480308, 13970272, -294276], [507187770, -14122130, -5160726, 6581656, 528958], [-244734828, -8297972, -13000599, 5647670, -1173905], [116912528, -11281370, 17038466, -6869172, -4852362], [76474218, 4135293, 21601917, 956424, -3248097], [-124986528, -4842566, -16787310, 8146690, 1426518], [253068574, 7924165, 27880553, -7051051, 3665931], [201869414, 7642770, 7240352, -6943197, 3032704], [378146992, -13313964, 24434316, -3653816, -6550876], [-85430784, 15899896, 49509995, 503148, -1309219], [-200096486, -1466192, 81514076, 3451428, 2174628], [-102067054, 11516164, 39512904, 15282880, 4158136], [163175844, 1571190, -16035846, 529313, -6220906], [81575078, 5507072, 52749468, 1892952, 593988], [144358612, 6319250, 57137994, 2177586, -7244866], [-120652508, 15359556, 35952915, -1737430, 953781]];
    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_6_a_f();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_207_6_a_f(:prec:=5)
    chi := MakeCharacter_207_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 6));
    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_6_a_f();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_207_6_a_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_207_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<2,R![6440, 1740, -770, -107, 8, 1]>],Snew);
    return Vf;
end function;