
// Make newform 464.6.a.i in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_464_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_464_6_a_i();".
// 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_464_6_a_i();".
// 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 := [10, -27, -34, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [0, 4, 0, 0], [-34, 0, 2, 0], [-94, -268, -4, 8]];
    Rf_basisdens := [1, 1, 3, 3];
    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_464_a();"
function MakeCharacter_464_a()
    N := 464;
    order := 1;
    char_gens := [175, 117, 321];
    v := [1, 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_464_a_Hecke(Kf)
    return MakeCharacter_464_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 := [[0, 0, 0, 0], [7, 0, -1, 0], [-17, -2, 2, 1], [52, -1, 2, 3], [31, -2, 25, 5], [-115, 7, -24, 15], [46, -9, 32, -1], [598, -62, -44, -29], [298, -33, -80, 35], [-841, 0, 0, 0], [4803, -201, -83, 23], [-2732, -314, -84, 10], [-280, -579, 792, -201], [5355, 486, -631, -193], [-5943, 531, 613, -18], [2215, 1039, -180, 157], [2710, -1391, -316, 35], [12362, -1681, 220, -599], [1960, 2276, -124, 258], [12186, -1712, 174, 24], [-18748, 1496, 792, -376], [26519, -1111, 3679, -716], [-15722, 1901, 1236, 277], [26892, 1635, -4112, 1095], [-12380, -797, 5556, 1795], [28228, -104, 10448, 398], [-2338, -1256, -3050, 1232], [-6084, -5217, 7474, -2065], [49443, -3664, 3126, 1093], [76482, -4830, 9976, -1556], [35122, -3014, 5704, 4193], [134902, -1110, 13184, -3227], [18208, -6452, -7964, 178], [219898, 15781, -15448, 199], [-104755, 1779, 8072, -3137], [165228, 193, 4818, 1665], [92228, 19857, 1012, 9225], [-30559, -19938, 29281, -3656], [128770, -3418, -18310, -2154], [130078, -9086, -18928, -7518], [290374, -7444, -3562, -544], [262965, 618, 8354, -1031], [237550, 20268, 14016, 5095], [605836, 12965, 3960, -7533], [-342662, -17044, -3056, 9548], [435596, -5681, -40874, 943], [637057, 4952, 10445, -2018], [-291494, 8872, -28702, 1566], [-157574, 35866, -2286, 22172], [-119104, 33403, -23952, -11489], [651939, 60732, -45348, 8270], [-321714, -33443, -35368, -21229], [-163007, -54252, 41960, -17872], [-611405, -46378, 7659, 1824], [-501247, -6897, -25798, -4396], [-319365, -56595, 45985, -9051], [-196054, -43509, -17120, -9015], [352969, 46393, -917, -20169], [-756378, 72636, 70240, -6052], [-670153, 6018, 39184, 1326], [25866, -14055, 59588, -5657], [528898, -69640, -36672, -27558], [1248299, -30962, 157149, 653], [-923914, 76308, 61504, -9541], [-1975343, -1641, -42082, -20318], [715758, 38515, -101548, 5317], [-56055, -48322, -26775, -6116], [-337658, 673, -48628, -30757], [-377194, 59588, -127918, -30472], [173595, -68913, -80668, -1895], [-1067758, 59174, 17944, 40838], [-2175633, 40931, -134369, -2588], [-1652718, -41266, 114448, -5131], [208813, -15322, -296258, 13543], [1242314, 153306, -73584, -38901], [-339144, 147743, -148766, 51461], [-760928, 141010, 48620, -32228], [-1457855, 12400, -44966, 28451], [-363117, -143302, 230148, 9376], [-1115890, 148528, -105884, -43652], [1065274, 11018, 183450, -95194], [837582, -29, -9072, -43773], [-2473582, -31113, -151520, -9067], [-495464, 71276, -22008, 44188], [-849082, -55443, -51480, 95161], [471258, -153604, 316688, -34901], [422682, -235856, 267368, 65266], [1426962, 6850, 485168, -9518], [645834, -124256, 35712, 23740], [-2599750, 226093, -184876, 2095], [1516611, 159870, -175735, 33259], [-2472599, -123875, 279539, -15885], [-2325208, -120067, -205238, -35581], [2169921, 185298, -340301, 13269], [145950, -268083, 482524, -5643], [1180169, -97299, 364739, 54231], [-4781865, 56907, -534800, -53157], [3966831, 98697, 73630, 2132], [4658080, 209238, 20664, -34220], [798772, -69820, 415056, 49366], [649096, 117485, -100398, 55441], [7072254, 126660, 72848, 70744], [5767405, 217522, 157349, -113264], [2601346, 191490, -227948, 3668], [3423624, -208314, 267472, -66938], [3120570, 100079, 40204, -150743], [5612862, 21855, 651084, 154109], [-7703741, 506107, 412674, 72592], [3841263, 135513, 61835, -113830], [-2380780, 616601, 204092, 121209], [-1520215, -179763, -33325, 96951], [6695987, -427230, 222814, 14247], [-2146544, 290756, 212516, 105738], [9010273, 132774, 66277, 27086], [3984390, 241408, -861082, 115082], [-2803794, -427693, -7076, -52109], [8079072, -171321, 544770, -33813], [-9042610, 137659, -497008, -252069], [-897736, -161445, 21588, -181927], [-3364741, 471178, -1105, -139014], [6894334, 28644, 697160, 96568], [9771045, -267856, 346828, -79710], [3385186, 150108, -521316, 107034], [4717636, 68544, -90684, 148842], [4062208, -59548, -692976, -149278], [-1838743, 909777, -258388, 7235], [2799189, -466335, -682412, 66047], [-11359726, 169728, 266622, -202022], [-3237906, 467048, -858720, 173839], [5469696, -351130, 659760, 148372], [7774435, -469532, 573515, -57168], [-4320710, -526486, -699260, -339245], [3775806, 877750, -537824, -135741], [2870042, 280277, -1177008, -203011], [-9034514, -690430, -131056, -183702], [-4830858, 156421, 1264060, -130699], [4586180, 448601, -1567320, 31415], [1267590, -286756, -871294, 47590], [-14932262, -694393, 80748, -42659], [-3141000, 650144, -1218684, -227888], [-6669288, 504763, 804046, 213177], [-6343151, 906297, -1127624, 412401], [-407302, 473310, -1137544, -40967], [-6817075, 288936, -1772939, -165052], [-1777354, 564027, -1371836, 59303], [708265, 349261, -295011, -338002], [13440498, 120468, 336312, -116742], [-13977083, -598133, 787958, -221850], [-8945691, 346902, -802909, 535923], [-6888398, -472538, -136602, 312372], [559119, -395973, 1659900, 256189], [4900334, 51310, -104924, -467042], [5068204, -1224405, 169170, -202677], [2693107, 1133951, -1994143, 368061], [11426466, 104284, -2075280, 218475], [-14539399, 26213, 156315, 220095], [-3223222, -896306, 2396306, 170210], [-11575046, 1018808, 1098344, 329460], [7302926, -323660, -1640416, -356488], [-8472301, 419012, -1322890, -717875], [-14356053, -94152, -2346859, 259273], [-6977593, -1697128, 1074040, -118604], [-93175, 1309867, -1726883, 28078], [-507754, -582872, -784640, -454255], [-13481727, -46863, 1904102, 269440], [4216481, -1320989, -747095, 80264], [29624678, 733910, -194434, -51024], [19003616, 658660, 1157300, 654848], [15421861, -615159, -2559426, -166116], [23974968, 249844, 745036, -599874], [-19812164, 869587, 1797622, 415571], [-2026613, 1961418, -1132366, -330779], [-6590770, -279822, 2498206, 270070], [-2729650, 77466, 1917752, -230888], [15459082, -255287, 4038064, -120447], [-27500534, -370350, 2312040, -135834], [-21066528, -727434, 12728, 162436], [-7180042, -2364145, -184948, -482267], [-11921401, -847167, -1467825, -685940], [-19561002, 947394, -1868424, 30430], [-8558109, -1241423, -575645, 63172], [-17947339, 896954, 1493629, -78752], [4935530, -163216, -1293656, 418636], [-15630019, 1810183, -1637926, 133924], [-11196596, 2363492, -2092072, 73934], [-958847, 1620298, -2164398, 102917], [32150034, -443921, -2750092, -132945], [17199530, 1464198, -251616, -495145], [-3294614, -1675143, 3618076, 294805], [36352928, -1000837, 1473426, 646793], [9479357, 2537812, -542640, -164384], [22097491, -2544166, -593805, 729616], [19075407, -428126, 2039265, 410445], [22673740, 3202962, -3046660, 318586], [-14154794, 84334, -1150216, 235409], [-3047746, -1757966, -87160, 46866], [18942000, 3337402, -929016, -190840], [-44099218, -1576494, 1968272, -329126], [49567653, -1995940, -362244, -673754], [-13009472, 2042010, -508092, 219170], [4401196, -695905, 401608, -3691], [32337190, 1009289, 1289260, -860407], [67637888, -948709, -2039012, -188803], [11017104, -2195685, 271416, -1319435], [-471538, -1670710, -3586144, 7573], [3098377, -1524178, -988958, -218951], [47942131, -1801463, 2225739, -576872], [-29195834, 185276, 4434458, -596138], [-7172909, -1215929, 2415934, -65586], [-10008563, 1402188, 3527619, 846475], [37469656, -1451559, -668436, -810799], [-26321214, -434124, -834536, 1630972], [20710109, 4100221, -1501681, 399451], [-21759813, 2389478, -911127, 14355], [14900062, -65792, -2206648, 924491], [6947561, -1759029, 4332906, -342936], [18868704, -345560, 234244, -1337404], [32879200, 3548620, -683024, 492374], [44658584, 774376, -5023136, 463740], [-12739682, 3622366, 2695808, -136954], [52461122, -2223225, 3837852, -325663], [29546792, 366107, -558082, -243367], [51648558, -275588, 5217444, 324320], [37716443, -1841653, -2623429, 724376], [-13110612, -2886006, -3383096, -459554], [23527306, 773382, 6920124, 701948], [13228076, -5790772, 837412, -1748154], [-73066854, 5235092, 4705056, 446665], [21888505, -4081377, 5323221, -326754], [-30940192, 623541, 2899786, -976275], [11329760, 364082, -8435432, 268332], [63504048, -2217618, -1355564, 384152], [-64682, -542366, 2186764, 885165], [-6422744, 2705932, -3211988, 1219844], [1957462, 1694126, -5199718, -345568], [6582678, 1864138, -688568, 1190495], [-25028918, -4810189, 3486100, 925841], [-64924584, 1181751, -8390600, -2213129], [2110156, 4258177, 1287102, 820431], [69852123, 1168239, 4706565, 935251], [14898325, -4383004, 4307183, -930199], [-24265122, -3485748, 1681918, -1066374], [-15644378, 5291322, -3120606, 1637968], [22336084, -3717908, -4869952, -156540], [-49516838, -609736, -5989096, 2146428], [48052038, 2319638, -3152214, -902144], [40395930, -3320713, 8494164, 1494855], [-113674534, -461117, -1252548, 1307367], [13349810, -2170262, 6908078, -558120], [9847955, -6763485, 1484631, -1991030], [11459322, 2283999, 3676320, 1556615], [-23569149, 2556725, 8732230, 21444], [43661025, -3550147, 3645839, 1669609], [-42820588, 2246592, -3708816, 1464574], [-99621836, -155301, 4774724, -291225], [-53461888, -1040326, -126696, -2310698], [4449520, -1427833, 830784, 642625], [-4915417, -235124, -3735929, 925056], [-69667366, -2664898, 4206664, 532218], [26483677, 5757886, -4506184, 615494], [30109170, -216424, -7853568, 656745], [56359951, 3639620, -1810639, -590575], [-21491602, 474986, -3326112, -1012390], [-63739506, -5654825, 2234256, 769481], [43521078, -1315647, -6870692, -498325], [11685983, -1393766, -4891203, -296489], [-14019596, -3258148, -8502616, 502646], [-945666, 1046091, -1638548, 1596473], [71408786, 1367200, 5925440, 251195], [-17264645, 5198108, 5670406, 524869], [-115382833, 3410351, 2376056, -566945], [-7299686, 2511742, 1907642, -1084488], [-13617855, -518654, 6572216, 16426], [72082034, -3358174, 2458600, 1962153], [45572632, 2604562, 2654864, -921684], [-80316857, 6635357, 2634777, -583393], [-96379354, -4138114, 11503288, -748519], [34967405, 4255660, -3149114, -1591159], [4856284, -176304, 3434704, 2005880], [42008062, 2836735, -686472, 3107297], [-69920774, -1811600, -9051110, -2170830], [-29239574, -3038008, -7044966, -2996640], [37720316, -2027342, 19816320, -1147654], [-496878, -5677220, 8067656, -704084], [71587194, 385478, 6568288, -4068333], [32108034, 6759014, -11249540, -27153], [5020570, 6192207, -5106916, 3820883], [48844384, -462741, 6716160, 3424617], [75822828, 2399039, -189810, -846591], [-143904007, 3915730, 6659100, 1540108], [-107855459, 254840, -8940438, -4378369], [131913098, 4284543, -1232348, 226055], [-1009075, 8905290, -2333212, 4225644], [40194143, 5120896, 62579, -1518842], [-12920878, -3716884, -372776, 2391156], [139210537, -8323253, -3070300, -1487475], [5303369, -3973219, 16171865, -2712220], [-9317901, 3857847, 764920, -1147477], [81702128, 1624471, 8960266, -1153917], [65942770, -996164, 9044552, -2048021], [-74952062, -6132103, -4690296, -4754049], [-75493202, 714948, -15787272, 184420], [-28356694, 3000412, 4822584, -2772527], [-47025177, -4074458, -8111615, 2279425], [112476970, 2031252, -4681704, -552129], [105513665, 11261817, -5014902, 2945538], [15101541, -12046112, -4813779, -1626188], [-106405719, -4272187, 6313188, -2018069], [-178178368, 3362763, -7833202, 1742507], [46393809, -1860078, 9526922, 1492725], [169448434, 7566667, -7555372, -137011], [202468184, -454409, -11287780, 621033], [127234314, -12923944, -5249024, 2387532], [-18797854, 3310055, -12192184, 958611], [178377692, 3928381, -5300918, 739241], [-50000089, 2067106, 2942776, -1643574], [72582718, -1572256, -13308608, 585721], [175080482, 6408450, -4099990, -696626], [-14368707, -10688739, 17318214, 1063212], [219819458, 1734705, 2408716, -2649791], [4686275, -1561400, -13512057, 1812490], [232311461, 2331571, -2836822, -1000100], [-78831994, 774724, 2176624, -2071676], [-93760119, -9594289, 9741483, 3166407], [48485343, 10732126, -10680296, 1299202], [2771208, -1834255, 8603812, -1585567], [106782122, 5362846, -2914766, 1652800], [142742728, -6449090, 12820456, 4075318], [-28127701, 9613927, 129427, -2048388], [108985007, -7300438, 459102, 2615283], [49328328, 6198124, -30461480, -803278], [-120484567, 4417377, -17892064, -15331], [49231808, 1674570, 3177272, 72030], [-133941178, -12724650, 5231640, 2369781], [28083693, 10036332, 5347219, 5121927], [-28072372, -16125590, 19236812, 2069458], [284412854, 11281780, -8236376, 2506748], [357644022, -2314530, 5570500, 1229818], [-30397570, 13869788, -2788580, -3424530], [-96541468, 5329362, -14980000, -353992], [-17929038, 1575435, -2306168, 1903335], [-206518282, 2286458, -706896, 1476806], [-121356626, -605351, 8374168, -1832677], [-99963012, 1038484, -24675044, -1555978], [-30418242, 4142742, 5310912, -3118006], [34204823, 3442232, -3108315, -4359569], [-95313738, 5203907, -14600076, -546473], [54398574, -10179326, 11748072, 6743925], [26686079, -4425579, -8328221, -5824366], [16285386, -15285774, 21906392, -343716], [18663386, -2925227, -2151428, 4278357], [-102120326, -15879194, 5399048, -770542], [166903010, 8796668, 4775220, -6422450], [-75780974, 15580159, -10393848, 5567943], [-2400126, 11002021, 13427716, 1590209], [-158776266, -580721, -15269696, -5427325], [-137415721, -1866291, -16068367, 1296863], [305712756, -8093915, 8891978, -3449279], [55904346, 899463, 12770420, 4628905], [-202092694, 10920616, 6983438, 961642], [-66684451, 1108140, -9940866, 5531545], [20204661, 1468932, 7936940, 7002122], [-68338189, 155705, 16428523, 5017712], [91550594, 4825608, 25453718, 6073504], [-39298117, 22777266, -8288491, 4707749], [-179667488, 911939, -5166304, -5559735], [58335148, 9343518, -3539028, 8867414], [-5748482, 2075060, -1107662, 109610], [-52994282, -3126064, 6519156, 7342286], [315013053, -1837278, -9307231, -2094138], [40575646, -9430100, -13750834, -4099728], [147968324, -9929733, 4709638, 948459], [296078758, 12673320, -18786600, 1210668], [252687266, -8635393, 10936224, -4487835], [-187214837, -10245088, 5220294, 6915677], [-125621030, -13829200, 30813712, 2689687], [-157056067, -4610411, -6993925, 1863661], [-114288026, -7724013, 1819276, -5344491], [236430943, 9376391, 9316758, -911710], [115592397, 7281923, -12155282, 2357574], [257489644, 8716406, -15663912, -2246946], [-173978311, -9285943, 367402, 4557890], [-196455023, -19726955, 17308233, -2235932], [-303197478, -4811817, -18936792, -2403391], [-12894020, 15052737, 8430658, -5236359], [25644728, -17413221, -23842034, -4138391], [-154087802, 13073444, 5281304, 2316815], [-86555911, 38053, 26627452, 5498455], [98409137, 9229466, -6253027, -9855942], [-66906362, -11075982, -8332596, -9945383], [-265476234, 8563278, -32328768, -1852860], [-310432273, 937459, 2024556, 3303785], [-122030737, -18362680, -5182697, -7681664], [113050933, 9485574, -23178509, 2529483], [-54012513, 14587757, -7491551, 5149431], [-364300703, 4453615, 5235114, -3341468], [-73994496, 25700732, 5057272, 4204014], [-119375628, -12063870, 18046432, 1531204], [-91812858, 853176, -43269470, -1145622], [15828338, -9126620, 18696000, 2448346], [53515954, 9228126, 468200, -5897882], [38326530, 1632602, 16292580, -8323156], [282001498, 23164578, -30356308, 3439715], [139186473, -8719576, 4417892, -9473462], [513850205, 92719, -2842248, -1369877], [155117730, -22130047, 12273784, -6559007], [136959987, -8678898, 21485266, 2907893], [258255982, -5865695, 1037736, -8177439], [302061511, 16326810, -10920935, -3476175], [30207492, -10620046, 440036, 6678844], [39527806, 2887760, -2876808, -550096], [10447051, 14657805, 26997996, -5384061], [-392886608, 5457177, -5414846, 1187423], [39278710, -4652765, 29348312, -751691], [-13451504, 21153317, -27684508, 531233], [40520754, 5069874, -8285868, -6279870], [-40780695, 24918303, -25237541, -1916189], [42762886, -15711544, -19058010, -7658152], [151360912, 19787702, 2945976, 7339518], [-251288617, 15909085, 25979471, 3678988], [-33493494, -5284396, 16562360, -6573308], [88638610, -1043320, 47527644, 3522956], [18089497, 20320435, 17217583, -4777367], [-345441275, -180568, 7832383, -1015979], [-157668457, 11334962, -46584532, 8752040], [131155779, 24806706, -10321938, -2925373], [-256218518, 2135769, 3504692, 173009], [360483652, -11367250, 23047800, 10614302], [123913810, 1931491, 30211256, 9497217], [441219865, 27872725, -17080825, -4963815]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_464_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_464_6_a_i();".
// 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_464_6_a_i(:prec:=4)
    chi := MakeCharacter_464_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_464_6_a_i();".
// 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_464_6_a_i( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_464_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<3,R![1665, 2316, 46, -28, 1]>],Snew);
    return Vf;
end function;