
// Make newform 1870.4.a.l in Magma, downloaded from the LMFDB on 04 October 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_1870_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_1870_4_a_l();".
// 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_1870_4_a_l();".
// 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 := [133376, -900114, 1553057, -52830, -235675, 5616, 11155, -48, -188, 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], [-38, 0, 1, 0, 0, 0, 0, 0, 0, 0], [-1077615086506, 2865108434391, -180747416102, -426229252092, 15226033827, 20039370762, -187243343, -335363514, 583064, 1773930], [1683131049628, -5868162087189, 487634632442, 894875660397, -35621821488, -42517720335, 432004490, 716071656, -1359938, -3803673], [-34775287143554, 112216768029017, -9127021067926, -17497205386601, 685491208884, 841880064105, -8196264970, -14270825528, 24849484, 76080479], [-6651207451114, 24688707393783, -2290839333734, -3801960561357, 164893045332, 181702673013, -2064012074, -3066878538, 6934298, 16304601], [-36397724747156, 124147377844903, -10369630465234, -19097255907079, 755306975766, 914534672295, -8890608400, -15477870112, 26152696, 82457371], [-38301482027642, 126967282553071, -9669673202458, -19535148647863, 704716928922, 932487885705, -7777219510, -15761655664, 19273912, 83931877], [40030180077632, -138801485366711, 10999237343788, 21522459053363, -793432324242, -1033175784015, 8801055760, 17510222654, -22253572, -93365447]];
    Rf_basisdens := [1, 1, 1, 3534148449, 2718575730, 35341484490, 7068296898, 35341484490, 35341484490, 35341484490];
    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_1870_a();"
