
// Make newform 567.4.a.i in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_567_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_567_4_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_567_4_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 := [-4616, 8592, -2506, -1941, 708, 138, -49, -3, 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], [-13, 0, 1, 0, 0, 0, 0, 0], [14, -20, -1, 1, 0, 0, 0, 0], [24200, -11632, -8352, 1851, 657, -81, -14, 1], [61640, -52264, -9066, 10857, 171, -681, 4, 13], [19504, -17633, -6738, 4950, 699, -369, -19, 8], [-25436, 30460, 3687, -6354, -228, 381, 5, -7]];
    Rf_basisdens := [1, 1, 1, 1, 744, 744, 186, 186];
    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_567_a();"
function MakeCharacter_567_a()
    N := 567;
    order := 1;
    char_gens := [407, 325];
    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_567_a_Hecke(Kf)
    return MakeCharacter_567_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, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 1, 0, 0, 0], [-7, 0, 0, 0, 0, 0, 0, 0], [2, 1, 1, 0, -1, -1, 0, 0], [7, 7, -2, 1, 0, 0, 0, -1], [21, -4, 2, -1, -2, 2, 1, -1], [17, 11, 1, 1, 2, 1, 1, 3], [25, 4, 5, 2, 1, 1, -1, 4], [80, -4, -5, 0, -5, 1, 1, -4], [3, 10, 5, -3, -3, 1, -4, 3], [31, -2, -13, -5, -1, 3, 2, -3], [62, -3, -15, 0, 5, -3, 0, -6], [-7, -2, 7, -7, -9, -7, 4, 1], [80, -33, 2, -2, -8, 0, -1, 4], [89, -23, -25, -9, 9, -1, -7, -5], [-16, -10, -17, -10, -13, 5, 5, 4], [78, -5, 4, -6, 7, -2, -9, -4], [-93, 4, -28, 19, 34, 0, 1, 1], [122, -19, -3, 1, -1, 9, -17, 11], [110, 13, 0, -6, -8, 10, 21, -16], [38, -60, -60, 7, 36, 2, -11, 5], [361, 20, -2, -1, 30, 4, 15, 15], [538, -9, 31, -2, -35, -25, -2, -28], [44, -164, 45, 18, 1, -5, -21, 14], [293, -53, -75, 25, -32, 5, -1, 7], [555, -145, 23, 3, 17, 5, 9, 19], [327, -33, -64, 23, 20, 0, 6, 27], [204, -203, 2, 8, 60, 26, 19, -2], [648, 39, 104, -27, -28, -6, 16, 17], [28, -330, 53, 21, -55, 9, -10, -11], [841, -32, 40, 33, 69, 4, 31, -25], [939, 22, -59, 11, 41, 25, -36, 9], [-731, -225, -61, 11, -82, -29, 25, -31], [-52, 39, -9, 10, -107, 17, -22, 4], [88, -183, 113, 25, -71, -7, 23, -5], [461, 79, 65, 3, -64, -47, -47, 13], [-115, -78, -10, -27, -106, -30, -37, -29], [645, 13, 4, -35, -62, -12, -36, -21], [601, 120, 33, 25, -21, -25, -34, 13], [-422, 189, -144, -32, -54, -4, 47, -38], [234, -282, 120, -28, -23, -32, -6, 12], [-963, 101, -61, -42, 21, 79, 84, -42], [-238, -415, -85, -19, -75, -21, -45, 49], [368, -302, 77, -28, -91, 43, 53, -20], [-803, 477, -139, -53, -31, -1, 9, 51], [739, -91, 76, 25, -42, -8, 38, -67], [947, -455, -128, -45, 2, -8, 10, 49], [915, 108, 28, -83, 57, -4, 7, -1], [-992, 193, -121, 16, 112, -69, -14, -2], [-19, 75, 117, -52, 151, 11, -54, 78], [-865, -778, 96, -20, -82, 30, -50, -52], [-575, 549, 25, -99, -113, 69, 13, -13], [654, -290, -229, 100, 22, 71, -21, 132], [978, -34, 272, -72, 8, -48, 70, -16], [74, -598, -22, 93, -110, 60, 7, -37], [1449, -200, 204, -9, -247, 32, 67, -25], [352, 169, 37, -8, -285, 33, -60, -112], [1209, 92, -172, 69, -20, -82, 17, -109], [-77, 325, 144, -122, 92, -44, 3, 12], [-1068, 966, -142, -58, -143, 76, -18, 0], [2225, -374, 18, -25, 73, -94, 15, 15], [978, -530, -205, -10, -152, -145, -19, -150], [544, -447, 29, -84, 23, -79, -112, 4], [-972, -58, 215, -162, -205, -139, 3, -26], [412, -525, 381, 92, 65, -89, -14, -94], [2775, 536, 80, 33, 230, 44, 3, 199], [594, -1202, 79, -32, -95, -111, -17, -188], [3252, -527, 118, 50, -66, -94, -61, 64], [-1570, -108, 238, 36, 314, 30, -46, 64], [3535, 167, 107, -41, -265, -217, -129, -3], [-327, -21, -116, 184, 334, -66, 105, -78], [-3227, 958, -291, 129, 401, 1, -56, 79], [1581, 204, -449, -41, 149, -61, -120, -15], [640, -226, -33, 130, 431, -215, -77, 192], [-259, 664, -671, -143, 39, -51, 66, -81], [5424, 615, 62, -126, 24, 22, -93, -24], [-1743, -828, 85, 41, -9, 7, -34, 1], [410, -1246, -193, -33, -31, 31, 66, -3], [1794, 1224, 252, -34, -268, -80, -26, -70], [4708, 369, -400, 84, 107, 104, -103, 40], [440, -883, 452, -140, 282, 52, 125, -46], [774, -1092, -279, -28, 39, 3, 53, 298], [1311, 1065, 90, 309, 484, 156, 106, 143], [3524, 62, -581, 256, -311, 205, 63, 142], [3186, 730, 302, 90, 200, 42, -158, 110], [-1597, 993, 614, -162, -218, 78, -11, 80], [180, -68, 126, -165, -146, -128, 57, -331], [4058, 536, -1065, 174, 102, -95, 5, -26], [611, -434, 19, -122, 305, -165, -205, 24], [2957, -1040, -197, -1, 525, 15, 34, 353], [2908, -555, 236, 108, 462, -54, 85, -94], [470, -1135, 65, -259, -655, 117, -145, -193], [-4827, 486, -477, -113, -443, -119, 6, 39], [-2270, 1556, -282, 42, -126, 14, 112, 42], [7718, 765, -439, -18, -281, -159, -62, -82], [-1981, 1203, 559, 395, -61, -121, -229, -167], [7043, 923, -392, 433, 308, 158, -74, 155], [3095, 92, 500, -321, -91, -112, -147, -71], [-1583, 1119, -172, -249, 352, 102, 118, 23], [2649, 963, -197, 55, -59, -43, 17, 169], [6796, 2, -105, -94, 275, -311, -95, -34], [6811, 19, -232, -77, 453, -18, -4, -173], [1659, -1939, 346, -245, -456, 128, -2, 371], [-906, 2070, -395, -260, -13, 155, 207, -138], [-253, 671, 297, 113, -1087, -39, -193, 155], [5419, -1783, -120, -35, 161, 10, 120, 285], [-1100, 623, -294, 6, -834, -316, -107, -280], [-4740, 892, 130, 76, -622, -362, -166, -164], [3316, -13, -185, -182, -607, 127, -326, 48], [-8119, -309, 716, 247, 42, 140, 340, 281], [-4609, 4029, -364, 259, 620, 338, 228, 87], [-2366, 1757, 779, 500, 561, -159, 114, 510], [206, 261, 984, -74, -295, 92, 147, 138], [8392, 1094, -205, 191, 121, -153, 202, -321], [-5801, -620, -555, 390, -335, -129, -159, 30], [3004, 1720, -865, 130, 151, -159, -245, 196], [-3240, 361, -376, 168, 84, -38, -147, 342], [-3191, 2104, -118, 323, 616, 520, 437, 301], [-8304, 1997, 60, 342, 346, -416, -379, -356], [-6841, -1880, -166, -407, -427, 90, -73, -255], [-7950, 2234, 825, -215, -815, 13, 210, -413], [-2770, 2098, 297, 666, 867, -29, 149, 10], [-4558, 1786, -200, 36, 528, 276, 26, -128], [-1623, -2335, -1424, 239, 227, 210, 86, 11], [-5468, 3544, -64, 198, 892, 520, 426, -42], [4012, 1164, -810, -100, 254, -434, 58, -544], [-6164, -3362, 981, -144, 307, -21, -123, 174], [-3439, -3792, 289, -305, -381, -187, 40, 221], [-3256, -581, -351, 742, -266, 57, -44, 424], [8940, 3004, -813, 308, 549, 89, -5, 154], [-7937, -1206, -480, 257, 1280, 280, 301, 35], [6132, -2344, 130, -29, -8, 508, 255, 169], [4865, -4350, 952, -199, -282, 106, 23, 451], [3648, 782, 1714, -394, -242, 150, -218, 38], [-5153, -3015, 249, -655, -857, 205, 105, -201], [5740, -1561, 437, -324, 76, -167, 90, -474], [6343, -4890, 1693, 245, 99, -287, -232, -149], [-1822, -2974, 243, -574, -974, -523, -105, -306], [-1619, 1368, -448, 169, 254, 98, -111, -273], [3219, -415, 717, -25, -1291, 87, 101, 155], [-2010, 381, 458, 42, 1150, -166, 149, 100], [7248, 1864, 136, 112, 144, 252, 144, -364], [-10402, -2266, 1673, 42, -643, -173, 261, -156], [-3450, -1719, 1420, 520, -310, -322, 303, -198], [-2279, -2033, 554, 649, 492, 570, 716, 103], [4923, 891, 1293, 119, 446, 25, -239, 305], [7449, 1229, 765, -37, 87, 297, -169, 169], [4311, -3757, -126, -65, 956, -170, -518, -147], [-2485, 5475, -560, 272, 76, 286, -75, 18], [-7465, -2308, 1218, 89, 722, 468, 35, 431], [10201, -3082, -831, 547, 1119, 479, -70, 499], [-12483, -98, -995, 19, 959, 219, 92, 723], [-3323, 2289, 1381, -413, -369, -185, 113, -557], [3621, -1525, 2492, -177, -670, 500, 522, 247], [-11094, 641, 143, -701, 1231, -109, 111, -51], [17318, -158, 103, -609, -651, 379, -82, -813], [11162, -2032, -551, 306, 801, 327, 479, -770], [-3581, -1824, 474, -19, 494, -566, -701, -919], [11412, 2220, -1268, -508, -23, 504, -44, 176], [-6939, 1379, -1069, -255, 791, 345, 295, -889], [-3530, -1628, -32, -552, -2080, -156, 512, 16], [10595, -3519, -1162, -674, 596, -16, 699, -252], [-7334, 4570, 1277, 32, -410, -359, -163, -188], [-4283, -3779, -2460, 265, -254, 66, 154, -1027], [-2325, 1671, -95, 403, 39, 143, -557, 935], [-19898, 3779, 58, 32, 562, -786, -437, 774], [-3379, -918, 825, 1129, -10, -265, 240, -279], [-3329, -1520, -1874, -373, -840, 140, -323, 361], [5591, -2401, -457, 25, 630, -469, -219, 51], [-15932, 1126, 373, -306, 457, -997, -735, -360], [401, 181, 400, -473, 1219, 18, 454, -323], [-5753, -1052, -594, -438, -1466, -120, -336, -366], [-7791, 3356, -544, -664, -1072, -84, -472, -208], [-9087, 3743, -2142, 399, 1898, -502, -558, 145], [4742, 6943, 1553, -696, -1139, -327, -170, 482], [-15545, 2810, -227, 163, 2013, 835, 176, 251], [5757, 3794, 419, 449, -915, 79, 368, -29], [-7419, 2125, 1939, -3, -219, 229, -463, 597], [16004, -2138, 68, -302, 1163, 228, 440, -618], [6081, -1128, -1377, 926, -697, 475, 49, 452], [-10868, 4041, -1566, -288, 878, -512, 155, -974], [4080, 2294, 1236, -488, -718, -176, -206, -516], [10914, -515, -910, 870, 1026, -392, 255, -360], [-3537, 5358, -895, -188, 2649, 481, -389, 566], [9106, -2599, -444, -496, -722, -330, -781, -782], [11713, -530, 677, -587, -963, 321, 282, 155], [-5994, 1212, -1363, -778, -86, 985, 693, -1074], [-22836, 6020, 2129, 311, -2087, -3, 190, 201], [-4516, -8139, 1022, -440, -2142, -484, -105, -366], [2878, -324, 927, 0, 321, 165, 195, 516], [-7463, -1502, -43, -193, -2921, -89, -1084, -113], [-17912, 1478, -2181, 40, -1577, -827, -639, 454], [5013, 3827, -14, 21, -677, -204, 188, 1075], [-8023, 4486, -1047, -287, 881, 279, 1090, -799], [43603, -4177, -363, 71, 1467, -343, 129, -351], [74, 2278, 2618, 349, -2694, -552, 297, 167], [8226, -1683, 140, -430, -444, 928, 95, 520], [-8643, -2312, 172, -87, 386, 736, -359, 137], [1889, 1717, -1928, 805, 750, -516, 36, -405], [1551, -1511, 3954, -155, -642, 504, 280, 1097], [4793, -3513, 1760, 95, -1830, -1040, -340, -383], [14349, -5180, -1786, 663, 453, -266, 1025, -993], [1148, 8381, 1585, 552, -1345, -199, 804, 634], [-27041, -5637, 2172, -927, -765, -190, 166, -283], [7113, 993, -142, -379, -539, -40, -506, 587], [-17570, -3484, 1424, -150, -730, 164, 90, 838], [1045, -6945, -2153, 211, -2215, -51, 417, -495], [6894, -1932, -866, -344, 114, 1250, 358, -568], [9501, -1507, -128, -17, 1309, 1042, -522, 631], [-9954, -90, 969, -121, -3093, 25, -724, -47], [1968, -8695, 1822, 134, 2800, -1200, -257, -520], [10600, 2482, -1058, 676, -762, -858, -60, -292], [-15879, 195, -452, 215, -1777, 526, -1020, 1215], [-15015, 4698, 2456, -181, -2780, 218, 1147, 431], [-5736, -8698, 673, -196, 499, 15, -365, -312], [-4449, 1074, 853, 1024, 671, 89, -393, 1602], [38529, 3836, 2813, -61, -1353, -221, 428, -725], [10237, -5278, 578, 723, 182, -1654, -547, -59], [-2816, 162, -2555, -702, -2251, -561, -157, -890], [7184, 6138, -2901, 1262, 1503, 73, 557, -986], [-4692, -1974, 390, 308, -2240, 298, 192, 1200], [24820, 9125, 232, -459, 1726, 230, -894, 225], [-5353, 4526, 2417, -273, -2733, -397, 1168, -1113], [-38358, 13302, -1156, -268, 1186, 176, -38, 368], [-25103, -3114, -2424, 109, -1340, -202, 635, 883], [14760, 4051, -3621, -214, 1663, -545, 1114, 608], [-31063, -2394, 3553, -1124, -2395, 473, 67, 206], [4054, 2145, -1137, 1084, 319, -73, -1342, 868], [16617, -1964, 1139, -645, 1139, -1371, -1028, 467], [-19405, -2458, -1407, 619, 1991, 2005, 136, -39], [-7713, 11276, 1243, 619, -8, 865, 774, 1483], [17238, 1301, -164, 2041, 1388, -98, 94, -1011], [-9352, 2267, 1688, -710, -692, 108, -271, -1196], [1061, -2586, 711, -1223, -3062, 1193, 50, -995], [-4003, -2444, 833, 1761, 723, 1025, 374, 1627], [25970, 920, 3874, 562, 2966, 310, -380, 294], [34909, 179, -2919, 1297, -347, 1329, 715, 173], [-22967, -4926, 511, 615, 1727, 1497, 1130, 1591], [-19836, -5483, 2598, -944, -1704, -672, -1541, -1594], [886, 8791, 2497, -1116, -1595, -1333, 186, -1752], [9366, 1994, -3121, 920, 1095, 729, 303, 982], [-3692, 5109, 1041, -620, -1297, 509, 528, 1596], [4630, 10826, 679, -604, 3969, 393, 111, 748], [2095, 2591, -1459, 705, -825, 429, 571, -229], [-17617, 5326, -2808, 337, 1100, -354, -23, -1735], [13504, -2042, 3267, -664, -4317, 1217, 427, 286], [3749, 6891, 416, 999, -997, 766, 564, 771], [45956, 2609, -810, -1660, 632, -162, -907, -1150], [-6047, -1038, -844, -858, -1168, -1114, -1192, 94], [-4398, -4851, 3665, 130, -205, 491, 306, 1968], [1500, -338, 1420, 940, -1228, -2012, -850, -152], [-32129, -3706, -2877, 68, -895, -809, -227, -1546], [16295, 738, -1950, -1021, -1126, 442, 1171, -1321], [8280, -10423, 1132, -138, -78, 398, -255, 84], [-14021, 9190, 3658, -1177, 836, -330, 1081, -787], [4136, 7341, 990, 1450, 3870, 242, 277, -196], [22711, 8745, 2043, -897, 170, -381, -337, -1487], [-31594, 2692, -456, 480, 3615, 460, -52, 232], [-21259, -3581, 350, 299, 1902, 1928, 22, -767], [-3843, 4933, -1729, 1567, 3353, -51, 1163, 1965], [-3387, 4036, -1518, 1809, 2280, 234, -291, 2067], [-55318, 14401, -733, -1978, -897, -1189, 148, -1388], [-2976, 7239, -4797, 1352, 3926, 943, -1064, 1226], [22794, 8790, 1890, -84, -4532, -614, -952, -860], [-25810, 5284, 3554, 836, 372, -106, 1594, -296], [-34500, -9281, 740, 978, -2680, -1644, -623, -964], [18279, -5474, 7237, 1821, -257, -837, -616, 757], [6828, -2943, -691, -908, 1183, -1057, 728, -272], [-2007, 2983, 6079, -1435, 1309, -645, -743, 1337], [17265, -1586, -1294, -541, 6982, -658, -1, 1275], [-13210, -1693, 338, -238, 2760, 114, -1299, 1204], [23535, 15703, 86, 1881, 4030, 280, -960, 1115], [14169, 11274, 6186, -329, -2446, -1006, -627, 1977], [-35464, -1592, -2279, -46, 425, -169, -837, -862], [20029, 6495, -4594, 379, -266, -1522, -790, -1235], [40857, 6205, 263, -717, 2377, 929, 1019, 1753], [24358, -1265, 4718, 142, -1876, 462, -1417, -12], [1544, -5048, -2444, -1630, 584, 1868, 1770, 374], [31816, -11270, -2050, -1834, 353, -1108, -650, -1084], [27149, -8095, -500, -921, -2424, 996, -802, -1223], [-65808, 5359, 3957, 596, 1167, -1945, 382, 472], [-22203, 15221, -2637, -1505, -3577, 1925, 515, 1195], [-21279, 128, 8632, 741, -119, 788, -607, 2441], [-21530, -3750, -953, -2322, -2540, 159, 1309, -2770], [5368, -21574, -2632, -845, -2058, -30, -529, -95], [17270, -2018, 6124, -885, -4426, 658, 877, -1235], [13782, -3436, 43, -1126, -83, 1005, 595, -2626], [-30234, 1772, -4255, 1026, -1315, 635, -2127, 1696], [-24827, -11548, 6140, 1685, -1434, 1692, 1845, 693], [-47511, 11599, -4191, 1181, 2095, 1213, -353, 3605], [26387, 8514, 707, 195, -2658, -739, -2200, 571], [56746, -2898, 380, 1525, -268, 1478, 423, 2151], [-47296, -4423, 3122, -716, 1994, -104, 367, 1958], [23561, -3039, -4533, 1793, -2641, 643, 55, -343], [486, -8510, -1286, 24, 991, -1578, -1564, -1220], [25024, -4646, 865, -972, -807, -1685, 53, -798], [18663, -14810, -1433, -535, -1080, 701, 218, -2555], [-13495, 3326, 4287, 2175, -1887, 583, 1160, 1909], [-12967, -3399, -106, 1181, -4356, -1070, 50, -185], [-29441, -67, 1028, -993, 1370, 410, -1206, 1057], [26653, 16471, -3569, -1335, -95, 107, -375, -375], [9618, -2313, 897, 681, -113, -399, -2735, 575], [10456, 19623, -3096, 560, -1550, -240, -1411, -794], [41673, -10079, 1848, -817, -804, -2128, -2504, 1219], [10102, -6823, -5221, -2447, 59, -173, 1087, -2079], [-32273, 5589, -1353, 1381, 4421, 157, -591, -2253], [-5657, -5018, 2032, -873, -1171, -2276, -1883, -1865], [9031, -9611, -4588, -1981, -1056, 744, 360, -681], [26994, -15159, -133, -678, -3089, 9, -344, -940], [71191, 438, 357, 27, -2161, 1621, 2102, -2507], [4965, 9896, -3476, -2375, 2378, -794, 809, -1853], [60213, 8474, -5183, 801, -167, 645, -1606, -197], [-33459, -13086, 1512, -1459, -1488, -56, -1267, -2141], [30795, -11745, 2510, 1768, -1334, -1852, -1653, 870], [-13718, 688, -275, 1160, -545, 191, -883, 1116], [-5635, -31898, 4259, 615, -36, -1591, -1708, -953], [1007, -3977, -1955, 1484, -5421, -363, -422, -556], [-2061, -5289, -2292, 1697, 1750, 2158, 2874, 159], [-29254, -19848, -416, 860, -1544, -476, -1056, 2340], [18239, -14089, -3035, -1817, 2109, 667, 2699, 371], [11336, -2622, -3180, 395, 1142, -1898, -1163, -667], [254, 9512, 3627, -2322, -3283, 1977, 921, -2694], [-41867, 5684, 5492, 154, 1600, -254, -906, -722], [42585, -24070, 835, -1130, -6425, 21, 237, -654], [5131, 906, -5940, 687, 2472, -324, 1353, -549], [-6089, -4083, -559, 3523, 681, -1729, -1979, 3341], [30691, 9562, 4244, 657, 964, 706, 2385, 1553], [72564, -2458, 1183, -1587, 179, 2359, 1492, -379], [4197, 6983, -1099, 147, 1195, -247, 317, 295], [-57116, -6476, 942, -100, -516, -1234, -710, -2180], [3857, 18885, 2630, 1221, 5422, 384, 2236, -1423], [-35769, -11881, -4782, -2809, 3668, 2010, -298, -1219], [34371, 6905, -129, -627, 586, -1901, 1289, -1133], [18149, -17188, -1431, -49, 5495, -1317, -2482, 35], [18636, -30557, -3876, 1220, 3865, 2272, 1327, -880], [1155, -2900, 3011, 501, -4195, -1265, 118, -773], [27964, 6659, 1150, 690, 900, 544, -1295, 2852], [51701, -12074, -1734, 505, -3168, 2562, -2175, 2213], [59166, -8485, -9092, -2102, -1832, -890, -1659, -3008], [3197, -6377, 1320, -4729, -6016, -2050, -1038, 1415], [33869, 8083, -3431, 3732, 3193, 331, 1654, 1574], [13875, -5108, 2331, 635, 7661, -679, -2466, 435], [49870, -5307, -2273, -921, 7881, -1137, 387, 2013], [20469, -392, 2027, 2335, -2205, -1721, -908, -523], [-59535, 1702, -10444, 377, -68, -208, -899, -1873], [1545, -8207, -5946, 1953, -3077, 268, 2190, 743], [-19884, -8288, -4790, 840, -1538, 1462, 1842, 2108], [-23399, 461, 3532, 1475, 186, -2348, 966, 2169], [-24400, -16283, 3350, 886, -8432, -1428, 1595, -2648], [49467, 16491, 2771, -313, -6002, -1241, -2055, -267], [16126, -7141, 6670, -2445, -3076, 272, 132, -317], [-20765, 31065, -4593, -1299, 5527, -1053, -513, 1269], [8395, -1055, -1595, 2115, 2501, -2153, -1895, -893], [55583, -10959, -4739, -2969, -985, -871, 159, -2973], [29848, 10596, -413, -2084, 573, 1933, 1295, 1132], [18911, -8771, -5775, 1365, 2793, -497, -2269, 877], [21731, 5377, -2588, 735, 915, 2310, -262, -1601], [47624, -4115, 4322, 1505, -1376, -2412, -1764, 537], [-14610, -22825, -4132, 80, 1888, 1352, 2749, -1102], [2046, 19276, 2934, -1802, -6426, -3114, -1056, 1334], [10302, 696, -12197, 2216, 4967, 313, -2073, 72], [-51153, 14554, 1825, 2683, -481, -1397, -892, 4327], [-53212, -15447, 4186, -5494, -4426, -1054, -721, -476], [-25676, 628, 2372, -1058, -1598, 144, 1546, -1826], [9160, 5903, 5234, 2527, 1422, -2204, -2044, 71], [-73517, -10807, -12469, -49, -293, 991, 1181, -4835], [2317, 10317, 283, 1487, -5271, -3035, -1837, -2303], [-55661, -638, 741, -688, -6931, 227, -519, -784], [-20731, -6340, 10222, -1039, -3484, 2342, -2575, 367], [78220, -7830, 3019, 1542, 4319, 3429, -7, 3796], [-19874, 14261, -1639, -2149, -9825, -1431, -1635, -951], [-73656, -5020, 8124, 2334, 2326, 340, 650, 670], [25164, -28343, -1394, -1404, -2368, 1120, 391, 4282], [-39201, 640, 7137, 1163, 1249, -1159, -2854, -2283], [21558, 8304, 4602, -234, 185, -2272, 2248, -2620], [-87518, -15586, -51, -2305, -2335, -35, -3284, 4367], [-8910, -9385, -1376, 3588, 560, -886, -51, 454], [-40617, -3338, 6321, -2579, -103, 467, 428, -503], [-11442, 4830, -6052, -2240, 1998, 860, 754, -1384], [24447, -17964, 3206, 841, -5129, 1070, -1617, 1929], [-9437, -8981, -2203, -2856, -2519, 679, 1386, -4386], [1517, 12552, 6569, -4196, -913, 845, 441, -2970], [10332, -823, -4779, 315, 7493, -427, 271, 1235], [10272, -9173, 1987, -3070, -780, -583, 1462, -1736], [50396, -18812, -6440, 376, -656, -2864, 1520, -3068], [-18154, -324, -5289, 4208, -519, -623, 1499, -470], [-8339, -4602, -4771, 3451, 2712, 2831, -698, 3587], [4283, -7328, -1382, -1349, 1902, -4278, -2625, -2011], [8910, 13987, 3101, -2308, -979, 1233, 1170, -456], [25757, -12463, -3846, -1459, -4996, 1128, 260, 1037], [-51933, 11602, -592, 2573, 3731, -1692, -2037, 3381], [-5595, -14998, 7436, 381, 3904, -2104, 677, -2513], [14469, 428, -1010, 603, 6161, 3914, 555, 25], [-27635, -19776, 3147, 1429, 5049, 1109, 1082, -791], [29239, -5650, -14952, 5872, 7116, -680, -1630, 3164], [9867, -13502, -1175, 1343, 10933, 641, 2630, -1419], [16030, -14853, 10408, -6274, -5296, -4602, -257, -4144], [-53972, 17124, 1327, 2576, 4793, -1079, 439, -1522], [-53814, 5772, -1240, 3586, -1794, 3412, 2806, 38], [-14806, -12798, -7746, 3758, -3057, -1646, -2074, 2194], [36689, 9925, -2173, 904, 2461, -1503, -466, -3146], [88814, -16140, -461, -2936, -3907, 4085, 3207, -1398], [1512, -15714, 5681, -178, -753, 355, 1097, -1466], [18472, 18780, 5910, -1228, 1661, 2914, 1834, -424], [-116546, -9622, 9261, -622, 45, 1071, 291, 3556], [23426, -4301, 729, -2968, -1553, -1585, -2722, -6258], [-77529, 12636, 3295, -3540, -10649, -15, 149, 148], [-32552, -9506, 3819, 3880, -3386, -2085, 295, 1036], [-28166, -21076, 1469, 72, -1287, 1371, -521, -658], [-71658, 31110, 8772, -746, 9320, 692, -528, 366], [-13466, 7769, 15153, -1640, -2069, -1233, -128, 1082], [54674, -21552, 6969, -1058, 1925, -393, 1867, -1876], [13060, -33331, 5960, -1172, 3780, -1616, 1055, -2386], [36917, 21797, -930, -468, 3286, 746, 539, 1730], [-119369, 12284, -2963, -2741, -672, -3413, -448, -5129], [-25289, -542, 2705, -721, -425, 5455, 2480, 3151], [-63181, 10264, -4548, 2693, -1026, -5026, -5573, -647], [-33936, 9081, -9257, -2208, -3585, 2591, 1362, 3846], [8868, 11888, -3559, 2966, 6157, 3155, -683, 6116], [-40612, -15847, -1147, 4462, -3265, -3737, 154, 1100], [39091, 18080, -3918, 2539, 315, 3634, 1217, 2039], [-9527, -9346, 6249, 62, 1819, 1425, 2093, 4840], [-4880, -9210, 1408, -3874, -6447, -842, 1680, 744], [-53777, 21094, 7287, 1665, -707, 997, -2106, 3881], [-4500, 788, 2110, 534, 5590, 1278, 128, -974], [-7752, 20994, 7208, -538, -1426, -96, 2160, -654], [-101656, 25378, 3731, -1891, -9477, -865, -800, -421], [-6924, -29222, 2933, 3434, -2532, -1627, -2429, 190], [52938, -6474, 5450, 2908, -7818, 2254, -1388, 4292]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_567_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_567_4_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_567_4_a_i(:prec:=8)
    chi := MakeCharacter_567_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_567_4_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_567_4_a_i( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_567_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![-4616, 8592, -2506, -1941, 708, 138, -49, -3, 1]>],Snew);
    return Vf;
end function;