
// Make newform 464.4.a.l 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_4_a_l();".
// 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_4_a_l();".
// 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 := [-8, 20, 18, -14, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [-6, 2, 1, 0, 0], [-2, -8, 1, 1, 0], [2, -2, -10, 1, 1], [16, 18, -14, -1, 1]];
    Rf_basisdens := [1, 1, 1, 2, 2];
    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 := 4;
    raw_aps := [[0, 0, 0, 0, 0], [-2, 0, 0, 1, 0], [2, -2, 1, 1, 1], [-8, 0, -1, 0, 2], [-1, -3, -1, -2, -7], [1, 1, -4, 4, -10], [13, 7, -2, -3, 3], [-43, 3, -5, -1, -3], [-26, 6, 7, -20, -4], [-29, 0, 0, 0, 0], [-80, 6, 13, -13, 8], [88, 18, 22, -40, 12], [-241, -3, -2, 25, 19], [45, -29, 27, 4, 7], [-61, 25, -58, 16, -9], [-117, 15, 26, 8, 2], [-80, -20, -11, -10, 26], [111, 57, -40, 3, 9], [-232, 92, 22, -48, 48], [112, 112, -32, 10, -16], [-382, -36, -34, -2, -30], [-77, 13, 38, 50, 127], [-88, 44, 55, -58, -2], [165, -21, 28, 31, 121], [297, 79, -22, -1, -31], [-194, 64, -78, -34, -6], [-110, -90, -132, 40, -42], [-432, -20, -39, -60, 58], [-266, -94, -53, 165, -143], [72, -50, -18, -134, -206], [637, -221, 97, -21, 129], [-693, 37, -5, 225, -5], [102, 104, 92, -226, 290], [-1146, 18, -67, 56, 32], [411, 75, 116, -186, -24], [628, 56, 321, -236, 70], [-523, 35, 238, -257, 13], [56, -186, 28, 333, -294], [1254, 166, 58, 8, -262], [444, -318, -240, 218, -346], [-272, -28, -8, -274, 60], [1122, 370, -219, 111, -65], [1237, 283, -271, 131, -179], [-833, -75, 336, 113, 47], [-366, -148, 144, -288, -168], [-1420, -412, -281, 324, -166], [-1020, 314, 4, -19, -142], [-772, 376, 14, 286, 140], [572, -220, 520, 134, 188], [1447, -643, 276, 93, 183], [-416, -40, -114, 331, -93], [-1400, 96, -205, 570, -594], [338, -426, -116, 475, 387], [124, -266, 70, 415, 354], [2881, 573, -283, -168, 134], [600, 382, 217, -457, 516], [203, -3, 198, -37, -479], [-1110, -772, 363, 319, 178], [-1534, -472, 132, 476, 348], [352, 144, -352, 523, 39], [-1248, 392, 105, -1046, -378], [2526, -324, -502, -76, 160], [2075, 49, -571, -590, 181], [981, -373, -503, 483, 285], [-2677, 87, -369, 90, 328], [-4221, -291, 234, -81, 489], [-2996, 90, -146, -251, -90], [-7345, 193, -48, 267, -275], [1952, -1124, 192, 630, 144], [1861, 49, 266, -650, -128], [1626, -148, 504, 916, 776], [1201, 891, 242, -832, 921], [749, 139, -381, -33, -1095], [-4564, -668, -149, 601, -783], [-2791, -1025, 495, -449, -703], [2928, -364, -347, 1340, -174], [2632, -70, 244, -980, 316], [-3344, -536, 81, 597, -1127], [1612, -228, 474, 979, -1257], [2554, 160, 144, -188, 992], [-7030, 470, 458, -476, 6], [-5797, 997, -372, -713, -335], [-1246, 194, 357, -496, 788], [-2766, -228, -678, -94, -522], [1302, -854, 205, 840, -1536], [-6229, 157, -1153, 1553, -849], [2598, -788, -584, -80, 304], [-6326, 452, -564, -588, -432], [1466, -1368, 762, 1308, 432], [1544, -1004, 335, 1006, 1350], [-6335, -1033, -661, 976, -181], [1266, -1092, -263, 371, -782], [960, -24, -161, -932, 1138], [7431, 201, 281, -644, 141], [822, 1742, -465, 772, -196], [1506, -276, 865, -2093, 1978], [1061, 601, -1352, 34, 28], [-2215, 1761, 575, -710, 1060], [2634, 170, -1636, -958, -2154], [-614, 516, 1324, -2058, -818], [1850, 2382, -989, -446, 456], [-1908, -186, -1212, 1198, -1226], [12588, 274, 186, -1087, 214], [5332, 1490, -316, -654, 266], [-8448, -1384, 1090, -16, -968], [-1935, -725, 794, -1983, 1227], [-3494, -138, 223, 1448, -284], [-2341, 811, -759, 908, 1402], [5797, 695, -514, 0, -1999], [10587, 113, -568, -423, -1213], [7418, -1948, 1669, 987, 1154], [-3208, 2116, -1285, -1461, -389], [7722, -1764, -1476, 1186, -1082], [-9954, 844, 1096, 31, -864], [-4312, -1680, -1302, 1518, -1064], [7441, -101, -182, -903, -1677], [-12162, -666, -235, 1254, 844], [678, -110, -749, -1304, 632], [8615, -539, 462, 1245, -1457], [13102, 408, 1782, -3083, 1644], [-1588, -1174, -8, -466, 2422], [-10440, -100, 810, 549, 3277], [1518, 2484, -666, -668, 356], [-410, 1462, 1142, -486, -1574], [-4792, -1600, -434, 1864, 2644], [9889, -1767, -902, 1212, 450], [1423, 815, -674, -2402, -3108], [-16444, 8, 602, 470, 1096], [433, 927, 2205, -4169, -1343], [512, -654, 154, -208, 848], [11890, 388, -2996, -1623, 100], [13699, -779, 465, 2245, -345], [-11477, -1067, 205, 665, -2377], [-9827, -1457, 2060, -719, 519], [-6034, 2520, -1624, 1068, -816], [-4805, -667, 1324, 3299, -1955], [-10607, 511, -2244, 147, -1503], [2544, -3268, 2754, -1530, 2204], [15235, -1363, 428, -857, 1813], [-2870, -2652, -1102, 1690, -2726], [-8746, 686, -3053, 1270, -2796], [-8907, 4517, 1480, -2408, 3142], [-11563, -149, -455, 747, 1161], [790, -4, -510, 1219, 804], [-2785, -3455, -1066, -1, -2135], [-2143, 2191, 812, -3662, 257], [1362, -728, 744, -4868, -1900], [17181, -775, -125, 1024, -2098], [-5319, 963, -2041, 4930, 135], [-18804, -3796, -96, 1646, 1016], [-5469, 751, 3434, 848, 2994], [-10384, 182, 1540, -1954, -2874], [6012, 2052, 1901, -5128, -322], [-13198, 968, 1349, -1351, -1046], [-4193, -2663, 347, 981, 1947], [-4694, -1132, 1183, -3369, 3802], [-12560, 716, -1106, -286, -404], [-11554, 840, 852, 540, 1628], [-1284, 1206, 732, 2486, -898], [-16414, -178, 1159, -5623, -2795], [161, -2369, -1167, -1376, -3665], [19860, -1564, 2320, -3997, 1651], [-10645, 2937, 818, -488, -537], [-5663, -1577, 2513, 2099, 1261], [-12635, -1455, 3487, 512, 530], [12405, 3155, -2736, 1010, -3303], [-14518, -2086, 2024, 176, -2742], [-1918, 3580, -2500, -2554, 1698], [-9595, -487, 683, -1980, 1942], [-6946, -1528, 80, 2350, 2626], [5878, -154, 2309, -406, 5404], [1972, 1464, -399, 2063, -1393], [6566, -4238, 3234, 5132, 2826], [38044, 1434, -884, 1990, -3430], [-11664, 3552, -3, -1738, -2154], [-24834, 4232, -364, 3912, -260], [-8906, 2734, 212, -2738, -1502], [-4521, -199, 3764, -3657, -187], [-15953, 6161, -166, -1474, 987], [2920, -870, -2820, -1690, -3598], [14699, -3787, 174, 2390, 679], [-7068, -5942, 936, 4981, -5538], [-25172, -5346, 748, 1378, 2106], [6423, 5787, -3239, 1802, -504], [9792, -1876, -1870, 1468, -264], [-14640, -6640, -1699, 2817, 537], [-1793, 3057, 2898, 723, 605], [4837, 1659, -609, 3331, -179], [15371, -3475, 2238, 2739, -2711], [-38372, -2156, 1901, -672, -3938], [2030, 170, 420, -2477, 563], [-15392, -3238, -5002, 4819, -9050], [-29137, -2291, -871, 4162, 7049], [-13672, 2794, -2228, 1748, -3364], [-18685, 1477, -5643, 1725, -2821], [11534, -5428, 3608, 1252, 1312], [-3604, -1754, 2900, -4992, -4204], [15576, 4090, -6132, 2902, 3066], [-3538, -4006, -806, 3523, -661], [25042, -4494, -3570, 3186, -122], [-17305, 2965, -534, -647, 6935], [14046, 3338, 3517, -1112, 7036], [21359, -2155, 1444, 5801, 2319], [-9335, 223, 736, -3621, 765], [-19025, 4097, -3655, -191, -1433], [24632, -7952, -499, 6305, -4671], [39483, -483, 2880, 778, 4295], [7974, -7834, 7174, 4220, 2746], [18405, -3451, 4323, 1854, 3052], [-17213, -9267, 4661, -2672, 565], [3667, -871, 380, 5869, -6529], [-1626, -1724, 1548, 892, 4852], [19718, -4392, -791, 2787, -2314], [6093, 9771, 3153, -6080, 1999], [30017, -353, 1385, 1911, 2817], [5629, -8591, 2165, 5820, -446], [30812, 556, 5548, -9580, -848], [-5354, 2800, -3760, 7126, -3658], [-36250, -3450, 16, 5638, 3902], [-7316, -5350, 6046, 1446, 1126], [29471, -4015, 3226, -4073, 6321], [39806, -570, -2763, -814, -5372], [-28258, 3140, 28, -200, 852], [51209, -893, 1528, 3000, -1711], [-31756, 32, 210, -152, 400], [-12316, -814, 7190, 2030, -5846], [-11682, 9432, -2078, -962, -1458], [-19353, -2679, -3197, 4281, 7143], [12135, 8069, -5498, 604, 2371], [-10862, 2934, 1527, -7838, -5176], [-3960, 778, 494, 7584, 10856], [-48214, -442, 1060, -742, 1898], [9029, -1493, -8625, -1453, -8103], [9226, 5252, -6458, -22, 4514], [10766, 4386, -5308, 1668, -6278], [-11313, -2303, 55, 5705, -10645], [-17415, 9963, -3094, 473, -2413], [26479, 3077, -1702, 4785, -2553], [-22832, -436, -6531, 7164, 4138], [13524, 34, 9467, -2541, 7908], [-18855, 819, -3795, -6622, 5227], [-34924, 4644, 7518, 2866, 7484], [12688, -5584, 1392, 7374, -8228], [-7994, 7360, -6258, -2214, -1618], [19004, 4642, 5668, -6686, -774], [-34294, -2462, 6632, 696, 9758], [21660, 6036, -5745, 2930, -7762], [17644, 5388, 2421, 566, -4618], [-41042, -134, 3612, 176, -1086], [24739, 10981, -2580, 294, -10045], [29711, -6679, 46, 3819, -5951], [-613, -5973, 2559, -10088, 1066], [-28516, 6990, 285, -9023, 3948], [5026, 532, -2922, 10762, -9618], [47271, -1651, -678, 3533, -2849], [39870, 102, 482, 134, -13770], [4823, 3549, -1298, 10429, 7419], [-14018, -1032, -158, 1397, 1280], [-35228, 2798, 48, 2230, 1474], [2010, 3886, 1300, 4795, 3719], [74875, 3381, -1309, 1173, 2651], [7229, 3883, 905, -592, -1789], [-12176, -4742, 6124, -5618, 3730], [-46737, 4505, 2032, -2929, 6241], [-46757, 8229, -1638, -8877, -1511], [-41987, -2269, 1245, -10116, -1929], [15890, -1484, 7788, -8242, 9982], [-16331, 8279, 6768, -4915, -2725], [-1825, -9295, 6903, -3027, 1987], [-15378, 306, 3263, 10421, 5265], [-33637, -1257, -2992, 5416, -3094], [-12354, -1946, -4000, 5264, 10558], [-20202, 8434, -5276, -7229, 8263], [-9199, 5071, 7273, 623, 5077], [9392, 4586, -644, 2516, 7040], [51754, 936, -2077, -1115, -11346], [-14785, 7625, -4903, -6975, 2167], [-21790, 1386, -533, -4909, -617], [-20662, 844, 5828, -10014, 5466], [-48958, 11426, -10333, -11536, -2096], [44628, 15248, -782, -6282, 10596], [17824, 12616, -6404, -1350, 2244], [-19522, 3458, -7866, -1998, 914], [6000, 2582, -6456, -7954, 10054], [-48415, 4631, 1485, -13957, -703], [-31961, -5919, 4673, -9447, -4053], [12769, -4949, 76, -3407, -11097], [15271, -5667, 3286, -8659, 7347], [-33102, 11194, -59, -4926, 540], [-4292, -5192, 6702, 6689, -1163], [34140, -2724, -179, -7107, -7399], [-19858, -4250, -3183, 2320, -11952], [42228, -2832, -702, -8387, 1505], [16104, -9006, 78, -3397, 2002], [19714, -416, 1166, 5236, -6656], [-31941, 1675, 886, -7542, 14844], [30767, -9363, -11442, 2768, -6089], [37795, -6129, 9684, 3852, 2278], [1780, -2376, -595, 468, 794], [20379, 2357, -5477, 15505, 8287], [34039, -11063, -3032, 12351, -3051], [-30500, 1442, -1772, -978, 3694], [54071, 2561, 5979, -1127, 7967], [23379, -16927, -181, 5362, 2085], [-4849, 15745, 4699, -18283, 14019], [23881, 9349, 1821, 4884, 13638], [77922, -3560, -2458, 2831, 128], [19199, 13935, 12458, -15766, 9160], [-17702, 5814, 743, -11226, -5308], [8096, -8624, 7957, 9553, 5905], [-25086, -1978, 9789, 9248, 8304], [17579, 4193, -4220, 3781, -15853], [-74848, -9882, -1268, 6838, -7578], [21430, -4326, 4505, -3448, -12372], [-10862, -1034, 6265, 6290, 9404], [15356, 1644, 660, -3513, -2461], [42297, -3009, 14057, -6013, 18333], [-41804, 2792, -9754, 15366, -4176], [48245, -8119, -8641, 2068, -1122], [-4481, -14183, -5526, 13039, 7693], [3060, 16278, -12514, -4437, 2974], [-13483, 2593, -3323, -19592, -5570], [3658, -6556, 18028, 316, -4484], [13976, -2782, -2401, 19725, 1484], [30984, -4520, 1448, -3357, 5695], [37143, -5819, -6200, 8617, -15461], [-74142, -8610, -5860, 9716, -11182], [9322, -3378, -12658, -4550, -21126], [-60327, -10277, 1646, 6948, -2599], [-17536, -1884, 9467, 9575, 7735], [38418, 6812, -4424, 9634, -1366], [-103241, 2215, -104, 9442, 6272], [44778, -9390, 2526, -9766, 12226], [21611, -18507, 3483, 17425, 2843], [-18697, -5935, 7571, 11088, 4321], [90904, -1380, 1430, -12732, -2792], [6062, 1400, -7348, -11408, -12632], [-35636, 3026, -3854, -5010, -8318], [77570, 8112, 1378, -4196, 12164], [-37130, 15010, -1196, -3318, -5810], [54263, -6367, -4996, 23391, -335], [-10738, -9684, 3164, -13428, -5144], [24549, -5361, -7180, -7255, 5335], [-123588, -9904, 1418, 2992, -11744], [96904, -1922, 21260, -12978, 18218], [4959, 173, 6905, 12646, 7237], [83091, 5029, 15828, -20729, 12445], [1451, 15893, -2301, 617, 2091], [30225, 4643, 32, 9264, -6595], [-61792, 6846, -7168, 6478, -3414], [-35788, -3340, -6485, 15710, -682], [-23158, -7164, 6544, -12172, -10376], [40838, -8460, 2294, 23476, -7124], [17472, 1956, 1083, -9450, 14270], [-423, -6109, 6204, 21301, -12681], [-91291, -4753, 5648, -9679, -6725], [-45762, 532, 3211, 13569, 8250], [63562, -3038, -7309, 4286, -3268], [75449, -8229, -3090, 9249, -3493], [7248, 8420, 4694, -17726, -10452], [57298, -11038, 1835, 2651, 6615], [88756, 2880, 3290, -10823, 10057], [-101485, 4333, -11322, -538, -10817], [79726, -2882, 18056, -25720, 6406], [-24189, -9855, 7187, 11710, -19507], [-27323, 6419, 11214, -4045, 15257], [-68080, -1230, -1424, -9524, 3044], [91618, -9182, -1794, -11072, 158], [-80082, 6644, -1040, -5884, 17448], [100122, 4896, 11784, -7009, 12604], [-17788, -15620, -1236, 1450, -17624], [25338, 27746, -1677, -10558, 7264], [72102, -14500, -11608, 6744, -4064], [-6540, 13776, -8891, -14982, 17526], [-22064, -5532, 4639, -5201, 13147], [-100993, -11887, 9075, -5643, 12067], [-78920, 2122, 11337, -2543, 16856], [-70891, -8201, -3312, 11341, -10741], [-6697, -14561, 8595, -16596, 11322], [-17885, 3911, -15357, 14350, -13044], [-103660, 550, -860, 80, 1700], [35521, 25621, -3043, -6452, -15906], [-27837, 10553, -11118, 7836, 6531], [-4175, 22195, -4646, -12327, 7239], [-22388, 7624, 1859, -240, -170], [-93958, -4550, -12019, 13790, 3040], [-25271, -9273, 1261, 8855, -16527], [-40675, 38541, 6770, -14408, 5574], [92674, -8048, -7758, 12759, -6404], [92413, -11501, 7947, -16309, 5817], [70344, -11362, 15526, 16910, 11190], [74209, 2909, 2622, 8870, -9816], [49562, 13356, -11396, -4699, 3628], [-123631, 5027, 2521, 590, -9969], [10250, -13280, 2757, 10265, -306], [-70985, 3811, 12057, -1746, 6156], [-49726, 8042, 2626, -9454, 4342], [103972, 3638, -9652, -5724, -15120], [18768, 20884, 946, -23058, 14972], [-34486, 23000, -11536, 5092, -14556], [-122464, 2014, -12860, -1550, -7018], [604, 7186, 542, 6406, 13218], [-49949, 9461, 1593, 2885, -3441], [-66740, -19328, 18218, 3877, -10379], [85663, -14353, -1632, -16230, -10644], [-160864, 6704, -1639, -9498, 678], [-63124, -7664, 14981, -8633, 17543], [-42245, -5179, -6158, 27039, 4017], [84527, 18125, -3853, -6274, -1519], [-101158, 14366, 892, -1554, 9942], [28692, -16194, -4328, 11334, 12182], [14455, 5827, -6058, 22260, 14338], [6194, -13602, 2229, 14498, -772], [-170356, -7420, 2407, -702, 10826], [104659, -4687, 21776, -1379, 25527], [-124312, 16054, 1806, -17706, 5946], [-69964, -11338, 7767, 12817, -21200], [-43352, -14092, 3968, 12990, 24316], [56624, 18090, 15776, -28280, 9812], [-77357, 12885, 3734, -20262, 21991], [64902, -9280, -4596, 12316, -30108], [48874, 336, 14014, -26972, 11284], [11002, 16124, -20675, 12039, -3154], [31921, 17691, -15981, 4206, 8515], [87792, -20624, -3562, -8933, 1647], [-40588, -15768, -873, 4959, 16519], [-114568, -10600, 10543, 11762, 6514], [-129188, 17126, -2268, -4320, 6228], [-78208, -7328, -4873, 1954, 16346], [24892, -7002, -4337, -20619, 4764]];
    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_4_a_l();".
// 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_4_a_l(:prec:=5)
    chi := MakeCharacter_464_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    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_4_a_l();".
// 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_4_a_l( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_464_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![1042, 187, -322, -52, 8, 1]>],Snew);
    return Vf;
end function;