
// Make newform 627.4.a.c in Magma, downloaded from the LMFDB on 06 February 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_627_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_627_4_a_c();".
// 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_627_4_a_c();".
// 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 := [-216, 7896, 21298, -4725, -10579, 424, 1335, -11, -63, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0], [-13, 0, 1, 0, 0, 0, 0, 0, 0, 0], [-16261016, 38034608, 35322602, -15586719, -8637956, 1557316, 543763, -48022, -9729, 353], [163634088, 79576816, -100717726, -31933143, -7445932, 473332, 1515811, 77026, -42113, -1519], [256280952, 133139984, -166906074, -105914197, 16258732, 18048588, -656311, -1018266, 9453, 17939], [-5852184, 45643072, 17683618, -29944231, -4642364, 4220724, 327587, -216318, -6961, 3697], [197129944, 847351568, -168892098, -441653689, 13813324, 54422956, -273587, -2474562, -1839, 37823], [-246289656, -1276889552, 168713562, 629171701, -11226236, -81959484, -172057, 4013018, 18611, -65987], [254221592, 1599814224, -159627154, -733273297, 10752652, 90885708, -66331, -4270546, -7927, 67719]];
    Rf_basisdens := [1, 1, 1, 2577760, 10311040, 10311040, 1288880, 10311040, 10311040, 10311040];
    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_627_a();"
