
// Make newform 60.7.k.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_60_k();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_60_k_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_60_7_k_a();".
// 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_60_7_k_a();".
// 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 := [14400, 0, 136704, 0, 84208, 0, 17520, 0, 1601, 0, 66, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -2087592, 0, -1142320, 0, -259203, 0, -26441, 0, -1185, 0, -19], [49000320, 135927072, 63616800, 99384168, 15253200, 19233252, 1638420, 1528575, 79560, 53586, 1380, 687], [49000320, -135927072, 63616800, -99384168, 15253200, -19233252, 1638420, -1528575, 79560, -53586, 1380, -687], [-145394880, -133704120, 392658240, -113809904, 154179840, -21572817, 18298680, -1891927, 860340, -77103, 13980, -1169], [-888773760, 829363416, 1591415280, 697709584, 436005720, 132806541, 35573670, 11695295, 1177020, 478023, 13950, 7261], [-2593618560, -3929581896, -3284498880, -1821510184, -1082540160, -277362471, -131727960, -20154950, -6587100, -737763, -114660, -10756], [-97761600, 1711375944, 239129280, 306902128, 210216960, -45632625, 33422760, -10996579, 1813500, -645879, 31860, -11789], [408193920, 6410120592, -956517120, 726646856, -840867840, -275044314, -133691040, -53619731, -7254000, -3057288, -127440, -55495], [479429760, -71868720, 991660800, -248168232, 343351040, -77814706, 41472000, -9175341, 2037360, -452244, 34800, -7777], [-11332494720, -36650106048, -15850954080, -25991693624, -4138804080, -5862158304, -399910140, -565989601, -16328520, -24313458, -239580, -380345], [12686186880, -31409051712, 12095572320, -26129803960, 3129513840, -6303562608, 314017020, -632679041, 13258440, -27822210, 199260, -441529]];
    Rf_basisdens := [1, 659520, 3810560, 3810560, 2857920, 8573760, 8573760, 8573760, 17147520, 1905280, 34295040, 34295040];
    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_60_k();"
function MakeCharacter_60_k()
    N := 60;
    order := 4;
    char_gens := [31, 41, 37];
    v := [4, 4, 3];
    // 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_60_k_Hecke();"
