
// Make newform 1620.4.a.j in Magma, downloaded from the LMFDB on 14 January 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_1620_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_1620_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_1620_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 := [-19148, 8656, 4412, -212, -151, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [56542, -1458, -2017, 272, 15, -2], [-92054, 15216, 10079, -1429, -195, 19], [-8714, 10056, 1409, -439, -30, 4], [15298, -5826, -967, 230, 15, -2], [-1024, -2822, -18, 129, 4, -1]];
    Rf_basisdens := [1, 2520, 2520, 420, 252, 84];
    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_1620_a();"
function MakeCharacter_1620_a()
    N := 1620;
    order := 1;
    char_gens := [811, 1541, 1297];
    v := [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_1620_a_Hecke(Kf)
    return MakeCharacter_1620_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, 0, 0, 0, 0], [5, 0, 0, 0, 0, 0], [2, 1, 0, 0, 0, 0], [0, 0, -1, 0, -1, 1], [-14, 2, 1, -1, 0, -1], [-2, -5, -1, 3, 0, 0], [-19, 0, 0, -2, 3, -1], [-5, -7, 2, 1, 0, -1], [-28, 0, 3, -4, 2, 3], [-54, -5, 6, 5, 1, 2], [-82, -5, 5, 1, -4, -2], [-52, -2, -10, -3, 4, 0], [-26, -7, -9, 1, 2, -5], [-77, -10, -3, -4, -2, -8], [-169, -8, 7, 6, 6, -5], [-168, 16, 10, -13, -5, -2], [6, 2, -14, 0, -4, 12], [24, 24, -2, 12, -10, 2], [-202, 12, 5, 14, -17, 13], [-150, 49, 7, -31, -4, 16], [-156, 4, 32, -26, 6, -4], [-48, -23, -5, 17, 16, -5], [20, 14, -25, -10, 4, -7], [-198, 27, 13, -19, -16, 4], [-262, 22, -11, 0, -18, 19], [186, 4, 13, 61, 14, -11], [-460, -4, -12, -14, 14, 4], [-206, -55, -6, -33, -4, -11], [-424, 27, -9, 5, 20, -24], [622, 33, -4, -68, 28, -32], [-356, -86, -40, 23, -3, 0], [-764, 26, -20, -4, 8, 30], [129, -50, 12, 104, 1, -9], [-1090, 2, 20, 46, -8, 14], [404, 47, 24, -67, -3, 22], [-232, -43, 40, 118, 28, -21], [-60, 55, -13, -55, -48, 49], [-1296, 59, 1, -35, -2, -21], [-715, 71, -14, 39, -18, -39], [160, -42, -112, 49, -9, 28], [62, 25, 70, -103, -8, -19], [-1130, -106, -31, -18, 3, -31], [-866, 77, -37, 135, -32, -4], [-1815, 11, 8, -9, -46, -1], [710, 20, 26, -118, -22, 28], [-49, -22, 26, 212, -7, -17], [512, 136, 2, -110, -88, 54], [-486, -5, 21, 3, -6, 11], [-112, -44, 80, 180, -40, 60], [-2566, 135, 23, -75, 16, 64], [-1644, -124, -40, -34, 38, 20], [152, 37, 28, 3, -14, -55], [-1312, -186, 19, 145, 54, -7], [-1602, -210, -134, 90, 52, -52], [-1215, -1, -94, 43, 20, 77], [-2394, -90, 65, 86, 2, -17], [-342, 130, -104, -178, 8, 58], [300, -71, 84, 34, 28, 35], [-1396, 230, 49, -269, 72, 3], [-398, -74, -56, 340, -6, 58], [-1961, -18, -137, -124, -22, -7], [1166, -63, 111, -31, -30, 39], [412, 206, 53, 138, -87, -25], [-4766, 130, 90, -92, 68, 24], [-3391, -66, 37, -104, -66, -37], [1360, -113, 18, -261, 107, -122], [3398, -152, -122, 164, -68, -82], [-182, 17, 241, -49, 134, -33], [652, 79, 178, 9, 72, -37], [-2998, -49, 77, 351, -128, 86], [-236, 330, 33, -118, 1, -21], [604, -144, -64, -86, -110, -56], [-3906, 213, 121, -189, 92, 40], [-3195, 331, 32, -171, -24, -29], [-1291, 237, -42, -159, -82, 33], [982, 34, -112, -4, 216, -54], [2996, 340, -202, -228, -40, 102], [-3108, -440, 123, 269, 72, -37], [1123, 1, -210, -65, 50, 195], [2424, 350, -200, -68, -92, 12], [3214, 19, -140, 295, -60, 5], [-306, -44, 129, 8, 33, 65], [-4100, -424, 66, 76, -28, -50], [4220, 639, 48, -427, 81, -30], [3914, -323, -57, 731, 8, -67], [-4504, -60, 268, -161, -60, -40], [2672, -9, -123, 215, -108, 24], [-1752, -312, 69, -124, -102, 21], [-4606, -140, 175, 43, -182, -81], [6794, 199, -169, -315, 58, 9], [4534, -234, -55, -52, -111, 49], [806, -58, 143, 249, 92, -197], [3928, -316, -342, 373, 193, -26], [-693, 336, 340, -86, 89, -283], [7212, 374, -338, -330, 40, 102], [3602, 268, -4, 36, -152, 96], [5780, -850, -157, 673, -272, 77], [-7282, 584, 30, -200, 120, 40], [5506, -467, 80, 407, 352, -149], [3510, 490, 166, -300, 296, -68], [-261, -177, -30, 291, 126, -267], [9556, 61, 177, -437, -80, -7], [-1152, 300, -394, -237, -28, -62], [3224, 241, -216, -379, 135, 36], [-270, -307, 157, 203, -100, -42], [8576, 137, -181, -167, 88, 203], [-2020, 194, -26, -364, 288, -336], [2930, -632, 281, 362, 259, 45], [5403, 26, 218, 410, 228, 56], [5352, 949, 21, -647, 94, 81], [-6162, 478, -143, 219, -424, 391], [5332, 840, -98, -282, -184, -226], [-6377, 443, -202, -239, -416, -61], [10804, -557, -108, 1023, -265, -102], [-756, 32, -297, -840, -192, -17], [-11766, -621, -707, -193, 290, -163], [5924, -428, -270, 388, -130, -94], [-2206, 692, 186, -1096, 236, -170], [16672, -360, -37, 39, -48, -227], [7496, -239, 66, -899, 12, 125], [-6608, -464, 216, 970, -4, 172], [-1171, 405, 564, -939, 182, -207], [18578, 144, 270, -264, 140, -48], [383, 411, 222, -399, -432, 147], [-1860, 1028, -379, 286, 254, 185], [128, -882, -240, 1232, 72, 26], [12394, -1238, -299, 1012, -439, 265], [1170, -522, 247, -307, -220, 83], [-13244, 666, 248, -1162, -464, 10], [1668, -1029, -458, 1063, -85, 338], [9144, 359, -27, -1123, 90, -113], [6230, -986, 212, -42, -280, 58], [4062, -538, 217, 151, 368, -33], [-10496, -98, 422, 921, -408, 144], [4516, 827, -188, -1707, 210, -277], [244, -203, 239, -493, -516, 72], [6178, -415, -445, -89, -344, 143], [7854, -1500, 14, 756, 572, -2], [-6012, 344, -486, -153, -96, -302], [9712, 1213, 418, 25, -87, -134], [10384, 518, -243, -1628, 178, -269], [-12264, 482, 414, -476, 238, 90], [11582, -1040, 184, -90, 708, -338], [3086, -65, 70, 33, -272, 39], [908, -508, -379, -446, 49, 527], [-8290, 309, -663, 979, 156, -204], [-12594, 1078, 152, -1406, -28, -138], [360, 97, 492, -99, 343, 252], [-5987, -520, 335, -666, 156, 284], [5226, -578, 379, -551, 8, 305], [244, -1546, 25, 470, 152, 315], [-15156, 231, 253, 219, 152, -497], [13535, -200, -189, 606, 746, -166], [22770, 304, -316, -156, -222, 350], [1876, 124, 445, -1616, 11, 31], [-120, -513, -26, 643, 197, -208], [2152, 330, 1427, 70, -84, 169], [352, 214, 1172, 218, -380, 298], [2156, -72, 540, 2142, 20, -156], [4878, -248, 878, 178, -154, -480], [-6366, 744, 136, -1650, 148, -436], [15248, 601, 939, 277, 96, -481], [-5312, -606, 848, 655, -387, -476], [-18674, 688, -710, 272, -460, 154], [15124, 129, -37, 1887, 150, 277], [15108, -799, 592, 569, 341, 426], [-996, -1689, 178, 1274, 452, 83], [1469, -334, 6, -602, 504, 376], [2675, -584, -1197, -394, -1186, 479], [-2796, 2092, 256, -993, 541, -260], [26130, 315, -368, -543, 284, -175], [-14756, 208, 123, 1120, 229, -655], [-28866, 1660, -446, 338, -448, 782], [-12226, -112, -964, 744, -610, 154], [5720, 1166, -150, 5, 356, 892], [15891, 859, 114, -455, 304, -37], [2582, -34, 465, 898, 350, -137], [-16124, 404, 22, 366, 228, -958], [3734, -229, 118, 543, -1184, 435], [14524, 2665, 69, -2567, 122, -543], [25408, -722, 83, -1559, 222, -783], [-17004, 429, -1364, 236, -628, 755], [-8814, -1130, 208, 1256, 940, -710], [13953, 866, 19, -2644, -74, 432], [-18248, 514, -175, -264, -1302, 579], [-7086, 12, -917, -1325, 128, -529], [-28686, 1081, 455, -1121, -396, 7], [5179, -402, 554, 902, -44, -516], [-10546, 408, 298, 464, 924, -160], [-15202, -1242, -810, -286, 624, -148], [-5326, -367, 147, 3123, -532, 301], [10104, 2164, 406, -2164, 242, -130], [-31316, 996, 343, -2878, 542, 371], [-15904, -187, -955, 427, -200, 89], [-41940, 1041, 1043, -1539, 284, 94], [9789, -2402, -232, 1498, -204, 470], [-21596, -1793, 1236, 1170, 356, -263], [-20478, 491, 283, -2153, 1288, 60], [10459, 945, 1056, -147, -266, -279], [-19924, -2078, 465, 572, -646, -493], [38132, 745, -632, -2043, 25, 162], [-9444, 2275, -1084, -328, 348, -247], [-6325, 2764, -696, -360, 324, 488], [1188, 1150, -1260, 1104, -264, 164], [-8035, -1805, -336, 439, 914, -949], [322, -747, 1172, 841, -737, 192], [10924, 1804, -786, -2562, 556, -274], [-48208, -304, 38, -168, -452, 110], [7056, -1796, 380, 2200, 1260, -620], [19322, -518, -14, -1434, 592, -520], [-34534, -836, -269, 1290, 642, -425], [-20522, -36, -25, -1335, 160, -185], [18590, 830, 122, -888, -728, 1268], [8454, -366, -847, 1274, -445, -383], [28307, -1496, -594, 656, 552, -1030], [19516, -1852, 468, 1470, -22, -884], [14592, 686, -1001, -2138, -776, 729], [-17533, 1873, 1926, -1599, -172, 251], [-7102, -662, -70, -2222, 64, 60], [21582, 507, 22, 2383, -1420, -17], [5146, 1215, -832, 1203, 421, -200], [-26824, -1590, -1406, 2685, -504, 944], [-32874, 1824, -635, -989, -604, 293], [25236, 261, 1203, 1019, -894, 687], [23466, 437, -816, 543, -668, 687], [-37442, 1184, -200, 2156, 980, -1008], [-5528, -2242, 1504, 1564, -64, -192], [22830, -443, 728, -1578, -330, 472], [-14644, -1672, 501, -2207, 356, -137], [5888, 361, 456, 1732, -12, 843], [-15023, -456, 98, -2478, 685, -203], [7980, 1250, 272, -194, 978, 632], [-748, 2188, -579, -149, -832, -79], [-10064, 580, -788, -808, -36, -1000], [-41147, -1035, -1516, -627, 1020, -1085], [6601, 742, 870, 1138, 8, 124], [22392, 893, -2379, -1649, 528, 946], [12004, 586, 811, -629, 740, 133], [-33734, -3564, -1915, 1220, 393, 385], [32214, -1609, 185, 3075, 1634, -301], [9037, -3537, 452, -1099, -692, -713], [-17718, -2965, -1706, 1064, 578, -270], [7180, -312, -166, -1410, 1144, -422], [-7574, 1438, 1536, -2242, -44, -562], [-16428, 784, -1413, -68, -555, 857], [26266, -2109, 212, 1478, -1430, 108], [-43740, -18, -25, 2571, -448, 1129], [-12223, 892, 746, 2270, -739, 777], [-9392, 4209, -135, -1629, -800, -993], [9506, -3249, -1263, 2313, 60, 618], [12632, 2662, 394, -2403, 300, -524], [6384, 3021, -2527, 403, 632, 451], [7911, -1116, 1522, 160, 752, -1246], [-58549, -3384, 2169, 3650, 242, 201], [-37228, 1336, 2187, -669, 272, 161], [36486, 1691, 2560, -1109, 836, -687], [32392, -2376, -1162, 2508, -194, 1330], [15059, 2758, 549, 3160, -1570, -1], [-15198, -1767, -1271, 1187, -1204, 74], [-16798, -3531, -330, 308, -582, 134], [-19482, 3779, 33, -1271, -612, -701], [39966, -1301, -1382, 1377, 140, -893], [-21470, 574, 2627, -1011, 1096, 661], [22574, -3861, -813, 2361, 224, -552], [-9107, 2706, 536, -844, 217, 1435], [5034, -622, 1084, -1190, -560, 54], [-24100, -646, -1426, -1173, -1472, 1124], [-21152, -108, -256, 668, -2108, 112], [-21139, 175, -910, -2397, 142, -207], [35288, -2585, -1380, 749, 1344, -1563], [43996, 2878, -1706, -2210, -1056, 1178], [-12816, -1014, -2204, 404, -1240, 1754], [-35434, 399, -504, -1463, 783, -72], [-15062, -1826, 1510, 850, 360, 820], [-39940, 779, 147, 1519, 1806, -869], [-18994, -1454, -1848, 2408, 830, -742], [12316, -305, 2062, -287, 1200, -1217], [-7705, -1073, 2822, -387, -670, -507], [-44, 388, -1617, -3585, 1048, 221], [-17853, 1592, 703, -1990, 934, 282], [6898, -216, -250, -2026, -386, 52], [11265, 1589, 2228, -555, 272, 515], [13378, 2796, -1012, -1314, -596, -1196], [33010, -447, 1613, -1447, 16, 565], [35912, 686, -3375, -932, -85, -617], [-6514, -3619, 413, 2193, -1144, -1190], [3075, 340, 2393, -3302, 218, -423], [-28938, 3637, 1126, -1205, -1069, 202], [-17716, 3578, -692, -1286, -1236, 690], [52946, 840, 2135, -1216, 1582, -1577], [17410, 2862, 950, -3744, 1032, -656], [23340, -3421, -121, -459, 1868, -856], [16784, -4386, 1317, 1750, -841, -1137], [13392, 2193, -1052, 2052, -1420, -373], [-28250, 1842, 1319, 1438, 486, 1225], [896, -1143, -1188, 711, -1557, 1142], [6756, -4975, -1179, 2879, -1872, 382], [77324, -2204, -364, 2679, 565, 648], [22886, -3236, -956, 3456, -1190, -414], [-6982, -5666, -1772, 1180, -1472, 306], [-20989, -5240, -365, 3098, 1542, -1157], [-65290, -4087, 526, 3939, 715, -366], [-19252, 2948, -2212, 446, -1958, 1772], [-30877, 2134, 1538, -2808, -1015, -773], [-27954, 4625, -1093, 217, 804, 1100], [37072, -4011, -107, 4201, -2014, 1781], [37206, 545, -1772, -1519, -2236, 759], [17862, -2718, -1221, 1588, -1185, 1191], [-27184, -170, 106, 2882, -32, -1512], [34696, -2496, -3114, 456, -518, -1650], [64514, 2426, 1099, -1194, 1038, -435], [30228, 3864, 1106, -547, -604, 466], [-1598, 1677, 599, -3559, 1630, 651], [4336, -2001, 3829, -731, -910, 407], [-2377, 4322, 604, -246, -1112, -390], [-1328, 216, 1890, -2269, -245, -1722], [-83560, 3768, 499, -1706, 147, -523], [25594, 5671, -1667, -4051, -168, 1468], [51892, 560, 1299, -152, 448, -1733], [23445, 2407, 1072, 5913, -220, 43], [-55220, -1105, -1673, -1965, 792, -766], [62920, 658, 5245, -2290, 1718, -2969], [47712, -3935, -153, 6089, -1064, 551], [24, 5238, 2280, -1344, 336, 438], [-17755, 358, 644, 3890, -1936, 2758], [-15680, -1179, 2060, 425, -1565, 1180], [13438, -1032, 2, 5174, 466, 2236], [-40507, -2383, 2838, 3393, 1646, -215], [-41595, 1611, -2038, -1965, -442, -2795], [9818, -3651, 1890, -707, 1368, -1491], [35145, -2496, -1557, 150, -978, -45], [-31324, -10931, -752, 4087, 355, -1378], [33574, 1561, -2495, -4205, 1454, 379], [43747, 3618, 1688, -2536, 547, 973], [-5730, 3309, 1737, -5031, -504, -1449], [26572, -5431, 1100, 3699, -356, -193], [7024, 2756, 2050, 1660, -376, -1446], [26617, -2134, 816, 398, 164, 2146], [-25462, 840, 1263, 3281, -396, -3321], [65848, 3063, 2732, -1426, -404, -1299], [-16076, 670, -608, -1186, -2320, 970], [30538, 6948, 2779, -590, 398, 1391], [-19370, -2186, 1394, 3030, 874, -992], [77747, 5078, 3121, -2664, -2082, 1731], [34472, -6424, -1878, 4786, 572, -794], [-15822, -75, -2822, 1493, 1616, -1915], [2174, 2393, 2689, 3971, -830, -879], [-13612, 5192, 67, 2556, -195, 1161], [107327, -227, -900, 3045, 1982, -103], [9413, 1876, -1974, -1630, -879, 2457], [-22272, -890, -3640, 1636, -1104, 1538], [-13610, -2244, -2334, -3506, 1552, -2394], [26178, 3606, -77, 1627, -1150, 647], [5708, -4611, -324, -1219, 1272, 2535], [29502, -2062, 4174, -1586, 3196, -2292], [31972, -4586, 843, 148, 1681, -1159], [75948, 2334, -488, -1143, -2813, 1880], [63046, 3150, 1374, -1418, -1244, 2364], [-13827, -151, -4746, -1335, 1134, 2173], [-2936, 5118, 1250, -194, -2144, 1668], [108936, -412, 1050, 2393, 1200, 94], [-44855, -3684, -4157, -3454, 464, 104], [-21040, -2680, -1448, -1621, 1617, 1848], [35408, -4841, -1709, -1345, -374, -963], [-26006, 316, 2804, -3286, -572, -560], [21449, 6939, -3916, -1157, -2294, 31], [19476, -2003, -763, 5549, 6, 1661], [-48327, -7780, -696, 3704, 1288, 540], [39584, 4382, -384, 1765, -49, -1220], [-86649, 577, -1250, -5733, 1202, 2231], [-129397, -1933, -2348, 1587, -420, 1161], [114538, -1644, -373, 2582, 2154, -401], [-26384, 1291, -2652, -5979, -931, -1826], [-42640, 1833, 192, 3448, -2700, 443], [9144, 3716, -3076, -2393, 113, -700], [-100478, -4228, 2667, 90, 1213, -437], [15388, -103, 1999, 1373, -3228, 1652], [86792, -868, 1449, -6696, 20, -419], [-100408, -613, -1173, -3409, -312, 502], [-26680, -9918, 418, 5524, -660, -1324], [14250, -3150, -1612, 2628, 3788, -1658], [57298, 1207, 592, 4478, -1890, 1208], [57606, -6150, 2338, -894, -860, -1360], [-18248, -1187, -6786, 1001, -2455, 3706], [-86365, -2362, 435, 4284, 8, -434], [-7340, -3024, -5530, 2552, 2362, -1754], [-89114, -4178, -605, 1159, -216, 2237], [-8310, 6613, 431, -7377, -1116, 2111], [-28241, -5371, -1658, -119, -1456, 2223], [37522, -2462, -1172, 1314, -768, -2102], [12347, 1133, -2196, -4071, 1166, -1907], [-31484, 2652, -898, 6386, 876, -1490], [88090, 133, -687, 4823, -814, -555], [-17800, 6, -1159, 3950, -2303, 2311], [48170, -2533, 1551, 3527, 888, -62], [-74790, 2761, -34, 1885, -1179, 1102], [-23452, 5530, 3131, -1285, 3652, -1287], [-5347, 3287, -362, -4171, 2062, 633], [43642, -3284, 4691, -1766, 846, -1833], [26674, -3357, 1754, 3937, 2836, -2141], [-17140, -6028, -2678, -182, 3504, -1578], [39210, 3130, 2091, -4345, -1274, 3047], [8668, 179, 1301, -4573, 276, 3206], [28580, 5960, -2385, -5918, -2890, 1975], [-40894, -264, 5268, 3244, -2418, -2922], [-48152, 5175, -2626, -4054, -2060, 1851], [-44652, 3178, -4301, 4427, -332, 121], [53212, -2319, 5333, 1205, 3238, -1409], [54920, 1640, -43, -3596, -3263, 2483], [52446, -545, 1389, -4453, 2836, -2056], [32574, -642, -1366, -3310, -760, 3304], [16004, -8673, 1441, 8069, 2106, -5095], [-77837, 6036, -2680, 3174, -4631, 1897], [-129952, -2918, -2394, 2878, 2904, -2904], [-36944, 3838, -3612, -5070, -1172, 386], [-82134, -7060, 3929, 9064, -859, -1411], [-92144, -4734, 2138, 2148, 1066, -2010], [29140, -2313, 1247, 2873, 1044, -2588], [-39348, -2974, 860, 4654, -1030, -3052], [-40780, 6084, -2622, 2300, -1948, -1290], [-36072, -1417, -994, -576, 3900, -1621], [-54101, 3785, -1136, 7721, 2, 2013], [87516, 6664, -842, -1815, -431, -2], [78708, -4407, -1325, -931, 2684, 1712], [9547, -3210, -3509, -2628, 770, -3775], [-2936, 10079, 1855, -10331, -4348, 3195], [-102336, -3402, 2603, -3581, 2564, -155], [-117156, -597, 322, -9681, 1571, -94], [-92616, 5272, -284, -1916, -1784, -2780]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1620_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1620_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_1620_4_a_j(:prec:=6)
    chi := MakeCharacter_1620_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_1620_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_1620_4_a_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1620_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<7,R![330100, -606480, 67668, 7784, -663, -12, 1]>,<11,R![-1558917900, 69128640, 6699969, -60480, -5826, 0, 1]>],Snew);
    return Vf;
end function;