
// Make newform 531.4.a.e in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_531_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_531_4_a_e();".
// 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_531_4_a_e();".
// 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 := [2432, 96, -2898, -157, 654, 47, -45, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0], [-12, -1, 1, 0, 0, 0, 0, 0], [10, -16, -2, 1, 0, 0, 0, 0], [-748, 294, 842, -247, -135, 30, 5, -1], [876, -256, -886, 243, 137, -30, -5, 1], [-4128, 898, 4513, -1110, -707, 145, 26, -5], [2248, -648, -2520, 689, 403, -88, -15, 3]];
    Rf_basisdens := [1, 1, 1, 1, 4, 4, 16, 8];
    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_531_a();"
function MakeCharacter_531_a()
    N := 531;
    order := 1;
    char_gens := [119, 415];
    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_531_a_Hecke(Kf)
    return MakeCharacter_531_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], [-5, 0, 0, 0, 0, 0, -1, 0], [7, 0, 0, 0, 0, 0, 0, 1], [-10, 0, -1, -2, -1, -1, 2, 0], [4, 0, -1, 1, -1, 2, -1, 0], [-16, -4, 2, 1, 0, 1, 2, -1], [3, -2, -7, -2, 3, -3, 2, -3], [-25, -14, 1, 2, 5, -1, 2, -3], [-48, -22, 3, 4, -1, 7, -1, 3], [10, 12, -3, 2, -9, 1, 5, -1], [12, 2, 2, 0, 16, -6, 1, -13], [-47, -42, -8, 0, 4, -10, 2, -3], [-16, 8, 11, -8, 5, 5, 0, -4], [-26, -40, 23, 11, 9, 10, 2, 7], [-23, -20, 0, -12, -12, -4, 29, -12], [-59, 0, 0, 0, 0, 0, 0, 0], [-150, -44, 3, -18, 23, -1, -11, -5], [-133, -14, -2, 5, -22, -9, 10, -26], [16, 48, 23, 25, -47, 8, -9, 10], [-136, -30, -17, 5, -23, -26, -16, 9], [-74, 14, 65, 6, -9, 5, 0, 12], [-125, 66, -24, -16, -4, 2, -8, 7], [-150, 44, -25, 41, 23, 0, 24, -33], [-57, 72, 88, -21, 0, 7, 14, 34], [-37, 162, 53, -5, -37, 16, 34, 56], [-226, 30, 36, 17, 42, 47, 37, 4], [-357, 76, -11, -22, 7, 7, -66, 7], [-229, 36, -15, 69, 5, 36, -61, -7], [-229, 200, 32, -17, 10, 15, 8, 70], [181, 144, -54, -21, -26, -63, -18, 6], [-834, 92, -74, -34, 6, -64, -50, -58], [-470, 28, -15, 0, -79, -37, 2, 12], [337, 100, 92, 41, 68, 33, -22, -24], [-668, 202, 16, 3, 116, 19, -64, 27], [4, -140, -83, 44, -37, -17, -185, -7], [415, -78, 72, 30, 98, -34, -89, -32], [240, -398, -5, -23, -3, -18, -38, -51], [-1436, 98, -229, 26, 1, 15, 13, -39], [-61, 254, 56, -10, 42, 0, -38, 7], [-330, 476, -13, 82, 23, 47, 12, -42], [734, -214, 91, -29, -65, 54, -12, 49], [61, 82, 210, 119, -24, -15, -86, 24], [109, -118, -35, 79, -149, 54, -12, 106], [216, -82, -90, -35, -44, 7, -117, 124], [292, -330, -131, 77, -61, -32, -154, -27], [-42, 202, -274, 73, 44, -7, 154, -85], [565, 90, 73, -127, -1, -140, 80, -46], [-344, -644, -38, -39, -100, -31, -36, 87], [-1013, 142, -78, 111, -176, 1, -219, -35], [2078, -152, 16, -32, -152, -58, 44, 10], [-637, -158, -26, -94, 194, 86, 41, -20], [-689, 618, -129, -175, 5, -130, 72, -2], [49, -208, 10, -133, 148, 119, -204, 96], [997, -246, -7, 7, 59, 150, 212, 30], [-863, -404, -494, 37, 66, -49, 143, -17], [1180, 374, -591, -8, -55, -129, 160, -148], [-1446, -430, -73, -12, 189, 129, -128, 10], [-2375, 894, -208, -43, -108, -9, 230, 12], [527, -262, 133, -93, 339, -106, -28, -244], [164, 726, 194, -241, -116, -145, 124, -43], [-433, -476, -201, 7, 121, -90, -273, -33], [554, 388, -102, 76, -198, -246, -66, -76], [-1482, 564, 402, -12, -12, -20, 121, 9], [-2363, -270, 9, 46, 99, 73, 426, -11], [553, -596, 444, 74, 56, 114, -441, 144], [-1292, 288, -616, -104, 60, 192, -54, 162], [-4215, -2, -647, -156, 279, -101, -12, -183], [-3094, -916, -273, 75, -99, 22, 302, -221], [-992, -1284, 365, -327, -131, -140, 321, 134], [149, 432, 421, -338, 175, -47, 428, 3], [-545, -460, 105, -280, 153, 3, -69, 264], [3289, 1436, 238, 112, -380, 118, 379, 86], [-727, 332, -39, 142, 5, -15, -588, -31], [1951, -320, 224, -145, -132, 83, 24, 218], [-722, 864, 355, -243, -415, -12, 155, 276], [386, 294, 242, -11, 208, 239, 7, -46], [-2803, 382, -196, -52, 170, 120, -1, 120], [599, -1008, -495, 92, 123, -29, 240, -393], [-3826, 432, 712, 158, 56, -62, -106, 428], [2375, 58, 585, 95, 167, -38, -32, -50], [-952, -764, 377, -221, -175, -154, 155, 190], [-876, -576, -617, 519, 5, 250, -814, 197], [-3092, -1410, 530, 251, -448, 433, 60, -47], [-834, -1880, 110, 187, 266, 121, -198, 125], [-2366, -844, 820, 3, 186, 9, -36, 131], [4848, -108, 281, -176, -275, -189, 342, -106], [-4538, 910, -345, -103, -319, -354, -54, -311], [-2285, 1928, -465, -237, -223, 106, -113, 359], [1283, 358, -233, -207, 49, -4, -251, 85], [-99, 1222, -591, -505, 175, -298, -342, -278], [-4823, 230, 115, -69, -53, -270, 77, 439], [1300, 856, 248, -29, 388, 423, -434, 503], [-3732, 1292, 805, 227, 209, 126, -674, 165], [-2817, 12, 1082, 139, 266, 577, 472, 106], [-6824, -728, -417, 15, 373, 310, 102, -175], [-3416, 564, -327, -43, -299, -42, 102, -417], [-5464, 1648, -581, -101, 541, 206, 150, 39], [5705, -1856, -310, -367, -294, -197, 544, 38], [-5358, -104, -33, 619, -369, 252, -117, 4], [5049, -3822, -559, -120, 271, 115, 436, -213], [2856, -910, 80, 27, 422, -365, -585, -370], [-4493, -2414, 840, 79, -374, -109, -550, -194], [-604, -2076, 319, -211, -257, 128, -8, 205], [491, 282, 304, 293, -360, 541, 396, 372], [-1800, -240, 389, -270, 359, -161, -96, 158], [914, 544, -461, 188, -441, 293, -114, 50], [2236, 3280, 431, -59, -795, -380, 528, 547], [2655, -2992, 511, 76, 299, 425, -7, 342], [-3361, 542, -267, 52, 671, 279, -312, 123], [6686, 654, -149, 98, 73, -25, 14, 142], [-583, 1512, 425, -108, 261, 219, -287, -94], [6624, -1724, -1158, -271, 188, -459, -728, 73], [4677, 1204, 656, -121, -36, 71, -1036, 396], [4292, 486, -375, -128, -649, -85, -28, 460], [-1899, -86, -226, -99, -460, -429, 674, -392], [4957, 1358, -203, -10, 587, -687, -696, -319], [1808, -198, 182, 95, -304, 37, 921, 594], [-5350, -918, 1331, -456, 463, -137, 443, -235], [2717, -1130, -1713, -278, 119, -655, 208, -75], [3416, 4054, -577, -171, 315, 0, 600, -331], [1874, -1256, 1036, 190, -804, 554, 30, 44], [-6306, -1074, 250, 193, 632, -249, 837, -592], [2144, 2268, 1111, 82, -289, 379, 326, 294], [2455, 994, 61, 585, -777, 246, -398, -164], [-12417, -886, -84, -200, 482, -26, -1378, -391], [1846, 2976, 1362, -190, -562, 164, -696, 314], [-603, 898, -1683, -38, 185, -461, -962, -229], [12467, -1410, -891, 793, 683, 12, 170, 62], [9335, 1470, -1624, -629, -16, -875, -606, -264], [-7862, 3510, -1650, -685, -32, -361, -756, -461], [-11, 3618, -1999, -453, -223, -560, -385, 89], [298, 3826, -570, -21, 436, -137, -1313, -392], [4135, -2496, -1273, 446, 563, 155, -1120, 691], [-2507, -1314, 60, -321, 566, -617, -326, -994], [-3319, -394, -655, -78, -773, 137, 2138, -103], [-5748, 1728, 278, -68, -286, -988, -370, -486], [4896, -1660, -68, -340, 424, -116, -254, 14], [1619, 1526, -1699, -455, -457, 170, 776, -260], [4251, -844, -2441, -62, -311, 611, -804, 749], [-8593, 3822, 1463, 341, -55, 212, -1254, 88], [-3961, 4714, 1208, 28, -702, -42, -968, 359], [5099, 264, 80, -204, -226, -88, 1935, 568], [14489, -3776, -368, 319, 334, 105, -800, -756], [-920, -2618, 1415, 1543, -325, 846, -188, 1011], [9505, -5186, 1646, 881, -528, 699, 418, 410], [-5167, 792, -557, 354, -661, -141, 958, 451], [-6701, -120, 456, 643, -1210, 263, -828, 870], [-6240, -2304, 160, 384, 356, 622, 462, 328], [-6119, 5034, -1603, -522, 361, 55, 554, 599], [12644, -1256, 882, -344, -418, 234, 910, 928], [17364, 3156, 1246, -158, -566, 242, 2116, -654], [-6392, 1256, -212, 376, 160, 620, -988, -1380], [-1807, 5930, -1768, -811, 690, -779, -328, -428], [927, -2352, 1058, 1533, -446, 763, -114, 250], [7489, 2028, -132, -19, 708, 197, 447, -1477], [8354, -2826, 1642, -553, 716, -949, -889, -876], [5587, 300, 1004, 857, -442, 37, 1072, 604], [8417, 3164, -1534, -709, 2034, -475, 1228, -466], [-10245, 1632, -1620, 281, 1250, 545, 230, -14], [17322, 1132, 1297, 559, -575, -54, 322, -257], [-4209, -1498, 811, 431, -55, -652, 1274, 534], [12901, -4166, 1529, 1271, -1189, -188, 835, 295], [15183, -1436, 1941, 1002, 363, 2155, -270, 1279], [6935, 2452, -1006, 595, -1068, 21, -1856, 598], [-1707, -3218, 2998, 5, -672, -621, -278, -914], [-19137, 2734, 1325, -467, 151, 522, -661, 1731], [12430, -4118, 713, 657, -147, 426, -1710, -715], [15766, 2512, 330, -510, -686, -1428, -206, 552], [-5663, 2794, -2231, -881, -237, -540, 1978, -402], [-5971, 2092, 328, -1441, 958, -75, 1582, -362], [-11223, 5476, 1153, 880, 5, 331, -357, -328], [-2810, -1312, 832, -186, -1450, 32, -237, -331], [-7477, -2620, 1190, -525, 346, 1233, 888, 380], [9831, -7850, 2527, 531, 673, 1052, 1440, 426], [4640, -1424, -691, 1284, 2473, 999, 988, -920], [-10269, -1000, 866, -841, 2714, 281, -998, -732], [-4365, 4686, -1067, 125, -765, -182, -2080, 472], [-1987, 2170, -725, 154, 37, 1483, 914, -85], [-2738, -4668, -1696, -1384, 1064, 380, 1812, -856], [21718, -2860, -900, 148, -932, -548, -1358, -384], [22850, -864, 2882, 284, -82, -386, -1570, -84], [-18484, -5400, -11, -237, 1553, 58, -1693, -570], [-7722, 7152, -1410, -1082, 422, -1168, 880, 118], [-9610, -4088, -3903, -487, 779, -1090, -579, -190], [8063, -1944, 1977, -250, 591, -235, -1400, 1205], [-9298, -10, -2480, -1433, -1562, -1741, 2939, -1160], [-5377, -4482, -537, -779, 265, -368, 1126, 368], [-9935, 4468, -3750, 921, 314, 983, -422, -522], [-7887, -2246, -189, 644, -2045, 803, -968, 1679], [9237, 2284, 214, 1795, -938, 245, -1180, -826], [17526, 252, -2579, 258, -1187, 645, -2802, -444], [-33387, 5206, 463, -477, -855, -874, 1148, -922], [6118, -2142, 2173, 1288, -435, -1511, -1169, -663], [4918, 1508, 286, 120, -374, -86, -890, -584], [7417, 800, 3199, -10, -195, 395, -96, -585], [-7253, 4512, -1377, -244, 1847, 185, 156, -1011], [-14937, -5242, -70, -461, -1184, 141, 2717, 1093], [-2394, 2884, -1443, 1179, 237, 672, 1328, 257], [-17751, 2830, -4195, 186, -1223, -1117, -146, -1169], [-21416, 2878, 910, -1069, -1352, 301, -381, 2218], [21845, 948, 2834, -273, -658, 309, 4098, -202], [5413, 4776, -539, -584, 1625, -1401, 552, -649], [-3495, -2738, 721, -1904, -113, -785, 2540, -715], [14682, -4780, 2690, 326, -498, -1268, -170, -858], [-323, -2522, 4558, -236, 856, 1384, -1498, 2279], [7649, 2724, 2208, 1562, -1470, 1286, -761, -904], [21958, 5960, 342, -633, -108, 439, -2434, 1513], [-3135, -5372, -6337, 344, 1177, -339, 560, -423], [7203, 7850, 1091, 1027, -1183, 1814, 1304, 972], [21033, 4038, 2217, 1060, -1441, 1599, 1634, 519], [22069, -5228, 1994, -588, 726, 50, -1701, -562], [-11608, 128, 2592, -789, 1496, 715, 1038, -285], [-13366, -1064, 1452, -1876, -1452, -808, 1290, -956], [-8106, -348, 1167, -227, -799, 944, 1127, -220], [16549, -4306, 4497, -410, 1995, 365, 1114, -191], [9872, 3010, 723, -158, 589, 1023, -838, -1228], [-9925, -8214, 940, 436, -1388, 890, 1994, -1825], [-5695, -5318, 739, -664, 1335, 947, -348, 223], [-22165, 864, -596, 1418, -2168, -2, -3895, 1336], [-22676, 7792, 2101, 439, 753, -1458, -541, -862], [-4891, 5688, 632, -2960, -1178, -2232, 2235, 178], [-24158, 10120, 3864, 766, -1540, -112, 476, 840], [7266, -4778, 2269, 2331, 2427, 1466, -3010, 1877], [-1731, -1766, 1423, 575, 1389, 2204, -1076, 808], [-8823, -7550, -740, -839, -1438, 993, 2853, 1345], [-5289, -1886, 921, -244, -355, 2293, 8, -697], [-26518, -6524, 570, 760, -846, -674, -2216, 1706], [27584, -2614, -668, 857, -650, 2711, -2275, 1718], [-1481, 6188, 241, 360, 2891, -559, -1302, -1343], [-6399, -3790, -3434, 117, -960, 1043, -1645, 1039], [3232, 5380, -5215, -674, 243, -2171, 826, -584], [12765, -158, -985, 3, -2139, 94, -759, 2665], [-33139, -1528, 2378, -1219, -2472, 1131, 1280, 1214], [-1036, 5028, -3196, -514, 1296, -1156, -1568, -1984], [5543, -7414, 2390, 686, -894, -374, 1393, 268], [17467, 2348, -5112, -1867, 864, -2347, -1378, -3024], [-14798, 2804, -1391, 295, 3073, 900, -694, -1841], [44149, -10210, 876, 2247, 1186, 371, -1548, 330], [7829, -3912, -4530, -2491, 2298, -589, 203, -789], [3067, 8876, 378, 2583, -688, 1619, -1550, -200], [-2467, 4234, -2541, -2887, 3057, -1872, 946, -2066], [28334, 8462, 193, 1252, 1447, 143, -1666, -1052], [20772, -7440, -366, -498, 2574, 200, 3550, 554], [-38338, -6244, -1380, 361, -2322, -1733, 312, 1127], [-16491, 1584, -1476, 2107, -2692, 559, -411, 935], [8327, -5604, -182, 1566, -268, 388, -5605, 210], [26930, -2796, -1643, 124, 1953, 531, -2516, 760], [-2000, 2838, 2601, 549, 1267, 1652, -1172, 2275], [-39058, 1264, 4867, 2069, -735, 2020, 263, 3160], [26917, 5612, -69, 2226, -517, 2351, 228, 1917], [-42229, -7824, -2649, 120, -39, -491, 4716, -1429], [-5774, -2052, 819, -149, -2723, 1690, 1462, -1189], [46502, 3108, 119, 1830, -2567, 653, -144, 1164], [-15915, 996, -5224, -2000, -1208, -1600, 2627, -350], [11549, -1148, 3298, 1853, 1516, 2013, 1650, 288], [-10745, -4250, 2118, -821, 1178, -2041, 2740, -3482], [33174, -304, -1154, 258, -1542, 2226, -1776, 2178], [9613, 5796, 1600, -981, -3126, -1249, -1742, 454], [1676, 7402, -2732, 861, 2450, 773, 1436, -1089], [17071, -12972, -56, -2280, 1546, 296, -1345, 1032], [7123, -12216, -48, 675, 2806, 2493, -3320, -1066], [-25220, -3472, 1856, -3126, 2616, 274, 1070, -1294], [1530, -21732, -78, 1304, 294, 1322, 1290, -554], [10175, -13906, -1746, -2145, -1536, 1053, -114, 2852], [-28835, 2978, 4359, 1777, -3047, 1492, -222, 2994], [-22113, -3540, -2785, -1631, 921, -2512, 453, -3665], [15396, 5044, -3648, 1522, -1332, -256, -1016, 1642], [12423, 3524, 1724, -589, -904, 2243, 1784, 558], [30459, 896, 4796, 1848, 2680, 2308, -2215, -2110], [-11838, 5454, 2434, -337, -696, -3067, 4333, -270], [-5182, -24466, 971, -717, 2213, -1084, 814, -615], [-40505, -2862, -1205, -306, 1497, -1569, -2124, -215], [18420, 5502, 269, 1886, 99, -1371, 2042, 376], [-11272, 9340, 785, -4232, -1513, -2351, 3076, -384], [-1553, -16674, 1365, -2081, -1957, -1688, 887, -1171], [13538, -1636, -1007, 2595, 2541, -102, 2852, -1831], [-6767, 15534, 52, 995, -1040, -559, -4020, 96], [527, -9796, 2848, -1015, -3964, 1641, 4028, 766], [24575, 10504, -1636, 2285, -5126, 827, -1706, 2010], [8002, 6592, 4589, 545, -513, 314, 1653, -1114], [-38332, 14630, 5428, 2087, 334, -659, 517, 180], [14096, 8152, -6174, -1350, -1890, -84, -3400, 1650], [-48699, 1720, -6103, -2068, 97, -3465, 55, -1888], [22055, 16990, -3110, -281, 1930, -1391, -2504, -590], [13944, 3372, -5637, -309, -3251, -1074, 3604, -2157], [-30007, 6988, 6366, -2481, -650, 865, 950, 788], [-451, 9244, -4815, 273, 2887, -1426, -2593, -1537], [-29665, -3612, -394, -766, 636, -704, -2767, -1144], [-59502, 4200, 148, -2696, 1088, -248, 1620, 512], [-3974, 15966, 2069, -1728, 3913, 559, -4760, -538], [-24184, -6808, 3268, -4092, 596, -1440, 5002, 1094], [-20865, 15410, 4165, -612, 2525, -87, 1096, -45], [35244, 4876, 2099, -3848, 3603, -1551, 208, -2362], [-40393, 3374, 946, 2051, -718, -2237, -550, -628], [-2976, -9310, 3331, 1888, -3465, 3641, -1354, 2558], [8203, -3204, -516, -396, 1748, -2348, -992, -707], [46511, -1524, -6832, 766, 452, -1830, -2837, -654], [-54067, 382, 8658, 232, -518, 844, 526, 3619], [-46073, 23054, 1582, -1479, 2118, 179, 458, 1266], [-42062, 18334, 105, -1879, -4111, -594, -304, 2575], [-23010, 3354, 3893, 1096, -231, -3173, -4280, -1746], [38575, -14300, -1176, 930, 4182, -586, -2063, -148], [30829, -1306, 6263, 1845, 437, -658, 936, -254], [-35160, 7620, 948, -94, -3416, 982, 5506, 3188], [-4827, -15200, -5112, -1863, 1592, -667, -670, -622], [-10945, -1552, -4490, 4369, -276, -267, -574, -4538], [-52635, -9122, -5220, 3771, -3662, 1115, 2075, 197], [9480, 6180, -6121, -315, -3371, -1228, 4604, -331], [-74162, -12814, 108, 1723, 1890, -85, 4559, -2192], [-6706, 12944, -853, -3373, -4343, -1278, -2133, 1206], [-43867, -1688, -3235, 985, 3095, 1082, -335, -3503], [9490, -10312, 2189, -1262, 241, 229, 7734, -170], [-24125, 12920, 754, 1992, 1036, -1690, -850, -555], [-18188, -10052, 4444, -1146, 834, -2728, 4717, 1241], [-949, 6220, 2440, 2397, 1884, 1953, 2252, 682], [-892, -8544, -2707, 369, 379, -1294, -2424, -5463], [-22730, 15288, -1287, -317, -2341, -1240, 2465, -3956], [-8320, 11284, 3642, -680, 2294, -142, -284, -3774], [-14714, 4104, -851, -3226, -3123, -3315, 1208, 1332], [-34708, -19420, -2802, 576, -898, -82, -2360, 312], [5930, -11944, 5358, 528, -278, -2266, -1394, -706], [-51206, -7998, -3001, -1766, 535, 2401, -3019, 2721], [15062, 27180, -1692, -1072, 624, -1264, -1938, 1836], [45821, 16486, -4314, 1457, 1056, -1745, -4490, 908], [14732, 7408, -3890, -952, -5746, -2282, -2066, 2800], [-7326, -33444, 1485, 2378, -629, -459, 2012, -2204], [38916, -6056, 4000, 1270, -1652, -1030, 2316, 1166], [-448, 17428, -4164, -1766, -160, -770, 3118, -172], [-53334, -5900, 7415, 875, -2893, 2602, 852, -1623], [-23004, 7306, 2284, -3480, 2746, 2868, -1373, 4209], [-21974, -10592, -1782, 4032, 582, 2888, -7024, 4122], [-20440, 11046, 7880, 1899, 1374, -1347, 4355, -3886], [-19617, 2180, -4324, 3759, -2522, 789, -4096, -2078], [-13931, 1050, -6585, -32, -1831, -815, -1320, 1991], [-48978, 18464, 2921, -2341, -2175, 618, 2042, 3347], [40448, -17186, 7801, 1387, 437, 2676, -122, 4669], [-43382, -68, -4014, -414, 8282, -402, -3812, 304], [-47758, 9826, 3159, 4879, -3023, 4416, 2500, 1825], [40069, 2324, -6896, 3185, -1720, 1045, -4098, -588], [-35312, -12388, 1576, 2616, 1664, -992, -1616, 814], [83103, -11628, -180, -1117, 4114, 1251, -1800, 2086], [-29729, -20250, 3013, -1857, -2249, 892, -182, -1084], [26058, -26422, 4894, 1169, 480, 249, -2741, -1002], [22943, -5110, 5065, -317, -3689, -1604, 4910, 432], [-13182, -8436, 713, -1572, 4337, 3111, 1992, 1168], [-73182, 16528, -2657, -4853, -2593, -3172, 2869, 2050], [2522, -196, 12526, -1590, 2382, -244, 2084, 2584], [22529, -6562, 9546, 5027, 2936, 7409, -1430, 1388], [21981, -8632, 3908, 1507, -346, -289, -1762, -1218], [-42781, -7840, -7597, -248, 375, -2977, 8096, -1023], [62297, 13860, 5416, -824, -3146, -3718, 2720, 1421], [-19630, -11686, -3207, -648, -2751, -1159, 2723, -3595], [31586, -17304, 3141, -1176, 5847, 1151, -3841, 807], [13790, -3146, -4577, -2457, 63, -1950, -994, -709], [44788, 5528, -2402, 1492, -2266, 712, -10584, 1820], [-28404, -34984, -7070, 1906, 6542, 2172, 1638, -6512], [-22372, -10168, 1213, 3233, 273, 712, 7342, 139], [20379, 22698, -10235, 3822, -951, 1519, -2530, -4265], [22304, 248, -6255, 4071, 9055, -1736, 55, -4552], [-11138, 23592, -1453, -903, 1767, 110, 1185, -144], [18048, -752, -374, 1603, -1376, 91, -8316, -1421], [-58311, -4728, -4361, 428, -2473, -3475, -5187, 3128], [14192, -5652, 6129, -3270, 3817, 1825, 1456, 5712], [68704, 26354, 3075, -229, -5271, 1660, -4182, 4803], [130, -15866, 8591, -1519, 521, -4118, 2588, -1777], [1571, 9918, -2299, -2517, 1051, -16, 3228, 62], [81079, -3722, 2893, 1919, -2901, 5834, -6502, 2804], [-19038, -180, -112, 3186, 2136, 2598, -6646, 192], [29838, 5852, -9729, -1995, -1693, -4194, 1194, -4943], [40692, 16620, 4891, -2894, 2269, 1463, -2912, 1830], [-61157, 27398, 3508, 1221, -8134, -1367, -4916, 1866], [23823, 916, -5029, -285, 4921, 1794, 3131, 1927], [6174, -8798, -220, -3465, 4674, 1293, 7979, -320], [1624, -25278, -4033, -3591, -713, -3672, 3230, 1179], [54983, -10302, -1849, -3510, 3295, -2215, 1446, -5955], [-56807, 3638, -1239, 3442, -211, -2821, 7676, -4051], [-55912, -2002, -10303, -1451, 2399, 2856, -1300, -2431], [-70210, 8892, -1238, 1874, -1818, -3074, 840, -5724], [53001, 3602, -9326, 421, -2682, -4343, -20, -1990], [-31960, 826, 3696, 463, 6610, 3719, -8255, 820], [109502, -10772, 285, 2891, 6477, -64, -1276, -2643], [37252, -4184, -5552, 2187, 3496, -1889, -8160, -5527], [23745, 16228, 1000, 1155, -2678, 1475, -1836, -1416], [11797, -32024, -3634, -4581, 5258, -2183, -2200, -5700], [-33699, -21386, -7834, -1871, 4536, -805, 9726, -3078], [63074, 9762, -8059, 1374, 2707, 81, 8290, 1230], [-49952, -6206, -3753, 1323, 1439, 598, -6264, -629], [11465, 3170, 2213, 5688, -5833, 3555, -4070, -1795], [-58299, -20850, 3196, 231, -6274, 1431, 312, 802], [58691, -1580, -4644, -4897, -428, -5413, 1124, -4712], [44558, 16142, -5284, 3753, -1428, -2807, -8770, -483], [-112730, 5792, -6762, 2879, 1304, -1581, -1690, -5295], [79763, -7026, 3389, 4989, 1535, 6706, -2418, 656], [-14188, -10488, 581, -3067, -4605, -5158, -5868, -519], [33704, 19024, 830, -4202, -3502, -3528, -5330, 4246], [49814, -6022, -10949, 1065, -1883, -2186, -6722, -1905], [35054, -772, -3216, 3294, -4900, 166, -2646, 4276], [23459, 8302, -4305, 4472, -1783, -407, 1542, -6293], [66141, -13476, 396, 4040, -2056, -2904, -3643, -1240], [57899, 8170, 5110, -641, -1438, -513, -5534, -220], [-5898, -29440, -2354, 438, -662, -638, -2288, -916], [43103, -33638, -4141, -1691, -5703, -1370, 12420, -716], [-10083, 19522, -2662, -5804, -6506, -2136, -5026, 4061], [11171, -38076, 3325, -2693, -5109, 688, 895, 3707], [6993, 23876, 6118, -2120, 2088, 582, -2043, 840], [58822, 5850, -1512, -723, 3574, 4333, -1271, 1080], [-62377, -6294, -3517, -8323, 1345, 2258, -4498, 1956], [17660, 11444, 4713, 1788, 2495, 375, -8654, -1898], [-34167, 9300, 10132, -6685, 2250, -915, 16330, 2346], [63966, -214, 5232, -1747, 3410, 769, 9516, -1071], [-2018, -7106, 13895, -1214, 8423, 341, -2197, 2675], [31163, -4790, -6331, 2050, -4871, -8205, -2964, -1165], [-36559, 14956, 4852, -5943, 2000, 1401, 6230, 1248], [123604, -29172, -10431, -6328, 3707, -2407, 2016, 732], [-9818, 22054, -15800, -1291, 4298, 441, 7115, 2018], [-44880, -14092, -460, -5260, 2620, -112, 3540, -536], [10814, 3992, -9799, 3322, 5683, 2429, 5113, -1185], [-51239, 8956, -192, -1799, 6398, -1387, -9108, -2262], [52909, 56, 750, 4957, 4754, 6187, -3931, 2505], [48179, -22172, 3649, -3242, -7417, 681, 3508, 4953], [36489, 11198, -4136, -263, 2760, 2987, 5252, -5082], [-91807, 4378, 439, 4895, 907, 258, 2625, 563], [56448, 12088, -5574, 1604, -2202, 78, 4110, 1742], [-35175, 38038, -5411, -3285, 3219, -326, -6324, 3762], [38330, -4390, 5536, 1257, -1574, -223, 4803, 1350], [12445, 8846, -771, 3584, 1733, 1693, 9256, -3049], [-61581, -11406, 13378, -5524, 5654, 3500, 5548, 2013], [-19940, 1698, -7251, 3049, 6771, -3544, -5156, -6381], [116299, -7406, 4284, 2890, -756, 980, 7907, 2086]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_531_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_531_4_a_e();".
// 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_531_4_a_e(:prec:=8)
    chi := MakeCharacter_531_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_531_4_a_e();".
// 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_531_4_a_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_531_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![128, -3596, 336, 2015, 214, -209, -31, 6, 1]>],Snew);
    return Vf;
end function;