
// Make newform 230.6.a.f in Magma, downloaded from the LMFDB on 17 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_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_230_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 := [154128, 66287, -197, -774, -1, 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], [13806, 6295, -1235, -13, 2], [-37102, -10657, 698, 18, -1], [-555282, -25565, 9580, 50, -13]];
    Rf_basisdens := [1, 1, 897, 598, 1794];
    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], [0, 1, 0, 0, 0], [25, 0, 0, 0, 0], [20, 4, 2, 0, 1], [49, 4, 3, 2, 3], [353, -11, 2, -3, -2], [385, 0, 0, 5, 7], [-161, -27, -11, -23, -6], [-529, 0, 0, 0, 0], [-839, 169, -20, -1, -17], [-3154, 30, -5, -72, 25], [-640, -330, -31, -27, 20], [-2303, -420, -35, -43, 5], [1445, -211, -10, -12, -27], [2766, -584, -133, 12, -56], [10851, -1333, -137, -153, -7], [-6421, -13, -291, -77, 195], [14327, 26, 153, 192, -35], [14990, 588, -89, 99, 94], [11010, -319, 347, 81, 150], [14113, -1395, -251, -440, 93], [20391, 2467, -164, -4, 139], [17427, 2359, -341, -195, -291], [18765, 1569, -510, -72, -51], [42981, 2092, 209, -490, -1], [-5521, 221, 455, 721, 137], [40910, 799, 55, 1176, -120], [-55538, 88, -707, -1171, 292], [38545, -491, -329, -365, 914], [73756, -3452, -101, 1199, -794], [116752, 132, -467, 358, -456], [10003, -7129, 811, -4, -771], [64326, -4818, 753, 483, 1587], [132426, 4036, 1572, 11, -366], [-127790, 574, 887, 3227, 905], [-208399, -4362, -2346, -1752, -615], [224456, -3194, 423, 837, -298], [-9856, 5782, 6514, 1239, 243], [-115834, 3098, -2556, -2360, 798], [33960, -19549, 817, -1542, -1036], [-120547, 14587, 799, 2836, -2101], [-287655, -8267, -2213, -2455, 190], [-102668, -1130, 3096, 4688, 2364], [-91453, 20319, -969, -1866, 2739], [151203, -4478, 888, -354, -1273], [109501, -8021, 118, -2228, 3119], [90235, 30955, 539, 4189, -135], [198752, 15480, -818, -870, -4604], [81383, 38503, -2512, 3670, -387], [485169, 3651, 4554, 5666, 1207], [-371025, -5637, -8279, 3078, -593], [27042, -1382, 10086, 1209, 1538], [391716, -32432, 488, -5134, -5056], [-326382, -33436, 2655, -9969, 1447], [682775, -25665, 2113, 2890, 1815], [-295548, -8299, -3302, -5655, 278], [64915, -25437, 14018, 5021, 5121], [-104139, -68549, -5014, 2420, -1012], [1033739, -29617, 4511, 10374, -1227], [-259773, -96293, 3490, 2100, 1941], [-70455, -5151, 10443, -6097, 2443], [-725967, -6071, -6949, 3645, 2575], [198322, -75149, -12197, -7964, -8602], [57625, 19427, -8557, 20270, -11555], [373891, 69849, 1704, -3266, -2962], [-138632, 5874, 9895, -3187, 5105], [-367752, 6446, 15362, -7291, -1844], [1565923, -8825, 9979, -14981, 14816], [-1210194, 123117, 13831, 18978, 2374], [-211387, 76259, -12806, -21297, -4093], [369115, 33805, -8827, 20894, -14749], [-1488619, 91255, 10820, 24646, -3165], [2024643, 82973, 3013, 7841, -5049], [1056492, 24842, 32554, 22478, 14376], [-172644, -139995, 13223, 23804, -2154], [-1848794, 54816, -16885, -2179, -16710], [579322, 96215, 24193, 29174, 3000], [-271309, -10314, -9996, -33048, -7941], [-1100888, 93166, -4702, -11302, -7696], [857165, 34035, 13201, -13560, -7970], [-1000307, -172623, 9636, -3934, 13069], [1137453, -63175, 23699, 44651, 9442], [-631931, -60899, 13672, 20678, 17359], [1900901, 9447, -15346, 4650, 8042], [-2841495, 56311, -28102, -20503, -9784], [-1923332, 38434, 46412, 17879, 7901], [-234737, 70503, -21928, -43318, -14262], [679307, -39293, -24949, -17175, 2989], [2441482, 192618, 779, 35504, -738], [-342706, -32496, 62202, 6792, -7608], [-2098633, -172089, -34529, 27307, -405], [1253820, 54618, -8140, -32514, -31702], [39210, 311358, 6561, -43906, 3778], [-1598312, -63036, 44516, 16301, 3786], [-696314, -92814, -20712, 27679, -1810], [-2563281, -41805, -42612, 70434, -20316], [259836, 222522, -36661, -14070, -5518], [-997850, -103500, -35006, 7052, 5984], [-657117, -85319, -4742, 35558, -33611], [2217388, 146206, -63715, -86024, -30924], [3444208, 52606, 40858, 73555, -21907], [5909270, 77636, 7507, 50101, -11282], [-4198563, -313089, 21049, -46803, 27985], [4351204, -59398, 32176, -54556, 5778], [4440112, -197605, -8811, 65584, -42186], [1672493, 164157, 21589, 9060, 15235], [8855836, 221517, -8626, 19502, 22632], [3451796, -410838, -60140, 556, -540], [4875058, 265651, -19347, -23794, -43182], [7762413, 23095, -22481, 29726, -32594], [-2596448, 135188, -17940, 28264, 42096], [4248448, -306338, -9214, -37352, -14838], [-2602942, -282783, -83198, -26753, 5748], [579662, 7528, -184179, -88659, -58105], [480901, 50311, -37332, 79036, -17963], [3285733, 65937, -16556, -106774, -13879], [445357, -494693, -20289, -19667, 57703], [2438126, -20354, -2133, -92966, -7112], [3698001, 95841, -40802, 72657, -55454], [-339106, -372486, 86130, 59122, 67970], [3913294, 210381, -49911, 63046, -29656], [-4706937, 286587, -76797, -95572, -3623], [-3554611, 57269, -68527, -137507, -5125], [2368808, -142482, 30700, -2711, -35193], [3114546, 4998, 44066, -28078, 108888], [-5251101, -523233, -53605, 43059, -14866], [14221895, -96404, 657, 15228, 29945], [4093527, 398441, -15258, 50316, -55040], [12715859, 21942, -40358, -14703, 9493], [3248721, -492759, -122031, -79705, -27941], [5022880, -303456, -64496, -65003, -9708], [-5559018, 436876, 78997, 69585, 6711], [-5813727, -28245, 178702, 16538, 46565], [-7902052, -638522, 40467, -66513, 45716], [-8366985, -120987, 381, 30060, -23340], [939178, 404328, 121738, -11690, -82380], [10527409, 488901, -163776, 17762, -12227], [-5049949, -110985, -40939, -50073, -44233], [154870, 385206, 179145, 35159, -59438], [5790807, -180570, -273802, -6195, -69277], [-12900748, 10208, -105516, -95073, -60674], [-1681840, -77922, 93216, 166000, 64550], [3397150, 909746, -86151, -55016, -114276], [435097, -826011, 68171, -907, -48795], [14147, 570523, -143849, 71955, -11631], [15752901, -272727, -37282, 13752, 16607], [1409278, 261996, 207607, -137507, 115257], [-7217533, -499341, 40185, 79414, 39413], [-7008010, -213726, 105896, 122655, -63052], [603078, 568962, 14267, 8484, 143906], [-15802916, -73515, 47289, 95008, -74068], [-1303120, -140784, 235260, 103672, -31840], [-4975226, 72438, -27069, 252577, -111289], [-11164388, -177570, 30119, 63284, 62484], [-20943466, -293540, -97519, 82317, -114752], [3962385, -1463307, -100190, -177462, 56431], [5971227, -541653, 73666, -96400, 89471], [-4511245, 418173, -12252, -197309, -83191], [-14495719, -526015, -89619, -281517, -6542], [-10126430, 275785, -145467, 21188, 103500], [12220972, 1131206, -71928, -44977, -43399], [-18207412, 116563, -25431, 46090, -59630], [-13899466, 1192414, 209477, 208290, -30926], [15110140, 350481, 123349, 285404, -109402], [10032618, -159832, 183976, 162462, 80057], [1461387, -75126, -329536, -371673, -98695], [3096677, -432356, -79916, -173703, -182451], [-3197914, 1064608, 205914, 248682, -10288], [-1055541, -300103, -27578, 71624, 2403], [14994499, -123750, -81244, -366424, 4707], [-11144363, -417899, -499436, -76084, 110017], [-4614981, -344169, -312118, -90451, 44865], [4974478, -736834, 203768, -271480, 222280], [-7397821, 835212, 543798, 190941, 136377], [11871015, 1411252, -191176, -82156, -240037], [4238339, 1050507, -234332, -66686, 77457], [2139329, -2300635, -96355, -90540, 201975], [16270925, -1579051, -552020, -195887, -173243], [-12936474, 11913, -242264, 107513, 7808], [9329366, 6574, -226721, -305727, -133263], [23332712, -437444, -12785, -30288, -135120], [8818673, -726870, 281097, 438988, -96673], [9113991, -355209, -176380, -459703, -194148], [-5873444, -498204, -40782, 97352, 80386], [10334493, -1805176, 116314, 137625, 109127], [-13393588, 1911044, 70771, -179699, 136795], [10422206, 1678712, 113101, 164367, 94115], [-15044478, 820660, 135041, -190627, 87914], [-13159033, 1736654, 285911, 257913, -6237], [1427951, 674988, 466932, 181795, -88189], [-3064045, 847863, -52745, 49860, 209083], [26955742, -1103598, 327294, 318014, -192242], [3403194, -153746, 377300, -227458, 89150], [-21157311, 1615351, -88565, -222075, 117453], [21651254, 2334216, -152690, 249442, 78648], [-2208018, 1827412, 291848, 378612, -91313], [-38857367, -1005735, -424624, -127964, -14321], [42961362, 1786892, -355242, 408176, -214372], [-10673616, 408698, 168022, 536964, -153922], [23216732, -2820282, -423785, -361250, -51618], [-14637892, -290805, 653745, 318088, -39010], [7330846, -1725378, -604879, -173441, 171757], [14735327, 2021970, -141816, -115074, 115587], [-34949713, 360147, 68378, 148794, -252757], [15734358, 1825398, 163348, -56796, 375046], [24104845, -1247987, -322593, -118558, 374595], [24769031, 125373, -390340, -146322, -201007], [34388860, 1679659, 271840, -377914, 252076], [-36463585, -608683, 215149, 293338, -6974], [7852849, 2866359, 325319, 335836, -392021], [-3145939, -985645, 298835, 177618, 209883], [16265236, -1310640, -936609, -228190, -241874], [18761349, -1156057, 135103, 509849, -330558], [49596326, 187790, 150964, 61306, -170624], [-43537825, 921465, 411479, -3797, -7793], [-40174429, -1751213, -463980, 220698, -213763], [5556502, -823550, 407829, 500476, 252670], [-27240127, 2010031, 472104, 190753, 163483], [3222119, -849165, -267210, -353756, 347786], [16463901, -345779, -94071, -373938, -269749], [-21373621, 3074511, 13812, 677325, -327723], [-33994077, -640879, -234466, 129848, -474803], [12629181, -713706, 372843, 179019, 242781], [23061562, -3367222, 11442, 164584, 323241], [-19648216, -21158, -362745, -579140, -46868], [-78788791, 204737, -466102, -1002633, 288939], [-24108517, -509509, -365969, -672047, 414190], [32534020, -4041156, -295731, 225272, -298109], [-10764202, 1092028, 519233, 309135, 538861], [-32383061, -1012771, -31059, 671045, -91969], [-17659998, 433360, 211551, 583265, -146715], [-84816517, 349318, -89167, -23766, -409427], [-9514920, -1068428, 372000, -349990, -87048], [37101745, -453758, 1000004, 167261, -65299], [-33137663, 3373659, 134305, -524711, 273399], [42374033, 2501685, 594226, -134636, -523011], [-50343102, 12658, -402802, -1033258, -32296], [-9924011, 2099649, 688700, 120668, 199515], [43955586, -310230, 352296, 899571, 154080], [-10181972, 2693473, -482597, -554791, -605840], [-29296803, -1697245, 269797, -675, 419123], [64409984, -5006226, -348514, 31275, -101686], [-40103768, 2915548, 86903, 56398, -321174], [20906430, -549222, 1128921, 674228, -217598], [28986482, -1812402, 69724, -26762, 429624], [19635367, 1238705, -653550, -528289, 352484], [79464518, 1982776, -97637, -119400, 495024], [-6936430, 1438884, -655537, 528937, -347111], [-109783104, 724081, -794025, -761758, 111438], [-19467329, 1584000, 91058, 1102295, 224697], [-57068330, 3391448, 324972, 127918, -20034], [323092, -1671638, 620798, -312382, 39764], [-19971141, -2599621, -1617418, -445392, -545166], [-11324719, 2041909, -401272, 1546770, -398135], [65624662, 3459756, -907236, -290056, -223952], [20890796, 3186902, 692462, -144995, 827516], [15910303, 4036928, 368723, 1219756, -408535], [35008826, -621152, -1089796, -517644, -478754], [78739261, 98165, 300244, -349447, 290670], [7005627, -4349153, 344411, 340034, -432127], [-9615837, -1541940, 298994, 943733, -90015], [14089348, -5869040, 144187, -936025, -320474], [-50008043, -4085701, 119489, -447797, 480209], [18032754, -114708, -610901, -378019, 250484], [17723616, 2908194, -197870, -708966, 42190], [-16795147, -2131776, -316683, 429456, -657933], [4606447, -3207618, 534057, 858320, 91789], [23981701, -3520977, 275920, 311216, 228023], [-75009882, -436218, -559913, -506419, -439894], [-19135015, -5700363, 137976, 1213225, 341240], [-3664393, 2305991, -1386342, -1335687, 48253], [6736085, -5590801, -265315, -564273, 152685], [-72129132, -5378878, 71892, -88924, -829621], [-20845151, 3038309, -274804, 720718, 285809], [26810653, 1499601, -1004075, 757012, -418701], [23756086, -3635246, 170285, 434512, 116082], [-20337552, -3619763, -418263, 886962, -42820], [-60857481, -2319167, -1855831, -85441, -534379], [66912416, -6050594, -727414, -989226, 529282], [30857460, 1263894, 173135, 1321023, 150191], [4380904, 2317610, -1653191, -1494268, -9624], [16299018, -2498582, -233406, 551804, -66282], [-88854295, 247994, -1360553, -489212, 184999], [78133886, 1889356, 496226, 1468998, -488756], [-20069006, -1082110, 613337, 548959, 586247], [-85507441, -802664, -267656, 177403, -1218145], [-63708065, 6772863, 370115, 1793731, -691859], [-54555879, 1056687, 1155288, 480774, 714765], [-6194874, 7536079, 621437, 1692266, -127870], [110372158, 5222139, 146153, 3524, -239730], [78669630, 2014188, 1623248, 1129752, 856292], [-74406621, -6555417, 689483, 1146909, 264035], [24717660, -583394, -1742496, 418740, -1095052], [-60756881, 23125, 21925, 293813, -205496], [-11123541, 4367716, -115744, -54532, 123527], [26592690, 4317349, 1319691, 1079136, 897548], [-81212360, -1335360, 1641392, -10592, 437470], [212950463, -1750948, 244476, 156130, 86367], [4484354, 7455808, 1337670, -65351, -469292], [73980584, -7547699, 924288, 1226730, 282848], [-50967914, 6270972, 1264286, 177970, -719003], [3814868, -2842430, 693423, 1419775, 478186], [-120461068, 10136474, 225254, -302208, 120564], [40136352, -336370, -1110213, -25602, 1000816], [-14002068, -830006, -238303, -224491, -303523], [-62534129, -5953737, 332829, 210646, -61165], [10849450, -609813, -1229645, 574172, -1064998], [-84526056, 2761564, 194467, 897017, 677071], [134285660, 268668, -813128, 420130, 81594], [152679868, -766161, -11863, -882866, -340496], [-39873316, -5547594, -1880333, 1001788, -254778], [-22298007, 1838945, -979027, 68163, 804726], [-14786180, -2760646, -3481974, -376816, -1274680], [82029984, 6057985, -632934, -236800, 311676], [57089942, -3598014, 1098780, 1744300, -745471], [-46650121, -3116553, 2214804, 222774, -478659], [90583696, -757838, -1446688, -1784569, 54854], [-36779844, -29816, 758533, 213078, 4557], [98057309, 2173697, 1783821, -10869, 453847], [7256898, -12075077, -1179298, -311262, -64466], [49758219, -440880, -119455, 458888, -353967], [-52292768, -1314231, 1772118, -3305, 481754], [6469784, -2070564, 1372015, -2456414, 1615950], [-30124620, 4356948, -649800, 1040, 683638], [61556493, 798516, 1754378, -1275855, 1696559], [73257180, 12074560, -681424, -564724, 861656], [116627382, -7202932, -1603391, -1080145, -528147], [119111784, 2033938, 316370, 416891, 472955], [-38753113, -3317619, 1489269, 496441, 720464], [-1959297, -2894163, -1365919, -1451331, 751889], [214413271, -2771895, -513020, -1664087, 129279], [86688219, 12550760, -776260, -1015254, -773829], [83839984, -11919048, -1572202, 1544323, -1432580], [101803168, 8878074, 1076022, 307019, -758141], [77229925, -223143, 577656, -17408, 1299473], [36953846, -1346188, -2962720, -1500659, -563191], [76798794, 1998645, -1571959, -2002330, -490416], [-113771, -7718449, -798652, -1019152, -962273], [-86380014, 3267741, -1631308, -826678, -99330], [191681468, 2164221, 1881206, 1188063, -533962], [-52649951, -1987347, -1969211, -2590250, 595023], [-58041745, 2197024, 1815939, 1082518, -479051], [99548166, -85942, -2235620, -1079922, -604834], [122410224, 745852, 279184, 378866, 1372390], [101673541, 2847909, 2156089, 278177, -102073], [-80213845, 4094193, -591667, -2764199, 260527], [73433589, -12758969, -2014854, -916747, 137907], [31947298, 10787082, -323045, 2663557, 3861], [-103719428, 3213870, 347384, 2839352, -983082], [25895005, -3041173, 2288151, 1553249, 68339], [-191404672, -11324544, 386010, 883329, 828126], [-84582889, 12831731, -957719, -523416, 1690817], [138509713, 4776697, -2174853, -465793, 174009], [252097703, -6116424, 42416, 2231949, -1073371], [198027304, -8723970, 772632, 424354, 13070], [202141244, 10066260, -1912006, -1593104, -655658], [-121718448, -13032490, -364476, -613002, -313568], [-196368268, -8723454, 2746323, -1008071, 1003307], [-31765475, 2084349, 196643, 490838, -148497], [32649490, -2416516, 1498538, 1078844, 1476040], [-21348697, -530757, -2960947, -2664423, 528287], [-328788151, 4500123, -836748, -1020059, -383461], [-189697838, -8785234, -1565857, -868540, -1253690], [-104283884, 3100933, -2034563, -2419972, 832306], [123739088, -3643057, -426730, -3078990, -500808], [-34594201, -9423317, -989693, -750006, 2019033], [-124143381, 11551398, 1180180, -743592, -421817], [-153288242, -1250664, 991795, 1876543, -2071278], [150518248, 4355064, -2429420, 372946, 884106], [-245598778, 16140280, 2606746, 1053157, 1245464], [-100595915, -2656847, -3421363, -3399485, 1357329], [40281570, 11684994, 626147, 137754, -757564], [81101386, -1641793, 990811, 4906844, -1176708], [-42682520, 15729864, -1805572, 73540, 1800904], [-34537483, 8613849, -441956, -930369, 727468], [-334795418, 2239886, -821130, 980963, 529832], [-316300289, 3874257, -144248, -183226, 584279], [-60630703, 5541430, 1477844, -2720607, 1921099], [-140211520, 11143284, 437922, -913130, -1534126], [-109437343, -267485, -35171, 1079808, -2654859], [-83179712, 11446541, 1335423, 1457282, -424462], [-59758761, -3816592, -1235195, 81294, -919771], [-15029592, -21317078, -1094746, 449888, -1924156], [27546177, -2318491, 4915721, 4540602, 1821723], [-11322993, -492437, -5757902, -3573448, -1036757], [-142014062, 1136904, -97783, -773860, -2453406], [-176521174, 22335546, 1411253, -2852616, 1800557], [15834650, -9115112, 516851, 4303341, 55519], [37509579, -8064529, -1102959, 2819033, -871687], [-9766259, -5453127, -2847964, -3672736, -603978], [192875320, 2904454, 412662, 272644, -193046], [201966742, -6143940, 928999, 1683953, -635071], [20701346, 866838, 5135592, 2173939, 1113914], [-13405346, -380838, 3591104, 3418864, 753622], [-399805197, 11914473, 789704, 921984, -1422271], [-203290833, 3127801, 1975082, 532406, -517684], [162157987, -691503, -1633732, -2139344, -841967], [-200981501, 2930723, -1006558, -880312, 746815], [33281380, -114030, -1197483, 2218633, -2796295], [-208854297, 2089351, -504593, -788193, 423501], [-189666983, 3327459, -558734, -1350179, 949677], [-57144679, 13102945, 2924965, 6476032, 150653], [120505850, 8067456, -515849, -3020895, -504398], [-39744269, -16291239, 462840, -2783518, -2318510], [113003611, -18986141, -3043064, -2989375, -1994873], [-39613884, -18615011, -1520423, -905515, 1579636], [156641516, -223782, -3100479, -875571, -2406870], [-349196738, 15056878, 2735002, 3578153, 1349491], [-167251981, 379435, 2777840, -480174, -556259], [-181506800, 9013744, -198116, 1914152, -360620], [-136379357, -9862493, 4909817, 3779050, 668595], [101235899, 27645722, -2185322, -2379890, -1244741], [98074553, 8755953, 4495820, -135524, 968449], [173615924, -3810749, 3079875, 436944, 2775386], [150978190, -8167616, 2357822, -1141244, 3270003], [-25036704, 17021096, -118611, 986490, 1390258], [179592948, -9014328, -5910153, -2244507, -195531], [58918868, -8254180, -5180942, -3403386, -1305214], [212074752, 25575915, -1684042, -2318391, -2071810], [145810097, -17606465, -754309, 1178053, -1521234], [-345463707, -777334, -4478365, -5948070, 218055], [84095769, 11034373, 349390, 5903600, -646853], [118682236, 11489248, 859056, 3605276, -990870], [-169411144, 10424880, 3345598, 1020430, -332166], [-363638529, 23219413, 2287871, -782440, 996425], [123294825, -17779299, 418915, -37788, -411089], [-83899221, -8825085, -905688, -1857384, 3413151], [-6983999, -922427, 2724106, -192700, -1445450], [-70442631, 14912053, 2321205, 1889414, 390285], [-45842562, -12471365, 5586709, 2473797, -786210]];
    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_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_230_6_a_f(: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_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_230_6_a_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_230_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<3,R![154128, 66287, -197, -774, -1, 1]>],Snew);
    return Vf;
end function;