
// Make newform 616.4.a.j in Magma, downloaded from the LMFDB on 14 January 2025.
// 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_j();".
// 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_j();".
// 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 := [320, -1496, -2452, 4790, -10, -145, 0, 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], [-43900, -44544, 196706, -2300, -5961, 14, 41], [-151252, -44544, 199262, -2300, -5961, 14, 41], [236, -49036, -266094, 6032, 8391, -34, -59], [-14161, -4906, 37663, -357, -1151, 1, 8], [23451, 81040, -109000, -580, 3318, 6, -23]];
    Rf_basisdens := [1, 1, 2556, 2556, 2556, 213, 639];
    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], [1, 0, -1, 0, 0, 0, 0], [-7, 0, 0, 0, 0, 0, 0], [-11, 0, 0, 0, 0, 0, 0], [13, -1, -2, 0, 0, 0, -1], [19, -6, -2, 0, 1, 0, 0], [2, -1, 1, 1, -1, -1, 2], [5, 2, 2, 0, 0, -2, -1], [70, -13, -5, 0, -1, 0, 0], [6, -6, 2, -2, 1, 0, -3], [18, -18, -2, -4, 6, 1, 1], [33, -13, 1, -4, -2, 2, 2], [65, -13, 6, -1, 3, -2, -7], [105, 5, 8, 7, -4, -5, 3], [-21, 30, 4, -12, 2, -1, -4], [250, 13, 7, 15, -4, 1, 7], [99, 33, -11, 3, -2, 3, -2], [163, 12, -10, 8, 2, -2, 7], [-133, 50, -1, -9, -4, -3, -10], [145, 43, 8, -7, 14, -5, -7], [107, -10, -34, 4, -8, 5, 8], [114, -20, 23, 4, -2, 6, -3], [-77, 1, -12, -23, 19, 9, -12], [429, 1, 2, -15, -15, -1, -8], [445, 142, 16, 15, -3, -3, 18], [-267, 93, -51, -16, 14, -2, 0], [-370, -29, -2, -29, 17, -3, -27], [334, 87, 3, -10, 11, 4, 2], [377, -30, 75, 11, -6, 3, -6], [-376, -122, -33, 1, 10, -1, 31], [636, 100, 39, 20, -8, -4, -9], [392, -168, -30, -18, 24, 19, 9], [278, -6, 23, 16, -16, -4, 17], [462, -49, -29, 44, -19, -22, 0], [197, 4, -153, 31, -10, 2, 7], [461, 122, 107, 12, -26, -8, -42], [-658, -74, 58, -6, -16, 2, -24], [-28, 16, 56, -6, 44, 8, -26], [-181, 17, -1, -53, 16, -33, -30], [-729, 112, 92, -8, 8, 24, 21], [615, 220, -7, 8, -22, -10, 0], [-527, -116, -29, 61, -44, 3, 28], [368, -471, -71, -18, 7, -14, 12], [90, 152, 125, 41, 4, -15, 17], [-1871, 255, 3, -8, 20, 10, 0], [198, 119, -120, 17, 5, -13, 11], [-36, -114, 19, 9, 9, -23, -78], [294, -25, 7, -21, -23, -39, 18], [-29, 206, -107, 46, 4, 12, 38], [-260, -131, -120, -55, -23, -9, -5], [-1154, -177, -85, 42, 25, -30, 32], [111, 163, 53, -40, 38, 6, -56], [1512, -107, 153, 19, 38, 33, 21], [-1812, 474, -62, 64, 26, -10, 4], [174, 449, 78, 23, -53, -11, 35], [1388, 675, 59, 61, 3, -11, 74], [-962, -113, -26, 1, 43, 15, -45], [-54, 505, 125, -64, 75, 12, -74], [-1728, -195, -84, -27, 33, -19, -35], [-906, -169, -251, 41, -91, 7, 52], [3371, -134, -303, 44, -7, -18, 25], [762, -392, 73, -66, -60, -2, 55], [61, -229, -39, -52, 64, 22, 6], [-951, 437, 202, 133, -81, -53, 54], [-155, 100, -84, -60, 68, 48, -159], [-2985, 404, -14, 90, -20, 52, 9], [-3080, 193, 183, 52, -27, 58, 46], [-1247, 122, 302, -130, 80, 81, -80], [471, 653, 305, -95, 34, -23, -94], [759, 281, 232, 33, -77, -35, -24], [1633, -27, 67, 84, -91, -45, -84], [-4684, -562, -190, -76, 23, 78, -31], [-994, 430, 327, 105, -86, -9, 111], [-1571, 564, -272, -66, 26, 60, 167], [2230, -370, 201, 105, -25, 117, 180], [561, 464, 202, 36, -72, -80, -41], [-2752, -307, 315, 23, -1, -75, -96], [594, -306, -89, -97, 74, 75, -203], [2429, 127, -64, -165, 66, 49, -51], [8265, -70, -286, -111, -63, -17, -102], [-3519, -548, -112, -130, 76, -21, -94], [4519, 534, 381, 3, 56, -26, 17], [2073, 351, 314, 279, -21, -39, 46], [-1610, 431, 82, -123, 111, 21, -147], [3129, 46, -564, -58, 34, 32, 51], [2130, 42, -226, 80, -62, 13, 41], [-3764, -306, -303, 103, -182, -53, 197], [3945, 753, -160, -232, 44, 24, -111], [-4843, 298, 13, -31, -92, -79, -108], [8024, 533, -44, -24, 40, 28, -160], [1280, 133, 90, 37, -123, -3, -43], [187, 1026, -14, -36, -140, -24, 155], [9549, 265, 350, 159, -95, -28, 53], [-5270, 426, 362, -214, 148, 54, -188], [4974, -605, -66, -151, -53, 3, -49], [811, -732, 155, 174, -58, -40, -34], [-3267, -49, 6, -105, -33, 17, 146], [1692, 608, 455, 52, -20, -58, 117], [3616, 395, 589, 76, 21, -26, -108], [-1664, -278, 290, -144, 134, -36, -92], [4992, -1405, 149, -228, -87, 32, -142], [9040, -383, 655, -25, 97, 137, -68], [3016, 1391, 139, 114, -29, 96, 20], [6024, -460, -274, 130, 96, 26, 98], [-1811, -943, 804, -239, 41, -65, -158], [7751, 370, 312, -73, 43, 41, -76], [5211, -528, -421, 241, -73, -27, 335], [-226, 1624, 211, -187, 146, 125, -97], [5103, -589, 649, -202, 22, 212, 60], [1456, 904, 290, 58, -160, -76, -172], [7948, -1414, 269, -195, 108, -1, -223], [1063, -558, 245, 281, -190, 8, 53], [2918, 217, -72, -280, -80, 68, 70], [-1207, -32, -25, 593, -464, -15, 238], [1498, -1004, -821, -183, 28, 102, 152], [4116, 1031, 69, 9, 96, 35, 207], [384, -192, 56, -434, 31, 68, -137], [-5095, -1104, 1148, 194, -164, 88, 199], [11257, -1670, 80, 24, 4, 55, 34], [-129, -1484, -229, 80, -132, 22, -96], [9344, 147, -610, 145, 19, -27, -103], [-6001, -855, -406, 538, -78, -126, -145], [2192, 806, 88, 370, 78, -74, 18], [4090, -1823, -278, -322, 126, -6, -10], [-7938, 952, 397, -511, 6, -31, -285], [-9179, 222, -398, -34, -170, -220, 359], [2354, -1220, -1011, 143, 45, 11, 134], [-11994, 204, -108, -14, 183, 84, 233], [-699, -1536, 549, 438, -13, -20, 109], [10270, -990, -690, -16, -342, 20, 126], [-7878, 1808, -119, 13, 212, 51, -291], [-10659, -2128, -892, -340, 106, 128, -235], [-3136, -1380, -978, 408, -132, -86, 346], [1887, -726, 242, -216, 47, -340, -138], [5933, 1600, 1115, -9, -33, 151, -127], [5762, -2271, -337, -235, 85, -53, -404], [-14728, -1682, 247, -114, 92, -112, -63], [829, -2496, 173, -112, 92, -52, -86], [-3944, 1658, -671, -477, 66, 53, 127], [-1730, -1295, 579, -7, 43, 313, 46], [34, 914, 203, 111, -106, 291, -39], [-7315, -120, -821, -399, 316, 53, -26], [6249, -1201, 514, -415, -101, 252, -423], [-547, 344, -911, 110, -112, -298, 110], [17882, 570, -605, 163, 127, -197, 222], [-2185, -1614, 514, -85, 81, -91, -454], [5651, 1079, 146, -147, 10, 187, -135], [-11540, 2573, 653, -1, -478, -215, -75], [-5102, -1588, -1039, 431, -104, -163, 185], [6954, 2486, 1013, 383, 68, -187, 183], [-5063, 777, 1148, -183, 133, -53, -234], [-2288, 1272, -250, 178, -108, 386, 22], [10170, 1384, -868, -94, 286, 56, -462], [-14860, 1052, -186, -128, -50, -234, -506], [14640, -4716, -190, -222, -86, 20, 146], [-24232, 469, -664, 17, 79, 191, 63], [-5738, 268, 450, 24, -314, 246, 86], [17649, -2134, -239, -195, -119, -223, -123], [10615, 1012, 407, 1152, -333, -42, 461], [-17873, -1384, -1372, -232, 240, 140, 137], [6130, -1474, 476, 142, -146, 192, 824], [-15281, -1129, 793, 24, -257, -13, 118], [13678, -603, 648, -316, 44, 220, -274], [-637, 1838, 1110, -360, 38, 154, -515], [-7548, 978, -1586, 46, 39, 176, -235], [-28476, 408, 363, 213, -262, 71, -45], [5759, -906, -1831, 176, 63, 190, 403], [9480, 565, -1459, -90, -65, 188, 210], [-6287, 1534, 849, -362, 4, -54, 178], [16780, 623, -1074, -581, 501, 261, -325], [14902, -655, -1185, 235, -241, 119, 420], [-8717, 418, -232, 766, 60, -361, 46], [14228, 261, -1514, -205, -303, 235, 347], [-12342, -978, 345, 281, 389, 389, 274], [-6257, -4015, 398, 611, -51, 275, 496], [-10337, 4061, -1726, -273, 165, -174, 9], [1594, 148, 1212, -200, 592, 157, -667], [-3518, 469, 238, -197, -379, -21, 407], [12243, -2535, 928, -122, -146, -94, 273], [-5164, -764, 344, 960, -476, -288, 624], [8976, -5448, -887, -848, 450, 0, -125], [-12761, -2668, -2928, 26, -228, 28, -343], [7507, 2772, -1657, -163, 477, 201, -275], [6125, 2246, 1112, 274, -178, -40, 7], [8616, 269, -481, -77, 281, -365, -324], [3606, 2081, 2103, -176, 43, 476, -12], [-11789, -2262, -975, 430, -367, -146, 141], [26478, -1012, -490, -58, -226, -98, -252], [-790, -2896, -2196, -1086, 324, 194, -386], [-7853, -487, 1682, -733, 605, 243, -520], [8798, 1985, -1184, 347, -125, -115, 629], [-3597, -912, -2812, -566, 210, -36, -695], [-24658, 1937, -527, -603, 247, 9, 406], [-14883, 1166, 1510, -668, 264, -101, -696], [21951, -1225, 2430, 129, -427, -403, -412], [31172, 712, -1867, -175, 290, 119, 211], [11242, -3294, 1292, -402, -22, 95, 143], [-7357, -2807, -1009, 342, -6, -176, -138], [31232, 1023, 354, 501, -369, 91, 545], [27954, 3568, 637, 11, -116, 135, 317], [-11948, -2593, 1718, -377, 169, 29, -601], [-10206, 419, 517, 281, -217, 355, -164], [-15843, 1916, 1282, -288, 85, 492, -334], [9526, 3127, 311, -291, -160, -201, 719], [8227, -1268, 13, -374, 124, -112, -178], [26738, -400, 2916, 54, -95, 260, -361], [-1814, -235, -1010, -1149, 459, 409, 379], [12266, 1966, 951, -727, 550, 311, -117], [-983, -2028, -1081, -92, 601, -340, 621], [12314, 2126, 2641, 187, 4, 131, -159], [-15399, -1310, 793, 712, -12, -108, 626], [-817, -2320, -844, 92, -348, -378, 479], [28113, -986, -903, -98, 927, 62, 201], [24522, -1488, -1726, 530, -606, 358, 1186], [2333, 4943, 1976, -135, -99, 127, 282], [6359, -149, 934, 1273, -641, -594, 793], [26611, -844, -4349, 723, 319, 175, 775], [19934, -4902, -1243, 217, -740, -339, 107], [1833, -1242, 448, -544, 70, 578, -403], [-7654, 429, -623, -16, 821, 342, -30], [-7282, -884, 1564, -240, 262, 306, -310], [11614, -796, -302, -1034, 808, 89, -175], [13263, 2602, 4002, 176, 526, -220, -339], [-21872, 2096, -259, 826, -324, -16, -645], [-12142, -3406, 767, 53, 216, 659, 509], [9130, 178, -3438, -700, -420, -234, -912], [14840, 4178, -1322, -520, 582, -316, -52], [3204, -3551, 642, 531, 485, 555, 105], [11921, -395, 782, 293, 189, 868, -489], [5278, 1422, -1018, -1232, 746, 639, 107], [-2626, -3063, -1393, -2089, 495, 467, -766], [-10968, -3507, 1196, 673, 59, 103, -25], [-11704, 2432, -922, -210, 248, 506, -420], [-13564, -1059, 1587, 123, -70, -91, 811], [-9670, 5878, -62, -88, 804, 270, -310], [-17655, 3497, -2544, 1151, -551, -559, 782], [4904, 1802, 1575, -477, -542, -167, 77], [18997, 3844, 594, -260, -38, -42, 1133], [-2032, 1394, 683, -903, 191, 289, -416], [-24277, 36, 1278, 496, -574, 116, 973], [6558, -3828, -393, -1012, -166, -432, -33], [679, 1509, 888, -1547, 566, 249, 259], [-1416, 2150, -754, -1294, 882, 299, -277], [-27935, -3348, 627, 709, 405, 9, -421], [34412, 337, -3194, 37, -425, 69, -317], [-35773, 3401, 76, -215, 370, -595, -1641], [6157, -5978, 1136, 1241, -1223, -489, 572], [8334, -1336, 116, -300, -48, 4, -1558], [18362, 436, -338, -786, 184, -518, -328], [28854, 7942, 13, 1031, -434, 525, 897], [-1701, -411, -4644, 555, -372, 709, 1053], [-12935, -5452, 1161, 1247, -1014, 395, 986], [-49076, -2624, -126, -330, 416, 104, -62], [-24079, -1194, -1549, 694, -1035, -4, 933], [4986, -263, 998, 713, 327, -377, -121], [6191, 1784, -1398, 1402, 160, 621, 376], [-27816, 310, -2909, 120, 96, 266, -55], [-56657, 4388, -1363, -846, 824, 280, 46], [-30769, -383, 3743, -808, 1744, 242, -892], [-34263, 5480, 449, -75, 770, 718, 103], [13556, 3215, -1948, 251, 601, -199, -159], [47753, -869, 294, 986, -834, -630, -67], [23111, -3244, 1967, 396, -323, 150, -97], [-20228, 4622, -3082, 1486, -806, -128, 236], [4563, 2230, -912, -405, 1103, 785, -424], [-19244, -1948, 3342, 436, 276, -121, 71], [-24905, 13133, 1986, 1439, -1283, 111, 1356], [23635, 3596, 866, -22, -474, 139, -886], [-36722, 5059, -819, -34, -305, 192, 1660], [-10743, -6202, 823, 272, -574, 176, -226], [-40617, -4580, -2966, -1596, 162, -60, -567], [-22248, -1070, 980, -854, 1636, 406, 950], [24078, -1603, 2967, -12, -389, -76, 34], [-40499, 3667, 556, 1461, -1762, -253, 949], [-3056, 1430, 105, 251, 1617, 211, -268], [-26057, 12442, -4, 270, 458, 508, 433], [24536, -2848, 363, 859, -1588, -731, 243], [70050, 1780, 2225, -71, 212, 405, -1003], [37222, -1284, -283, 722, -198, -692, 859], [-33912, 2139, 534, -1127, 69, 335, 159], [-31337, -682, -3341, -957, -276, -683, -70], [-12728, 1802, -1630, 1298, 12, 94, 1426], [-20315, -516, 2679, -932, 1173, 370, -1315], [-2048, 2886, -677, 2206, -440, -912, 569], [-14859, 4050, -2624, -186, -212, -798, 559], [-37873, -3966, -1018, -544, 194, 447, 442], [-37994, -2575, 3439, 986, -905, -1016, 490], [-18070, 3084, 697, 355, 1543, -281, -80], [-33451, -6771, -1914, -255, -26, 167, -1201], [13372, 1602, -2334, 1170, -770, -1285, 511], [-7341, -5966, 1318, 295, -77, 49, -290], [9942, -1572, 2583, -177, -566, 1275, 409], [-20924, 2347, -287, 1061, 51, 183, 112], [52914, 709, -2767, -580, 703, 242, -960], [-44109, 4985, 4760, -1112, -828, 16, 343], [7836, 5682, 876, -3006, 181, 372, 133], [8011, 908, 3945, 1680, -1038, -1046, -1056], [29164, 5116, -1897, -2114, 958, 384, -949], [-37130, 5700, 975, -946, 2066, 892, -1135], [69213, -4225, -2493, 2686, -1532, -864, 1878], [-6494, -4049, -3823, 416, -465, -38, -2084], [-3533, 2851, -3336, 775, 539, 226, 1777], [-24090, -10060, 1792, -418, 506, -246, -792], [-339, 4986, 2402, 466, 1636, -32, -265], [-26588, 6882, 1694, 212, -574, 47, 1021], [-55807, -1584, -1664, 520, 64, 1016, 751], [6243, 2940, -2751, -1166, 708, 212, -90], [44956, 6248, 984, -1164, -244, 996, 520], [22924, -5125, -129, -352, -291, 586, 706], [14820, 11067, 5032, 251, -935, -501, -1069], [20428, -7650, -4872, 680, -998, -490, 558], [-30592, 4960, 1600, -1176, 1546, 576, 1480], [33989, 3584, 522, 58, 448, 1008, -565], [-2495, 3777, 886, 1075, 177, 212, -1271], [1099, 1998, -1469, -61, -995, -757, -1251], [30394, -1671, 1402, 756, -604, 64, -632], [-44082, 7124, 5580, -780, 216, 908, -42], [-29168, 8288, 3284, 892, -850, 332, 1488], [70656, 1250, -5176, -466, 1616, 358, 234], [-2186, -4062, 3531, 1200, -978, -1100, -969], [14767, 1528, 442, -2690, 2964, 452, -1805], [-25109, -461, 1361, -611, 464, -427, 312], [5079, -3520, 2221, -2357, 296, -377, 562], [-11530, 3414, 3575, 417, -1414, -803, 393], [21267, 15609, 5012, -1205, -337, -33, -1268], [9345, 6590, 330, -458, -988, -108, -173], [-27374, -4597, -116, -1446, 462, -1578, 64], [-43131, -5184, -689, -809, 562, 318, -2353], [9334, 13018, 1911, 1125, 1040, 357, -389], [24786, 10791, -823, -732, -1947, -988, 812], [-12777, -8856, -706, 182, 1216, -15, 564], [30306, -6257, -986, -497, -455, -383, 685], [-68650, 6702, 243, -384, 1440, 800, 1593], [73199, 677, 684, 4085, -1203, 12, 2455], [-44696, -3875, -429, 435, 590, 597, 411], [-18310, 5994, 2516, 826, -466, 1061, 861], [11133, -5076, -327, 23, -1263, -889, -547], [5471, -757, -3292, -401, -959, 87, -1230], [-21066, 11868, 1616, 1586, -1418, -38, 12], [45475, 5478, 2070, 1972, 602, 558, -1075], [21070, -2908, -4377, -1131, 1036, -394, -356], [6787, 5317, 7183, -73, -172, -229, 190], [-13435, -19188, 749, 2367, -1212, 11, 1624], [32923, -5402, -430, -950, -1802, 74, 411], [-4792, 225, 614, -677, -729, 313, 1705], [-38151, -10862, -6285, -236, -236, -92, 96], [30827, 8286, 3840, -1884, 1208, 608, -1279], [-3332, 485, -7610, 1955, -1881, -551, 1369], [-21143, -9054, 2757, -596, 1036, 156, -1990], [6324, 7392, 3629, -144, -394, -936, -793], [37066, -2186, 2646, -1996, 70, 137, 533], [3508, 966, -2204, 1362, -998, 180, 582], [29900, -4087, 530, 13, -63, -1085, -1757], [5462, 4366, -1061, 803, -1374, -339, -465], [57923, -9752, -455, -1765, 1525, 147, 283], [34926, 2062, 1539, 847, 1497, 351, 880], [-71770, -8701, -3573, 79, -499, -301, 16], [-4280, 1005, 3126, -593, -817, 169, -941], [35027, -4830, -2778, 104, -434, 852, 109], [-808, -588, 83, -627, -492, -741, -113], [-22499, 6948, 6553, -1901, 433, 539, 157], [-26919, 472, 340, 1776, -340, 56, 11], [12189, 4162, 1562, 44, 4, -415, -1658], [7386, -2921, -4165, -2783, 1728, 551, -1341], [6666, 1782, -75, 1573, -282, 792, 1518], [34371, -8463, 1847, 951, -1848, -241, -594], [46886, 5757, 1385, -1426, -693, 1526, 916], [67844, 5759, 631, -2082, 1557, -80, -730], [-89113, 1558, 5918, -746, -868, 288, -491], [18417, -3610, -5437, 1938, -1469, -486, 2311], [-1692, -4770, 868, 3702, -1018, -1890, -366], [14196, -5, 163, 3546, -1075, -1220, 1894], [-23464, -16495, 946, -1945, 1959, 717, -2223], [3940, -212, 4372, 106, 156, -705, 1311], [-18549, -9816, 2830, -3667, 1509, -237, -2392], [54213, -805, 1281, 120, 503, 957, 2218], [219, 11493, 3812, -4445, 682, 829, -425], [-9987, -5066, -298, -1216, 1077, -1136, -2782], [-51223, 7331, -4196, 1103, 940, 1437, -501], [39906, -2665, 1395, -1107, 2065, 1569, -1230], [-3884, 12072, -51, -1537, 1048, -462, -2366], [-11895, -18141, 1296, 1255, -1529, -220, -1399], [31588, 19299, -2514, 989, -883, 373, 1119], [-70904, 6641, 2945, -3747, 1949, 1771, -1346], [-3132, -2630, -2219, 2783, -3271, -13, -208], [-28422, 18080, 4435, 1141, 64, 195, 1139], [40209, -2926, -715, -284, 610, 1288, 1152], [-258, 4980, 10378, 2088, 724, 180, 984], [-20844, 8676, 895, 1293, -2313, -451, 1168], [31342, -16096, 2829, -649, -348, -170, 1880], [-47517, 964, -525, -796, -1514, -402, 3742], [-3953, -1072, 3644, 506, -146, -2132, -527], [-7698, 2847, 438, 2598, -1326, -462, 226], [-8311, 1688, 7342, -1010, -972, -1194, -803], [30722, 2670, -3138, -616, -192, -78, -2440], [17330, 13532, -1270, 1888, 858, 668, 2306], [46244, -7692, 5370, 1056, 2128, 966, -786], [-100522, 4512, 5282, -1960, 434, -872, -3858], [-62508, -10811, -5015, -26, -1947, 610, 670], [32841, 3041, 124, 1982, 640, -46, 1221], [5665, -13940, 6972, -1512, -316, 640, -2435], [-4848, 17816, 474, 1078, 480, 1126, -1902], [78836, 14788, 3420, 738, -232, -1120, 2072], [-72611, 20834, -1292, 937, -383, -153, 298], [-49340, 15431, -2966, 571, 1277, 731, 1113], [-40190, 10064, 2182, 2818, -1104, -1350, -390], [-58498, -4915, -2057, -3684, 559, 868, -2504], [-63935, -3826, 6806, 513, -523, 899, 806], [90004, 4511, -4004, 2664, -1460, 1644, 2624], [-13551, 2354, 2883, -1569, 1781, 639, -1817], [-108476, 3264, 3419, 341, 2374, 347, -423], [-53378, 386, -3916, 786, 618, 1624, -1434], [-47351, -10190, -482, 3096, -1632, -291, 282], [29032, -2535, -4830, 367, 1657, 473, 2221], [40873, -5010, -7485, -2572, 1422, 964, 462], [18340, 8822, -3398, 1452, 1642, -20, -412], [23046, -13930, -3323, -1107, 71, -647, -664], [-82476, -9382, 2892, 1596, -942, -778, 1442], [-8614, 7918, 5472, 3786, -974, 702, 2600], [-22997, -6996, -6688, 602, -288, 594, 1183], [-15019, -13400, -7239, 2974, -1805, -1320, 1453], [-46454, -13358, 1729, -1415, 2420, -239, -1697], [-27310, -4244, -4997, -462, -1856, -1616, 1675], [95024, -8738, -2550, 226, 1078, -1620, -3168], [-104273, -16336, -3003, 22, 1006, 1192, -876], [-22387, -3626, -11830, -1550, 1696, 660, 495], [10320, 914, 2458, 1436, -284, -1166, 198], [60028, -13619, -6167, 279, 1428, 685, 763], [-27780, -3997, -6740, 2149, -469, 1435, 1331]];
    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_j();".
// 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_j(: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_j();".
// 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_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_616_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![-320, -1496, 2452, 4790, 10, -145, 0, 1]>,<5,R![-14549536, -6037280, -111752, 107076, 2228, -591, -6, 1]>],Snew);
    return Vf;
end function;