function MakeCharacter_60_k_Hecke(Kf)
    N := 60;
    order := 4;
    char_gens := [31, 41, 37];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
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 := 7;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [26, -4, 1, 2, -1, 0, 0, 0, 0, 0, 0, 0], [10, 10, -1, -6, 1, 0, 0, 0, 1, 0, 0, -1], [-269, -2, -11, -11, -5, -2, -1, -2, -1, 1, -2, 2], [-167, 171, 28, 0, 6, -3, 0, -4, -2, 10, 7, -5], [-447, -469, 2, -38, -14, -6, -10, 2, -13, 0, 5, -17], [16, -2096, 6, -16, -16, -5, 4, -10, -11, 4, -22, -22], [-1938, 1964, 4, 8, -6, -9, 0, -34, -13, 60, 6, -30], [25, -7767, 314, -396, 2, -41, 50, -20, 16, 50, -30, -30], [-10506, -84, 263, 343, -55, -44, -62, -29, -22, 62, 51, -51], [23651, 23537, -100, 16, -64, -82, 50, -156, 43, 0, -25, -83], [-26820, 88, 828, 670, 30, 9, 64, 76, -15, -64, -82, 82], [-5332, 5376, 198, -174, 246, -72, 0, 130, -22, -160, -52, 80], [31556, 31922, 290, -356, 56, 173, 20, 234, -107, 0, -10, 412], [-33795, 33445, -5717, 325, -315, 390, 0, 25, 175, -480, 120, 240], [-597, -5660, -2944, 3450, -114, 253, -533, 1335, 344, -533, -141, -141], [66652, 18, 8118, 7520, -920, -281, 594, 236, 295, -594, -362, 362], [63648, 62196, -758, 936, -254, -506, -440, -2148, 32, 0, 220, 158], [17140, 350, 11348, 11272, 1060, 312, -390, 46, -428, 390, -30, 30], [-26455, 26315, -11804, -1086, 780, -1476, 0, 1226, 70, 640, 154, -320], [1854, 74212, -8345, 6657, 1789, -844, -234, -3575, -1010, -234, -133, -133], [159042, -157696, -17481, 573, 179, 711, 0, -1919, -673, 1070, -59, -535], [382, -73322, -10742, 10084, -1904, -329, 2088, -290, -53, 2088, -474, -474], [-261779, -264323, -440, -25592, -3684, -2062, 1580, -4116, -832, 0, -790, 342], [170123, -943, 26574, 28838, -850, 189, 256, -972, 1388, -256, 1292, -1292], [465506, -464578, -33382, -639, -588, -165, 0, -289, -464, -20, -2165, 10], [-161484, -162328, -797, -46687, 1823, 513, -1870, -1001, 375, 0, 935, 295], [-106, 225372, -38102, 34510, 818, -1796, 1436, 1550, 1902, 1436, -1338, -1338], [-495507, 492611, -58352, -1302, -2614, -3265, 0, 4198, 1448, 1030, -505, -515], [595966, 600682, 1709, -29174, 6067, 3888, -3060, 10404, 649, 0, 1530, -2449], [246867, 4660, 97819, 93151, 1425, 2326, 3325, 98, 991, -3325, -4570, 4570], [248371, 249997, -3048, -18436, 2144, -452, 2530, -1576, 3861, 0, -1265, -1111], [-8674, 276256, -52360, 60418, -3414, 4029, -3406, 16110, 4645, -3406, 1238, 1238], [-2571, -1426113, -44310, 38162, 10744, -3074, -1674, 2220, 5645, -1674, 2922, 2922], [-1622730, 5580, 39056, 41814, 2090, 6959, 3150, -8678, 4529, -3150, -5920, 5920], [314521, 331987, 8956, -90608, 5620, 7288, 2890, 15744, -223, 0, -1445, 9233], [879228, -891064, -72540, 5782, -26484, -1226, 0, 6054, 5918, 2180, -7776, -1090], [431568, 420106, -1666, -73494, -12956, -7311, 3160, -13588, -4065, 0, -1580, -1120], [-2132493, 2132469, -23021, -4079, -7861, -4501, 0, 4103, 12, 820, -11506, -410], [12813, -446980, -81912, 61362, 142, -10275, 8237, -13455, -2538, 8237, -12171, -12171], [-1144060, 6882, 25928, 31044, 38340, 9440, -10544, 8916, -7986, 10544, 14032, -14032], [-315326, -16444, -20776, -40668, -28040, -26390, -6702, 18038, -16648, 6702, -1854, 1854], [500935, -473455, -51796, -2542, 5580, 2408, 0, -24938, -13740, 17580, -15652, -8790], [-3336701, -3352247, 8169, 158481, -12055, -1943, -11660, -17149, -15942, 0, 5830, 15602], [-5534, 1706400, 81812, -91530, -5458, -4859, 17314, 8930, 10393, 17314, 2138, 2138], [407870, -12516, -266658, -239788, -26220, 919, 7202, -20856, 20637, -7202, 6014, -6014], [4605166, -4642418, 372130, 10729, -22488, -3767, 0, 26523, 18626, -8260, 21363, 4130], [-4617068, -4580716, 3770, 148274, 21882, 12826, 10700, 53938, 14406, 0, -5350, -19166], [1146, 5927196, 81176, -62066, 21954, 9555, -30246, -13110, -10701, -30246, 10818, 10818], [-4458219, 4469927, 329844, -1122, 16862, 5427, 0, -10586, -5854, -1390, 3337, 695], [-19544, -3313570, 8726, 14054, -3926, 11390, 7534, 12700, 8154, 7534, 26388, 26388], [1086088, 5436, -64730, -135194, -11550, -29796, -2652, 45390, -37884, 2652, -25074, 25074], [4921963, 51030, -589255, -652595, 83635, 19360, 17215, 62130, -14455, -17215, -1210, 1210], [-7837619, -7833373, -9692, 292808, 23068, 6688, -9130, -13116, 11815, 0, 4565, 12235], [-12133602, 12120616, 308998, 3286, -57204, 17793, 0, 9700, 6493, -42000, -61932, 21000], [-34355, -9358893, 412422, -323718, -34544, 44352, -32950, 47500, -9997, -32950, 21210, 21210], [-923306, -37596, -678760, -607006, -66530, -1719, 6742, -56350, 42619, -6742, 15404, -15404], [11432173, 11414191, -7466, 1196698, -12166, -9816, 1650, -9198, -1525, 0, -825, -17075], [1924616, -56790, -676314, -564716, -14560, -991, -43930, -56508, 11869, 43930, 55090, -55090], [6734352, -6759656, 1323754, -8460, 294, -38802, 0, 33764, 12652, 35380, 34828, -17690], [-11581785, 11495555, 687725, 21743, -122625, -12712, 0, 64487, 43115, -17320, -23312, 8660], [3189228, 3037236, -30690, -66230, -60462, -45576, -60840, -145818, -45306, 0, 30420, -6444], [-87916, -56194, -868582, -758162, 20390, -984, -63062, -40704, -7852, 63062, 69716, -69716], [3935431, -3843523, -276364, -18166, 44532, -35572, 0, -73742, -45954, 126720, -2182, -63360], [-4004667, -3954999, -53737, 670471, 65485, 5874, 37920, 50927, 78571, 0, -18960, -73956], [-434788, -94176, -248756, -229890, -108110, -84743, -53328, 8048, -43895, 53328, 26914, -26914], [7766585, 7725245, 44930, 432464, -121410, -38240, 35140, 25500, -65600, 0, -17570, -39480], [-19079876, -19141752, -39034, -451094, 65898, 13432, -88740, -13754, 8096, 0, 44370, -42786], [-56232, 19891114, 220096, -69070, -45894, 75513, -19818, 27150, -19281, -19818, 85314, 85314], [-18280041, 18224593, -401596, 38978, -50002, -37861, 0, 16470, 27724, 98230, 93539, -49115], [67770, -19277842, -1598854, 1546346, 88638, -26254, -42400, -129270, -41516, -42400, -6270, -6270], [4559202, 4723614, -30701, -1842562, 236993, 103146, -41880, 116208, 112907, 0, 20940, 38443], [14372299, -14460407, -1930818, 10184, 64308, 49265, 0, 77924, 44054, -166270, 79465, 83135], [-127942, 10648508, -1255136, 1386358, -19690, 65611, -52798, 197150, 62331, -52798, 58734, 58734], [-27144714, 27032512, 521340, -6498, -138518, 20151, 0, 118700, 56101, -165500, -115564, 82750], [-80793, 3483195, 505750, -565714, 221652, -29982, 2208, -2310, 110775, 2208, 163896, 163896], [9810863, 10237961, 158578, 797612, 117750, 138164, 150770, 336552, 54971, 0, -75385, 173739], [27388866, -247170, 2661650, 2757670, -392070, -199160, -37890, -31640, 10120, 37890, 64380, -64380], [-29614, 25828886, 561124, -391018, -285462, 85053, 27674, 146910, -55439, 27674, -87682, -87682], [-53017, -40010894, -1751976, 1625658, 128530, -63159, -94123, 197945, 116176, -94123, -91911, -91911], [-17379030, 177204, 2795444, 2459550, 15850, 9257, 133022, 130358, -34925, -133022, -205536, 205536], [18812558, 56278, 1526032, 1418616, 487940, 2570, -134976, 347824, -188684, 134976, 240408, -240408], [22466685, -22355825, -2050016, -61212, 9060, -140802, 0, -49648, -55430, 270040, -27992, -135020], [-26898, 8695584, -2814076, 3135410, -313766, 160667, 91398, -45170, -133769, 91398, 98966, 98966], [-33407880, 33330740, -295758, -60674, -64370, -193874, 0, 137814, 38570, 189260, 46726, -94630], [320594, -29881468, 137492, -353716, -64480, -108112, 130176, -490660, -212482, 130176, -150528, -150528], [-3377177, -3598409, -87716, -1521508, -68516, -78116, -65000, -72708, -22900, 0, 32500, -203740], [13991761, -42371, 4510980, 4643384, 39940, 23831, -87298, -95020, -21096, 87298, 37384, -37384], [1088930, -1041830, -1233590, 57183, -17280, -56667, 0, -104283, -23550, 274800, 130203, -137400], [-30705944, -30730608, 197047, -3535811, -233081, -18017, 11370, 209319, -209379, 0, -5685, -42621], [-5148, -74517014, -3625242, 3574514, -120594, -25364, -10442, 192060, 30512, -10442, -181764, -181764], [33105246, 33028242, 132129, -3796046, -251673, -59772, 42540, 102924, -170631, 0, -21270, -69069], [26092429, -266332, -1033207, -479455, -565265, 10544, 85179, -501174, 362055, -85179, 52578, -52578], [212176, 23691432, -3811994, 3226964, 418764, -292515, 220084, -478170, 80339, 220084, 53818, 53818], [-72761514, 73238892, -1778156, -298638, 728142, -104079, 0, -178740, -238689, 88260, -3744, -44130], [-266247, -46483529, 1676010, -989476, -191322, 343267, -134528, 171810, -77020, -134528, 360684, 360684], [-19481008, 500766, 1828788, 984328, 567680, 78536, 5948, 416556, -416282, -5948, -427904, 427904], [3152168, -3288804, -251494, -467004, 184386, -475812, 0, 603640, 68318, -119020, -205492, 59510], [64232368, 93066, 4016270, 4123686, -148590, 146774, 255808, -186330, 309516, -255808, -78914, 78914], [39437712, 39442764, -177888, -1180972, -303920, -240904, 486860, -776352, 180414, 0, -243430, 360086], [1304243, 1726541, 450915, 6466067, 303583, 377249, -332200, 1245037, -239766, 0, 166100, -205724], [46525836, -47466348, 3843202, 537366, -1291158, 251100, 0, 403146, 470256, -367980, 2730, 183990], [-263144, -11714444, 3754400, -3624532, -57544, 64934, -117066, 571030, 198210, -117066, -44742, -44742], [42879280, 14112, -721548, -1181990, -43090, -216109, 126156, 515284, -104065, -126156, 54842, -54842], [7369555, 6992275, -266646, 5994832, -7674, -137160, -102960, -976860, 78006, 0, 51480, 384414], [-14013028, -13598176, 80801, -4524069, 241781, 161291, 92270, -112707, 126625, 0, -46135, 562225], [-25234797, 26340821, -1310606, -425468, 1608316, 43169, 0, -680556, -553012, 168750, 161199, -84375], [-407098, -75187390, 2245900, -2541724, 238392, -147912, 39168, 832460, 555010, 39168, -18264, -18264], [50162418, -272820, -581824, -426946, -782750, -195381, -110690, -502678, -33251, 110690, -347800, 347800], [-9933870, -9942870, 135627, -261478, -76467, 29580, -68160, 623880, -140127, 0, 34080, -463173], [-5309111, 5338743, 6887974, -57282, 345228, -253071, 0, 27650, -14816, 421210, 468919, -210605], [-70997127, -71071149, -190610, 4702278, 44438, -73086, 72150, -305618, 153599, 0, -36075, 4911], [550442, 57936256, -2779968, 2487278, -37882, -146345, 49838, -820150, -404097, 49838, -280734, -280734], [-3623618, 119472, -12316009, -12412029, 29805, 71462, 75166, -37953, 27156, -75166, -133973, 133973], [97339134, -396940, -3579446, -3586684, -109320, -400559, -346390, 345408, -350009, 346390, 338170, -338170], [88344592, -87288856, 10126374, -356224, 1103454, 101804, 0, -699512, -527868, 139680, -238666, -69840], [89187868, 88582706, 298754, 3724036, -567096, -134171, -336820, 579802, -601335, 0, 168410, -717800], [92963211, -93827763, 4823477, 221567, -1449503, -577609, 0, 642985, 432276, 733800, 3516, -366900], [43979, 145136772, 5678308, -6047890, -141982, -184791, 230251, 193355, 140812, 230251, -281313, -281313], [-51410372, -736890, -4765618, -3706912, -481240, -207537, -501370, -567536, 27983, 501370, 491170, -491170], [-66917427, 65942491, 7469552, 390524, -1323444, -223234, 0, 584412, 487468, 252580, 168306, -126290], [-44517317, -44866509, 108327, 1274247, -1219819, -555746, 762300, -1777633, -282923, 0, -381150, 1155618], [112114290, -111110360, 314849, -587637, 531145, 67503, 0, -416293, -501965, -306350, -1213597, 153175], [182687268, 256872, -6111842, -6314316, 1360380, 155635, -247624, 801486, -348861, 247624, 599012, -599012], [-128940269, 509779, -5988208, -7205398, 1257910, -98816, 91952, 1547494, -516643, -91952, 330304, -330304], [-720318, -47858444, 4448902, -4350292, -1016472, 49305, 568338, 1790160, 671013, 568338, -349524, -349524], [826912, 111875064, -1162196, 905000, 1041064, -128598, -272512, -2165180, -698314, -272512, 511356, 511356], [-13429458, -12195366, 1009773, 1289442, 1095019, 1052396, -870700, 2298228, -392727, 0, 435350, 380987], [-125529397, 124520261, -6374988, 893910, -1781634, 407637, 0, 115226, 504568, -36590, 103117, 18295], [258156, 47539624, 2004684, -583378, 63518, 710653, -940176, -1060960, -968809, -940176, 544648, 544648], [104163438, -105763704, 16008832, -44422, -744194, -798365, 0, 1644688, 800133, -92380, 765460, 46190], [-68270398, 1550208, -7636755, -8266947, 2329355, 1235112, 338834, 197965, 23738, -338834, -432227, 432227], [41188997, 42808379, 107054, -7389698, 251558, 179306, 1260770, 819258, 702637, 0, -630385, 276793], [-157802028, 367966, -7152748, -7007536, -1447560, 440572, 1241548, -1087156, 1314154, -1241548, -941944, 941944], [-1057214, -170424812, 1479076, 863874, -572546, 1171475, -974606, 1318630, -114261, -974606, 795798, 795798], [80214837, -78244941, -442519, -1209329, 3586409, -651071, 0, -760567, -984948, 853380, 833874, -426690], [-157620980, -158546780, 204498, 6245588, -117818, 43340, -1012480, -837300, -667398, 0, 506240, 622238], [89153997, 88136469, -1567997, -17713813, 1628549, 30276, -1078080, -702377, 1059233, 0, 539040, -1344108], [551006, 513110196, -4948670, 4892248, 575976, -28211, -183506, -1438060, -522795, -183506, 336048, 336048], [44896630, -203808, 11851188, 11918534, -105910, -170135, -482954, -248594, -449281, 482954, -181248, 181248], [-205129279, -1386269, 1446318, 3982528, 10760, -118164, -710862, -463774, 557243, 710862, 2072436, -2072436], [-123788002, 124416326, -4557422, 485893, 250656, 576385, 0, -1114217, -314162, 447340, 331895, -223670], [170724904, 171885688, 846224, -4769820, -993960, -73868, 1308520, 1233376, -265832, 0, -654260, 119372], [900014, -318637400, -3400270, 1854442, 428694, -772914, 731636, -1414530, -127100, 731636, -385498, -385498], [469862, 144444486, -2198690, 3701006, -1331518, 751158, -833972, -276550, -1221020, -833972, -663174, -663174], [-18199947, 19975551, -2336870, -511106, 889236, -474269, 0, -1264498, -887802, 1701930, -546509, -850965], [-76457585, -77723195, 1020090, 1020686, -996190, 11950, -1289510, 292670, -1652895, 0, 644755, 106565], [1445090, 220187780, -2909116, -1465426, 1470982, -2187271, 1306610, -1293230, 742181, 1306610, -1596950, -1596950], [-27999690, 29442800, -29878878, -84686, 534280, 417569, 0, -1358424, -721555, 438600, -774216, -219300], [-113831263, -115941781, -600040, -18095364, -1786568, -1193304, 276090, -1722852, -455219, 0, -138045, -1125751], [221887570, 1159066, 5972616, 5463450, 3528970, 904483, -839212, 880792, -1093795, 839212, 371626, -371626], [-5748660, 5896120, -18078168, -640546, 1544640, -1118926, 0, 493086, -73730, 1104220, 1308744, -552110], [208051288, 208177306, -718720, -13437076, -1454442, -1086581, 2299180, -2846798, 781729, 0, -1149590, 1104506], [-115733028, -118200456, -1565542, 6106710, -1920346, -1742944, 1018460, -5219382, 331828, 0, -509230, 677182], [-536182682, 235946, 18634362, 18270994, -20150, 54262, 344148, 215474, 162464, -344148, -147894, 147894], [-448742, -25224212, -3461747, 2760447, -628733, -350650, 2222842, 4675, 799392, 2222842, 892809, 892809], [-1407922, 386175488, -10989764, 9942800, 1542396, -523482, -316308, 2636720, 1931404, -316308, 179124, 179124], [146423931, 144370707, -1003384, -325220, 2130700, 563658, -3180540, -830016, -23228, 0, 1590270, -636322], [453300655, -303423, 15885982, 17864990, 262870, 686081, -750224, -1859516, 239280, 750224, 119492, -119492], [95469640, 99646340, 628636, -18495052, 2077024, 1352830, 1471040, 3976620, 1459714, 0, -735520, 93196], [430362069, -430869317, -6900324, 1156026, 1604518, 1822827, 0, -648778, 253624, -1840850, 2347367, 920425], [-264355938, -260967066, 91229, 5215430, -332017, -120394, 3629660, 1021668, 1603207, 0, -1814830, 643603], [-545559167, 1851746, 15505275, 12968111, 2256985, 583164, 1652373, 2743030, 383791, -1652373, 205866, -205866], [-24907057, -22601059, 1915320, 5641672, 1559008, 1737164, -1168330, 1399012, -762321, 0, 584165, 3406471], [-283940394, 283047672, -35985800, -875138, 1072622, -1199769, 0, 1767860, 446361, -243460, 968476, 121730], [468553738, 662508, 30428532, 31075866, 3252870, 986175, -627246, 653274, -303579, 627246, 1300608, -1300608], [136874445, 135041415, 1559750, -30683148, -2180030, -310140, -1212750, -3066840, -2476265, 0, 606375, 3399935]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_60_k_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_60_7_k_a();".
// 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_60_7_k_a(:prec:=12)
    chi := MakeCharacter_60_k();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 7));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 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_60_7_k_a();".
// 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_60_7_k_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_60_k();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,7,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;