
// Make newform 616.4.a.k in Magma, downloaded from the LMFDB on 26 December 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_616_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_616_4_a_k();".
// 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_616_4_a_k();".
// 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 := [18816, -34432, -6504, 5172, 354, -144, -3, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0], [152160, -59944, -8748, 2006, -180, -13, 3], [-42, 0, 1, 0, 0, 0, 0], [-177504, -248408, 8748, 2218, 180, 13, -3], [-1043232, 110776, 207908, -2834, -6340, 31, 47], [1126176, 453032, -248340, -25654, 7284, 221, -51]];
    Rf_basisdens := [1, 1, 12672, 1, 12672, 12672, 12672];
    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_616_a();"
function MakeCharacter_616_a()
    N := 616;
    order := 1;
    char_gens := [463, 309, 353, 57];
    v := [1, 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_616_a_Hecke(Kf)
    return MakeCharacter_616_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]];
    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, 0, 0], [0, 1, 0, 0, 0, 0, 0], [2, 0, -1, 0, 0, 0, 0], [7, 0, 0, 0, 0, 0, 0], [11, 0, 0, 0, 0, 0, 0], [4, 0, -1, 0, 0, 1, 0], [7, 2, -3, 0, 1, 0, 1], [3, 4, 0, 0, 0, 0, 1], [-7, 8, 1, -2, 0, 0, -1], [14, -2, -2, 0, -3, -1, 0], [-27, 7, -2, -2, -1, 1, 3], [44, -12, -4, -3, -3, -1, -4], [74, -11, 3, 2, 0, 4, 4], [85, 16, 5, 3, 3, -3, 1], [-16, 23, 9, -2, -1, 5, -4], [255, -10, 15, 7, 5, -1, 1], [81, 16, 22, -4, 3, 4, 1], [95, -19, 9, -6, 5, 3, 3], [81, 12, 15, 6, -2, -6, 3], [159, 6, 1, 12, -1, -5, 1], [57, 8, -1, -12, 1, 0, -1], [9, -28, -17, -9, 7, 1, 9], [-41, -48, -16, -10, -2, 6, 1], [201, -20, 3, -10, 2, -4, 5], [579, -38, -19, 20, 2, 0, -9], [78, 28, -1, -12, -14, 7, -10], [-33, 28, -23, -18, 6, 7, -5], [436, -124, 54, 12, 14, 6, 8], [262, -96, -22, -6, -11, 1, 8], [461, -72, -93, -14, -7, 1, -7], [-60, -148, -74, 0, -3, 11, 20], [269, -32, 6, 8, -18, -4, 3], [270, 176, 34, 5, 9, -17, -10], [35, -158, -32, 12, 14, -24, -11], [782, -198, 18, -2, 13, -31, -8], [-337, -52, 47, 27, -26, -10, -21], [256, -16, -141, 4, -6, 2, 10], [-264, -96, -62, -4, -18, -16, -32], [-1160, -46, 8, -2, -20, -22, 16], [421, -55, 81, -34, -17, 7, 1], [-737, 124, 99, -4, 22, -8, 13], [-510, 44, 1, -2, -28, 18, 0], [319, -156, 159, 24, 5, 13, 17], [-712, 84, 112, -28, -13, 13, -14], [428, 58, -194, -30, 7, -1, -14], [-369, -24, -7, 26, 4, -11, -21], [-416, 100, 78, -4, 52, -40, -28], [-2076, -336, -132, 6, 22, 33, 30], [-623, -154, 168, 60, 12, 4, 51], [996, -194, -63, 34, -28, -44, -30], [202, 6, -14, 40, -36, -48, 8], [-482, -500, 164, 8, 3, -35, -30], [-728, 465, -91, 74, 4, 16, 6], [-2107, -276, -92, -16, 57, 36, 9], [2464, 168, 82, 54, -44, 12, -58], [-694, -140, -142, 40, -28, -28, -26], [-723, 72, -24, -50, 30, 58, 29], [-1786, 32, -86, 104, 18, 32, 22], [-888, -136, -26, 124, 49, 23, 38], [2026, -370, -90, 26, -2, -50, 28], [-721, -432, 88, -24, 66, -16, 33], [-2199, -173, 201, 46, 15, -37, 21], [-2423, -474, -68, 52, 4, 44, 11], [-1405, -390, 261, -6, -60, 31, -29], [-191, 240, 81, -100, 4, 30, 9], [-263, -322, 233, -88, 6, 18, -39], [3179, -132, -257, -2, -6, -36, 45], [956, -36, 328, 58, -43, -91, -98], [3529, 292, -103, 33, 55, -27, 33], [-3055, -183, 245, -26, 83, -35, -23], [749, 96, 151, 42, -106, -36, -151], [383, -544, -49, -43, 74, 26, 79], [-1647, 195, 200, -14, -21, -61, -29], [-1468, 418, 318, 104, -5, -9, 126], [1989, 382, 313, -22, -72, 42, 51], [-1750, 638, 2, 18, 16, 63, 112], [451, -166, -567, -48, -26, 122, -25], [1281, -348, 72, -88, -2, -104, -55], [2402, 38, -370, -6, 39, -45, 136], [-2503, 222, 143, 92, -57, -136, -61], [4071, -269, 149, 68, 34, 2, 85], [4217, -462, 137, 77, 51, 153, -37], [-851, 1084, -123, 35, -96, 84, -83], [-1301, 1366, 193, 36, -26, -48, 135], [-3152, -606, -2, -98, -64, -12, -100], [4787, 678, 17, -130, -56, -32, -39], [3724, 788, -16, 73, 217, -61, 56], [4222, 182, 108, 30, 7, 91, -124], [-4428, 1296, 331, 64, 8, -101, -76], [1593, 774, 367, -122, -17, -33, -93], [3580, 995, 96, -172, 8, 40, -60], [4080, -402, -224, -234, 62, 22, -52], [-3703, 654, 787, 0, 118, -36, 87], [6727, -624, -271, -19, -149, -107, -141], [7770, -34, 50, -176, -50, -70, -14], [876, -906, 198, 124, -78, -218, -124], [9168, -706, 285, 190, 66, -66, 118], [4563, 126, -835, -252, -118, -80, -65], [6373, -416, -90, -74, -144, -118, -145], [-3728, 1004, -24, -182, -171, 67, -166], [4228, -1048, -96, -132, 34, 54, 176], [-4268, 116, -88, 84, 15, 29, 178], [8607, -1452, -214, 152, 40, -52, -43], [5184, 388, 288, 230, -127, 53, -222], [-1624, -108, 388, 0, 158, -182, 60], [-1981, -380, 389, 196, 154, -54, -13], [6347, -1459, -81, 92, -2, -94, -15], [4410, 737, 277, 26, 48, -162, -152], [3978, -862, -200, -14, -209, -43, 82], [-4880, 207, -503, 22, 74, 160, 50], [-9720, 668, 180, 66, -92, -40, 36], [-3786, 1176, -60, 412, 53, 49, -36], [1203, -234, -243, -395, 0, 156, 221], [312, -1795, 602, -100, -28, 58, -116], [4639, -1060, -161, 142, 215, -125, -27], [-9630, -432, 1322, -321, 58, -182, 22], [-5857, 1350, -156, -120, 25, -10, -29], [1707, -673, -444, 250, 125, 83, -59], [9589, 2596, 389, -302, -118, -56, -67], [2085, 8, -379, -263, -191, -61, -83], [-7068, 332, 977, -98, -94, 38, 2], [-5698, -650, 730, -154, -124, -224, 24], [4846, 456, -99, -364, -164, 61, 46], [11698, -22, 680, -56, -20, 230, 94], [-1344, 45, 158, 568, 52, -184, 80], [-1012, 1734, 366, -190, -59, -5, 158], [-1663, -380, -963, -158, 36, 334, 121], [6902, -446, -714, 326, 12, 283, 204], [-16639, 131, -854, -378, -227, 167, -185], [8843, 1111, -321, 126, -97, 203, -93], [-4042, -1180, -134, -112, 62, -162, 70], [7330, 1164, -632, 36, 203, 165, 46], [-5879, 2168, -715, -264, -44, 20, 219], [-4368, 2222, 1202, -114, 178, 88, 142], [-2089, 402, 597, -20, -77, -64, -299], [-5984, -573, -177, 10, -282, -2, -162], [2293, 1064, 642, 300, 50, -106, -255], [-7419, 1888, 510, -214, -158, 158, 107], [654, -842, 627, 596, 124, 142, 48], [9490, -846, 1152, 308, -19, -203, 76], [-8159, 1642, -384, -146, -246, -10, -33], [-2616, 1472, 166, -334, 139, -11, -78], [-15079, 1130, 47, 170, 35, -227, 231], [-6565, -2500, -787, -37, 93, 79, 243], [10394, -1144, 231, -196, -362, -142, -168], [-8214, 1014, -494, 130, 474, 353, 128], [4804, 2278, -915, -120, 142, -79, -108], [-1093, -1106, -1195, 120, -387, 14, 9], [-3733, -1446, 220, -252, 221, -314, 111], [10640, -2108, -1584, -128, -31, 59, -136], [708, 2430, 490, 516, 259, -287, 354], [1561, -2510, -1299, 208, -18, -348, -103], [-4976, 972, -248, 492, 50, -362, -12], [-21306, 558, 562, 206, -30, -346, -322], [-10658, 600, 696, -278, 176, -42, -330], [-10208, 1376, -256, 34, -310, 516, 80], [6888, -1484, -1352, -36, 22, -282, -320], [2396, -3076, 204, -594, 288, -34, 270], [-1364, -1907, -173, 322, 282, -280, -290], [5107, 153, 1421, -166, 221, 27, -1], [16243, 392, -29, 64, -338, 196, -439], [10796, 238, 492, -50, -50, 288, 78], [-14111, -1744, -231, 289, -192, -148, -291], [-6900, 1745, 450, 792, -272, 98, 8], [-6959, 2476, 759, 274, 182, -204, -411], [5545, 141, -2332, -234, -135, -277, 127], [-738, 2544, 354, 96, -127, -119, 206], [-13277, -691, -507, -134, -315, -55, -93], [-11464, 80, 616, -610, -383, 167, -570], [5810, -486, 2299, -472, -374, 262, -152], [12434, -1460, 80, 368, -254, -530, -62], [6701, -2702, -586, -50, 208, 96, 45], [9285, -1284, 635, -429, -163, -77, 45], [-1716, 4540, -1278, -34, 236, 450, 382], [3802, 546, 2026, 378, -90, -157, -524], [35371, -2458, 1675, 18, 178, 224, 187], [8465, -868, 731, 95, -119, 615, -219], [3788, 612, -288, 373, 55, -427, 188], [-18622, -3328, -98, 426, -104, -166, -250], [10790, 238, -2455, -312, 60, 135, 514], [-23390, -1098, -792, 160, -124, -386, -38], [-1073, 1432, -926, 8, -120, -204, -331], [29139, 864, 1623, 150, -206, -100, 31], [-8056, 4607, 2677, -446, 158, 48, 282], [1985, -128, -2199, -254, 208, 410, 171], [-5837, 662, -48, 290, 154, -336, 659], [8112, 2982, -2262, -652, 17, 141, 250], [13036, 410, 23, 348, 247, -70, 478], [1306, -840, -588, -68, -300, -518, -460], [-11944, 1616, 10, -428, -402, -138, -144], [16797, 1660, -701, -406, 166, 470, -195], [15688, 2072, 1690, 548, 328, -408, -196], [11327, 1302, -2705, 262, -352, -6, 145], [50815, 584, -266, 282, 90, -32, -1], [8511, -332, -1219, 377, -187, 575, 131], [-2331, 2084, 755, -1382, -668, -118, -511], [-220, 1584, 1612, 1076, -81, -265, 146], [31404, -1212, -2032, 85, -109, 281, 420], [-6642, -1279, 601, -782, 214, 528, -172], [-16938, 2730, -1216, -448, 98, -42, -278], [-13396, 5232, 1834, -222, -63, -29, -338], [-5816, -78, -1200, 420, 562, -260, 36], [9125, 2420, 2686, -128, -140, -172, -87], [17345, -124, 219, 380, 81, -448, -17], [13819, -1442, -3310, -424, -139, 122, -57], [5880, 1476, 2977, 714, 212, -388, -498], [-3661, 4501, -738, -230, -21, 437, -331], [7626, 1476, 3150, 500, -156, -144, -454], [10, -5172, -346, 452, 503, 29, -40], [10248, -262, 117, -152, 565, 694, 94], [-16282, -4036, 1382, 186, 109, -175, -108], [12784, -130, 915, -28, 440, -548, -182], [-25675, -942, 2359, -830, -196, -136, 163], [-26854, -5234, -1199, 516, 85, 398, 20], [27208, 2338, -506, 216, -552, 388, 264], [14007, -1310, -643, 468, 54, 2, 119], [-15639, 104, 367, 553, 267, -79, 277], [7146, -2869, -1271, 838, -274, -354, -460], [11926, -2482, -1836, 542, -319, 3, -706], [11565, 504, -1691, -598, -970, -168, 237], [5012, 792, -3966, -290, -147, 469, -190], [12034, 4016, 754, -106, -292, 450, 150], [-20468, -3956, -2972, 19, 215, 741, 524], [-13955, -3718, 419, -440, -172, -404, -409], [14619, 3318, 2706, 270, -602, -66, -355], [-19116, 2054, 3878, -264, 729, 347, -222], [13782, 5064, 3536, -110, 614, -636, -20], [34944, 4344, -1596, 180, -34, 402, -680], [-28080, 5620, 2320, 106, 204, -166, 888], [-11191, 6120, 2661, -57, 107, 153, 477], [-14316, 3360, -1008, -1097, 115, 657, -256], [-8631, 124, -548, -666, -888, -58, -893], [-4752, 848, 4712, 356, -206, 586, -560], [8934, -3658, 794, -440, -266, -368, 400], [-6671, -3830, -1168, 228, 145, -362, -223], [17802, -2516, -2006, 410, -202, -20, 566], [30955, -5074, -1995, -348, -360, -570, -729], [-19234, -2824, 688, 948, 349, -261, 168], [-25259, -6222, 917, 274, 246, 200, -5], [-2760, 2084, 860, -458, -692, 217, -322], [7781, 3132, -3177, -504, 584, 0, 547], [-1333, 2260, 284, 1244, 480, -804, 113], [18268, -5673, 3747, 426, -177, -953, -164], [19492, -3608, 2806, 1141, 311, -3, -444], [-5678, -917, -1041, 34, -590, -124, 144], [2240, 2890, -1408, -554, 16, 758, 1192], [3108, -4433, 1247, 418, 23, 343, 620], [-4235, -3929, -91, 596, 590, -574, -225], [32738, 440, 4086, 268, 756, -256, 346], [-4182, 3992, 1650, 12, 402, 614, 342], [4406, -8184, -1698, 468, 493, -661, -960], [-26889, 916, 2197, 552, 229, 268, -167], [27971, 2968, 2767, -362, -69, -367, -347], [31656, -304, 2250, -298, -884, 64, 334], [5701, -2819, -2981, 638, -951, 35, -731], [5372, 11864, -190, -292, -250, 246, 456], [12465, -2910, 2887, 1283, 101, -57, 151], [-5795, 2478, -1766, 254, 108, -322, 31], [-5736, -1864, -515, 314, 608, -656, -922], [6012, -5547, 785, -706, -882, -470, -390], [-22961, 3812, 3287, -2215, -370, 558, -305], [-37608, -4844, -1112, -944, -334, 318, -636], [2496, -5294, -581, 1164, 328, 1233, 396], [15821, -4813, 5357, 414, 399, -731, 429], [-18902, -7592, 2842, 326, -146, -414, 684], [-11001, 1429, 3459, 24, -682, 106, -987], [-6600, 1456, -3382, -1605, -303, 235, -1300], [38763, 1106, -4165, 962, -210, 388, -85], [-17379, 140, -1941, 1443, -689, -395, -599], [4908, 2504, 2286, 854, -271, -151, -614], [44332, -164, -401, -664, -970, -278, -802], [-4931, -1800, 163, 580, -568, 948, 267], [28386, -2738, -1294, -1928, 270, 610, -24], [3650, 3912, 3500, -404, -321, -83, -2], [31521, 940, -1101, 312, 661, -384, 1151], [9328, -4428, 2220, 442, 876, -25, 394], [-18139, 11054, -1441, 290, -452, 420, 455], [11470, 5562, 708, 696, 1303, -1053, 52], [-55536, 1202, 1542, -878, -33, -93, 18], [-54811, 2766, -828, -206, 140, -794, -401], [28106, -1470, -700, -1768, -4, -122, 98], [-6745, 5046, 2029, 744, -129, -1441, 297], [6866, 1852, -1520, -1192, 790, 408, -590], [-605, 6239, -1569, 786, -1301, 529, -865], [14145, 728, 694, 962, -258, -122, -977], [9689, -5716, -1651, -300, 736, -376, 307], [26021, 42, 3615, 1175, 549, 283, -633], [-30826, -1142, 1154, -518, -275, 829, -480], [-4442, 1778, 3106, 902, -522, -661, 520], [1541, -3664, -4085, -328, -723, -606, -1121], [15008, 1920, 2898, -1331, 315, 225, 56], [2131, -1277, -965, 2108, 250, 164, 117], [-15312, -3802, -758, 166, 19, -475, 166], [3537, 640, 250, 1172, -380, 444, 347], [-23712, -2048, -5714, -682, -641, 369, 522], [-13926, 1352, -3279, -1056, -384, 39, -1538], [-36801, 11173, -3076, -298, -625, 151, -475], [-1754, 1116, -3019, -278, 272, -658, 1012], [-13655, 858, 1878, -246, -412, -938, -1589], [-21409, 190, -4048, -866, 204, -78, 309], [19888, 3727, 1011, -1118, -176, 1768, -450], [-16154, 10056, -2070, 834, 715, 303, 608], [42309, 1032, -4769, -1561, 11, 597, -787], [-10654, 2382, -1126, 1792, 324, -348, 954], [-38853, 3636, -3047, -782, 378, 506, -855], [-12090, -1160, 854, 1271, 531, -879, 1058], [-32175, -2880, 3685, 1524, 782, 72, 75], [31980, 7868, -4239, -338, -408, 136, -174], [29708, 780, 3436, 2408, 276, -284, 252], [51412, -4590, 820, 1618, 521, 69, -558], [-32856, 676, -624, 1218, -472, 708, -252], [-38252, 2346, 2778, 146, -240, 510, 650], [-40266, -818, -8062, -1128, 654, -114, 452], [-14673, 906, 2793, 1786, 362, 602, -443], [-9177, -5320, 2961, -847, 199, -439, 63], [91966, -1151, 2989, 594, 780, 254, 1076], [15034, 473, 7042, 316, -36, -698, 202], [11558, 6360, 5114, -2468, 284, 332, 298], [30078, -11514, -3854, 72, 262, -278, -796], [-61816, 1520, 2518, 508, 678, -500, 1454], [-11509, -3986, 284, -1420, 440, -272, 1001], [58453, -3204, -3277, 1810, 206, -380, 953], [24403, -7643, -3079, -330, -1015, 51, 431], [21007, 8006, -2579, -826, 725, 311, -223], [11006, -7104, 2498, -694, -331, -1073, -160], [16721, -5582, -433, 1086, -352, 776, 225], [24695, -8252, 2029, 298, 1142, 1338, 733], [17440, -539, 4598, 1792, 720, -938, 220], [-27049, -3968, 3151, 135, -474, 370, 603], [6426, -10728, -1562, 338, 659, 1183, 1844], [27882, -564, 2086, -1272, 491, 1021, -236], [1881, 3178, -2609, 947, 1233, -605, 279], [28186, 158, -2450, -1048, 530, -1124, -1166], [39023, -6418, -3440, 1952, 590, -72, -471], [-10915, 6180, -2793, -1849, -37, 781, 697], [1039, -10488, 1800, 52, 1477, -264, 1495], [37768, 672, -160, -2641, 681, 1307, -436], [-12438, -11373, -3561, -454, 320, 378, 512], [67181, 4376, 775, -926, 254, 940, -63], [48012, 648, 1978, 2620, 120, -294, 648], [1, 4996, 1135, -1102, -1242, -1832, -1959], [-17378, -432, 862, -2341, -734, 1066, -838], [-52883, 4321, 289, -586, 1207, 623, 913], [-3681, -1012, -3689, -354, -1115, 1725, -347], [33805, -1154, -313, -208, -342, 938, 821], [-5092, 5844, 3676, -332, -1116, -988, -984], [27030, 9510, 1639, -32, -252, 1508, 500], [-67655, 576, -3469, 2448, -1742, -766, -609], [-1842, 6226, 8320, -892, 512, -10, 350], [-56222, 8068, 711, -2216, -808, 814, -148], [-41561, 10080, -338, -1232, -812, -636, -555], [22136, -8352, -7496, 145, -831, 223, 204], [34414, 15618, -2454, 354, 1054, -124, 688], [-43680, -11654, -412, 32, 1584, 752, -696], [33080, 1128, 842, -704, 669, 1459, 2782], [28000, 12447, 4233, -1598, -384, 546, -342], [54498, -846, 906, 2938, 640, -387, -572], [33125, -10542, -4616, 1742, -322, -722, -397], [-35058, -2650, 2894, -728, 1380, 794, -1056], [-71297, -10768, 2707, 1272, -1576, 186, 25], [17140, 6422, -812, 16, -707, 1089, -1714], [14222, -1101, -6121, 58, 1216, 658, -1052], [-8893, -3898, -5735, -900, -1350, 610, 521], [-45345, 8032, -3635, -13, 23, -1239, 439], [37809, -17636, -1526, 28, -659, -348, -835], [47034, -12948, 846, 69, 574, -26, 402], [24197, 2389, -5607, 650, 1459, -1745, 1217], [946, 8868, -1708, 252, 213, 1371, -994], [45514, -22178, 3268, -726, 579, -873, 144], [-16279, -9780, -7117, 462, -574, 1250, -445], [55692, -4978, -4867, -1300, -899, 1134, -1518], [22204, 13256, 6824, -1368, 72, -668, -772], [-87412, 6380, 2584, 806, -729, -55, 846], [-25646, -530, -3564, -3148, -836, 1786, -334], [62728, -6796, -1522, -519, -687, 599, 1200], [15969, 7365, 31, -2620, 842, 2178, 267], [17551, -14080, -1913, 215, 1350, -1802, 939], [71131, 12384, 4905, 960, 551, -760, -751], [-43343, 10602, 1523, -152, 457, -548, -633], [79625, -13730, 4767, -1068, -675, 1140, 343], [67331, 5144, 4862, -2086, 188, 782, 347], [-20304, 7540, 4924, 473, 926, -138, -708], [-38369, -5952, 1341, -2027, -1107, -253, -1617], [12088, -340, 1318, -1846, 2118, 2022, 750], [29641, -8842, 6066, 1080, -502, -612, 1351], [-36764, 6056, -1432, -2218, -2596, 31, -2066], [30736, 7876, -1748, 1596, 423, 1225, 1976], [-76234, -2920, 5251, -1668, -782, -798, -1268], [3332, 676, -6898, -2756, 1168, 364, 216], [-74828, 4466, 312, 278, -104, -547, -974], [-81714, 17940, 1730, 1661, 810, -406, 774], [-40962, -1502, 2733, 394, -788, -340, -664], [-92351, 4928, 671, 1150, 664, 940, 675], [-8466, -12263, 1238, -1616, -448, 1230, -1882], [65675, -14270, 2621, 1864, 1328, -1880, -1463], [100290, -4704, -5032, -678, -1514, -860, -1360], [-2676, 1296, 2882, -1252, 438, -2784, -96], [-12416, -5174, 3262, 1718, -690, -1764, -2086], [36956, -14608, 322, 1784, 778, 2320, 564], [18580, -3820, 1736, -840, -167, 653, -1626], [57334, 8932, 1163, 856, 566, -1583, 826], [54773, -8442, -2123, 1060, 118, 274, -1695], [-121884, -3120, 5444, -636, 718, 234, -1068], [-70484, -1498, -2334, 2522, -308, -838, -546], [-109976, -648, -2497, 864, 988, -131, 1108], [40094, 18720, 2372, -942, 1512, -652, 70], [-17686, 3236, 768, 1500, 454, -1122, 1084], [-23108, 11254, 5426, -1124, -895, -1795, -1062], [-59761, -9301, 2069, 920, -1370, -1626, -1259], [-44192, 4745, -9476, -2780, -340, -560, 1584], [-88260, 1525, -337, 602, -532, -326, -498], [-11722, -7908, -7176, 264, 1175, -685, 2092], [-62140, 4810, -3170, 846, 618, 28, 392], [-52693, -4968, 1089, -997, -2649, 869, -1765], [-25108, -1792, -138, 4136, 1782, 96, 1138], [-76074, -7990, -2613, -1112, -2170, 464, 1064], [76136, 2528, 9432, -752, -1554, -46, -1384], [-45382, -3266, 4386, 898, 1272, 103, 1016], [-60846, -7652, -5138, -118, -1728, 96, -452], [-40080, -15226, 2622, -472, -960, -370, 244], [27973, 490, 5819, 1728, -1608, -840, -2219], [19103, 17135, -225, 578, 499, 1055, 863], [-24280, -564, 5748, 2466, -63, -155, -1352], [22979, 1902, -10328, -1002, -2050, 374, -2555], [-2486, -9612, -586, -1338, -1466, -502, -1916], [-51724, 18164, -3343, 990, 806, 828, 222], [-67385, -19212, -951, 190, 1082, -310, -771], [-37874, 10002, -4586, -1946, -950, 218, 592], [-2901, 702, 3368, 1168, 1427, -1954, -173], [31026, -13964, 3348, 528, -42, 412, 2394]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_616_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_616_4_a_k();".
// 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_616_4_a_k(:prec:=7)
    chi := MakeCharacter_616_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_616_4_a_k();".
// 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_616_4_a_k( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_616_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![18816, -34432, -6504, 5172, 354, -144, -3, 1]>,<5,R![-7697280, -3193632, -41856, 72712, 2820, -468, -11, 1]>],Snew);
    return Vf;
end function;