
// Make newform 230.6.a.g in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_230_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_230_6_a_g();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_230_6_a_g();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [10080, 13416, -255, -772, 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], [-49872, -64449, 21494, 96, -29], [-308394, -138879, 19336, 198, -25], [-102006, 3884, 8441, -2, -11]];
    Rf_basisdens := [1, 1, 3342, 3342, 557];
    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_230_a();"
function MakeCharacter_230_a()
    N := 230;
    order := 1;
    char_gens := [47, 51];
    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_230_a_Hecke(Kf)
    return MakeCharacter_230_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 := [[-4, 0, 0, 0, 0], [1, 1, 0, 0, 0], [-25, 0, 0, 0, 0], [26, -2, -1, 0, -1], [15, -16, -2, 3, 0], [-149, 10, 1, -4, -6], [-352, 27, 2, -10, 5], [383, 56, -2, 9, 1], [529, 0, 0, 0, 0], [707, 12, -34, -4, 25], [362, 128, 16, 3, -4], [2345, 301, -52, -21, -5], [-1904, 121, 9, -41, 38], [-428, -319, -3, -46, -23], [-2930, 52, 33, 49, -103], [-4667, 106, 129, 133, -2], [8799, -846, 39, -39, -94], [21525, -166, -34, -71, 122], [26575, -817, 60, 125, -107], [20640, 2180, 346, 63, -85], [25188, -87, -176, -35, 132], [55140, -401, -447, -404, -131], [21355, 1328, -49, -287, -226], [11492, -581, 283, 170, -573], [-4957, -2074, 754, -75, 220], [43383, -2190, 1197, -477, -406], [16183, 4065, 311, 11, -957], [-53323, 1757, -270, -649, 181], [24707, -5148, -180, 711, 1041], [7681, 1753, -1218, 781, -449], [44542, -74, -815, 851, 739], [-3856, 1685, -714, -1027, -162], [-176985, 1007, 1027, -1479, -824], [10545, -3083, -1173, 1558, 850], [3299, -10373, -1649, -1393, -592], [147989, 896, -677, 2430, -465], [62013, -5231, -3024, 2881, 2107], [17899, -2527, 3636, -1834, 1655], [-252760, -3934, -198, 260, -666], [87513, -21327, 129, -2877, -1073], [-51806, 17949, -284, -299, 312], [164629, 3346, -3482, -349, 1925], [68158, 11230, 1920, 568, 3380], [178374, -23947, 2870, -2897, -1084], [-354583, -9496, -3027, 1082, -33], [30278, -13505, -1897, 78, 5427], [-117939, -19600, 3737, -1121, -2278], [-57134, 9998, 5556, -2494, 3066], [-733714, 2117, 909, -4960, -6085], [93624, 12239, 6947, -4574, -5007], [394346, -27623, -6764, 4769, -6162], [358205, -22931, -2921, 2876, 2204], [565198, 17502, 1454, -3484, 1440], [421101, -11235, -4503, -6129, -1262], [-95758, -57999, -3364, -2827, -3678], [6818, -73364, 4237, 3596, -1816], [273229, -27392, 2712, 1870, 4909], [20224, 12863, 7428, -4096, -2068], [14934, -39215, -6408, 1807, 13446], [-393436, -32691, 1451, 134, 4335], [932809, -13036, 3663, 1325, 5460], [234651, -100958, 1913, 2049, -5708], [-670063, 8947, 3383, -1491, -16189], [232556, 50443, -10004, 2525, -8174], [600070, -74575, 7278, -262, 9872], [-920935, 80835, -4813, 2717, -1156], [628903, -57331, -9999, 13436, -11170], [150859, -26614, -15738, 16079, 15475], [-767919, -21985, -18815, 5049, 15735], [-133407, 31218, 8392, -11210, -5445], [183752, 903, -6232, -23983, -1438], [-912776, 29113, 8163, 1804, 20337], [-574815, 3950, -23413, 11347, 7914], [-364548, 156220, 84, -830, -16130], [1593939, 40811, -29131, -3401, 4961], [928045, 74365, -3498, 23617, -215], [1286053, 40767, 43831, -18899, -8323], [2065391, -163806, 18303, -25098, -653], [-759516, 105708, 30060, -1650, 14946], [-1095392, 82871, 28161, -12145, -25871], [-1511618, 114759, -10139, 16084, 20335], [2478875, 139112, 5044, 13935, -2647], [-1652854, 73955, 17931, -24892, 3337], [241530, 107847, -23996, -23624, 14482], [2467329, -103058, -20685, 20470, 2516], [621559, -85647, 18844, 20620, -32201], [-1067004, -66935, -6274, 51234, 22204], [-171817, 50948, 2119, 21237, -26290], [-1637876, -135910, -19855, -28685, -11011], [399986, -45604, -30422, 10074, 14810], [1017857, -106834, -4149, -28015, -1392], [-2231884, -157644, -6772, -20740, -48042], [-3902778, 39096, 34723, -5657, 38741], [-1827183, 81639, -1143, 40494, -6726], [-1727985, -150917, -8217, -30290, -34450], [-392516, -60729, 5080, -8006, 44374], [-470240, -177252, 33559, 23191, 27645], [-441454, 233868, 3734, -35122, 20826], [2011908, 127883, 19463, 40582, 16837], [3434654, -4830, -23511, -15267, 54221], [2123403, 68601, 9478, 31618, 68733], [-467287, 191847, 29636, 11825, -16285], [1357221, 10108, 28565, -36933, -17332], [1166526, 222594, -53586, 30996, 69606], [725565, 65565, -21641, 1753, -36825], [4896196, -80131, -1002, 49421, -17690], [-4928165, -494281, 4520, 36178, 19650], [3938418, 305598, 21696, -49884, -41588], [679475, -272539, 2367, -62929, 17537], [5592058, 84725, -63255, 22025, 103471], [10663660, -134832, -11608, -11128, 9912], [2638142, 23238, 106800, -49158, 12324], [845638, -374532, -62225, 98548, 43200], [881967, 59235, 42085, -11411, 77488], [4220282, -120921, 103023, -32460, 33203], [5009822, 297805, 86599, -22972, -34227], [-2110307, -20452, 56337, 9605, -37636], [-1987110, -125508, 43419, 54765, 32765], [10054835, 421750, 82045, -12700, -25918], [-2168658, 151512, 59334, 74622, -14920], [4497023, 30509, -65201, -19767, -39007], [313332, -530109, -15254, -63041, -22638], [8924723, -358758, -31033, -26497, 49118], [3711161, 60647, -43236, 73976, 61853], [6111466, -378408, 40604, -44914, 32886], [7470843, 209802, 61344, -55569, 33993], [1591347, 221600, -5614, -1487, -122490], [-5154256, 388565, -146184, 35336, 75112], [-5512384, 571857, -27246, -53460, 7965], [2456341, -631076, 66913, 44003, 150766], [-2500523, 157591, 193879, -119362, -95072], [-1780913, 134727, -119387, 74905, -35980], [5939608, 752661, 71279, -124042, -35163], [7095335, 211795, 2060, -81915, -53667], [6089196, -377039, 174083, -53265, -57049], [221788, -39434, -166928, 98018, 47922], [-13190482, -26923, 131439, -72460, 67937], [3032985, -166814, -41979, 14731, -91734], [12013325, -28029, -13708, 25931, 74573], [-18094272, -195153, -6492, -91080, -136475], [-3122609, -63759, -218077, 208694, 109190], [13707358, 132326, -144610, 35368, 231286], [-7993456, -395838, 55971, -97953, -51857], [-12260181, -542846, 130247, 52485, 78138], [-10299241, 110338, -34105, 113355, -55226], [-3198020, 219873, -118349, 60106, -71245], [-536935, -1050831, 46587, 100113, -83500], [-1162674, 802281, 67950, -96615, 68308], [972803, 268043, -128663, -65994, 158060], [976212, -348834, -209685, 69237, -170621], [5838841, 766749, -83161, -38557, 2471], [4919572, -186684, -46640, 49636, -41492], [-4210809, -65613, 280237, -67259, 128042], [-6080218, -214726, 162993, -83575, -59411], [23357985, 86841, -22166, -26285, -94731], [-7443646, 97355, -261471, 98714, -98477], [-5800132, -613949, -150733, 301914, 135587], [15353829, -671892, -168684, -173748, -44985], [-9895657, -1604140, 5578, 172221, 4031], [2975349, 363535, -95779, 69513, -203763], [13155111, 282613, -302128, 11940, 113103], [8856103, -991333, 272021, -53483, -167453], [1829790, 446228, 168263, -108725, 106145], [8726015, 918087, 58103, -60847, 257203], [158798, 964778, 48309, 15026, -170017], [-9809010, -60537, 279762, -117894, 307959], [5614676, -150299, -40348, 73866, 244989], [11975848, -228474, 87356, 67154, 124494], [-1078190, -1658469, 30485, -86482, 14229], [27089747, -331762, -114069, 36314, 84247], [4429012, -1246839, -3797, -108884, -39529], [-321915, 676084, -218484, 6718, -268915], [12214444, 778666, 255408, -116792, 78944], [3624174, 1184315, -151366, -198608, 140221], [-8628983, 220622, 265899, -6256, -59197], [-21186978, 835671, -133689, 110244, -136751], [-18595584, 1473739, 34386, -143117, 169422], [4914909, 663862, -234166, 376584, 233023], [19036792, -517544, 15421, 150986, -208080], [8253417, 1071501, 46309, -225017, -124928], [7740624, -2139064, -3751, 84997, 145733], [35983327, 141304, 302238, -86915, 25662], [-30971645, 490820, -89403, 183902, 19610], [22693704, 834744, -113868, 272250, 87360], [-10492784, 2447927, -139924, -145988, 45471], [6629565, 901947, -7305, -112845, -188754], [-7864933, 602931, 335625, -59097, -29276], [-14647927, 833665, 301784, 185631, -269809], [10401912, -443369, 162141, 131413, 353446], [2565084, 1909983, 289944, 79782, 272779], [-8838116, 1710131, -263700, 111083, -160140], [-6036226, -232248, 2762, -227074, -252124], [15421314, -277164, 318304, -197636, -98706], [24749347, 228824, -250291, -70409, 236482], [-23965508, -2038266, -538136, 117874, -61270], [-2555980, -296508, -194071, -139930, 568317], [-23807100, -1308309, 51367, 245692, -10905], [-10128314, -985956, 332438, 160142, 304626], [12252230, -1720078, 372948, -285406, 21824], [490760, 789608, -70071, 567641, 160531], [8006981, 1179409, 270127, -199123, 42023], [-13947171, 1454557, -102105, -104333, 16366], [-44255711, -726972, 134165, -371206, -616221], [-19384430, -1570717, 272355, 160634, -59671], [18558264, -1121050, 586, -152040, -140510], [-7670606, 123991, 49686, 416155, 205412], [-8514584, -196381, -453027, -101788, -31797], [-41015015, -1202159, 457794, 217876, 7756], [3068254, -2187757, -294793, 380779, 43849], [-23065934, 47657, 60240, 124193, 69712], [5450164, -741935, -663122, 201827, -131008], [-7406090, 1995582, -535085, -557, 236345], [-21904613, 297090, 316640, -532765, -68249], [-8084950, 1510020, -69154, -23728, -221212], [8456389, -298448, 14517, -41225, -175796], [32478162, -193161, 239947, 1756, 273957], [-6215944, -3468898, -249887, 471243, 268893], [-115105, -3188676, -329980, -216868, -427275], [34917334, 3810097, 547530, -72776, 385398], [-20083098, -2044093, -445328, 43065, 225994], [27775273, 3276240, -74638, 16904, -382285], [56292030, -2824659, 197773, -293750, 155393], [-9136852, 2001005, 239733, -345595, -249176], [-18685442, 1604240, 149475, 241604, -31093], [-4418302, -2580198, 298601, -674515, 59037], [-31044209, -2222860, -58836, -177142, 41799], [-36041715, -613320, 57522, 121887, -622679], [-6882086, 835882, -446940, 81373, -471960], [-39132403, -2255859, 332961, 480141, 339282], [17939915, 2553634, 58141, 256193, -784230], [-17224687, -1461383, -276721, -409347, 214688], [60720043, 756898, 155338, -155407, -174800], [14818794, -599918, -74550, -174644, -124316], [-2189814, 2184547, -94288, 231942, -411791], [-35755491, 3988544, -547321, 385351, 520874], [-4615416, 2339577, -155235, -227430, 312465], [7774578, -51256, -799264, 261082, -522922], [38950536, -710001, 101415, 501828, -744421], [19486811, 2696979, 362369, 109106, 265888], [24278302, 1331980, 689820, -446189, -357227], [59950053, -1558464, -119841, 373683, 4010], [-11814155, 736975, 369001, 497744, -316124], [39506090, -1407046, -88787, -588723, -396261], [91375824, -4023286, 676907, -521579, -96677], [16042514, 2991096, -791218, -379852, -68624], [-22757929, -3148166, 238897, 215714, 720200], [-70129322, -1025472, 158105, 273281, 528289], [65821543, 817663, -52287, -158033, -141872], [25230049, 1209933, 782291, -443317, -616403], [16315780, -2061747, -828452, -167528, 495097], [24387416, 686198, 22828, 896340, 620546], [-40209736, 1161752, 202092, -312946, 120994], [-74102506, 2706857, 454854, 623612, 202430], [44080310, -3795499, 504607, 264300, -444175], [-41932714, 2122304, -476088, 194396, -120636], [-2952741, 3775293, 282705, -502956, 192122], [-39431645, -3691392, 69908, -187297, 754116], [-100705278, -2116464, -152030, 99736, -269862], [57420631, 2331498, 313843, 172294, -830356], [-78776194, 778397, 624172, -549093, -536362], [-50875858, 1470075, 265470, 282876, 48685], [25394921, -1634181, 74036, -200491, -480959], [-19060327, 2592046, -733987, -94131, 556636], [13125393, 451, 1034262, -798071, -426451], [-65828872, 4525332, -1568446, 599390, 553616], [56314409, -978042, -679578, 18453, 219474], [-54229719, -4554714, -149070, -142635, -771154], [53871398, 4515745, -30209, 563744, -1060837], [-67912813, -1905573, -469806, -434475, 1069605], [37355675, 179330, 1442373, -1113838, -624982], [-9234223, 3947136, 244860, -43734, 504609], [-23286877, 2823786, -94377, -219297, -271956], [-9579496, -428838, -54687, -179970, 926829], [4494814, -1201617, 1016429, 418892, -892109], [-52117264, -3507655, 685198, 829761, 356426], [12921560, 2207938, -1370191, 356895, 668625], [19065739, -7000481, -393231, -596345, -696789], [-65503287, -5948488, 97817, 125005, -307908], [-109946692, 2476100, 1104490, -1607046, 539684], [12464377, 4049763, -75431, 197887, 600178], [-163773874, -2607782, 86035, 595775, -65433], [9882928, -2327698, -1613628, 400334, -609040], [-27894149, 8247360, -131720, -764021, -41064], [-2341832, 1066166, 1395684, -532270, 79078], [-86703955, 4211493, 989265, -394881, 305284], [114412528, -1260161, 248028, -68942, -741113], [28957733, 4054170, -253923, 1487853, 265218], [87595584, -3660117, -227217, 944004, 1179073], [-3712137, -2172887, 2859, -295181, -781487], [-7957387, -3690297, -1392547, 992627, 232513], [-9507478, -2552128, -30264, 889376, -57500], [43657667, -891732, -61771, 930929, -1016356], [-66381930, -5102930, -412372, 228252, 376952], [31507247, 4584412, 721012, -875395, 73251], [91099989, -1146020, -335217, 526558, -238933], [25746389, 6741603, 1194935, 453491, 1112867], [-92269980, 474992, 1098722, -188600, 1019346], [4127483, -3799618, -1223271, -902278, 1124127], [-91702473, -3967869, -289467, 1700652, 482626], [-141150201, -3003725, -283026, -509276, 796096], [-162626230, -7757774, -477517, -5472, 328081], [242970335, 5907291, 530786, -95935, -402025], [162231478, -2363502, 72986, 297806, -776710], [-59767240, 4897828, 574987, 1216985, 886793], [76295511, -3888751, -1069573, -1438955, -775174], [65403410, -2060119, -61160, 826269, 45438], [-33965127, 5054751, -700437, -1108431, -794713], [112983957, 4342887, 856171, -324209, 742342], [-36624190, -2864334, 1402472, -1622056, 843162], [-19842343, -5867235, -330975, -635121, -783297], [-100763278, -779610, 70727, 32933, 690751], [35360323, 1689496, 1155714, -575855, -408157], [74876726, 4457446, -964034, 1454954, 367694], [-125550323, -1015095, 206186, 186086, -330570], [19271814, 5224416, 1708221, -576042, -1092999], [-1549890, 12138955, -584205, -1076288, -531023], [-84466055, -5803037, 1222527, -604346, -103874], [-130064544, -60276, 1231776, 26337, 530250], [127827841, -3087912, 472409, 500879, -440554], [-122922037, -2539167, -447100, 714488, -586478], [71148003, 345122, -769636, 767353, 1566836], [81042388, -10454060, 888325, 307772, -617994], [113879186, 4914542, -1028829, -95245, 1453653], [22564012, -11756544, 810998, 449360, -2178678], [-45869012, 724231, 1461900, -462152, 1380043], [74654088, -3702592, -1533424, -943064, -1033492], [-22278679, 3646529, 783409, -1187715, -804194], [110276615, 4897157, -998168, -230406, -213701], [130731903, -711972, -223116, -767607, 1199995], [180944445, -6434178, -660363, -602589, -220040], [-72829289, 2615026, 2004940, 1112540, -903599], [53760835, -831566, 532329, 38326, 897711], [130860367, -1320147, -841765, 743564, -1539862], [-191288153, -6611627, 201480, 1372618, 238891], [3211196, -3291443, 1429955, 241740, -949429], [15237225, 2746105, 676718, 974472, -1761065], [269396499, 5197713, 139279, 47029, 391153], [-104126766, 905137, 1599467, -2533296, -747869], [-109894827, -6514797, 668974, 690754, -169628], [198521340, -2892070, 601211, 311416, -854536], [225061858, -4119201, 533300, 114437, 1344622], [116064017, 2258022, 1560002, -1276429, -915804], [108898110, -480576, -2795148, -664764, 1874462], [-12600358, -10457474, 133520, -237048, 1494878], [31226139, 2938682, 1150567, -341361, 967534], [3072803, 10335086, -624915, 1793, -1078362], [-110916469, 13148204, -104378, -306894, -99821], [61531391, 6119791, 203627, 2314881, 1707652], [-18299358, 13639986, 699582, -534768, -1057654], [123495389, -5312772, 735641, -473155, -1367204], [-152535803, 2409203, -529245, -967600, 185164], [165478116, 11628191, -361672, -1029395, -1471228], [179062415, 8901728, -1830165, -1459681, -347726], [4444390, -11934949, -679896, 550862, -1366041], [150007792, -9323872, 309792, 642248, 626890], [77636112, 7503568, 2163680, -1737462, -1329452], [-80136876, -4466556, -2034282, -329892, -2592808], [141853959, 4440297, 624015, 967515, -1831030], [-21621278, -3407521, 2538266, -652601, -1076480], [-279745826, -1586508, -427826, -231950, 1067142], [259765711, -4285224, -160909, 619451, 124642], [-226309369, 4028816, 922356, -1778260, -3721591], [-37108268, -1017710, -10977, 1316197, 1479091], [-90753133, 4784919, -3368653, 1403213, 928775], [-139985279, 11016425, -1420128, 1956578, 364874], [226389682, 6028137, -498856, -1155769, 744890], [56423855, -4454474, 287419, -1125238, -1116049], [19008291, 20026687, 18984, -1063139, 183961], [-62955114, -17029814, -1594428, -1694672, -272454], [-38108973, -4754585, -786955, -1363560, -2589402], [-104637029, -8929192, 1694613, 1411637, 41368], [-163361930, 1555864, -914289, -666131, 128993], [97780587, -1043187, -258573, 1233747, -1621097], [-100468400, 3450860, 1751952, -1141768, -2650756], [242939441, 12660516, 3165975, -645306, 959210], [-94961585, -3787777, -1323601, -89828, -43158], [150494480, -3754953, 3733679, -1949716, -664027], [126917694, 3113477, -2657650, -532250, 685565], [-57912106, -10240746, -857542, -887170, 2869684], [-63948466, 9860979, -918792, -432843, -1181404], [51360097, -20938515, 694063, 1403383, 1153289], [-286675775, 14896930, -670800, 2376013, 377450], [96814034, 11560358, 1406698, 25926, -802054], [-300411418, 6901447, -1765856, 753641, 1443314], [-65892676, -951097, -1909541, 2537478, -1064893], [2142234, 14139588, -217791, 3374247, 2127745], [170911178, -6168796, -1539050, 3088293, 1319506], [-2999739, -17397635, 178413, 1277521, 2486278], [162011439, 3766328, -3944059, -355685, -2558320], [-99163634, 10981415, -2047576, -255986, 2499648], [-113974558, 22477842, -848700, -1062594, 1879264], [-70441035, -911263, 921223, 1583277, 2535116], [-176838213, -1579761, -183573, 1177494, -382826], [-103382744, -4122978, 1745702, -3392896, -1951534], [-45623930, -4644839, -77553, -2150024, 2465035], [-235974754, 1804301, -328934, -404268, 1927332], [-120975182, -1730731, 1584531, -1902676, 1040219], [-182602620, -3418467, -296007, -1122342, -2216323], [-93565113, -1855167, 2371027, 1447489, 1160938], [-129219981, 1272330, 240783, 2772123, -263238], [-93841069, 4074624, 1084596, -1102626, 82005], [176334756, 7111201, 3947468, -1380411, 117436], [-5130691, 4496165, 790894, -1333263, -1978387], [137291298, -14483403, -475926, 3363798, -941432], [-56629135, -4047372, -1852024, 2368652, 2616089], [293290966, -9473032, 156138, 1110581, 3938879], [100649981, -2321347, -2760410, 1524579, -2830847], [16096627, 1635543, -2342420, 2257072, 2131521], [335889398, 7254389, 1394593, -2156532, -406933], [-367574744, -13272300, -1490564, 1064836, -130072], [135602910, 8507261, 252236, -632735, -734454], [-127558679, 9099628, 629091, -468584, 2245701], [-141608452, -10631715, 3213887, -695008, -4059929], [208501781, -11350139, 1726613, 1183179, -2585015], [-241661112, 14991824, -1124101, 843148, -2097065], [36819930, 9435206, 3475441, -3349131, -1111645], [128492611, 9111537, -1708349, -423455, 787184], [-31545802, -1115006, -429622, 1802262, -327596], [52750696, -15783912, 3010075, -2145908, -1591558], [-220842173, 4474602, 537448, -607409, 3023443], [123163865, -18774744, 193604, 3023267, -1513746], [222281684, -1014905, -134575, 426546, -1178663], [-191156952, -7346916, -374970, -534612, 917602], [82277038, 9648006, 256474, -4266146, -2680040], [266449706, 4364133, 2142090, -1136109, -1009350], [166955420, 18819681, -2636044, -1555873, 245512], [-121793028, 14331731, -1141619, 3368196, -1890519], [-6153226, -8127043, -3907842, 2651828, 1550918], [211055290, 24971373, -1207498, -2285821, 1279200], [-127084766, 4073466, 1746412, -1815035, -304103]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_230_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_230_6_a_g();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_230_6_a_g(:prec:=5)
    chi := MakeCharacter_230_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_230_6_a_g();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_230_6_a_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_230_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<3,R![-2820, 11615, 2051, -762, -5, 1]>],Snew);
    return Vf;
end function;