
// Make newform 1160.4.a.d in Magma, downloaded from the LMFDB on 05 February 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_1160_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_1160_4_a_d();".
// 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_1160_4_a_d();".
// 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 := [29241, 306882, 125775, -115371, -8331, 7393, 229, -153, -2, 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, 1, 0, 0, 0, 0, 0, 0, 0], [-34, -1, 1, 0, 0, 0, 0, 0, 0], [38859669, 24338340, -2823462, -3863979, -14679, 117166, -1044, -975, 28], [-25186491, 8821539, 17094078, -2051001, -1262884, 41381, 27270, -175, -181], [28309851, 33995196, 2814750, -2243565, -532169, 32914, 13380, -113, -92], [30254310, -31260303, -14745096, 3331332, 1004139, -83507, -20058, 606, 121], [33459831, 16916049, -18048204, -1259181, 1167610, 37675, -23664, -335, 151], [-32740713, -68664843, 62031402, 4325013, -4990984, -142149, 112698, 1403, -771]];
    Rf_basisdens := [1, 1, 1, 940248, 1880496, 940248, 940248, 470124, 1880496];
    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_1160_a();"
function MakeCharacter_1160_a()
    N := 1160;
    order := 1;
    char_gens := [871, 581, 697, 321];
    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_1160_a_Hecke(Kf)
    return MakeCharacter_1160_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], [-1, 1, 0, 0, 0, 0, 0, 0, 0], [5, 0, 0, 0, 0, 0, 0, 0, 0], [-4, -1, 0, 0, -1, 0, 0, 0, 0], [-12, -1, 0, 0, 0, 0, 0, 0, 1], [-2, 0, 0, 0, 1, 1, 1, 0, -1], [11, -3, -1, 0, 1, 0, -1, -1, -1], [-4, 0, -2, 1, 1, -2, -1, 1, 0], [-23, 1, -1, -1, 1, -1, -2, 1, 2], [29, 0, 0, 0, 0, 0, 0, 0, 0], [-64, -4, -1, -2, 1, 2, -2, 1, 0], [21, -1, 5, 0, 4, 0, 1, 1, 2], [-37, -1, 5, 0, 5, 6, 4, 0, -3], [-76, -18, 1, -2, -7, -1, 1, -4, 3], [-66, -24, 1, 2, 0, 1, -1, 4, -2], [9, -27, 0, 5, 1, -8, 5, -2, 3], [-171, -4, 2, -6, -6, 5, 5, 5, -4], [-44, -32, -5, 5, 2, 3, 4, -2, 2], [-138, -2, 1, 2, 14, -2, 6, -1, -5], [-146, 21, -7, 2, 2, -16, 6, -17, -10], [2, -32, -6, -8, -12, -16, -5, -1, 10], [-105, -22, 15, -2, -14, 3, -7, 6, -5], [-296, -33, 1, 3, 11, 8, 1, 4, -4], [-22, -38, -3, -3, -23, -6, 3, -10, -13], [117, 1, 14, 5, -4, 5, 9, -23, -2], [-153, 37, 6, -3, -15, 19, 10, 14, 1], [-108, 36, 25, -6, -6, 0, -6, 1, 23], [-160, 63, -14, 12, 28, 4, 4, 0, -27], [-251, 11, -20, 3, 46, 4, -13, 4, -4], [7, -7, -1, -12, -33, 13, -16, 31, 3], [-306, 100, 4, -15, 47, 5, -8, -12, -7], [-414, 126, -7, -6, -18, 8, -12, 19, -1], [-2, 8, 52, 2, -12, 45, -2, 31, 12], [-544, 66, 12, 18, -1, -28, 32, -38, 21], [-424, 90, -3, 5, -7, -10, 21, -6, 23], [-910, 129, 8, -9, 69, 18, -29, 33, 11], [278, -20, 9, -11, -28, -36, -60, -9, 4], [-544, 28, 19, -12, 34, -13, 13, 18, 38], [-636, 0, -45, -4, 27, -52, -30, -25, 8], [-104, -48, -27, 11, 0, -33, 16, -76, -48], [-1521, -51, -13, -4, 26, 19, -19, 12, -8], [163, 145, 21, -8, -75, 4, -42, 26, -3], [-530, 133, 30, 26, -27, -32, -14, -40, -26], [396, -118, -33, 13, -7, -17, -13, 27, -73], [-248, 382, 68, -24, 25, 54, -34, 40, 13], [-1420, -41, 53, 28, -12, -12, 16, -29, 24], [-478, 311, -12, 2, 24, -28, 34, -80, -1], [-737, -61, -68, 24, 92, -9, 61, -1, -21], [-478, 172, 31, 30, -74, -34, 10, -41, 21], [-290, 410, 13, 23, 4, -52, 19, -54, 26], [-136, -172, -41, -23, 35, 56, -9, 36, -67], [-1416, 101, 22, 13, -49, 62, 1, 15, -75], [77, -147, -46, -23, 37, 39, -72, 66, 1], [-98, 223, 79, -23, -117, 58, 9, 76, -6], [-1111, -33, 7, -58, -107, -46, -38, 22, 73], [-516, -624, -63, 22, -50, -27, 7, 10, -40], [-1193, 243, 8, 3, 171, 46, -1, 4, 41], [-542, 309, 48, -72, -18, 16, 50, 4, -23], [315, 431, -7, 56, 53, 2, 78, 42, -7], [-65, -279, -115, -58, -10, -24, -6, -72, 14], [650, -324, 15, -12, 30, -40, -66, 123, 57], [1742, -2, -52, 68, 73, 4, 53, -61, -49], [-778, -52, 104, 19, -45, 103, 74, 42, 73], [597, 57, 86, 36, 20, -75, 35, 69, 97], [2471, -161, -28, 61, 112, -78, -1, -134, 62], [383, 571, -77, 6, -52, 54, -35, 75, -46], [1320, -234, -36, 47, -1, -42, -75, -93, -138], [878, -196, -55, 25, -83, 72, -28, 63, 65], [-176, -541, -80, 26, -190, -234, -56, -106, 69], [230, 502, -36, -66, 2, -14, -16, 22, -6], [2405, -215, -125, -8, 79, -60, -116, 106, 199], [237, -187, 82, -92, 4, 119, -67, -61, -29], [-398, 60, 65, -42, 210, 1, 135, -106, -158], [1642, -68, 85, -107, -300, -2, -3, 54, 138], [-3992, -163, 67, -49, 231, 14, 107, 22, -28], [2056, 253, 81, -57, -178, 26, -125, 64, 193], [-571, 273, 123, -4, 117, 14, 148, -40, -99], [1442, 414, -32, 0, -215, 210, 10, -26, -123], [384, -336, -157, 139, 220, 7, 100, -24, -108], [79, -25, -81, -170, -65, 16, -130, 190, -85], [-672, 519, 219, 6, 3, -20, 160, 27, 45], [193, 511, -128, 33, 52, -2, 161, -22, -158], [-550, 110, -18, -40, -304, -78, 74, 60, 188], [487, 313, -59, -20, -136, 58, 251, -87, -26], [-2808, -689, -62, 33, -41, 62, -47, 143, 23], [-1033, -13, 113, -87, 71, 100, 43, 38, 27], [1017, 779, -71, 32, 89, 86, 202, -96, -359], [2073, 573, 37, -74, -303, -38, 0, -62, 201], [1232, 586, -273, 33, -318, -124, -17, 98, 72], [-330, 426, -86, 131, 153, 174, -13, 81, -70], [-388, -802, 76, -65, -254, 65, -102, 56, 164], [-1938, 91, -225, 81, 24, 34, 185, -120, -133], [413, -904, -204, 9, 189, -217, -118, -178, 134], [-3458, 438, -247, 114, -34, -14, 170, -225, -193], [-4245, 309, -92, 95, -27, -29, -22, -154, 93], [-374, 256, -505, 140, 146, -125, 147, -178, -190], [1103, -431, 44, 9, -198, -108, -223, 24, 236], [3781, 303, 279, -190, -276, 40, -214, 76, 356], [-2948, 620, -150, 25, -43, 182, 199, -43, -248], [3514, 682, -216, 84, -221, -216, -48, -198, 15], [-1522, 339, 239, 99, -23, 156, 125, -116, -36], [2169, 439, -73, 114, -66, -187, 81, 78, -16], [3113, 493, 184, 122, 352, -72, 106, 100, -242], [1761, 759, 30, -17, -10, -352, 81, -118, 192], [2429, 187, -292, -35, -271, 163, -104, 2, -75], [-369, 955, -176, 213, 80, -68, 84, -59, 12], [148, 910, 194, 41, -301, 74, 111, 105, -28], [7759, 253, -48, 31, 458, -72, 117, -138, -12], [3442, 165, 307, -111, -14, 238, -87, 204, -105], [4023, -1345, -255, -104, 409, 96, -210, 280, -39], [194, 68, -283, -166, 412, -179, -253, 168, -218], [1540, 90, 151, 5, -420, 234, -37, 72, 26], [1860, -4, 85, 313, 423, -188, 108, -147, -109], [-2150, 827, 265, 69, -707, -204, 59, -104, 148], [6414, 458, 73, -105, -239, 162, -125, 4, -231], [2845, -2433, -181, -114, -119, 122, 34, -26, -263], [228, 586, -1, 166, 138, -6, -54, -37, -199], [5648, -695, 402, 46, 62, 148, -68, 106, 273], [6520, 782, -435, -61, 352, -38, -206, 353, 100], [-1432, -550, 118, 103, 683, 148, -5, -145, -198], [-3447, -697, 104, 79, 366, 18, 225, 16, -80], [308, -738, -219, -215, -481, -64, -51, 288, -75], [4726, 1624, 290, 16, 79, 10, -41, -35, 89], [2798, -38, 304, -111, 127, 402, 27, -243, -434], [-684, 309, 300, -65, -74, 48, 19, -77, 178], [-1423, -41, -592, 19, 106, -122, 109, -300, -84], [-9175, -1603, -86, 27, -326, -130, -183, -266, 396], [1086, -453, -151, 40, 670, -50, 210, 269, 90], [-1648, -2122, 100, 65, -81, -1, 162, 96, 445], [-1321, 1337, 104, -1, -259, 182, 198, -503, 137], [-9982, -640, -428, 171, 379, -228, 31, -137, 86], [7626, 562, -32, -271, -697, 163, -202, 326, 65], [6606, -1044, -161, 158, -360, -126, 168, -337, -391], [-2816, -332, -358, 4, -427, -264, -245, 57, 199], [-6146, -2058, -119, -13, 98, 0, -201, -146, -288], [-13778, -1744, -186, -6, -662, 98, 110, -14, -182], [5825, 2211, 166, -213, 489, 64, -74, -117, 61], [-5978, 355, 285, -263, 151, 170, -27, 250, 96], [8142, 2382, -202, 250, 483, -142, -317, -147, -227], [-5328, -526, 221, 5, -683, 478, 279, -108, -189], [-2340, -66, 173, 165, -420, 104, 153, 312, 316], [-6008, -1192, 43, -139, -415, 222, -371, -296, -289], [-1626, -92, -586, 249, 539, 27, 210, 122, -125], [-5122, -1790, -367, -220, -121, -103, 117, -266, -23], [-15377, -669, -108, 59, -133, -314, 143, 80, 349], [-1882, -2963, -179, -241, -351, -558, -19, -180, 188], [-6465, 695, -104, 265, -459, -464, 50, 95, 497], [-95, -571, 35, 144, -361, 16, 470, -304, -317], [-13296, -897, 137, -83, 77, 256, -633, 310, 60], [2213, 2890, 164, -83, 421, 113, 192, 36, 162], [-19428, 1022, 135, 91, 450, 519, 322, 64, -186], [1187, -2305, 690, 71, -396, -54, 245, 154, 470], [-1634, -459, 793, -395, -293, 166, -487, 530, 334], [9314, -14, 145, 242, -452, -355, 227, -320, -248], [-11550, -828, -561, 4, 747, 521, 17, 144, -483], [14721, 643, 699, -233, -153, 665, 4, 327, -116], [834, -2171, -276, 215, 559, 148, 101, -3, -255], [-8996, -312, 358, -112, -731, -496, -338, -48, 481], [-16363, -1053, -352, 161, 658, -290, -679, 22, -144], [-528, -1598, 150, -108, 54, -102, 138, 244, 354], [-4845, -2863, -787, 37, 261, -168, -41, -428, -427], [5192, -1082, 546, -232, -314, 656, -80, 112, -274], [2208, 54, -320, 111, -523, 243, -16, -122, -623], [-4052, 676, -660, 247, 695, -272, 171, -449, -360], [3905, 1201, 381, 178, -1611, -516, 312, -284, 497], [14350, -462, -138, 499, 781, 101, 102, -98, -281], [12974, -741, -8, -355, 267, 248, -405, 671, -611], [-10902, -1790, 891, -507, -676, 318, -760, 395, 444], [-10638, 1408, 307, 263, 48, 220, 307, 176, -266], [-1207, 2619, -457, 74, 372, -746, -217, -201, 118], [-4336, 1157, 762, 271, -23, 0, 249, -243, -659], [-12318, 388, 476, -220, -722, 480, -428, -88, -114], [7004, -3487, -42, 83, 191, -144, -23, 533, 571], [6296, 2168, 291, -25, 189, 59, 363, -689, 219], [-2924, 3027, 409, -548, 1082, 372, -184, 15, -66], [-14501, 2175, -397, -322, -618, -188, -630, -98, 654], [-12646, 2451, -278, 15, -638, -68, 659, 15, 182], [-4077, 891, 823, -206, -96, 213, -413, 474, 902], [390, -2324, 286, 185, -473, 29, 228, -354, 31], [-19210, 614, -106, 248, 524, 440, 528, 254, -476], [-9364, 2228, -219, -136, 318, 29, -171, 268, 1302], [3040, -1104, 528, 97, -1059, 930, 303, -19, 36], [-6180, 1014, 265, -61, -274, 506, 303, -198, 156], [-3165, 2747, 144, 73, -1424, 108, 357, 286, -10], [6368, -2, -781, -392, -403, -378, -936, 153, 490], [-2966, 910, 394, 488, -456, -774, -134, -78, 420], [-9251, -1927, 287, -428, 452, 56, 5, 547, 258], [4951, -2439, 350, -160, -378, -320, -908, 548, 490], [-27589, 2829, 426, 13, 120, 660, 339, -330, -698], [18194, -5876, -165, -3, 383, -436, 7, -812, 37], [-4782, 2206, -761, 459, 317, -14, 389, -102, -249], [-9724, -86, 1044, -449, -98, 847, 148, 1138, 346], [1016, -1698, -426, -353, -89, -252, -249, 129, 852], [8057, -2023, 61, 48, -1126, 114, -296, -160, 142], [4729, 603, 1281, 83, -773, 388, 225, 398, -63], [6506, 374, -773, -789, -1169, 96, -181, 294, 681], [-14381, 1369, -364, -221, -788, -212, -1005, 92, -238], [-4237, 871, -1146, -225, 321, 531, -656, 416, -523], [-6478, 466, -405, -569, -815, 416, -265, 550, -753], [-1009, 882, 403, 74, 2210, -465, 85, 0, 1], [2419, -6947, 295, 124, 274, -357, 401, -450, -168], [8074, -3918, -1220, 44, 346, 304, 432, -142, -872], [-23473, 755, 172, 553, 517, -278, 424, -913, 701], [-13346, -892, 366, -442, 1182, 356, -88, 142, 126], [-6398, -4046, -212, -413, 635, 76, -657, -349, 632], [14672, -3020, 435, 139, 260, 178, 463, 64, -666], [9029, 1011, 718, 198, -494, 383, -25, 641, 701], [-5508, 2052, 728, -157, 207, 776, -289, 101, 414], [-6548, 616, -1296, 394, 447, -201, -791, 1166, 161], [16632, -3347, 1393, 243, -421, -112, 629, 638, 668], [4689, 3015, 66, 445, -373, 454, 894, -53, -1069], [-10094, -1420, 419, -379, -2167, 124, 715, -510, -133], [3540, -2246, -979, 726, 252, 233, 123, -538, -1464], [-7782, -2040, 450, -5, -1469, -107, -500, 442, 1165], [5993, 1242, -343, -124, -198, 367, -349, 932, 207], [-22831, -1453, 275, 90, -286, 3, -213, 502, 916], [-1279, 5564, 408, -303, -57, -449, -158, 240, 1534], [-9760, 2020, 39, 141, -1091, -1224, -725, -36, 1791], [1710, 3175, -310, 44, 1438, -312, -190, -262, -439], [12282, 648, 484, -282, -255, 490, 895, -421, 523], [-1903, -1777, -737, 196, -276, -494, -644, 34, 396], [1000, -1122, 1041, -33, 97, -168, -831, 82, 873], [13006, 5010, -84, 282, -344, -806, -630, -912, 784], [-13044, -1614, -195, -724, -244, 835, 119, 32, 342], [-5602, 1207, -633, 99, 1445, -256, -307, 254, 462], [-13736, -3946, 177, -139, 408, -149, -738, 134, 432], [3379, -2957, 529, 226, 262, 122, 817, -217, 1024], [8477, -1972, 108, 185, -529, -777, 114, -910, 428], [-2826, 2264, 951, -392, -798, 195, 231, 1592, 1252], [-13010, 3633, -284, -81, 1350, 360, -81, 537, 1178], [14239, -5217, -317, 34, 952, -1052, 435, 587, 850], [-14381, -7094, -375, 279, 955, 539, 186, 505, -1595], [20018, 1357, -1145, 1003, 2033, -84, 767, -468, -876], [-4827, -4329, -638, 43, 32, 42, 129, 980, -466], [-23022, -1417, 212, 100, 118, 446, 474, -530, -549], [13056, 2920, 157, -36, -1258, 613, 1, -686, -16], [277, 7495, 1693, -748, 1031, 128, -276, -20, 131], [36358, 3514, 1145, 119, -2244, 542, 716, 361, 476], [21262, -666, 1628, -2, -65, 708, -528, 808, 897], [26798, -2590, -1248, 117, 419, -522, -519, -1087, 232], [-2626, -10738, 273, -92, -449, -273, 207, -152, -269], [9413, 296, 779, -393, -1677, 1685, 260, -31, -187], [4316, 251, 95, 399, 1620, 522, -341, -326, -1057], [12511, -5451, -1156, 187, -1115, 91, -618, -32, -63], [18436, -6938, -1423, 569, 1535, -1042, -423, 82, 945], [4766, -1484, -155, -541, -3365, -702, -293, -64, 897], [20966, 4751, -24, 144, -163, 136, -760, -434, -562], [-4060, -4955, 288, -615, 102, -1208, -859, 409, -540], [24, 635, -1177, -366, -1621, 92, -924, 907, 881], [-2202, 3168, 1059, -324, -1218, 527, -533, 24, -140], [-29029, -5361, -1704, 445, 2419, -700, 322, -533, 263], [10016, 5380, 438, 330, -924, -424, 390, -530, -1444], [10402, 2528, 647, 350, 1224, 1643, 1009, -200, 506], [1879, 2867, -992, 481, 130, 282, 637, -420, -488], [50947, -4901, -443, -356, -388, 268, -241, 341, 62], [-7100, 1990, 303, 271, -672, 1384, 1011, 508, -672], [-16659, 3851, -485, 870, 1362, 289, 1759, -24, -876], [2995, 3727, -436, 882, 3580, -208, 18, -620, -722], [23183, -3251, -679, 654, 986, -565, 655, 226, 336], [-4202, -2122, -1111, -307, 87, -574, -1313, 1190, -1299], [-29700, 1576, -1671, -116, -1508, -853, -469, 1136, 476], [-7813, 5547, 26, -716, -1318, -1124, 360, -692, 804], [-8930, -7404, 1024, 64, -2426, -60, 252, 316, 1046], [-2583, -6007, -1804, -133, -1215, -762, -124, -759, -807], [50402, -1000, -660, -276, 1185, -70, -823, 187, -461], [-22820, 6613, -1350, 232, -1716, 294, 766, -380, -493], [43972, -1666, 1100, -504, -581, 428, -658, 962, 243], [-3864, 4104, -1679, -341, 771, -96, -459, -404, -1519], [-8113, -3477, -832, 78, 886, -742, -1244, 904, 844], [20101, -1273, -477, -62, 98, 169, -367, -1234, -364], [-6, -2930, 968, -414, -1772, 176, 270, -170, 80], [21984, 7942, 1154, 13, -2021, 1494, -741, 169, -148], [11862, -5278, 768, -1086, -1568, 1102, -406, -668, 1408], [-22286, 287, -1628, -98, -411, -1906, -1744, 136, 1700], [-8952, -916, -1473, -93, -1543, 637, -265, 81, 743], [-4076, -924, 2649, 294, -608, 193, 1127, -1150, -374], [-3778, 1212, 464, 185, -1214, 1943, 770, -350, -762], [10793, -7775, -425, 378, -1391, -1574, 398, -1556, -351], [7465, -5211, 279, -728, 851, 1228, 14, 304, 307], [8726, 2537, 289, 794, 850, -1112, 750, -465, -218], [-21619, -2574, 1398, 235, 2167, -525, 576, -454, 878], [-24964, 1666, -2037, -435, 841, -784, -789, -1434, 925], [19557, -8634, -589, -1000, -210, -111, -1539, 138, 421], [-12597, 531, -292, 947, -20, -1000, 483, -726, -1990], [-12623, 4167, -1352, 228, -198, -1516, -220, -286, -1092], [19366, -2526, -82, -761, 762, 226, -1083, 585, -1115], [11849, -4059, 1314, 697, 776, -159, -295, 1073, 138], [207, -231, -1536, -57, -519, 344, -200, 969, 1945], [12450, -7660, 451, -833, -2771, 952, -679, 694, -547], [37596, -4726, 508, 402, 2236, 100, -1034, 988, 44], [-21814, -938, 374, -208, -884, -1648, 228, -1114, 1156], [-8370, -1221, -650, 92, -338, 556, -956, 724, -1007], [27068, 4420, -369, 829, 2935, -1074, -1401, 518, 1009], [-16732, 927, -967, -101, -157, -1682, -153, -1150, -774], [-29604, -1468, 34, -964, -383, 786, -1725, 1131, 1371], [-4049, 529, -2040, 189, 2288, 724, 269, 432, 506], [-1940, -1514, -1710, -331, -2311, -1226, -1027, 1081, 1148], [33713, -3165, 1242, -379, -2609, 1016, 941, 168, -499], [-21319, 3490, -1499, -967, 1255, -281, -1656, 93, -937], [20004, -7478, 1641, 876, 1393, 417, 2117, -176, 675], [-830, -6768, -1461, 135, -2227, -1140, 906, -733, -1195], [32013, 4787, -557, 560, 1218, -260, 742, -1078, -1422], [29482, 2064, -579, -430, 3665, -608, -64, 363, 256], [-74783, -1593, -2267, 1083, 1701, -1334, 331, -666, 631], [-34538, 3142, -87, 1022, 1812, -672, 108, -349, 901], [-16533, 4351, 1342, 267, -468, 1950, 1357, 1222, -1286], [-21362, 3096, -2160, 1141, 861, -2825, 292, -1984, 521], [-8794, 6028, -170, -1062, -1016, 1136, 522, 2028, 252], [15626, -10905, -23, -342, 928, 1598, 708, -109, -2858], [-31804, -6218, -239, 205, -863, -400, -779, -716, 379], [-52504, 7104, -110, 19, -1968, 400, -1209, 775, -155], [23340, -2532, 1188, -314, -11, -204, -1276, -380, 1053], [-4933, -5531, -732, 335, -923, -1292, -871, -306, -773], [-36090, 343, -1229, -279, -1035, 260, -213, 1122, 166], [10915, -4958, 577, 254, -1258, -1465, -1307, 1478, 2059], [23961, 1025, -2016, 1959, 2817, 580, 1265, -852, -1713], [22, -6785, 1303, 193, -871, -1412, -713, 706, 98], [-18354, -1312, -2877, 645, 539, -2176, 1663, -1920, -1519], [32857, -2851, 1724, -245, 2372, -1164, 763, -814, 1378], [49151, 2675, 1319, -726, -2365, -38, 148, -1142, 1987], [-258, -9413, 122, -770, -798, 2672, -730, 1482, -1065], [-14729, 5311, 3346, -89, -730, 562, -979, 1438, -8], [8343, 645, -1790, 519, 3274, -1572, -1405, -176, 1096], [-17862, 9416, 796, -1083, -21, 1379, 1178, -240, 21], [-12038, 1126, -2195, 1057, 2121, -210, -1363, 80, 27], [3235, 2307, 1183, -950, 3731, 1168, -428, 580, 151], [-152, 5844, 1619, -1305, -1456, -780, -981, -288, 918], [-22370, 5979, -961, -11, 4109, 698, 153, -1808, -2052], [820, 3974, 1546, -1003, -3483, -139, 996, -220, -597], [-17868, 3384, 1292, 368, 34, 1596, 2340, -1122, -2098], [-14143, 1465, 737, 622, 2873, -1514, 76, -734, 577], [27906, -818, 1317, -111, 3314, -511, 1572, -2404, -14], [18978, -3796, -141, 1525, 2315, 362, -991, -1360, -819], [-109290, -3038, -1276, 1057, 334, -545, 218, -186, 64], [-10546, -7944, -1036, 1501, -3401, -1766, 511, -1313, 570], [-20550, -3749, 2615, 363, 109, -952, -135, 398, 2338], [-418, -980, 2418, 974, -1994, 26, 832, -68, -802], [2281, -12039, 1977, -688, -1860, 310, -1091, 2769, 2022], [-45587, -8729, 2426, -1313, -1212, -220, -2229, 2216, 1846], [-29931, 7878, 790, 5, -1777, -403, -660, -920, -600], [-47282, 1020, -734, 108, -1833, 844, -351, 1405, 277], [-48778, 8778, 2750, 716, -286, -1072, 686, -352, 2350], [71473, -2677, 1295, 672, 1422, 2530, 1906, 52, -1634], [-9446, -7708, -1668, 964, 2258, 490, 1418, 738, 1498], [47575, -3203, 1467, 460, -525, -154, 160, -890, -3917], [-42584, -6577, 1511, 617, -2307, 948, 503, -1036, 1218], [14128, -5818, -1296, -1186, 1743, -445, -1089, -1126, 681], [17175, 3281, 1191, -275, 2371, 3382, 829, 1614, -2795], [10171, -6642, -1882, 279, 1679, -119, -2286, 1330, -1164], [7130, 6536, 1337, -207, -1100, -358, 2494, 175, 2184], [-8161, 3884, -2560, 476, -242, -1075, 595, -429, -3376], [-31483, 2125, 1732, 835, -2174, -1128, 785, -1480, -852], [8224, -6212, -459, -389, 6136, -1613, -106, 194, 1620], [-63874, -5192, 1064, -899, -2210, -280, -1867, 917, 1463], [-45960, -11042, 65, -407, -3197, 1312, 283, 1478, -1907], [-20107, -7359, -1519, 578, 1123, 297, 234, 265, -629], [44582, 3908, 1960, -1319, 1510, 1380, 409, 399, 481], [-77515, 10531, 1430, -143, 4163, 2657, 710, -648, -579], [51236, 10794, -1406, 454, 3390, 263, -310, 1073, -2042], [-13304, 275, 2153, 365, 1038, -1476, -1693, -260, 427], [20094, -1394, -747, -327, -1313, 1128, -659, -862, -2387], [-61985, -1213, 644, -1999, -2625, 2211, 644, 986, -1193], [-35292, 10600, -3361, 656, -1010, -1675, 1013, -696, -2894], [5276, 420, 337, 1987, 4074, 264, 3007, -338, 166], [3859, -729, 1263, 991, 2179, -1138, 455, -606, -633], [-21688, 5900, -2356, 1898, 3028, -2193, 184, 1073, 856], [49635, 919, 603, -70, -1618, 1254, -779, 271, -2388], [-51015, -5087, 558, -756, -4102, 1405, -889, 1901, -157], [-58193, 5459, -420, 433, 1968, 1628, 1193, -830, 522], [-45086, -8478, -1106, -971, 269, 1690, 431, 2221, -1000], [-33453, -3387, -1545, 182, 2986, 1677, -747, 206, -686], [-11860, 636, 3257, 348, -2747, -1898, -844, 191, 678], [24126, -4130, -1864, 2, 3899, -2329, -439, -1818, 1793], [-22550, -559, -829, -1412, -2722, -1274, 1278, 1999, 2730], [-52363, 1755, -634, -953, 1053, 1599, 1106, 976, -2915], [-660, -11024, 77, 1332, -82, -1254, -548, -2339, -487], [-67637, 5170, 2818, -2559, 695, 2643, 262, -508, 394], [59843, 6229, 3132, -973, 3222, 1549, -1667, 1741, 776], [10342, 8508, -1588, 334, 705, -105, 1269, -1988, 239], [-92317, 903, 3126, -821, 3168, 1360, 1847, 314, 982], [-92253, -2719, -2773, 1592, 1664, 891, 2359, 944, 246], [-16085, 6695, -1900, -59, 2984, 302, 899, -1322, 22], [-9450, -4042, -3421, 904, 1440, -4289, -3261, 506, 3554], [65691, 1685, 961, 428, -694, 2134, -367, -421, -908], [25502, -12263, 139, 1204, 716, 576, 1844, 763, -1612], [-16458, 6146, -2750, -343, 5816, -870, -1689, 45, -2261], [-35942, 1725, -664, 1112, -1933, 1488, -452, 1444, -2788], [-17181, 3131, -4551, -166, 196, -3252, -2894, 646, -972], [35471, 6149, 2079, -97, -2543, -982, 23, 836, 189], [-45068, 4978, 3001, -510, -2586, 2469, 3667, -1818, -2454], [84629, 2413, 727, -104, 1047, 1470, -1210, 454, -2349], [3997, 2135, 1550, 191, 2342, 1834, -729, 2886, -1444], [-1920, -11364, 3815, -1232, -1520, -1708, -2314, 1859, 4793], [30677, 2897, 1792, -1446, -3284, -882, 640, -1246, -56], [38028, 6287, -454, 100, 1097, -2316, -3296, -640, 1154], [-106603, 307, -773, -246, -2789, -570, -326, -442, -2865], [24736, 15304, 464, -108, 1314, -150, 378, 1624, 2274], [31608, -10380, -913, -399, -3115, 834, 1007, -1434, -453], [17542, 4619, 3134, 315, 851, 124, -2943, -217, 281], [1351, 1081, -705, -246, 4796, -414, 154, -1314, 1048], [-79430, -6204, -2735, 119, -91, -2526, -781, 586, 3519], [23685, 6807, -342, -897, -7518, -2488, -1940, -971, 2942], [-37752, 4268, 2906, 1027, 2405, 883, -692, 468, -663], [-3218, -13298, 986, 912, -1798, -1358, 1028, -1252, 3266], [-1519, -7061, -4370, 733, 1788, -3998, -465, -2900, 1538], [27264, 8212, -1687, 927, -4683, -778, 447, 1702, 679], [15095, -9, 1191, -206, 5678, 1283, 1299, 1648, 624], [6358, -734, 2842, -380, 2320, 390, 926, 2798, 48], [-65012, 11038, 3747, -504, 1131, 3299, 3095, 344, -1859], [-80555, -479, -239, 654, -6686, -1009, -613, -1494, 1180], [-25405, -2219, 410, -379, -2798, 2760, 1553, 1192, -924], [-3122, 11962, 455, 363, 7558, -1343, -1456, 1286, -922], [-13492, 6365, -4912, -46, -3438, -1516, -1258, 684, -2275], [-19990, 6711, 2565, 750, -335, -1132, 1612, -1345, 1741], [11960, 152, 686, 1208, -1318, -3007, 310, -1349, 2274], [-40190, 2686, 2657, -2091, 4851, -72, -627, 1862, 101], [58957, -13550, -2679, -1110, -1978, -803, 699, -2570, -155], [-89300, 462, -564, 51, 1183, -2020, 2569, -2429, 1716], [53740, -5668, -826, -540, 1628, 2880, -879, 3083, 222], [-51696, 17006, 1473, 794, 1632, 4355, 801, -1684, -1838], [36447, 7015, 3946, -1163, 338, 5088, 465, 3630, 164], [-54470, -8014, 555, 397, 3206, 1262, 1556, 727, -2554], [29680, 14352, -1960, 515, -2063, -549, 268, -88, -167], [26310, 4193, 4584, -748, 4872, 2152, -1300, 1024, 301], [-23848, -25200, 1086, -834, -1428, -786, -252, -1430, 2748], [39717, 9689, -830, 85, 2129, -107, -850, 962, 1429], [-65722, -1669, 2056, 936, -2158, -2058, 2254, -2598, 3371], [-27617, 7279, -165, -378, 5291, 256, 1898, -498, -4325], [120514, 8969, 4032, -797, -2057, -228, -263, -639, 3133], [55812, -16020, -261, -1076, -3365, -320, -338, 3113, 1382]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1160_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1160_4_a_d();".
// 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_1160_4_a_d(:prec:=9)
    chi := MakeCharacter_1160_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_1160_4_a_d();".
// 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_1160_4_a_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1160_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![345664, 216256, -196192, -75568, 26700, 5568, -814, -133, 7, 1]>],Snew);
    return Vf;
end function;