function MakeCharacter_627_a()
    N := 627;
    order := 1;
    char_gens := [419, 343, 496];
    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_627_a_Hecke(Kf)
    return MakeCharacter_627_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, -1, 0, 0, 0, 0, 0, 0, 0, 0], [-3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 0, 0, 0, 0, 0, 0, 1, 0, 0], [-3, -1, 0, 0, 0, 0, 0, 0, -1, -1], [11, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-11, 1, -2, 1, 0, -1, 1, 0, 2, 0], [-14, 0, 0, -2, 1, 1, 0, 0, 1, -1], [-19, 0, 0, 0, 0, 0, 0, 0, 0, 0], [14, 7, -1, -1, -3, 1, 0, -4, 1, 2], [-1, 29, -6, -1, -4, -1, 7, -3, -2, 2], [3, 32, -7, -3, 3, -1, -2, -4, 4, 7], [-15, -3, -6, 1, -5, 4, -7, 4, -1, 5], [-32, 30, 16, -9, -1, 2, -5, 1, 0, -6], [-110, -27, 11, -1, -3, 1, 8, 5, -5, -6], [-66, 53, -1, -6, 6, 3, -3, -3, 7, 0], [3, 15, 4, 13, 5, -6, -7, -23, -13, -11], [95, 19, -2, 24, 16, 2, -14, -4, 9, 9], [-135, -35, 0, 16, -1, -5, -4, -18, -10, 8], [33, 36, 13, -5, -9, 11, 6, 29, 8, -17], [113, 38, 9, 0, 5, 4, 17, 0, -9, 18], [-223, 72, 1, -28, -11, -2, 1, -22, 29, 18], [-168, -47, 9, -32, -12, 5, -9, 17, -3, -12], [-306, -45, -9, 24, -7, -14, -7, -6, 30, 15], [35, 75, 46, -7, -4, -15, -17, -31, -2, 0], [-298, -179, 21, 17, 2, 10, -10, -11, 10, -15], [-331, -130, 1, -4, -20, -7, 11, -21, -20, -25], [72, -36, -4, -6, 31, -27, 0, -25, -17, 27], [98, 35, 29, 4, -6, -1, 17, -28, -1, 14], [171, -204, 5, 11, 5, 27, -40, 26, -38, -15], [75, -13, 12, -4, 17, 39, 12, 6, -12, -12], [-297, -50, 15, -6, -11, 16, -3, -43, 25, 4], [-264, -48, -20, 30, 40, -50, -2, -38, 26, 6], [-301, -269, 26, 49, 39, -70, -19, -83, -9, 43], [-32, 74, -4, 22, 1, -7, 72, 34, 63, -5], [-59, -103, -56, 33, 6, 19, 9, -60, -44, -28], [-281, 250, -33, -41, 0, -28, 16, 64, 9, 62], [-862, 80, -86, -37, -11, -20, 49, 61, 32, 2], [-245, -257, 86, 28, 2, -48, -94, -50, 9, 57], [-60, 71, -93, -118, -39, 82, 17, 74, 0, -41], [-496, -55, -13, 111, 31, -43, 82, 1, -53, -42], [1124, -65, 5, -3, 6, -8, -58, 13, 40, 145], [206, -39, 109, -39, 24, -16, -50, 40, 22, 23], [715, -220, -31, 39, 11, 21, -14, 86, 0, -59], [420, -184, 84, 82, 57, -3, -36, -130, -35, -43], [-243, 35, -62, -100, -37, -7, 16, 107, 82, 66], [-990, -191, 123, 113, -51, -31, -40, 107, -55, -56], [-24, -317, 51, -14, -3, -10, 45, -50, 4, 71], [-1046, 85, -59, -39, -65, -15, 76, 112, 97, 110], [27, -99, 86, -27, -48, -61, 21, 31, -108, -130], [-1521, -110, -59, 63, -16, -106, 18, -53, 11, -26], [-1003, -165, -328, -7, 77, -14, -125, -173, 59, 117], [-281, 220, -145, 158, 35, -100, -5, -13, -67, 48], [15, -97, 104, -112, 41, -29, 166, 78, 46, 78], [431, -327, -64, 144, -19, -25, -88, 0, 66, -58], [-687, -20, -49, 83, 35, -61, -88, 15, -54, -197], [2097, -302, 49, -161, -99, 61, 74, 16, 42, -39], [347, 152, 207, -197, -60, 102, 76, 169, 23, 30], [830, -2, 74, -19, -13, 82, -125, -307, 38, 74], [-2288, 61, -103, 22, -124, 93, 33, 144, 11, -46], [24, -7, -203, 212, 203, -54, -153, -272, -86, 17], [-2946, -189, -125, 8, 83, 70, -161, 242, -54, -25], [-788, -390, 2, -36, 61, -23, 180, 84, 69, 47], [967, 469, -38, 59, 97, -32, 185, 93, 141, 109], [2095, -219, 216, -49, -108, -27, -21, -52, -60, 50], [-1334, 1152, 194, -14, 99, 19, 10, -48, -41, 25], [516, -91, -225, 80, -197, -36, 3, 40, 20, 17], [-1112, -227, 321, -55, 39, -45, -62, 265, -141, -44], [-1702, -246, -392, -86, 173, 73, 88, -74, 15, 47], [-2281, 314, -103, -225, -188, 166, 250, 195, 55, -168], [-2811, 588, -61, 9, 37, 29, 42, 415, 122, -7], [-1577, 929, 10, -250, 42, 16, 86, -92, 209, 477], [1259, -81, -362, -180, 99, 147, 254, 161, 172, 80], [363, -268, -17, 177, 51, 235, -172, 285, -114, -241], [-2543, 424, -217, -110, 176, -1, 125, 147, 192, -41], [637, -138, 87, 163, 7, 29, 52, -33, -234, -29], [-1226, -392, 196, -115, 112, -141, 295, -221, 111, 171], [500, 707, 203, -10, -132, -27, -171, -7, 39, 102], [-3862, 225, -63, 58, 105, 50, -33, -232, 226, 459], [1774, -167, 339, 134, 30, -27, -1, -18, -245, -258], [-2186, -256, 368, -214, -228, 120, 100, 36, -304, -144], [-2349, -1107, 98, 55, -88, 29, -325, 247, -76, -94], [-1377, 1213, -12, -209, -98, -39, 393, -34, 100, -118], [2790, -304, -290, -9, 51, -128, 159, 213, 398, 122], [-4644, 883, -189, -152, -165, 150, -171, -122, -236, -335], [1638, 1015, -463, 143, -30, -134, -192, -180, -184, -125], [4106, 430, 284, -256, 135, -27, -252, -418, 161, 299], [-2517, -386, -505, -181, -38, 120, -204, -313, 131, 34], [-873, 326, -115, -228, -135, 164, 347, 200, -175, 26], [-1484, -1396, 332, -69, -236, 61, 365, 620, 135, -29], [-3999, -253, 332, -86, 53, 105, 86, 74, -522, -106], [-633, 1102, -347, 17, 212, -4, 162, 351, 93, -114], [-1690, 487, 359, -135, -4, 16, 322, 168, -84, 1], [-1085, 812, -113, -194, -100, -119, 365, -381, 38, 115], [3616, -1262, -82, -104, 42, -72, 78, 374, 592, -30], [-1525, 1184, -575, 258, 179, -92, -605, -486, -211, -14], [-4982, 716, 204, 98, -135, -63, 242, 265, -279, -689], [-5513, -1042, 363, 72, 49, 182, -117, -166, -201, -390], [301, -73, 178, -372, -509, 49, 12, 140, 48, 294], [-418, 212, -78, 382, 24, 68, -460, -260, -750, 152], [4029, 617, 216, 601, 275, 44, -293, -45, -93, 201], [-3952, 1130, -698, 94, 102, 66, -196, -6, 222, 236], [-1260, -1084, -384, -38, -159, -51, 570, 47, -37, 237], [-5048, -1872, 472, 133, 292, 157, -117, -181, 157, -131], [-1451, 732, 1695, -385, -186, -32, 86, -25, -179, -68], [-973, -649, 254, 63, -76, -139, 737, -145, 218, -86], [-3868, 402, -6, 0, 133, -31, -406, -582, 299, -79], [-2366, 129, -175, -214, -108, -327, 349, -204, 117, 82], [-4579, 976, -7, -7, 318, 136, 52, 619, -153, -42], [2488, 500, 64, 104, 9, -11, -174, -492, -473, 299], [2160, 1269, -11, -243, -356, 82, -174, 151, -150, 259], [-7265, -1203, 502, -353, 202, -263, -33, -12, 500, 250], [-4500, 2296, 336, 7, 247, -128, 227, -237, 212, 354], [-2930, 1470, -372, 141, 295, -162, 189, 575, 282, 398], [5193, -229, 32, 624, 58, -8, -242, 112, -829, -283], [-5754, -472, -20, -223, -374, -97, 383, 701, -41, -775], [5520, -761, 741, 355, -8, -308, 226, 13, 150, 1], [5392, -1313, 293, -466, -21, 206, 317, -58, -222, -39], [-2749, -487, -1100, 271, -112, 37, 463, 466, 256, 378], [-1889, 313, 226, 533, 2, 363, -903, 258, -692, -972], [4813, -2071, 160, -152, -336, 236, -380, 436, -389, -425], [-6905, 1996, -653, 26, 390, 213, -273, 997, 376, 227], [3488, -505, 1357, -718, -432, -117, 583, 368, 89, -140], [-5108, 1011, -573, 37, 348, 228, -596, -199, 56, 495], [-2075, 585, -690, 140, -36, 204, 540, 1240, 781, -543], [9199, 1141, -192, 756, 420, -50, -378, -360, -929, 113], [-4245, -2708, 209, 614, 262, -115, -663, 21, 94, 17], [2714, -1191, -293, 603, 62, -272, -178, 523, -112, -557], [7784, 540, -1330, 648, 543, -287, 108, -629, -309, -295], [1635, 3395, 200, 413, 274, -49, 395, 7, 90, -346], [878, 2004, 950, -878, -87, 175, 542, -392, -219, -99], [6743, -1997, -404, -38, -710, 398, -84, 330, -563, -495], [5500, 1559, -53, 207, 6, 256, 648, 543, -674, -277], [10202, 100, 354, 318, -45, -77, -1354, -205, -145, -223], [-1536, -2820, -698, -370, 410, 26, -464, 292, 112, 30], [-1773, -2166, 1001, -335, -309, -63, -132, -757, -662, -77], [-1354, -1989, 267, -112, 813, 294, -339, -40, 160, -329], [10496, -120, 1082, -435, -827, -236, 243, 593, 260, 106], [9365, -2573, -754, 940, 112, -644, -20, -380, 715, 149], [-4200, -1998, -72, -273, -639, 24, -513, 735, -168, -708], [-170, 1860, 396, 349, -203, 368, -963, 495, 32, -526], [1833, 1627, -742, -804, 598, 370, 480, 44, 717, 279], [2740, 480, 336, 192, -385, -111, 508, 2095, -337, -391], [2460, -2574, 818, -218, 339, -215, 228, 470, 443, -417], [-1989, -1648, -443, 596, -9, -324, -311, -1302, 679, 272], [4097, 2563, -466, -300, -128, -182, 782, 1513, 189, 511], [20764, 501, 793, 310, 230, 315, -535, -490, -539, -642], [-1158, -2571, 139, -66, 132, -597, -193, -960, -169, -152], [-430, 451, 265, -23, -622, 220, 42, 1721, -802, -1265], [-15348, -445, -619, -116, -643, -400, -155, -302, 256, -53], [10066, 178, -138, -982, -460, 658, 426, 1748, 762, -100], [-11247, -2564, -365, 93, -817, 609, -100, 122, -698, -637], [-337, 2178, -97, -602, -437, 172, 1635, -980, -335, 338], [6840, 1847, -1257, 951, -144, 282, -4, 661, 322, 391], [6591, -2955, -734, 223, 227, -478, 137, 23, -481, -377], [-1508, -5026, -924, 334, -419, -295, -270, 4, 621, -527], [4222, -3514, -1334, 53, -326, -273, -507, 225, 891, 977], [11843, 1961, -2000, 6, -718, -260, 74, 116, 149, -359], [8978, -2493, 295, -656, 457, 170, 679, 1040, 834, 345], [-2061, -4194, -855, -729, -64, 56, 546, 1253, 193, 652], [-155, 1487, 254, -530, -269, 521, 982, -774, -1194, -60], [2352, -1259, -1201, -1070, 338, 145, 31, 214, 535, 170], [-2921, -229, -838, 890, -36, -748, 400, 540, 1145, -525], [-4982, -3809, -855, -469, -286, -476, 1054, -603, 970, 787], [11623, 1570, -965, 171, 88, -272, -440, 159, -273, -132], [6069, 2342, -1987, -85, 746, -148, -56, -1431, 229, 726], [10176, 1377, 875, -328, 133, -396, 149, -356, -1678, -415], [-14472, 2054, -548, 1085, 600, -293, -749, -1784, -3, 341], [168, 1934, -114, 505, 559, 288, -697, 41, -308, -564], [-13808, -1136, -520, 1081, 496, -765, -101, 327, -485, -739], [-12061, -3734, -131, 1107, 784, 494, -82, 706, -629, -434], [13719, 588, -1243, -9, 4, 268, 622, -543, 43, -582], [-4789, -3697, 210, -87, -1187, 326, 653, -718, -757, -1387], [16095, 615, 1052, -41, 233, 686, -1309, -854, -827, 1069], [-17428, 3357, -309, -84, 685, 78, -1151, -680, 382, -859], [22690, 585, -1183, -591, 559, 525, 80, -154, 1229, 1002], [-16305, -3336, 1011, -331, 626, -388, -810, 335, -495, 62], [2789, -1726, -1367, 286, -198, -279, -337, -804, 1954, 1021], [4841, 1293, -1534, -1335, -993, -306, 945, -44, 73, 889], [-2532, 1346, 742, 1357, -312, -617, -405, 338, -919, -945], [4979, 1714, 1951, 853, -486, -546, -1442, -1397, -523, -422], [-7241, 3050, -1581, -436, 584, 737, 49, -1104, -72, 269], [-6665, -5910, 1431, 745, -221, -179, 324, -1277, -320, -257], [-12542, -292, -746, 1027, 330, -953, 1707, -398, -393, -119], [-7177, -638, -41, 690, -427, 8, -469, 146, -793, -108], [-7946, -2546, 2966, -914, -1037, 55, 246, -1047, -1233, -151], [-994, 5721, -553, 353, -102, -650, 856, -1212, 1382, 1081], [-587, -1528, -473, -1366, 632, 331, 613, 489, 1132, 71], [3535, -1124, 2321, 1368, -6, -139, -1577, -1504, -1076, -185], [23485, 1794, 231, 244, 260, 543, -285, -2566, 6, 403], [455, -3026, 117, -338, -377, 474, -1739, 457, -1429, -228], [1310, 6684, -844, 102, 426, 108, -458, -504, 744, 420], [-22124, 4270, 1674, -1675, -567, 960, 1131, 653, 404, 932], [345, -5490, 1553, -528, -1388, -437, 223, 3232, -300, -709], [10573, -3557, -388, 644, -408, 578, 450, 884, 145, -261], [12864, 3861, 639, 889, 156, -274, 726, -605, 776, 891], [6816, -2516, 1844, 1059, -642, -791, -211, 595, -1615, -1209], [-3240, -709, -591, 743, 712, 530, 268, -1901, -98, 381], [3771, -2784, 2295, 1147, 448, 308, -2136, -1111, -1979, -2014], [-4035, -6436, 845, 1540, 644, -1231, -651, -1650, -380, 839], [-1750, 10170, -1406, -655, -434, -121, -401, -2518, 1583, 669], [-9942, 6205, 473, -406, 624, -601, 851, 3010, 1039, 430], [-9202, 23, -911, 2273, 642, -760, 774, 472, 582, -567], [-20278, -6463, -1053, 156, -115, -120, 1233, 3041, -214, -1119], [14610, -3092, -134, 773, -678, 363, 69, 491, -1635, -2227], [25553, -5092, 465, -1791, -111, 663, -130, 533, 124, -425], [-8490, -7184, 2908, -456, 1140, 176, -668, 1833, -332, 1064], [-9999, -1322, -625, -161, -1408, 224, 1130, 4201, -533, -514], [-4009, 7242, 231, 249, 1143, -69, 1246, -1579, 646, -563], [-12308, -6951, -1933, 697, 235, 753, -64, 263, -671, -1116], [-11454, -2439, -469, -105, 857, 1093, -1966, 1759, 891, -98], [22517, -2802, 4207, -548, 369, -242, -879, -116, -231, 1240], [-5045, 5423, -874, -1662, -751, 941, 382, 1341, 62, 562], [-10740, -2548, 2192, -1810, -500, 570, -318, 800, -794, 778], [7652, 3196, 1008, -98, -1082, 274, 16, -1190, -450, -1310], [2509, 238, -2215, 1753, 896, -768, -438, 11, -579, 100], [-28935, 3069, 470, 975, 467, 38, -1065, 29, 307, -521], [1748, -2186, 844, 368, -770, -326, 240, -186, -432, 1020], [-18733, -667, -808, 727, 39, -750, 303, 213, 1239, -175], [-2139, 1157, -116, 685, -168, -851, 1889, 989, 1680, -110], [11580, -1290, -2440, 1940, 1082, 990, -1836, -263, -256, 512], [-11487, -5751, -1794, -1027, -1590, -43, -371, -174, 164, -630], [-3210, -4922, 76, 1929, 843, -772, -2939, -908, 380, -782], [891, -3958, -1811, -750, -634, 21, -1585, 178, 1270, 705], [-87, -1341, -1992, 886, -678, -1780, 1318, 1084, 1251, 1593], [-2291, 2599, 562, -914, 6, 1320, -1262, -932, 111, 1641], [-16150, 2267, 2345, 104, 1662, 109, -485, -1438, -1095, -852], [-18697, 433, -1998, -898, 762, 1308, -206, -874, -969, -637], [31048, 7925, 1425, -820, -22, -1087, 563, -300, -345, 1444], [-11478, -4105, -2911, 439, 485, 813, 448, -1056, 1107, -324], [14310, 14182, -2240, -845, 499, 30, 671, -2293, 1336, 566], [-8341, -569, 1630, 1555, -885, -1000, -369, 29, -723, -743], [-17386, 7449, -1665, -297, 56, 166, 492, -369, -718, 1495], [-25218, -5543, -3629, -47, -338, -870, 908, 1236, 2112, -999], [12156, 2651, 1167, -2786, -273, 1356, -1807, 262, 1480, 1117], [-15734, -5897, 3495, 1370, -333, 1292, -2429, -1266, -1982, -2341], [-37723, -559, 216, -239, -945, -474, 1093, 2146, -1361, -1185], [22849, 5408, 199, -2577, -1551, 257, 2350, 293, 192, -227], [-27673, 3231, 620, 2509, 1602, -645, -743, -1810, 662, 822], [16442, 1247, 397, 429, 391, -1611, 162, -1985, -199, 210], [5031, -1719, -1404, -1824, -345, 245, 580, 914, 4150, 2656], [3333, -7712, 683, -1021, 190, 180, -618, 1371, -675, -1098], [-18998, 2443, -1209, 1786, 1869, -28, 891, -2476, -868, 1725], [-3821, 4020, 523, 2553, -270, -408, 916, 327, -871, -1792], [12717, -197, -4, 1243, -939, -578, 1285, -548, -2859, -1235], [19409, -740, 3211, 1962, 325, 1114, -1183, -558, -2625, -812], [-171, 7721, -854, 535, 814, -399, 1437, 126, 2080, -318], [10008, -100, 4062, -1855, -662, 17, -687, 2273, 1263, 379], [-5580, -8802, 1602, 1966, -754, -1600, 338, 1530, -1716, -1738], [24762, -7383, 2495, -1011, 1102, 802, -74, 171, 758, 331], [649, 7032, -2535, 823, -474, -1182, -1998, 54, -707, 1692], [-5365, 14163, -2540, -3163, -1060, -331, 1079, -863, 2174, 3046], [33723, -2399, 504, 1510, 105, -1865, 846, -3002, -470, -80], [-5075, -1081, 1490, 2020, -1951, -817, -528, 2341, -1252, -1400], [21720, 905, -1767, 2670, 769, 172, -1167, -252, -1590, -43], [13709, -982, 337, -244, -820, -55, -429, 2657, 1876, -533], [8066, 4506, 1964, 11, 277, 44, 115, -71, -886, -1704], [-12355, -7449, -342, -102, 704, -70, -1138, -874, -1063, -3367], [-15099, 6015, -226, 1031, -501, -582, 2137, -1813, -1083, -1035], [-536, -8492, 1186, -1731, -3123, -956, 1103, 1375, 92, 846], [-16423, 9855, -644, 1915, 2017, 504, -1607, 1347, 697, 479], [-10403, 1031, 3106, -1357, 1211, 2542, -1105, 596, 875, 479], [-9496, -7770, -174, 1624, -363, 171, -966, 5438, -1573, -2069], [-3180, 1650, -142, -1314, -970, 504, 2458, -46, -824, -1222], [-10888, -11689, 1419, -1209, -123, 1025, 494, 646, -2923, -1538], [-14305, 12980, 1139, -447, -894, -268, -2102, -2429, 969, 1406], [10150, -1053, 3005, -1976, 987, -218, -471, 50, -1584, 933], [17384, -6085, -23, 1188, 1363, -318, -1591, -2698, -1730, 1365], [-26631, -1638, -5207, 1786, 2459, 1630, -2695, -3826, -1091, 1676], [95, 12104, -2671, 1421, 1516, -488, 174, 1713, 1003, 270], [-6048, 8406, 3310, -270, 935, 453, 888, 1537, -1037, 275], [-13597, -2260, -53, 1492, 2070, 963, -2119, 773, -458, -2591], [-31337, -3079, 2256, -976, -44, -1122, -1686, -2250, -51, 1187], [5910, -787, 1699, -1676, -1970, 1011, -1531, -2186, 1135, -570], [884, 4905, 2181, -743, 2498, -1390, -1228, -709, 1394, -1565], [-6226, -3820, 1220, -1821, 1493, 342, 1457, 263, 814, -2256], [-13527, 4686, 1059, 2027, -1004, -1108, -1446, -4499, -1853, -426], [108, 4347, 2357, 312, 439, -1668, 2923, -1448, -1144, -1441], [-19750, 11208, -1604, 831, -2362, -227, 1461, 512, -1599, -455], [-5639, 2849, -5408, 38, -477, 335, 2772, 2460, 1932, 804], [-17379, 16496, -3155, 1382, 1017, -430, 3469, 3380, 1865, -332], [8466, -2806, 2068, 1538, -1466, 1476, -2410, 3986, -2766, -2242], [12211, -12053, -1298, 1220, -129, 319, 2458, -2160, 1666, -496], [13794, 4247, 1667, 3045, 2410, -282, -3454, -4866, -1702, 215], [-22150, -1160, -3444, 4145, 2320, -523, -1773, 838, -315, -2603], [-6961, -8456, -223, 761, -1273, -627, -1554, 3655, 672, -2699], [40059, -72, -485, -1306, -452, 1149, -687, 2137, -3416, -5029], [-10072, 10653, 1449, 534, 354, -2663, -617, -992, 2079, 2628], [946, 2508, 1100, -241, -591, 2378, -23, -2041, 3450, 52], [5413, 6516, -6017, 1572, -873, 290, -1527, -1892, -2195, -1732], [28370, 8916, -3896, -185, -483, 1528, 1419, 1185, -512, -1402], [-30761, -613, 1952, 580, 1558, 396, -2022, 831, 53, 235], [14955, 9578, 1809, -167, -607, 1471, -1318, 4353, 266, -1887], [11194, 14731, 709, 854, -257, -152, -1387, -346, -2158, -871], [-53969, 722, 1299, -952, 2010, -1035, 2395, 964, 1068, 213], [-16484, 3049, -2095, 491, 681, -1513, -2480, -606, -2021, 78], [-38294, 11345, 3303, 1736, 1864, -1791, -337, -1123, 1107, 1168], [-4970, 10619, -787, -2886, -1700, 1141, -163, -1373, 121, 818], [-51003, -2460, -5325, -473, 1301, 851, -2508, -1960, 882, 1355], [13323, -2180, -4215, -801, -3226, 2204, 44, 3235, -325, -1926], [5485, 1185, 6496, -2515, -1425, 1862, 3759, 2057, -2505, -895], [-12998, -97, -2021, -756, -1911, -820, 1219, -962, -250, 1221], [-32901, 5529, 3110, -215, -3334, -993, 749, 3727, -2422, -3410], [-8466, -16965, -1627, 3155, 2680, 2646, -4246, -125, -2688, -2571], [1143, 9547, 1600, -2837, -1891, -1122, 4259, 4191, 3217, -1605], [-19368, 4297, 569, -65, -2140, 1124, 2662, -2971, 3560, 2443], [6634, -8257, 3469, -948, 2669, 2866, -2453, -542, 1526, -855], [-33022, -2085, 109, -1252, 543, -310, -1155, 2268, -3252, -2807], [8776, -23116, -338, 1628, 1324, -1546, 290, -557, 190, 1706], [-7289, 18477, -4372, 2491, -68, -1443, 2279, -1604, 228, -1274], [-22608, -10030, 3758, -861, -2430, 469, 1693, -497, -519, 1463], [6882, 17207, 3719, -1413, -74, 2176, 144, 2702, -3792, -727], [898, 9453, -5219, 1784, 1781, -1652, -179, -949, 1564, 2793], [-27333, -18199, 3668, 226, 1578, -1766, -616, -4820, 2391, 5895], [-21907, -18590, 5847, 3247, 1447, -743, -1208, 1061, -650, 747], [23829, 10964, 2177, -741, 876, -2560, -3042, -5656, 815, 1890], [-28099, 9829, -376, -2887, -1774, 1281, 2791, 3819, -502, 2292], [-15734, -7096, -2236, -2331, 601, 876, -1697, 2901, 1282, 118], [24178, -11249, -407, -1129, 606, 190, -474, 1345, 5014, 1657], [-19404, -1305, 7301, 1227, -31, -905, 2876, 685, -911, -2522], [-13175, 9573, 1942, -1243, 348, 1879, -839, 6045, 404, 1262], [-17756, -336, -360, 531, 4127, -890, -1071, -7229, 1114, 5140], [23787, -8154, 2521, -94, 44, 533, -2471, 1772, -770, -1991], [23694, -19093, 3131, 2198, 2500, 273, -255, 1302, 305, 1070], [-16692, -4409, -2685, -2650, 3050, 393, 119, -2891, 2035, 2318], [-36284, 11061, 2267, -601, -266, 1822, -1686, -491, -1194, -1057], [-8189, -13659, 4160, -885, 1359, -1132, -43, 3973, 3511, 2117], [39567, 13116, 1595, -1118, -821, 2448, 1955, -2050, -1169, -4336], [-485, -4616, 11561, 670, -678, -909, -1779, -3592, -2946, 597], [-13475, -7992, -553, 1744, 1619, -1120, -4035, 1332, -2519, 756], [-27822, -4323, 2111, 242, 542, -1739, 1489, 5909, 1051, -1976], [11632, -2733, -1493, 2644, 1668, 1005, 1085, 3128, -785, -2092], [-41318, 16406, -4054, 249, 2299, -2010, -1549, -549, 3832, 7778], [-7162, 14749, 5091, -240, -1817, -2624, -523, -1536, 2866, 2959], [-35243, 1798, -2901, 1114, 2261, 744, -653, -4432, -5077, 1176], [-63554, -4518, 258, -2715, -272, 293, -2567, 4589, 77, 1917], [16169, -8332, 1933, -2197, -1013, 3387, -4904, -5815, -2804, -685], [43536, -2872, 5612, 1409, 823, -1838, 227, 186, -3750, -2388], [-14217, -7207, -2408, 545, -2321, -2300, 3353, -853, 4153, 2787], [-38813, -13587, -2028, 2870, 1735, -665, -374, -2572, -1368, 4950], [2305, -1185, -1668, -1535, -975, -1110, 2777, 51, -3703, 523], [-2181, 3822, -1699, 1228, 954, -1543, 3435, 6135, 732, 1009], [-41173, -6804, -269, 937, -1190, -24, 1146, -617, -3655, -590], [-45200, -18841, 1435, -300, -1599, 1520, 855, -1472, 1848, -1519], [-17503, 3894, -6339, -1977, -69, 1373, -2144, -5942, -2700, 1575], [-22309, 11555, -13150, 2252, 1526, 434, -140, 3052, 371, -1697], [39396, -17522, 3262, -2989, 1460, 2391, -971, -1057, 1367, -883], [-35917, 11512, -1509, -2091, -1896, -2038, -2378, -4581, -65, 3732], [-34253, -15078, 3021, -1280, 233, 366, 975, 4598, -4191, -744], [-36159, 4873, -4916, -2878, -2928, 220, 4680, 578, -725, -3577], [-86143, -15232, 2589, 84, 998, 3121, -2265, -809, -812, 943], [-17152, -6991, 817, -3253, -3156, 1400, 4558, 6083, 38, -1211], [47551, -4079, -918, -552, 2822, 496, -522, 5636, 3411, 51], [-45696, -7994, 376, -3714, -2876, -218, -870, -319, -1836, 148], [-6492, 11518, -5362, 2558, 2262, 1550, -4342, -1755, -1040, -1266], [28978, -2784, 4400, -1799, 650, 827, 2983, -3400, 679, -1005], [-26505, -7210, 5347, 1858, -961, -2060, -5167, 714, -2689, -4080], [8455, -5819, -3142, 2558, 1919, -1237, 498, -4005, -2338, -674], [-28813, -2915, -3878, -526, 2414, 1646, -340, 1844, 1905, 1267], [-62757, 2253, -1444, 2477, 810, 1343, -1921, 351, -354, 3410], [-16177, -11980, 2353, -4569, -2341, -623, 644, 3157, -438, 2441], [21788, 19573, -8543, 1108, -1488, -541, 727, -3744, -195, -2964], [-33735, -20549, -1088, -818, 313, -2265, 3874, 3672, 2436, -1370], [19331, -14776, -717, 1722, 1236, -847, 69, 2158, -1158, 607], [48234, 10783, 5833, 2373, 1681, 2393, -3654, -345, -1451, -190], [-16787, 29488, 247, 676, -763, 470, 923, 4612, -659, -1544], [-23172, -9095, -153, 1279, 4134, -142, -1842, 1935, -2384, -4371], [-43256, -1605, 1939, -1346, -4764, 3407, -1951, 151, -1273, 2744], [5666, 3772, 998, -872, -3539, 511, 4536, 1517, 1419, 559], [20484, -21852, -3028, -595, -92, 1311, -1993, 7291, -1333, -3987], [16175, -12956, 1341, -1454, -218, 1099, -2251, -5938, -1326, -583], [-27074, -1838, -134, -1479, -2985, 708, 3555, -4243, -2542, -2444], [-25183, -5912, 297, 2051, 332, -936, -2062, 3606, 2523, -822], [-52831, -16818, -3367, 1471, 1960, -1956, 200, 1587, 597, -6794], [-27163, 2295, -2920, -2199, 293, 1586, -59, 3685, -4143, -1653], [-14073, -6115, -3648, 391, -317, 954, 3405, -1157, 839, 1365], [50328, 8668, -9026, 439, -767, -480, 2177, 3243, 484, 666], [68158, 1955, 6303, 2333, 2780, -1724, -3230, -1828, -3632, 3677], [45360, 2880, 1258, 34, -350, 1940, 3858, 8252, -58, -1280], [48188, -7292, 8518, -2003, 1347, -580, -2161, 3403, -2974, 2846], [-3441, -861, -3384, -2333, 164, 3673, -2191, 1887, 1840, 1970], [-41031, -12122, 5369, 5720, 1503, -1102, -3287, 4276, -539, -3182], [-41671, 6433, -1304, 930, 1604, 1432, -1048, -3932, 5923, 3329], [-21705, 4410, -3825, -2890, -4261, 1842, 2255, 5460, 1217, -3534], [-10158, 11914, 3230, 2701, -902, -969, 3719, 8413, -489, -2819], [30428, 5488, 5124, 426, 1390, -4052, 6, 244, 548, -2544], [51316, -16184, -958, -2671, -1514, 1579, 1793, -6539, 2741, -205], [-59009, 1290, 915, 1560, 2800, 25, -2239, 5226, 4152, -1887], [-44831, 23547, -3826, 520, 1796, 464, -84, -6504, -377, 1511], [-57614, 687, 5397, 2747, 3691, 209, -2194, -5199, 1663, -888], [-84777, 6646, 2397, 3567, -942, -2710, -2020, 2097, -185, -354], [38953, -3461, -5630, 3268, 864, -3018, -2690, 2176, 1927, 2647], [31700, 10534, 3772, 805, 213, 698, 1861, -3601, 970, -2882], [-38159, 8820, 893, -995, -4205, 181, -206, 5485, -3450, -1027], [36945, -2239, -3472, 3465, 3355, -3402, 3663, -4213, 1997, 2127], [15144, -23097, -3617, -2059, 378, 1080, -1030, -2535, 2398, -391], [-21067, 10733, -3102, -1380, 454, 578, -2984, -2944, -919, 915], [53597, 13471, -7638, -7559, -1750, -21, 4865, 272, 8468, 3734], [-1809, 21044, -8769, -3792, -2023, -1556, 2265, 278, 2839, 6990], [13083, 7084, -833, -1827, -1949, 1171, 4162, 5053, 3066, 5223], [-52424, -17660, 6844, -3143, -1734, 481, 2467, 4620, 527, 1819], [3996, 3072, 5390, 1361, -3054, 153, -3943, 3462, -2013, -6547], [-1947, 7049, 4622, -3903, -4261, 3950, 109, 4441, 621, 4189], [-37197, 9343, -10932, 2267, 4471, 2600, -3091, -4132, 1283, 3333], [21361, -20395, 2954, -105, -1346, -2607, -15, -325, -52, -2406], [18650, 16388, 2534, -3731, -1504, 2257, 5249, -1439, -297, 815], [53717, 4326, 2833, -517, -1970, -16, -1310, 1295, -2687, 566], [-2769, 21351, 1404, -5692, -2272, 1210, 6518, 5556, -2057, 2001], [18053, -16713, 2004, 2612, -1760, -1810, -3898, -1474, -5459, 1981], [-19571, 7522, -3871, -954, -1398, -1533, -1467, -2966, 980, -4169], [56856, 1343, 8783, -335, 2997, 25, -1288, 3693, -3677, -4898], [58412, -19606, 2444, -1815, -2955, -184, -245, 7311, -722, 4068], [-74755, -16142, 3861, 5343, 1651, 683, -472, 3294, -5518, -601], [94622, -6146, -1020, 1600, -468, -1874, -130, 2600, 1436, 2308], [78394, 17830, 584, -2892, -3960, 1622, 5318, -4784, 1436, -2392], [60691, -2002, -3543, 1065, -208, 904, -7766, -1015, -7331, -3224], [15430, -6546, -238, 3371, -1440, -1411, -2267, -1906, -2843, -8409], [26525, -3350, -6755, -2565, -2580, 442, 1352, -1423, 6019, 7854], [-6808, 1730, -1448, 393, -1940, 3691, -909, 2506, -3, -2247], [13742, 1983, 4533, 161, -62, 2788, -1650, -7845, 5652, 517], [-17285, 13243, -5252, -4425, 3005, 3562, 2243, 1823, 1679, 2777], [-40732, -14342, -4110, -4352, 352, 2140, 1524, 226, -436, 262], [-2546, -8201, -9099, -517, -1459, -3005, -260, 1084, 4385, -24], [62961, 10277, 944, -500, -7, 1625, 4490, 4801, 3202, -4672], [-7158, -21809, -5375, 2476, 1829, -2636, 35, -592, 2056, 993], [124641, -6431, 8374, 793, -27, 1854, 293, 4063, -5145, -861], [18754, 19100, -1084, -4197, 2173, 2244, 67, -1293, 3750, 3122], [-24773, -4320, -4833, 2480, 5025, -3498, -1161, 1884, 1265, 3634], [6014, -42307, -3427, 302, 742, -2541, 825, 1010, 981, -848], [44444, -8058, 4176, -2321, -1891, 806, -775, -2729, -1522, -5154], [40295, -8287, 6646, 1454, 404, 1518, -216, 4323, -6395, -2139]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_627_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_627_4_a_c();".
// 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_627_4_a_c(:prec:=10)
    chi := MakeCharacter_627_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_627_4_a_c();".
// 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_627_4_a_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_627_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![-216, -7896, 21298, 4725, -10579, -424, 1335, 11, -63, 0, 1]>],Snew);
    return Vf;
end function;