function MakeCharacter_1870_a()
    N := 1870;
    order := 1;
    char_gens := [1497, 1531, 1431];
    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_1870_a_Hecke( : Kf := Kf)
    return MakeCharacter_1870_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 := [[2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [5, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 0, 0, 0, 1, 0, 0, 0, 0, 0], [-11, 0, 0, 0, 0, 0, 0, 0, 0, 0], [12, 1, 0, 0, 0, 0, 0, 1, 0, 1], [-17, 0, 0, 0, 0, 0, 0, 0, 0, 0], [14, 0, 1, 0, -1, 0, -1, 0, -1, 1], [29, -3, -1, -1, 1, 0, 0, 2, -1, 0], [17, 7, -2, -1, 1, -1, 0, 1, 2, 0], [51, 6, -2, 0, 0, 0, -1, 1, 2, 0], [42, -4, -1, 3, 5, -1, -1, -2, 0, -5], [94, -2, -1, -1, 3, 0, 0, -3, 0, -3], [139, -7, 0, 2, -5, 1, 2, -1, 0, -3], [57, 3, 0, -1, 0, -3, -3, -1, -1, -3], [99, 24, -2, 2, -1, 2, 1, -5, -2, 0], [76, -9, 0, 2, 1, -1, 1, -4, 2, -2], [83, 8, -7, -3, 11, 1, -4, 5, -4, 1], [18, 8, 0, -4, 1, -2, 0, 0, -2, 4], [180, -15, -3, -3, -7, 2, 2, 10, 2, 11], [109, 37, 2, -5, -13, -2, 0, -3, -1, 6], [-41, -10, 0, -3, -3, 0, 6, -14, -3, -4], [107, 17, -4, 8, -27, -2, 3, 9, -2, 5], [-31, 4, -9, 5, -2, 7, 6, 4, -2, -8], [-16, 23, -9, 5, 10, 6, -5, -12, -11, -2], [187, -19, -3, -3, 14, -1, -12, 3, 8, -4], [-27, -75, 3, -1, -7, -1, -8, -1, -10, 4], [262, -47, 14, 11, 6, 2, -1, -19, 5, -4], [-257, 4, -17, -13, 2, -2, -3, 5, 12, 5], [-86, -22, -22, 11, 14, 2, -13, 9, -5, -5], [220, -54, -3, 2, -13, 3, -9, 28, 10, 1], [706, 36, 1, -1, -30, 4, -4, -1, 0, -26], [550, -86, 40, -2, 2, -1, 3, -20, 10, 19], [322, -108, -7, 1, 6, -6, 4, 3, -2, -30], [-243, 20, -25, 2, -7, 0, -4, 9, -27, 51], [366, -3, 0, 3, 22, 10, 23, 10, 27, 6], [285, -74, 41, -20, -13, -5, 13, 7, 1, 10], [-432, -45, 6, -3, -33, -5, -1, -19, -8, 0], [387, -125, -15, -5, 23, 27, 16, 6, 22, 8], [577, -56, 41, -18, 8, -9, -1, 6, 27, -12], [572, -60, -8, 8, 29, -8, -31, 19, -29, 9], [374, -223, 14, 23, 12, 13, 12, -29, -29, -29], [-119, 0, 53, 12, -27, -10, 5, -6, 6, 60], [-127, -64, 15, 0, -41, -19, -13, -10, 31, -18], [670, -152, 26, -10, 6, 7, 19, -41, -16, -59], [51, 1, 18, 11, 28, 0, 44, -49, -25, 22], [-633, -27, -49, 11, 2, 2, -14, -10, 23, 12], [991, -193, 34, -13, -92, 11, -17, 12, 31, 23], [1074, -215, -19, -7, 61, 7, 23, 20, -26, 14], [-157, -370, 14, -17, -53, -24, -4, 33, 15, 66], [971, 202, 26, -22, -5, -5, 8, 22, -4, 3], [955, -5, 57, -29, 38, 6, 21, -18, -24, 61], [-1031, -171, 9, 19, 68, -8, -12, -44, -85, -22], [1039, -68, -24, -19, -7, -7, 19, 81, 9, 15], [1052, -129, 32, 23, -33, -17, 20, -11, -3, 1], [708, -345, 12, 42, 44, -11, -21, 7, 10, 1], [675, -383, -40, 3, 77, 0, -50, 16, -9, -14], [444, -59, -34, -21, 65, -24, 21, -61, 17, -96], [-194, -100, -40, -32, -21, 9, -23, -57, -34, 1], [194, 370, 17, -12, -74, 2, 7, -27, -65, 1], [431, 6, 36, 10, 20, -17, 16, -60, -36, -71], [-185, 85, -91, 12, -30, 0, 4, 104, 47, 27], [618, -374, -26, 58, -64, -6, -15, 17, 29, -109], [1223, -383, -27, 35, 95, -1, 10, -48, 8, -64], [-841, -151, 66, 44, -55, 26, 47, 10, -102, 78], [-870, -39, -73, -22, -1, 15, 0, 103, 7, 176], [348, -16, -52, -31, -18, 11, -28, 3, 33, -95], [617, -149, -162, -49, 13, -28, 6, 35, 71, 10], [-149, -216, 30, -2, -302, -25, -12, 63, 102, 103], [-1069, 196, -11, 30, -45, -14, -8, -29, 65, -83], [-325, 403, -111, 59, 91, -46, -29, 14, -22, -25], [3008, -507, 8, 23, -110, -9, -16, -99, -39, -75], [633, -388, -47, -28, -80, -37, -19, -31, -23, -18], [756, -312, 34, -38, -108, 54, 16, -84, 4, -108], [-480, -473, -2, -49, -12, -30, -17, 16, -3, 182], [155, 403, -26, -17, -170, 11, 17, -4, 157, -63], [-572, -76, 121, 25, 89, 15, -23, -120, -52, -68], [1150, 235, -69, 0, -175, 53, 14, -5, 119, 8], [1293, -376, -65, 44, 186, 45, 9, 59, 57, -58], [1359, 690, 2, 24, -159, 5, -52, 59, 60, -51], [861, 206, -31, -120, 13, -4, 36, -41, 99, 53], [-546, -34, 16, 62, 85, 20, -19, 33, -53, 75], [-1733, 908, 90, 23, -198, 55, -13, 110, -69, 94], [-726, 510, 80, -96, -183, 16, 70, -46, 4, 110], [-1058, -24, 86, 70, -384, -25, -31, -2, -2, 29], [61, -34, -51, -44, 148, 36, 44, -134, 63, -63], [507, -77, 1, -1, -88, -106, 21, 82, 2, -145], [2124, -481, 163, -10, 33, 18, 123, -98, 41, -107], [-1281, -162, -63, 20, 119, 1, -51, 86, 95, 28], [2629, -494, 6, 4, -192, -16, -51, 18, -16, -64], [-2157, -209, -197, 25, 106, -16, -33, -101, -2, -139], [1298, 241, 147, 103, -137, 4, 59, -48, 61, -146], [-574, -86, -205, -101, 231, -7, -93, 46, 44, -15], [-1067, 4, 206, -26, -2, -32, 29, -87, -2, -176], [-661, 292, 11, 108, 159, -25, 49, 108, -9, -180], [635, -18, -149, -30, 287, -43, 37, 5, 3, 16], [-799, -786, -35, 12, 377, -9, 82, -72, -90, -73], [-5347, 1041, 189, 49, 83, 47, 60, -6, 42, 156], [1738, -116, -34, 78, -140, 16, 21, 43, 135, -57], [-3475, 1609, 187, 55, -362, 0, 114, -156, 161, -84], [3466, -267, 161, 141, -29, 66, 4, -124, -62, -117], [2939, -305, 83, 14, 116, 82, 64, -146, -147, -213], [423, 594, 93, 16, 136, 101, 111, -139, -17, 86], [1855, 552, 52, 26, -285, -72, -65, 184, 32, 54], [-2369, -668, -188, -95, 363, -69, -99, 270, -65, 109], [-2447, -707, -51, -53, -37, -83, -84, 147, 130, 106], [-5877, 1372, -277, -112, -365, 11, -51, 68, -49, -24], [-2037, -1485, -34, -100, 393, -52, -1, -39, 70, -65], [2778, 1227, -133, 98, -86, 108, -67, -13, 61, -244], [-3678, 1771, 320, 89, -314, 42, 136, -151, -30, 51], [-1555, 534, 169, -42, 159, -13, 125, -104, 61, 66], [-537, 80, 72, -70, -213, -58, -218, 159, 153, 113], [-3098, -613, -73, 13, 246, 22, -13, 94, -209, 18], [2669, -414, 71, -150, 162, 55, 37, -41, -27, 114], [-2021, 1177, -114, 30, -70, -45, -8, 154, 76, -156], [-4368, 813, 104, 23, 35, -47, -68, -60, 161, 69], [-1666, 532, 291, 31, -185, 23, 81, -306, -60, -173], [-5033, -389, 194, -29, -110, -67, -23, 37, 293, 95], [-8246, -495, 43, 56, 57, -19, -66, 191, -109, 74], [185, -923, 38, -49, 102, 23, 115, -24, 9, 253], [-3971, -982, -61, -114, 401, 105, -58, -112, -196, 79], [1622, -322, -365, 48, 116, 28, -55, 50, -71, -213], [-2876, -741, 160, -15, -535, 2, -67, 182, 47, 50], [-809, -364, 67, -87, 556, -101, 54, -142, -30, -175], [-7812, 1406, 66, 48, 627, 93, 119, -318, -18, -315], [-3045, 813, -3, 5, -322, -38, 23, -50, -236, 211], [-1597, 1496, 122, 78, -185, -61, -146, 65, -144, -109], [836, -931, 173, 71, 197, -71, 11, -255, -48, -226], [-17, -1171, 210, -101, -118, -39, 25, 267, 61, 221], [3291, 277, 230, 134, -571, -39, -14, -215, -170, -93], [9142, 401, 221, 95, -271, -43, 153, -61, 68, -162], [2920, -43, -238, 121, -5, -31, -56, -85, -127, 253], [382, -835, 233, 15, 271, 107, -73, 257, 8, 114], [-1894, 910, 89, 22, -256, -135, 42, 0, -9, -140], [-1659, -7, -351, -69, -207, -60, -199, -127, -110, -485], [-865, -471, 148, -195, -87, 35, 7, -5, 49, 465], [7369, -1309, 37, -61, -79, 146, 61, 55, 176, -369], [2034, -2174, -81, -50, -143, -129, -232, 38, 215, -218], [-359, -1145, 17, 11, -317, 14, -29, -25, 346, -55], [13140, 972, -278, 88, 84, 75, 103, -210, -164, -53], [-157, -161, -127, -49, 546, 9, -13, 116, -93, -365], [-2925, 342, 647, 95, -226, -173, -42, 25, -14, 66], [-4261, 545, -45, -11, -139, -122, -22, -316, -219, -40], [894, -218, -30, -60, 88, 5, -197, 328, -226, 535], [-5385, -626, 455, -180, 231, -66, 31, 110, 156, 210], [7610, -1392, 271, 28, -89, -77, 2, -311, -281, 204], [9460, -127, 92, 31, 114, 8, 285, -243, -139, -192], [-6869, -2504, 662, 258, -135, 123, 142, -563, -132, -267], [6730, -829, -42, -2, -163, -1, 29, 80, -56, 34], [4622, -1888, 252, -6, 226, 125, 163, -533, -76, -17], [4524, 83, 560, 213, -837, 2, 113, -405, 93, -206], [4454, -1986, 8, -68, -763, 5, 77, 136, 128, 29], [-3566, -1901, -332, -49, 386, 268, 137, 23, 141, 314], [-2940, -550, -108, 28, 349, -187, -201, 326, -14, 243], [-1975, -338, -382, 54, -357, 104, 77, -78, 142, -378], [-2362, -701, -336, -87, -1036, -32, 27, -102, 233, 310], [2592, 1670, -946, -230, 207, -43, -265, 502, -126, 337], [2609, 760, 181, -86, -1002, -58, 226, -414, -203, -123], [123, -678, -493, -8, 526, 45, 210, 112, -4, -461], [-8612, -188, -145, -24, -355, -144, -15, 335, 383, 15], [-1297, 1532, 269, -47, -678, 11, -206, -264, -70, 9], [6117, 5111, -4, -10, 195, 22, 1, -415, -152, -77], [-8423, -1441, 108, -96, -415, 217, 118, 21, -182, 477], [1269, -992, -316, -328, -317, -78, -173, 292, 378, -98], [-8593, -2835, 229, -17, -196, -36, -9, -291, -368, 35], [-4225, -1926, 132, 125, -283, 78, -280, -269, -65, -491], [-1257, 471, -2, -247, -60, 86, 264, 257, 121, 80], [-2241, 1571, 111, -167, 323, -32, -221, 200, -172, 313], [-9079, 648, -44, 459, -122, 114, 14, -248, -191, -83], [11218, 2357, -84, 85, 683, 65, 189, -479, 116, -238], [4804, -552, -877, -82, 1485, -81, -562, 329, -31, 76], [-5410, -2527, 627, -34, 20, -48, 133, -127, 71, -332], [-8714, 2432, 30, 351, 428, 275, -30, -214, 35, -403], [-2724, 858, -500, 84, -786, 18, -42, -352, 250, -636], [-185, 178, 88, 25, 517, 12, 250, 579, 7, 766], [-14044, 2038, 346, -216, 319, -44, 108, 7, -110, 236], [-13651, -1004, -84, -79, 1590, -35, 45, -516, 241, -366], [-15031, -2106, -16, 4, -557, 104, 263, 338, -306, 530], [16672, 2992, -7, 294, 43, 79, 213, -338, -32, -447], [-1540, -1195, 154, 71, -1183, -25, 242, 168, 593, 289], [-11469, -3266, -460, -94, -34, 102, 131, 589, 248, -96], [-5189, 1010, 668, 85, 18, 31, 3, 66, -549, 474], [4656, 1869, 702, 239, -129, -67, 15, -535, 220, -446], [773, 1906, 107, -262, -536, 119, 240, -68, -338, 109], [8302, -2686, -104, 120, -290, -226, -16, 253, 38, 90], [-2845, -2838, 731, 72, 371, 106, 261, -648, -262, -212], [140, 1964, 180, 376, 477, 102, 304, -137, -204, -206], [18752, 3557, 364, -3, 473, 242, 373, -206, -479, 550], [-6677, 1982, -142, -133, 837, 148, 96, 302, 169, -166], [-12797, 2697, 529, -201, -604, -223, 151, -148, 211, -283], [-5636, -1406, -646, 196, 634, 32, -352, 566, 98, -326], [3138, 2666, -643, 266, 597, 17, -140, 351, 299, -418], [-9605, -2984, 516, 538, -444, -24, -56, -33, -83, 117], [-9645, -398, 573, 238, -823, 277, 602, -986, 210, -807], [-4156, -2873, 373, -255, -527, -174, -240, 476, 148, 583], [12572, 3316, -945, -319, 23, 39, -485, 1020, 442, 561], [-6980, 786, 495, -35, 616, 4, -32, -65, -56, -382], [-428, 2433, -1, 192, -1563, -163, 198, -465, 541, -226], [6722, 578, 151, 156, 400, 50, 111, 676, 301, 425], [21642, 214, 771, 322, -97, -139, -319, -112, 24, 307], [-7817, 1800, 934, -149, -796, 184, 134, -534, -603, 751], [-7185, -1232, 866, 388, -1015, 5, -16, -556, 244, 83], [1162, -3970, -474, -190, 284, -44, 90, 559, -420, 36], [-635, 4104, -98, 332, 519, -105, 12, 31, -436, 713], [29722, 2770, 62, -154, -68, -161, 143, 636, 200, 109], [19489, -1898, 321, -72, -255, -129, -235, -42, -313, 88], [11919, -2670, 84, 127, -1369, -188, -4, 193, 385, -54], [10135, 2604, 417, -164, -228, -295, -44, -784, -372, -593], [-2958, 3351, 1054, -173, -1758, 59, 433, -527, 328, 330], [-3378, 206, 656, -155, -946, -80, 195, 335, 567, 420], [-20365, -1318, 126, -270, -747, -194, -311, -219, -490, -538], [1782, -523, 347, 340, -756, -152, 317, 737, 11, 148], [18988, 5233, 127, -142, -91, -215, -64, 667, -159, -172], [-19883, -624, -81, 162, 708, 389, 31, -336, -369, -92], [26512, -1044, 570, 393, -319, 189, 298, -42, -171, 104], [-11880, -1610, -1296, -122, 2015, 104, -298, 395, 256, -246], [11291, 4527, 367, 240, -950, 85, 477, 236, -157, 329], [7156, -2409, -597, 273, -752, 92, 94, -189, 662, 73], [-11077, 1833, 238, -350, -1055, 256, 513, -126, -168, -78], [1467, 399, 48, -313, -1567, -247, -297, -565, -77, -571], [-4666, -2137, 30, 117, 639, 65, 30, 564, -723, 297], [3282, 1130, 488, 265, -1715, 90, -469, 398, -571, 455], [11905, 1555, -186, -138, -1006, 71, -170, 574, -218, 900], [-7192, 925, -541, 20, 275, -369, 92, 821, 271, -194], [15053, -877, 414, -240, 919, -119, -174, -247, 790, -225], [10415, -807, 841, 399, -755, -265, 28, -1004, 80, -672], [1651, -2585, 471, -46, -1498, -13, 819, -377, -401, 300], [-7822, 4597, -417, 247, 1717, 448, -306, 88, 362, -623], [26362, 7765, -74, 262, 80, 191, -65, -533, -546, -219], [7813, -4326, -526, -771, 865, -33, -201, -10, -377, -629], [35267, 4998, -1116, -252, 1191, 137, -576, 336, 54, 563], [-11580, 890, -988, 40, 934, 191, -147, 762, 492, -659], [1227, 4384, -533, -626, -1288, -13, -385, 615, -363, 886], [1189, 1538, -1322, -208, 1309, 132, -649, 856, -146, -134], [9938, -3723, 722, -5, 136, 55, -390, 39, 649, 111], [14725, 564, -807, 554, 768, -41, 90, -492, -474, -1119], [244, -2192, 936, 322, -321, 61, 67, 484, -648, 955], [-11741, -2212, -561, 336, 2159, 337, -7, 165, -427, 124], [24310, 762, -818, -294, 643, 404, -206, 141, 300, 986], [-6581, 198, -711, -6, -1060, -262, -156, 395, 277, 601], [41207, -1915, 848, 17, -20, 11, 436, -763, -288, -516], [10627, -2007, 291, 181, 627, -486, -529, -865, -322, -599], [4755, -4641, 63, -303, -1687, -24, 367, -28, 86, 419], [-22281, 1722, -331, -814, 559, -399, 446, 622, 738, 367], [30596, -3867, 337, 203, -856, 320, 224, -349, -116, -161], [-22448, 2708, -714, 113, 137, -305, 350, -1086, 311, -1502], [16483, 3909, -1178, 10, -1245, 266, -269, -344, -180, -560], [13756, -4065, 124, -599, -263, 312, -17, 177, 479, -534], [26055, 1520, 235, -66, -1157, 107, 375, 268, -527, 438], [21293, 8108, -802, -148, 489, -38, 49, 892, 208, 452], [9520, -532, -31, -1008, -13, 279, 408, 121, 605, 1522], [5531, 281, -791, 311, 1494, -177, 247, -374, 435, -285], [25780, 8388, 407, -244, -789, -26, 285, -277, 307, 797], [-16919, 611, -1051, 101, 1521, -147, -304, -534, -608, -668], [73, 3412, -728, -192, -587, 328, 370, 989, 113, 237], [9879, -2576, -540, 146, 852, -271, 126, 686, -124, 577], [-14017, -4283, 130, -301, 1545, 219, -169, -307, -623, 555], [12502, -4016, 60, 366, -516, 93, 629, 429, -174, 519], [-29025, -3396, 550, -313, 2003, -68, -176, -327, 643, -505], [46272, -462, -610, 52, 632, 346, 157, 547, 293, -301], [10341, 1617, 637, -449, 1914, 263, 362, -944, 616, 554], [39837, 2171, -26, -334, 287, -366, -321, -35, -212, -193], [4966, -1222, 422, -74, -2988, -135, -157, -548, 340, -875], [25678, 1212, 328, 216, 907, 464, 632, -630, -150, 364], [-6524, -4270, -554, 7, 898, 602, 95, -485, -507, -495], [14521, -127, -1808, -478, 826, 548, 341, 856, 64, 53], [32019, 3113, 382, -28, 1648, 14, 121, 106, 770, -539], [11908, -656, 325, 212, -732, -11, -227, -454, -634, -1113], [2327, 4821, -556, 849, -1396, 728, 832, -582, 93, -434], [42480, 7131, -223, 184, 2105, 235, -378, 324, 425, -273], [-13004, -2023, 341, 739, -1838, 432, 584, 75, 80, 451], [-11540, -1004, -94, 154, 302, -154, -146, 1376, 640, 1450], [2196, 2646, -992, 226, -243, 209, -759, -529, -700, -469], [24993, 5960, -449, -186, -1509, -78, -48, 765, -1047, 133], [43065, 4615, 968, 730, -451, -5, -182, -5, -674, 1345], [24799, 8020, -596, 32, 1846, -79, -214, 318, -428, -303], [43497, -764, 649, 602, -1430, -382, 58, -852, -1237, -67], [-23499, 150, -417, 170, -921, -391, -267, -294, 5, 250], [-23387, -418, 98, 140, 735, -158, 145, 336, 698, 482], [19690, 8376, -1479, -442, 11, 176, -415, 1270, 313, -527], [10524, -2795, -117, 104, 1441, 321, 334, -1256, -1099, -415], [6477, 2599, 3132, 565, -3488, -316, 360, -939, 69, 192], [19923, 5790, 959, 376, -1879, 27, -379, 127, -351, -160], [-8861, 3127, -643, 91, 1984, -160, -433, 1026, -210, 181], [23614, -6885, 674, 167, -1436, 54, 409, 739, 679, -138], [69687, 1335, 906, 190, 228, 315, 440, -610, -12, -882], [19280, 4222, -445, 154, 225, -289, -256, -625, 1177, -1602], [31512, 2127, 302, -37, -1614, -239, -58, 794, -111, 1719], [2001, 8736, 490, 553, -149, -35, -179, -433, 1093, -635], [-17013, 5604, -66, 128, 1, 618, 647, 408, 158, 624], [-37839, 58, 1586, 212, -961, -112, -423, -244, -300, -870], [27357, 4883, -1130, 197, -402, 267, 792, -475, 170, -382], [19938, 7944, -328, -172, 1370, 260, -333, 191, -417, 115], [56963, -3084, 428, 403, -701, -331, 5, -158, -627, 755], [-12443, -4907, 111, 165, 1709, -89, -92, 12, -410, 748], [-59743, 2720, -1111, 65, -507, -118, -835, 731, -440, 516], [-4674, 1427, 197, 140, -866, 741, -850, -1461, -609, -109], [19870, 8777, 593, -223, -530, -297, -519, -548, -640, 1364], [39131, -1166, 1064, 475, -782, -174, 816, 120, -997, 5], [19773, -1312, 1561, 184, -1552, -677, -113, -479, -409, 518], [11309, -4097, -700, -704, 1149, -191, -1084, 433, -534, 1271], [25984, 8846, 159, -132, 1347, 393, 474, -257, -751, -798], [-22954, -345, 1223, 173, -2441, 548, 171, -214, 49, 262], [-449, 602, -1320, 144, 1459, -16, -1517, -70, -538, -316], [-30218, 5182, -1284, -422, 93, -653, -735, 538, -252, -191], [2442, 2077, 602, 245, -307, -261, 405, 463, 382, -486], [27657, -2454, 925, 510, 1297, -228, -902, 184, 379, -359], [-11997, -497, 766, 287, 457, 642, 786, -1250, 361, 230], [35680, 3266, 163, -555, -141, -189, 711, 734, 64, 586], [-13335, -1669, 475, 458, -3470, -440, 308, 314, 1157, -19], [45705, -1691, -997, -701, -793, 126, -53, -566, 450, 571], [-14499, 1155, -757, -483, -2529, 182, -467, -753, -416, 1159], [-9042, 7954, -93, -689, -2198, 281, -507, -783, -1132, 1033], [11048, -176, -1268, 110, -2529, 148, 474, -1153, -306, -74], [29228, -5160, 1253, 302, 1291, 25, 1079, 506, 1016, -911], [-1035, -334, 1242, -132, -587, 355, 8, -23, -532, 1405], [-21085, -3790, 1068, 1124, 3666, 180, 446, -1491, -465, -1207], [13889, 8224, -1252, -255, 2663, 135, -1235, -710, -923, 173], [-4216, 1606, 1225, 119, 205, 541, 1273, -1928, 310, -479], [9788, -2051, 161, -459, 356, -470, -710, 187, 1280, -123], [-47942, 822, 139, -721, 3625, 191, -343, 731, -26, 406], [-4397, 3577, 2513, -60, -1444, 17, -311, 93, -237, 850], [16694, 855, 494, 899, -1595, 139, 754, -1312, -681, -173], [16514, -890, -1314, -246, -624, 195, 149, 690, -438, 857], [-50230, 1133, 871, -357, 488, -501, 947, 603, 568, -522], [15336, -328, 155, 342, 2658, 443, 885, -1104, -404, 139], [-4507, 275, -423, -83, 246, -665, 62, -211, -990, 236], [3321, -9724, -2781, -849, 1492, -823, -892, 1058, 100, -643], [29902, -11884, 70, 224, 930, 1, -1047, -144, -884, 797], [4900, -996, -118, 266, 1937, -26, 230, -844, -740, -838], [-75727, 7368, -12, 663, 1980, 93, -215, -250, 339, -78], [36779, -1041, -480, -210, -1227, 432, 577, 2254, 342, 1012], [-46049, 4934, -432, 381, -384, -678, -444, -624, 515, -1309], [92022, -4147, 975, -136, 945, -117, 532, -388, 371, -959], [-26763, 2416, -1103, 270, 398, -1110, -286, 725, 421, 23], [55336, 2950, -25, -173, 7, 313, -169, 1082, -946, 787], [-24696, -2337, -885, -1098, 2116, -97, 236, -1769, -513, -1655], [19542, -2306, 2124, 164, -1314, -520, -414, -25, 860, 250], [-36961, -481, -1221, -1425, 1310, 216, -123, 1576, 1464, 229], [44734, -851, -49, -664, -93, -589, 360, 724, 375, 763], [18872, 7510, -679, -1234, 2650, 37, -28, 1611, 349, 1220], [-4439, -10151, 323, 329, 324, 666, 545, -115, 74, -1257], [9813, -10720, -413, 323, 1970, 359, -490, 185, -464, 196], [23939, 1645, -362, 448, -1534, -871, -36, 202, -130, -1432], [-38579, 1762, 553, -814, 327, 335, 1131, 467, 2123, -14], [5629, -7560, -884, -601, 2133, 541, 431, -952, 245, -527], [-58346, 1035, 1502, 525, -726, 568, 1051, 566, 459, 1558], [-4986, 11055, 1236, 1081, -1274, 691, 450, -1518, 351, 375], [-21030, 6480, -318, -567, 5203, 473, -450, -1376, -377, -1126], [-44351, -8317, 1785, 513, 3741, -732, 160, -1000, -723, -882], [-14654, 5473, 1460, -987, 690, 97, 744, -405, -367, 93], [-38010, -8296, 227, -765, 4661, -327, 141, -608, 584, 371], [27538, -320, -1956, 512, 49, 822, 751, 1141, 1679, -17], [-8139, -2574, -579, 1126, -4884, -209, 99, -516, -1231, 156], [564, -1589, 376, 503, -2628, 151, 512, -1399, -425, -2073], [-11388, -3555, -1233, -802, -1857, -482, -587, -378, -1193, 55], [21153, 9912, -1048, 187, -2829, 116, -228, -77, 991, -122], [49920, 8103, 20, -245, -2340, 629, 643, -807, 436, -236], [-61169, 4059, 137, -995, 2137, 282, 77, 531, 638, 661], [-9447, 7720, -2594, -206, 1586, 160, -1883, 2006, -260, 1852], [-27338, -1524, -896, -630, 4277, 690, -1170, 472, 750, -256], [17475, 3736, -964, -303, 1120, -667, 451, -476, -725, -1650], [26601, 6483, -619, 361, 23, -197, -392, 1497, -450, 1710], [-55941, -1034, 120, 359, -568, 572, 400, -1134, -1111, -179], [15500, -2698, -222, -898, 2110, -346, -364, -574, 1006, 1128], [-13901, 5368, 2585, 274, -381, -413, -645, 1719, -459, 138], [18163, -9727, 1139, -1057, -2577, 287, 484, 782, 1264, 166], [28457, -850, 1778, 1190, -1003, 1282, 1157, -1960, -1140, -950], [-19897, 5170, 2185, 1466, -1918, 190, 80, -1553, -417, -731], [-1780, 6344, 1932, -325, -1736, -120, 641, 321, -1581, 116], [-19383, 6162, 1683, 62, 1008, -297, -323, -769, -699, -244], [50717, -10944, 71, 1256, 983, -876, -172, -1411, 1227, -2121], [-40400, -9334, -734, -490, -853, -430, -336, -667, -636, -1566], [23425, 765, -1349, -275, -1162, 963, -406, 2055, 594, 3032], [-44683, 65, 413, -1227, 2579, -212, -10, -956, -417, -1466], [42780, -7236, 1442, 1698, -3651, 595, 657, -58, -762, -339], [19834, 1536, -1488, 145, 37, 546, -763, 594, -613, 131], [-6523, -3819, -2620, -620, 2123, 92, 249, 1709, -378, 19], [-46497, -4501, 552, 1025, 191, -757, -417, 1391, 69, 1023], [-20154, -11439, 147, 228, 845, 493, -1098, -2020, -1267, -1365], [3117, -1489, 2572, -769, 2053, -1157, -35, 679, 601, 1137], [-13424, -858, 1138, 302, -460, 244, -408, 119, 396, 580], [-4175, -2872, -2785, 302, -2743, 764, 80, 1584, 557, 1191], [-67044, 3610, 1361, 6, -622, 127, 826, -501, 1573, 1418], [-60930, 143, 2394, 525, -1628, -587, 189, -1105, 900, 1828], [-52700, 4216, 3276, 306, -3638, -498, 118, -230, 268, -512], [-10562, 17638, -1120, 736, -809, -530, 299, 1235, -187, -573], [-5218, -5467, -2100, 349, 4954, 30, -895, 893, -175, 328], [-18723, -2731, 406, 1347, -42, -112, 622, -1418, -239, -642], [22430, 1953, 426, -583, 2038, -51, 476, 1627, 461, -35], [-3979, -1412, 1905, 122, -615, -365, 263, 1480, 173, -192], [-46294, 9118, 715, 1517, -2473, -589, 641, -1720, 1774, -135], [42753, -2020, 1370, 498, 5109, 1, -496, 394, 146, -1385], [-26681, 6664, 183, -620, 348, -179, -1547, 479, -695, 676], [-30844, 3816, 588, -236, -2483, 890, 1475, -1007, 607, -285], [-48250, -228, -1842, -278, 80, -104, 548, 1189, 578, 28], [10256, 307, -2156, -701, 2373, -8, -575, -93, -595, 994], [15247, -6462, 1658, 25, -3349, 540, 936, 427, 583, 1270], [-55346, -1880, 1044, 1130, 75, -146, 1288, -107, -208, -2408], [39363, 2960, 407, 1608, -1571, 1003, -447, -1436, -919, -344], [21269, -15605, 153, -1489, -204, -302, 38, 252, -53, -618], [959, 15693, 1969, 465, -4723, 192, 801, -3258, 1018, -175], [6647, 3821, 219, -784, -480, -377, -1039, -476, -1147, -1555], [33645, -16843, -1475, -76, -192, 181, 957, 129, 1125, -240], [33955, -9429, -1401, -745, 905, -831, -846, 1496, 288, 1310], [-44977, 15776, -1720, -1221, 599, 1133, -153, 1050, -729, 899], [10167, 4203, -56, 205, -2089, 1116, 454, -701, -27, -2814], [549, -6065, -1699, 673, 2171, 489, 628, 960, 1164, 2062], [-41103, 416, -1155, -2178, 2415, 645, 373, 1113, 809, 1284], [980, -3103, -2818, -1295, 1486, 117, 440, 311, -345, 1159], [-32337, 1534, 594, 1378, -2495, -355, -714, 257, -1754, -123], [-44791, -1183, -1921, 104, -1500, 78, -1466, -2324, 129, -1661], [-28218, -11599, 1190, 977, 3443, -350, 415, -1260, 313, -1154], [-35467, 3323, -755, 839, 2644, 278, 1816, -1484, -1001, 820], [-23371, -13285, -590, -862, 1115, 266, 345, -1457, -324, -455], [10465, 8532, 234, 1446, -2375, 298, -727, 396, -118, 1140], [68383, -4505, -121, 365, -448, 30, 196, 3328, 1413, -120], [-56624, -15991, -792, -1313, 187, -489, -619, 1209, 302, 878], [7204, -3328, -880, -1699, 1150, -988, -387, 867, -667, 73], [-8838, 13137, -3080, 74, -106, -1291, 215, 1149, 1876, -1113], [26595, -5979, -3262, -368, -684, 257, 274, 384, 914, -596], [15119, 4794, -3283, -1144, -2271, 6, 470, -659, -297, 497], [44081, 3573, -2358, -2660, 1133, -222, -1113, 5446, -38, 2194], [18765, -1273, 2050, -201, 3904, 930, 772, -1515, -309, 110], [-42396, 4030, 1667, -462, -9, 421, 288, 3069, 887, 3220], [-74186, -10530, -1963, -224, -3892, -704, -173, 1759, 2313, 1667], [-31226, -4268, 2116, -30, -6608, 134, 1442, 780, -1222, -50], [-444, 5655, -108, 461, 2870, 876, 1456, -609, 894, 255], [29397, 3102, 4470, 28, 1608, 772, 1128, -2401, 587, -651], [73515, -10067, 2013, 203, 5180, -614, -1020, -1478, -151, -1638]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1870_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1870_4_a_l();".
// 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_1870_4_a_l(:prec:=10)
    chi := MakeCharacter_1870_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_1870_4_a_l();".
// 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_1870_4_a_l( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1870_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![133376, -900114, 1553057, -52830, -235675, 5616, 11155, -48, -188, 0, 1]>],Snew);
    return Vf;
end function;