
// Make newform 1521.4.a.bh in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1521_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_1521_4_a_bh();".
// 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_1521_4_a_bh();".
// 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 := [-4096, 3584, 4784, -3203, -1501, 680, 145, -46, -4, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0], [-149293824, 52058000, 91159455, -12738943, -11530440, 728955, 501446, -12396, -6901], [-6050816, -22791952, 16793257, 4265751, -3297016, -384275, 195178, 11372, -3843], [-646464, -1604391, 252488, 485407, -171803, -72705, 19422, 2737, -595], [-92826880, -97179408, 67400873, 38793527, -14845688, -3803155, 1059978, 103372, -23843], [-122506496, 12391680, 111900273, 12527327, -23878504, -2570427, 1548474, 90940, -32107], [-202361088, 51740944, 217315329, 3078399, -46218904, -2210427, 2837370, 88524, -53515], [59238144, 34322440, -85614861, -25660427, 19362096, 3186791, -1304226, -97156, 27975]];
    Rf_basisdens := [1, 1, 8071424, 4035712, 504464, 8071424, 8071424, 8071424, 4035712];
    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_1521_a();"
function MakeCharacter_1521_a()
    N := 1521;
    order := 1;
    char_gens := [677, 847];
    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_1521_a_Hecke(Kf)
    return MakeCharacter_1521_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 := [[1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 3, 1, 1, -1, 1, 0, 0, 1], [-4, -1, -1, 1, -2, -1, 0, 0, 2], [21, -2, 2, 2, 0, -3, 2, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0], [7, 8, -2, 2, -5, -1, 7, -5, 7], [-14, -4, 1, 0, 0, 3, -1, 1, 10], [22, -8, 6, 0, -1, -14, -2, 0, 3], [-16, -29, -3, -3, 6, 5, -6, 0, 8], [-82, 21, 7, -1, 2, -1, 12, -8, -4], [-12, -28, -16, 14, 9, 4, 13, -11, -12], [150, -14, -3, -6, 2, 21, 12, -2, -7], [-70, 14, 3, -2, -25, 21, -5, -5, -11], [92, 25, 23, -1, 25, -7, -10, -4, -5], [18, 18, 12, 12, -36, 6, -13, -3, 43], [158, 49, -30, -1, -8, 13, 22, -22, 34], [4, 6, 16, 52, 17, -18, 51, -13, 18], [102, 45, 28, -57, 37, -3, -9, -31, 22], [264, -11, -71, 11, 27, -17, 27, -23, 26], [-52, 85, 50, 5, -45, -39, 19, 15, 2], [44, -5, -3, 77, 3, 9, -5, 21, 38], [444, 21, -88, -85, 10, 16, 25, -13, 10], [210, -42, 9, 44, 18, 46, 17, 29, -13], [157, -96, 54, 68, 87, -17, -20, 6, 8], [-164, -5, 39, -89, 5, 45, -1, -47, -38], [416, -82, -76, -14, -64, -4, -9, 27, -21], [-180, -131, -48, -41, -13, 24, -19, -35, -137], [-246, -72, -102, -152, 94, -44, -76, 32, -46], [142, 38, -11, 164, -88, -54, 51, 51, -25], [68, 59, 93, -27, 29, 7, 52, -26, 121], [116, -13, -106, 89, 81, -6, -2, 2, 8], [-184, 121, 126, 115, -67, -153, -84, 46, -57], [1213, -88, -92, 80, -39, 43, 59, -53, 21], [828, -453, 33, -69, 118, 73, -63, 41, -221], [-390, 144, 126, -52, 75, 108, 64, -70, -137], [-412, -189, -205, 77, -134, -3, 92, -2, 222], [-533, -146, -38, -6, -179, -93, -129, -29, -93], [1246, 126, -62, 158, -94, -90, -4, 16, -66], [-910, 320, 152, 76, -2, 96, -72, 48, 2], [57, 100, -136, -268, -78, -33, 81, 3, 220], [288, -297, 133, -53, -26, -135, 125, -95, 235], [140, 524, 246, 256, -56, 52, -161, -13, 169], [1734, 68, -225, -176, 87, -61, -44, 16, 16], [-706, 26, 202, -130, -101, -218, 104, 22, -131], [-1064, -18, -44, -266, 253, -4, -219, 15, -330], [-1759, 678, 30, 134, -208, 277, 116, -190, 27], [1554, 295, -51, -119, -260, 99, 10, -58, -2], [1034, 225, 122, 335, -17, 253, -373, -63, 4], [1384, -170, -230, -232, 24, -216, -133, 1, -179], [1254, -272, -121, -354, -138, 132, -159, -47, -153], [1166, 497, -39, 179, -334, -45, 161, -71, 263], [1364, 407, 287, -3, -95, -153, -302, 158, 167], [-553, 485, 231, -53, 319, 84, 196, -72, -262], [160, -547, 14, 167, 71, -258, -388, 10, 140], [-258, 952, 460, 56, 79, 246, 291, 209, 106], [2946, -781, -221, -499, 357, -189, 48, 80, 61], [-1632, 322, 162, 106, 108, -172, 179, 259, -121], [1284, 960, -178, 206, -212, 256, -177, 5, 115], [45, -312, -576, -298, 276, -381, -221, 117, -250], [-1398, 434, 209, 218, -221, 87, -556, 84, 450], [-1514, 183, -45, -125, -210, -109, -47, -103, 337], [437, 175, -27, 653, -231, -328, 126, -106, 520], [2254, 589, 85, -701, 278, 163, 172, -60, -236], [107, 375, 209, 315, -32, 224, 803, -209, -82], [-316, -150, 132, 54, 108, 294, -402, -202, -326], [272, -414, -426, -190, -328, 402, 383, -161, -59], [52, 19, -284, -781, 706, -454, -33, -163, 382], [-2776, -552, -64, -344, 640, -92, -471, 17, -645], [732, 794, 454, 88, -303, 566, 631, -257, 322], [-195, -636, -854, -260, -139, 99, 498, -308, 356], [4808, 6, 154, 30, -13, 368, 346, -20, -189], [-4678, -181, 629, -1035, 734, -377, 31, -81, -913], [-928, 202, -214, -1080, 894, -372, -461, -227, -141], [172, -1386, 351, -246, 165, -238, 155, 217, -78], [4484, -8, -320, -876, 398, -144, -260, -96, 186], [1496, 622, 292, 670, -20, -288, 542, 338, 912], [1444, -955, -349, -871, -207, 141, -471, 87, -706], [227, 1004, -448, 612, 100, 167, -330, -134, 329], [1914, 750, 785, 50, 422, -368, 378, -348, 2], [-378, 367, -267, 721, -267, -121, 259, 189, 50], [410, 1688, 82, 550, -12, 820, 413, 179, 665], [4282, -240, 860, -592, 775, 56, -374, 28, -771], [-166, -1314, -147, -302, 358, -804, 164, -334, -880], [1242, 1081, -1207, -325, -798, 5, -281, -197, -165], [-551, 1155, 265, -923, 729, -580, 232, -340, 266], [-2954, 548, -1047, -182, 197, 27, -1041, -291, -311], [2728, -1809, 387, -609, 239, -451, -419, 59, 1046], [2368, 258, 224, 228, -508, 752, 737, -225, -837], [-194, 814, -304, 378, 203, -530, 1013, -525, 918], [-6816, -250, -125, -374, -37, -410, 125, -261, -826], [812, 205, 283, -245, 52, -971, -251, 129, 1103], [-2020, 1941, -619, 191, -626, 207, -454, -306, -882], [2948, -178, -511, 262, 418, 1398, 793, 425, 17], [-1079, -758, -622, -1046, 962, 141, -723, 451, -592], [1174, 1263, -265, 81, 992, -391, 561, 197, 861], [758, -1302, -320, -1368, -258, -276, 713, -73, -751], [-2212, 1369, 420, -665, 458, -483, 208, -356, -1004], [6583, 989, 251, 471, -155, -36, -1003, -87, 391], [-836, 728, -1398, -392, -715, -32, 534, 560, -391], [-2002, 923, 712, 1041, 24, 227, -109, -125, -599], [1380, 531, -239, 295, -706, 869, 143, -629, 353], [8522, -1711, 279, 219, 519, 165, -952, -586, 495], [932, 805, 806, 1329, -389, 457, 1207, -129, 690], [-408, -194, 31, 162, -1172, 1082, 383, 243, -579], [-2302, 2388, 2087, 302, -298, 489, -99, 417, -576], [1068, 437, -894, -1913, 132, 38, -1652, -30, 163], [-3081, 513, -523, -1025, 109, -1354, 714, -90, 60], [2800, -680, 536, 1492, -1047, -854, 403, 369, -532], [1854, -2168, -941, 980, -176, 119, 656, 130, -925], [3088, 1275, -103, -151, 831, 29, 753, 419, 104], [1796, -886, -1148, -1384, 374, -18, -685, -495, -2215], [4352, 1601, 406, -797, 424, -1247, 2120, 12, 606], [-3436, -2340, 960, -464, 924, 620, -459, 817, 223], [-5594, 1871, -1167, 1753, -1361, 89, 477, -473, 1216], [-1118, 1208, -361, -1026, 1108, -455, -135, -479, -1378], [-232, -2125, -760, -1359, 323, 516, -324, 1080, -1718], [3602, -946, -718, 646, 86, 1748, -1180, 576, -156], [5436, -2595, -1003, 1613, -322, 1177, 1637, -431, 1733], [3756, 986, 1687, 1174, -723, 74, 1318, -152, 1035], [-5294, 379, -657, 2681, -495, 767, 1148, 28, 1673], [-8100, -369, -1644, -661, -38, 977, -1455, 859, 439], [-1940, -2238, 14, -3722, 98, -1476, -318, -466, -966], [-1750, -2884, 289, 1028, 966, 1007, -805, -127, -1228], [-822, 1810, -839, -850, -370, 3103, -357, -127, -38], [-7688, 2166, 1106, 2530, -1043, 602, 1160, 338, 1283], [1722, -597, 187, 2053, -697, 809, -1990, -54, 55], [-5618, -315, -1799, 791, -373, 777, -1104, 434, 1475], [-7682, -1027, -251, 675, -644, -1655, 508, -144, 536], [-3242, 710, -582, -2400, 958, -18, 749, -1009, 355], [7702, -2769, 250, -2339, 2603, -1889, -2212, -402, -2273], [2836, 1067, -87, -71, -2076, 291, 1034, -90, 1682], [11880, -212, 1976, -2000, 212, 362, -138, 298, -716], [5734, -1894, -2798, -222, 301, 674, -682, 664, 393], [9417, -563, 535, -2075, 28, -156, -1203, -223, 2570], [-3355, -296, -1236, -438, -296, -1809, 1083, 233, 1822], [1102, -3648, -206, -1118, -16, 370, -273, -1087, -471], [13665, -2404, -1748, -192, 203, 691, 1317, 281, 1325], [-6074, -3109, -1143, 973, -240, 331, -1568, -374, -746], [1754, 3072, -1259, -96, -1159, -487, 1716, -44, 1236], [7805, -3360, -356, 1008, 479, -1117, 1362, 422, 644], [-394, 2644, 2546, 374, 1317, 154, 2129, 13, 342], [3364, 638, -836, 834, 681, 558, -258, -64, 2539], [-9856, -1458, 81, -406, -498, 626, 2383, 623, 607], [400, -2092, 186, 874, 1059, -262, 525, 9, -2968], [15322, -1522, 40, 2522, -516, 1268, 1784, -1372, 518], [-7030, 402, -1984, -1462, 812, 110, -2108, -324, -1208], [3637, -2381, -2953, -705, -2335, -404, -999, 371, -473], [10778, -2719, -444, -165, 135, -511, -736, 2214, 99], [-2398, -536, 496, 1984, -845, 1430, 2110, -1328, 363], [2954, 3297, 295, 151, 338, 391, 1042, 420, -604], [-5697, 1325, 1981, 3189, -1937, 1172, -1867, 943, 111], [-3663, -708, -1328, -1828, 22, -1013, -1997, 633, 34], [5464, -5177, 87, 1153, 898, -1753, -241, 183, -2757], [-4760, 2100, -991, 4040, -2349, -572, 390, 520, 1025], [-1584, 4518, -68, -2006, 2370, -1852, 827, 487, 2105], [4262, -2468, -2796, -448, 768, 2736, -985, 911, 2309], [12888, -3349, -1182, -1385, 1237, -1088, -3679, 1005, -2393], [-1448, -1437, -2016, -973, 1172, -798, 2093, -1145, 966], [1286, -1700, -1442, 1232, -2939, -508, -1168, 466, -805], [-12914, -864, 1261, -1160, -584, -609, -1796, 930, -619], [3100, 3149, -608, 2427, -2211, 2372, -1810, -356, 1014], [2984, -2127, -1121, 1371, -2272, 1433, -889, 227, 2837], [15010, 6992, -839, -2192, -2030, 1579, 460, 446, 531], [4310, -3964, -1989, 346, 1194, -1243, -625, -229, 2262], [-4414, 4741, 1463, -485, -1933, -1871, -1668, 254, 651], [-6848, 1454, 3368, 966, -1038, 924, -1929, 1639, -3419], [11298, -2659, 1893, -585, -2038, -1689, -2678, 1572, 2000], [-5870, -7904, 1409, 3092, 1214, -2039, -1218, 400, -3015], [-5344, -2165, 893, -3245, 2340, -1883, 3725, -619, -491], [6806, 1073, -306, 3151, 1712, 225, -2520, 544, 3020], [-18228, 4629, 3337, 1333, 24, 1067, 113, -1659, 1581], [-17112, -3557, 459, -319, -687, -1331, -1609, 201, -5464], [-12259, 2065, 1387, -1153, -1160, -2242, -778, 1024, -591], [1432, -216, -2478, 232, 2932, 2016, 1823, -1813, -1203], [5714, 2374, 1823, 484, 467, 880, -4735, 435, -3032], [11956, -7476, -1980, -2892, 1469, -368, -239, -733, -868], [11246, -2106, -4990, 200, -1301, 1380, 2905, 273, -496], [5748, 3900, 3222, 4216, -4391, 48, 4687, 681, 1450], [-10544, -2638, -460, -4154, -434, -1864, -82, -1398, 1246], [18698, -3369, -2951, -2251, -709, -1961, 3513, 691, 1142], [-5122, 5060, 1865, 36, -1988, -557, 2602, -828, -3105], [10722, 736, 1834, 632, 543, 2396, -1180, -754, -251], [11489, 4804, -1198, -544, -991, 2335, -720, 530, -3958], [15860, -2798, -2724, 1310, 1736, -2612, -165, 351, -1281], [5202, -3422, 118, -5750, 5091, 336, 336, 1282, -2761], [-4018, 4560, 1398, -1346, -638, -2854, 1121, -841, -1523], [9670, 1779, -2522, 957, -3216, -225, -1332, 724, -1056], [-2583, 1434, -886, 1860, 3196, 2105, -2399, 35, -1652], [6884, -2188, -2120, -2992, -1725, 14, -3316, 1510, -635], [-260, 1147, 630, 433, -719, 4930, -718, 1504, 994], [-2107, -2097, -419, 3277, -2569, -4196, -51, -227, -97], [7796, 4085, 3686, -3437, 799, 3702, 2689, 73, -1835], [8484, 404, -6006, -1420, 2178, 2378, -180, 576, 460], [-7704, -2118, 5159, 1750, 2056, -762, 715, -1013, -1059], [-1780, -8743, -5144, 545, -2872, -1410, -887, 1043, 3144], [16935, 2210, 3034, 3374, 748, 1601, 1692, -1888, 507], [-11536, 487, 301, 941, -945, 967, -1062, -82, 2021], [8448, 4811, 2918, 1935, -906, 2580, 1533, 871, 4046], [-390, -8528, -1426, -3544, 1229, 1566, -848, -790, 595], [9906, 3562, -716, -3686, 3783, -2450, -38, -356, 2303], [-5140, 4021, 2427, 6043, -861, -1591, -449, 2173, 2100], [-3754, 4061, 3125, 1619, -978, 193, 2464, -1138, -1700], [-14101, 4522, 1724, 1654, -1089, -3093, -1494, 944, 5792], [3385, 429, 3551, 4899, -977, 2414, 1177, 3405, 1587], [24322, -3800, 6486, -3052, 1525, 838, 584, 682, 325], [2050, -1452, -2266, 2760, -1941, 5138, -1257, 137, -1178], [4741, -1432, 28, 1668, -2193, 2147, 1800, 2824, 2354], [2146, -828, 1453, 636, -4631, 2028, -932, 1108, -4713], [-26801, -6922, 2930, -1658, -1659, -45, 744, 1104, 358], [10319, 1751, 3979, 2559, 841, -1178, 821, -2065, -655], [9244, -2671, -8461, -2285, 1641, 231, -872, -856, 1643], [-14748, -5280, -2142, 888, -1795, 2840, -3122, 752, -1009], [2563, 8364, -1912, 3276, 73, -2015, -138, -2274, 3928], [25408, 7241, 4779, 3147, -2589, 3401, 2301, 1535, 778], [-17296, -2335, -533, 2017, -5500, 2497, -2439, -415, 1259], [-3762, -10076, -4726, -60, 3593, -2284, -4285, -683, -1558], [-18630, -2760, -3178, 3756, -2153, 1350, -728, 1630, -1293], [20768, -5945, 4399, -1195, 680, -1419, -423, 1449, 2005], [12882, -3191, 1137, 1373, -366, -3795, -6315, 3037, -1427], [1618, 1284, 4568, 3360, -2226, 1240, 2982, -2598, -2980], [-12704, 3540, -6196, 740, -2144, 440, 1615, -605, 5825], [19988, -6057, 3350, -4635, 2392, -2629, -1778, -558, -1068], [22138, -5929, -5083, -2167, 1653, -1487, -1172, -5414, -937], [54044, -7606, -4210, -1930, -1328, -1694, 4666, -2210, -2750], [9208, -241, 259, 6157, -4080, 4145, 4404, -258, 6556], [-8078, 1580, 1508, -746, -2888, 2090, 7483, -2035, 477], [-6624, -7287, 3735, -937, -488, -479, 5269, 801, -709], [-3634, -13109, -7191, -2171, 1256, -5863, 36, -188, -6218], [-882, 6405, 1032, -4833, -1507, -3015, 3658, -3696, -2413], [-4248, 2155, -2923, -4187, 3380, 197, -3122, -1448, -3974], [35618, -4533, -2264, -1247, 6494, 1659, 1275, 631, -5201], [-39162, 6575, 3311, -1711, 1753, -741, -1706, -256, -525], [-16370, 2088, -8163, 106, 1284, -2157, -1957, -2421, 334], [-7893, -5707, -6201, -1353, -5954, 2840, -3542, -384, -2769], [24148, -6297, -3265, -3083, 2791, 2405, 2605, 171, 4128], [-11322, -9168, -4941, -4252, 5356, 2870, 3118, -704, -3092], [6760, 5009, -1471, -3169, -805, 429, -7966, 1658, -7219], [-8630, -7654, -1891, 2034, -1814, -1929, -6593, 1853, 998], [-7520, 262, 3536, 5198, -2506, 360, -6098, 1890, 854], [370, 4071, -1767, 6741, -3037, -2733, 3157, -1681, 7902], [-39030, -6400, 545, -4496, 6824, 899, 1089, 163, 432], [14948, -14687, -963, -4933, 3965, -1911, -2420, 2010, -6843], [13550, -2773, 357, 7293, -2703, -1227, -2346, 834, -1247], [11106, -5988, -20, -3430, 2746, 1938, -4901, 1517, -5705], [22058, -6519, -3759, 3403, -511, 4339, -1551, 1279, 1230], [33310, -11357, 4121, 337, 247, -3855, -526, -800, 611], [5784, -1982, -1434, 1626, 385, 4430, 5780, 474, -4615], [2822, -511, 2966, 3019, -369, 1641, 7619, 2873, -148], [-27920, 8635, 2109, 257, 1637, 3369, -5871, -1389, -2078], [18576, -3186, 2152, 3490, -861, 1162, -2696, 3802, 1905], [-24760, 10637, 910, -779, 1192, -3137, 1091, 3285, 2951], [-16724, -8639, -4197, -7033, 1969, -1291, -4552, 2178, -171], [-14402, 4588, 3021, 6858, -5798, 3700, 1009, 561, 3671], [-17698, 5137, 2455, -5151, 4291, -7539, -1773, 1725, -3918], [-16546, -1679, 2883, -905, -3940, 405, -1757, -1633, -4791], [30432, -8066, 1280, 3842, 590, 1794, 996, -3400, 1878], [25088, -8460, 4748, -464, -1018, -3648, -502, -1610, -3152], [5682, -4893, 5341, 2481, 450, -2381, 712, -1346, -4828], [3844, 10435, -180, 9859, -5192, 2825, -3107, -285, 3609], [-50446, -13054, -6696, -2354, 803, 2804, 1881, -1209, -932], [-20477, 1328, -1292, 4376, 3592, -4139, -2035, 2403, -1024], [-31018, 4811, 1157, -2065, -3726, 3069, -603, 1301, 491], [14132, -9679, 3929, 4455, -555, 3997, -1338, 726, -3401], [-39501, -5788, -1030, 3090, -299, -133, 1015, 871, 3529], [-18903, -12993, 681, -3587, 403, -1000, 2850, -210, -7634], [-13816, -8107, -2541, 2913, -2862, 883, 1707, -293, 5421], [-37136, -1489, 6757, 7249, -4794, 441, -858, 1536, 6860], [-14112, -6792, 6645, 5692, -1507, 3624, 2260, 3310, 3077], [3548, 1376, -3418, -1646, 2841, 2798, -1487, 3653, -6258], [15410, -6423, 1209, 9111, -1260, -281, -2178, 1500, -3822], [35510, 6286, 8949, -5226, 3692, -1961, -2116, -250, -2977], [-42068, -493, 1944, 393, 1178, -5384, 2008, -144, -4439], [-9976, -4611, -3697, -6173, 3715, 5029, -1737, -3363, -6076], [25944, -215, -464, -3649, 4481, -5272, -970, 1216, 2874], [-18454, 4012, -1020, 7504, -4475, 6410, -5862, -32, 2729], [-44540, -8043, -1816, 4539, 781, 400, 37, -539, 4569], [-18978, 16370, 7178, 4364, -685, -1644, 3977, -411, 6624], [30913, 11701, -2715, -5571, 2035, 466, -3681, 9, -9377], [-13042, 1701, 934, -3985, 4802, -3059, -6419, 473, 3465], [28466, -6232, -6784, -8680, 1814, -6, -4009, -3333, 3173], [27528, -10550, -2882, 5974, -2933, 2282, 1938, 3560, 6825], [-1752, 3629, -9379, -389, -7364, 6545, 4563, 1239, -2459], [-29500, 8704, 6080, -6790, 2666, 2542, -3773, 4405, -8273], [4075, -3914, 5610, -1674, 1517, -181, -84, 696, 6926], [21396, -5584, 2436, -1992, 2554, -4952, 18, 3114, 7728], [-18568, -589, -310, -35, -1546, -4974, -1318, 998, -411], [-69724, -2638, -1572, 230, 196, -5690, 708, 2096, 2016], [-25344, -5112, -154, 2208, 7668, -5208, -7245, 4267, 1361], [28134, -7010, -837, 9892, 329, 3228, 7729, -2133, 6246], [15380, 6654, -410, 3016, 3664, -1056, 599, -551, 4769], [-56871, 3166, 618, 9682, -7338, 737, 2442, -608, 8431], [-5642, 1316, -7776, -6086, -4648, -1842, 741, 19, -3701], [36072, -628, -915, 5764, 1584, 6296, 4174, 1946, 8486], [-17964, 8580, -1570, 4868, 2675, 2582, 3146, 1560, 5881], [22820, -25277, -3909, -4073, 2651, 4965, 3439, -199, -8492], [5970, -11761, -7207, -7027, 7524, -5929, -4691, 2229, -3789], [3340, 17486, -2958, 4944, -686, 7890, 2499, -6903, 81], [-23236, -16624, -10299, -192, -1989, 4704, -8866, 3620, -603], [-19941, 25183, 1709, 3137, -4759, 13982, -1225, -1525, 4429], [1931, -2373, 7159, 8565, -2379, 1800, -2738, 3726, 1928], [-58772, -5977, -1685, -1775, 9705, 903, 2276, -324, -1503], [4784, -12591, -5403, -3965, 1215, 2283, 1699, 3889, -9446], [-31922, -4042, 3721, 3634, -2495, -2569, -4736, 4348, -1936], [-31350, 22119, -1584, -3587, -10128, -3777, 6263, -4561, 4897], [34081, 15652, 648, 10264, -3460, 3789, -1390, 5026, 4047], [-75612, 5803, -322, -2947, -8479, 506, 4001, 897, -51], [53054, 8760, -80, 524, 837, -7726, 4776, -5222, -2787], [41422, 2509, 2375, -11597, 2303, -495, 1149, -837, 4342], [-6472, 13560, -3010, -2908, -738, -4942, 1224, -5980, 2368], [-29644, 691, 2765, -8027, 1829, -2551, -2449, -1291, -4200], [18310, -4400, 7296, 7760, -5184, 7786, 1752, 776, 1710], [-11936, 14087, 10961, 7149, -3924, -3443, 4286, -1280, 278], [-13504, -1952, -6619, -10336, 2366, -1504, 4335, -3585, 8423], [2068, 5374, -1506, 3410, -3127, 9884, -5635, 3707, -7674], [-31916, 3175, -5656, 329, -3445, 3229, -3400, -1638, 3713], [1954, 18505, 9843, -3037, 8680, 373, 4705, -4139, 1791], [27270, 9868, -6110, 2376, 1163, 9574, 2069, 539, -4404], [-22362, -134, -3559, -164, -4270, 6903, 2133, -3955, -1800], [-49829, 6433, 8067, -331, 596, -1838, 1825, 2137, -4408], [14224, 18772, 6759, 1652, 3622, -1276, 2156, 4344, -1946], [-18768, 7937, -3382, -457, -2409, -606, 2352, 2074, 11012], [-2282, -3846, -6182, -4942, 566, -8244, -460, 4676, -1484], [-5580, 20910, 7888, -9698, 1444, 1756, 5167, 675, -1689], [18996, -3775, -4246, 4537, 652, -2900, -4311, -2333, 10002], [45219, 10935, -4039, 2863, -9750, -3656, -5389, 843, -1260], [-19232, 10124, -3465, 612, 718, 4336, -811, -4679, -6371], [18473, 11761, 12655, 11287, -8046, 4066, 12612, 42, 12883], [-13636, -11149, 8217, 3933, 5941, 2317, -8996, 2442, -15733], [2704, 4555, 375, -6207, -4326, 5405, 9928, -3054, -2050], [31690, 19272, 6026, 1276, 2135, -2730, 8178, -2872, 5389], [14490, -975, -5421, -14863, 3341, -3759, 1575, 4769, 4628], [-63050, 3588, -3656, -5536, 461, 6582, -306, -1332, -751], [23408, -4000, -7900, 5396, -2603, 4120, 6839, 2829, 1214], [57319, -21439, -13053, -5257, 8237, -2700, -3067, -879, 4279], [-35785, 6010, 4742, 11594, 174, 3035, 6008, 3194, 8095], [964, -3428, 1174, -856, -3191, -8098, 928, 3390, 5], [-60676, 10161, 3478, -4945, 6127, -1478, -6280, 886, -204], [-47561, 556, 7576, -2800, 3828, -10341, -1246, 2674, -9355], [41782, -9356, -10568, -15620, 8113, -4328, 8721, -1485, -1876], [-29876, -4721, 1457, -3077, 1719, -2315, 6337, 2715, 4558], [-4734, 20492, 4259, 5364, -6524, 8979, 2570, -3628, 7985], [18732, 20871, 3997, 3037, -2263, 3127, -1656, -584, 11989], [38334, -6770, 6386, -11222, 3119, -7462, -3715, -1129, -702], [-35978, 12754, 1260, 310, -3312, -2820, 8064, -1336, 9818], [34820, 4057, -2302, -2013, 11382, 8722, -4941, -6627, -9174], [-6090, 17903, -1225, -8171, -4723, 419, 1952, 6008, -2055], [864, 6822, 862, 1914, -4640, 8474, 11096, -136, 1032], [79532, -1961, 12681, 6841, -5120, -1313, 16577, -2783, 5063], [45722, -15204, -2442, 4334, -5027, -5366, -3261, 7679, -2960], [-42534, -9617, -2116, 11957, -1286, -6557, 700, -1464, 6842], [-28564, -15385, -2624, -15347, 144, -10065, -5594, 302, -3116], [-76354, -5057, -3387, -3113, -3242, 10447, 7169, 3837, 10297], [-59444, 12154, -1506, 4850, -2186, -2958, 8322, -6334, 4868], [-18856, 7457, 17687, 7323, -1572, 4865, -4758, 4136, -4124], [-2662, 5196, -639, 7058, -2554, -469, -795, -2359, 4662], [63838, 6697, 4901, 8987, -6091, 2781, 2615, 5485, 7254], [32260, -33057, -5226, -7991, 5392, -5366, -7729, 6829, 4746], [-44802, 13094, 9057, 7684, -4118, 2943, -13067, 1997, 692], [39796, -7907, -2359, -8125, -1611, 1919, -2724, -4718, -10385], [-39182, -12947, -239, 9693, 3561, 1507, -3821, -803, -9390], [-48978, 8596, -6270, -9840, 4475, -5506, 2924, -3138, 1915], [-42628, 14411, 3731, 14413, 3014, 7479, -8280, 1456, -1850], [63650, -4566, 2765, 7826, 8927, -801, 9096, 1088, -1058], [16203, -6978, 190, 9714, 7499, -2825, 3017, -5963, 4699], [-44752, 25899, 5760, 3879, 10, 1538, -2559, -1153, 7124], [-92142, 15495, 1301, -5013, 1980, -1167, 3075, 5735, 4015], [-30024, -6585, 4287, 7129, -4276, 6527, -1305, -6093, -9315], [12408, 15737, 2710, 5569, -11586, 1555, 8467, -3799, 25157], [-27200, 33506, -4101, 2062, 139, 13670, -3527, -701, -9990], [44916, -28686, 1665, -266, 4888, -11918, -9984, -2784, -18424], [10442, -5979, 1383, -11349, 13698, -5471, -1598, -5034, -8432], [-20140, 9965, 735, -111, 7932, 4535, -22121, -1681, -10285], [28920, 5196, -14942, -4064, -13, -6482, -2104, -5938, -12755], [15264, 4618, 358, 19166, 2692, 9996, -3258, 4278, 11468], [13234, -7373, 3085, -499, 353, -6821, -13930, 4576, 1503], [-4298, -849, -4917, 1081, -10190, 4911, -5817, -2837, -14185], [16772, -9773, -1352, 7405, 12972, -1756, -14584, -3252, -365], [61076, -301, 2396, 5991, 5786, 4762, 11777, -965, 12356], [47916, 1245, 7952, 17419, -2942, 15056, 6608, -1348, 3735], [-23250, 3964, -6632, 11872, -3698, -8112, -17032, -336, -2854], [8681, -1611, -4537, -1185, 3296, 2, 3130, -7564, -8879], [-25386, 5942, 1684, -1886, 3374, -5694, 13558, 1358, 1596], [-49809, 14239, 3897, -17119, -3778, 13866, -6578, 3040, -3319], [-33876, -5511, -28644, 1195, -10917, 720, 6230, -458, 7342], [77154, 1819, -13775, -11059, -445, -7039, 6071, 1125, -4438], [-43638, -8063, -6995, -7973, 12879, 8305, 4617, -5137, 378], [-7182, 74, -8786, -1530, -4185, 13590, -11354, 452, -11773], [-58816, -1725, -818, -15915, 14063, -14230, -15783, 5841, -9833], [-43958, -6658, 6470, -7842, 4602, -7810, -5024, 6112, -10154], [-7523, 7369, -11571, -2317, -1223, 4068, 282, 3986, -9610], [-26364, -24175, 1381, -659, -4610, 1931, -613, 5087, -14111], [77040, 7878, 3675, -8970, -2818, -362, 13254, -5610, 1648], [-67928, -11603, -3984, 6883, 3521, -928, 6684, 1544, -10398], [38350, -8018, 16224, -7226, 3567, -4116, -12092, 2098, -15379], [-10601, 861, -655, 7327, -3387, -13302, -15498, -1734, 908], [-32836, -8353, 5807, 9133, -167, 1065, -16910, 8284, -11315], [-6125, -12746, 4840, -14608, 10127, 13165, -13135, 617, -2239], [43864, 30623, 8612, 9149, -199, 8656, 3227, 195, 2485], [-21060, -14846, -3642, -11320, 928, -1718, -7283, 5283, -1551], [-4360, -13477, 275, 12085, 1950, -5405, 3436, 2990, -4308], [-73740, -3899, 3524, 8953, -10058, 4227, 7897, 3611, 14895], [-11604, -10140, -3426, 4308, -12219, 8580, -8775, -349, -5932], [-95932, 24505, 4548, 4017, 5492, 3327, 6215, 5513, 2203], [48038, -8797, 4901, 8287, -15739, -7461, -4403, -2105, 3614], [9688, 6617, -1787, -1689, 8116, -10157, 106, 5510, 6736], [-4210, 11089, -4353, 17559, -10591, 16849, 11350, -3290, 12879], [-57724, -14263, -3542, -13355, 18062, -18272, -1005, -195, 1534], [22110, 9583, -718, -12527, -3259, 15339, -8312, -2338, 4281], [16046, 2479, 8334, 10041, -16100, -1353, 2165, 81, -13049], [11256, 8387, -1080, -2639, 825, -14139, -12394, -576, -18391], [60190, 12849, 3805, -9833, 7208, 15391, 12206, -2576, -11350], [14990, -15508, -14141, -9820, 5804, 17129, -4397, 4789, 1648], [-209, 24596, 16104, -8812, 3560, -13467, -10619, 3795, 572], [48992, -24935, -9582, -10707, 4429, 6245, -16939, 777, -4638], [-18688, -24670, 15538, 11616, -6775, 6266, 10355, 3199, 14366], [25956, -54, -7492, -12710, -3346, -9548, -9803, -1743, -14889], [24786, -20614, 60, -594, 11138, -5774, -20537, 5491, -10029], [-63753, -2052, 7626, 44, 291, 9501, 14932, -9898, 7854], [36368, -1507, 12923, 2763, 1928, -6371, 17724, -1928, -4256], [-77196, 16014, -4116, 4954, -363, 4888, 11120, -1854, 5285], [24646, 8778, -3690, 468, 7650, -17864, -1749, 7653, 435], [-31598, -15643, -19371, 12823, -2111, -563, -5555, 2519, 3044], [-17732, 24468, 10896, 6896, -8455, 14400, -12308, 6930, -879], [-37862, -2590, 12419, 11894, 101, -8218, -12946, 11590, -4727], [-45018, -24679, 4557, 24421, -9274, 7927, -2991, 2357, -11453], [33540, 3704, -2145, -10764, -3925, -5324, -5923, 4595, 13494], [-5522, 14502, -8397, -20282, 4350, -9417, -15820, -7494, -5433], [14587, 3691, 21113, 10417, -2547, 3254, 17510, -2766, -2], [3788, -1456, -9012, 8228, -9019, 3056, 9845, 1231, -14136]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1521_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1521_4_a_bh();".
// 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_1521_4_a_bh(:prec:=9)
    chi := MakeCharacter_1521_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_1521_4_a_bh();".
// 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_1521_4_a_bh( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1521_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![-344, 1464, 5898, -1257, -2310, 486, 205, -42, -5, 1]>,<5,R![-3059376152, -79067576, 128609278, 1389429, -1945112, 11193, 12686, -266, -30, 1]>,<7,R![-27715644424, -12058090668, -1223096892, 80750883, 15288900, 47784, -49156, -1023, 38, 1]>],Snew);
    return Vf;
end function;