
// Make newform 1870.4.a.j in Magma, downloaded from the LMFDB on 15 September 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_j();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_1870_4_a_j();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [1239820, -2545931, 1064495, 269951, -177203, -8357, 9025, 138, -168, -1, 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], [-34, 0, 1, 0, 0, 0, 0, 0, 0, 0], [61946558969024, -100136504023535, 1409614613354, 10587246201675, 13050721352, -280653563492, -1995578838, 2139046692, 14345391, -1418864], [-38434968318281, 42900830424779, 2179236618529, -6891056697519, -90529912592, 333272268635, 3797467365, -6041299572, -40587027, 35618030], [26248026321743, 129591486417163, -49392854218345, -30046172417766, 5025170029856, 2015142302743, -110257158024, -42017831958, 644823840, 261476227], [-33614659373033, 66000533168135, -11296527867077, -13281650708331, 1517252492908, 892939297265, -32230000527, -19034162997, 168498822, 120921722], [327314334748880, -382349379296273, 16810503426389, 62432531356524, -4308313278223, -3438276985121, 101991030765, 66570823938, -581928192, -401828813], [191533010569300, -603328073572192, 119038209898294, 95256410323011, -12150669081566, -5176777457017, 267798251931, 99268261587, -1591189881, -593618545], [792007981928909, -1073578693602245, 33005127423221, 179419733033970, -8459528668594, -9761813784548, 184311433641, 188074882305, -908653584, -1135239893]];
    Rf_basisdens := [1, 1, 1, 2260973693961, 753657897987, 2260973693961, 753657897987, 2260973693961, 2260973693961, 2260973693961];
    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], [0, 0, 0, 0, 0, 0, 0, -1, 0, 0], [-11, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 1, 1, 1, -1, 0, 0, 0], [17, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 0, 0, 1, 1, 1, 2, 0, 0, 0], [-11, -4, 0, -2, -3, -2, 0, 2, 0, 0], [10, -11, -2, -3, -4, -5, 2, 3, 1, -3], [1, 5, -2, 2, 1, -3, -1, 1, -2, 0], [49, 11, 1, 0, 0, -3, 4, 0, 0, 4], [-68, 3, -5, 3, -3, 4, -4, 6, 2, -1], [69, 20, -2, 4, 7, 5, -3, 2, 0, 0], [-22, 19, -1, 0, 11, 8, 0, 7, -1, -3], [-29, 4, 2, -2, 1, -1, 2, 12, 2, -1], [60, 16, 2, 1, 5, -9, -4, 1, -1, 2], [0, -35, -1, -10, -1, 8, -4, -1, 0, -3], [152, 4, 8, 6, -14, 4, 4, 7, 0, -2], [-161, -6, -1, -5, -15, 2, -3, -4, 13, -1], [-128, 16, 1, -2, 3, -8, 7, -16, -1, -2], [27, 25, -1, 6, 3, -12, -8, -22, 6, 12], [-25, 74, -12, 3, -4, -8, -4, 2, -3, -3], [-61, -56, 9, -25, -18, -3, 17, -12, -4, -9], [1, 44, 6, -10, 8, 1, -3, 14, 7, -7], [-378, 61, -3, 17, 20, 11, 8, -8, -17, 9], [22, 137, 1, 1, 2, -5, -2, 9, -5, 3], [-20, -22, 25, -6, -10, -5, 2, -22, 2, 9], [-216, 79, -23, 3, 16, 27, 7, -16, 9, -16], [-216, 36, -5, -13, -3, -2, -8, -16, -5, 17], [382, -22, 5, -20, 2, 44, 0, -11, -2, -14], [-184, 173, 3, 14, 6, 31, -15, -7, -11, 34], [30, 174, 10, -16, -32, -10, 8, 4, 14, 22], [-310, 181, -5, -4, 24, 21, -1, -39, 9, -18], [-133, 152, -14, 7, 0, -18, -16, -33, -2, 5], [-7, -102, 25, -14, -4, 33, -5, 30, 11, -5], [413, 16, -2, 13, 10, -32, -26, 13, 4, 13], [-52, 125, -44, 5, 41, -26, -35, 38, -4, 0], [29, 99, -1, 11, -24, -11, 31, 49, -36, -29], [-484, 68, 12, 7, 0, -36, 45, -12, -29, -3], [-669, -78, 25, -7, 19, -19, -13, 28, 7, -10], [602, 107, -11, 12, -26, -39, -15, 44, -20, -20], [-496, -164, 11, -14, 71, 49, -29, -4, 1, 21], [-610, -44, -78, -5, -4, -30, -9, 37, 19, -5], [-353, 5, -52, -6, -108, -12, 6, 30, 31, 13], [-768, -61, 53, -40, -5, -44, 40, 15, -11, -29], [277, -261, 18, -42, -51, -10, -43, -25, 14, 15], [1045, -238, 13, 30, -49, -32, 22, 63, -34, 52], [193, 15, 21, 9, -69, -70, -44, 66, -17, 36], [84, -228, 65, 36, 3, 96, -34, -30, -21, 39], [-72, 168, 8, 20, -17, -59, 25, 14, 23, -33], [-1059, 231, -3, 55, 32, -47, 17, 78, -30, 41], [-1143, -165, 4, -8, 1, -94, 9, -23, -26, 9], [-1664, -290, 5, 12, 141, 84, -6, -70, 29, -9], [-1076, -272, -13, 8, 106, 63, -16, -5, 20, 17], [-1513, 214, -14, 112, 130, 20, -36, 114, 21, 15], [-1551, 41, 75, -36, -7, 42, -3, 8, -8, 39], [-1082, 25, -27, -18, 42, 39, 29, -33, 50, -8], [465, -98, 4, 68, 140, -6, 7, -89, -47, -8], [-2559, -126, -12, 11, 43, 51, -9, -89, -35, 58], [-108, -221, -10, -98, -97, -7, -18, 41, -39, -24], [-888, 200, 20, -7, 138, -20, -34, -124, -7, -30], [-101, -32, -97, -55, 11, 83, 65, 11, -45, -26], [127, -271, 49, 51, -126, -9, 89, 165, -46, 35], [1726, -378, -16, -46, -45, 1, 62, 50, -39, -36], [369, -291, 38, 61, -71, 3, 33, -36, 47, -26], [-556, -161, 133, -66, -140, -63, 76, 120, 40, -5], [1056, 475, -27, -10, -105, -92, -30, 138, 45, -81], [-1807, -116, 16, 48, -73, -9, -22, -127, -30, 9], [-3267, 24, -128, -5, 28, -10, -118, 15, 48, -55], [-1869, 149, 51, 75, -58, -85, -99, -73, -8, 29], [-1310, 129, 259, -110, -126, 19, 161, -40, -26, 12], [363, 601, -66, 91, -54, -40, 51, 34, -78, -32], [950, 223, 106, -18, -200, 26, 79, 6, 6, 19], [-2293, 434, -3, -46, 64, -83, -67, 54, 87, 59], [-2689, -430, -129, 62, -67, 154, -18, -5, 26, -30], [-2023, -448, 179, -113, -39, 168, 32, 46, -63, 82], [475, -77, 102, -35, 29, 169, 41, -120, -127, 190], [-2967, -121, -178, 95, 228, 24, 93, 50, -146, -20], [-969, 11, 20, -146, -25, 115, -113, -18, 132, -96], [-4107, 444, 20, -63, -214, -256, -62, 239, 24, -117], [1219, -207, -19, 43, 3, -137, -18, 186, -13, 35], [-637, 186, 31, 99, 12, 271, -10, 93, 65, -60], [-3956, 275, -102, 142, 266, 136, -19, 139, -16, 19], [-4864, 655, 40, 160, 120, 42, 25, 306, -132, 73], [2502, 89, -18, 105, 66, -74, -130, 8, 131, -68], [-2741, -6, -95, 175, 394, 273, -230, -180, -72, 38], [-140, -844, 172, 97, -161, 21, 11, -74, 64, 41], [-5510, -585, -90, -9, -116, -100, -134, 105, 69, -66], [-806, -418, -6, -92, 123, 21, -119, -67, -25, -25], [-4322, 168, -85, -143, -256, -111, 75, 222, 49, 62], [-6049, -234, -14, -142, -234, -101, -35, 9, 101, -59], [-2781, -359, 73, -140, 84, -31, 280, -54, 76, -144], [1679, 333, -34, 128, 1, 71, -51, -101, -28, 22], [648, 969, 276, 9, 74, -102, -52, 167, -101, 104], [-179, -448, -52, -125, -540, -6, 58, 47, 226, -13], [-5820, -495, 43, -2, 173, -133, -78, -70, -71, 128], [-1267, 35, 23, 43, -136, -177, -61, 213, 28, 135], [-949, 1260, -55, -7, 407, -13, 75, -5, 11, -140], [1223, 774, 104, 70, 169, -302, 72, 125, -90, -96], [-2601, 460, 225, -197, -77, 26, -139, 194, -33, 105], [-3940, 1164, 154, -265, -156, -210, 108, -116, 27, -148], [4963, -449, 196, -151, 162, 108, 37, -116, -208, 38], [-4918, 563, 150, 28, 23, -183, -52, 440, -7, 94], [-2787, 471, -185, -54, 161, 116, -234, -252, 104, 158], [648, 1196, -265, 269, 278, 175, -143, 453, -49, -184], [-3944, 241, -54, -341, -98, -260, 238, -19, -31, -88], [3711, -451, 170, 123, 158, 18, 13, -70, -123, -118], [-777, 1143, 52, 134, 472, 6, -4, 333, -30, -165], [2936, 305, -80, 49, 521, 396, -177, 49, 66, 10], [5340, -481, -22, 157, -322, -26, -180, 151, 105, 168], [4603, 842, -173, 39, -134, -438, 166, 123, 74, -221], [-3681, -1371, -54, -52, -210, -91, -86, 56, 35, -16], [2727, -832, -62, 99, -216, 274, -134, -146, -26, 61], [-4138, -240, -128, 75, 242, 220, -209, 87, 62, 229], [-1643, -521, 173, 118, 514, 477, -132, -447, 55, 62], [5597, 781, -29, -96, -292, -37, 28, -64, 50, 288], [1388, -58, -209, 174, 471, -160, -225, 89, -13, 116], [4459, -967, 44, -331, -133, -395, 85, 274, 141, -172], [-2629, -38, -213, -132, -409, 52, 20, -359, 210, -180], [1294, -1201, 129, 130, 433, 167, -26, -618, 25, -34], [5152, -789, -50, -55, 543, 325, -63, -655, 134, -37], [-7459, -1111, 179, -98, -212, 321, -2, -287, 183, -46], [2645, -83, -355, 70, 229, 120, -245, -488, 21, 33], [6610, -1114, -206, -164, -176, -146, 130, -349, -6, 70], [10741, -166, 565, -183, -430, -43, 282, -30, -8, 196], [9495, -1374, 114, 224, 183, 199, -34, -260, 76, -51], [-6174, 315, -361, -169, -119, -542, -97, 156, -16, -166], [4172, 492, 15, -26, -235, -106, 291, -115, -153, 120], [4473, -511, 336, -128, -35, 57, 38, -96, 320, -85], [-5214, -113, 191, -111, -99, 154, -135, -524, -22, 252], [4514, -1843, -227, -8, -180, 219, 59, -175, 26, 36], [5500, -1521, -101, -117, -151, -2, -313, -72, 156, -132], [9066, -2126, -162, -61, -507, -27, 438, 363, -30, 62], [-1602, -535, 307, -189, -54, -65, -346, -23, 239, -147], [-520, -1670, -259, -78, -197, -226, 527, 244, -73, -188], [3970, -650, 217, 253, 830, 739, -349, -229, 21, 232], [5304, -1416, 232, 283, 179, 379, 58, -38, -148, -38], [7210, -792, -121, -101, -372, -163, 17, -369, -111, -126], [-4152, 1324, -660, 462, 496, -102, -334, 454, -262, -22], [6399, 1509, -2, -70, -307, 132, 21, -487, -206, 35], [-5728, -1634, -229, -153, -562, -835, 162, -288, -65, 201], [7959, -816, -496, -312, 149, 90, -400, 24, 58, -54], [-6, 1465, -68, 82, 950, 674, -297, -706, 112, -125], [-5450, 1655, 135, -8, 291, 357, 226, -854, -369, 474], [4533, -14, -78, -205, -593, -381, -21, -438, -69, 0], [124, -613, -229, 138, 684, 613, -483, -566, 80, 168], [-11577, -3367, -110, -36, 15, -629, 11, 96, -26, 48], [2622, -1700, -536, -127, -217, -5, 182, 551, 273, -364], [15827, 918, -12, -318, -228, -122, -427, 114, -55, -186], [3324, 316, 399, -30, 468, -9, 276, -275, -178, -13], [-4146, 167, -198, 368, 376, 438, -185, -433, -250, 15], [11312, -1337, -359, -106, 384, -109, -109, 166, 56, 190], [-5186, -1702, 386, -240, -256, -220, 308, -947, 24, 182], [11300, -749, -114, -280, -525, -875, 588, -84, -257, -2], [-5917, 1459, -341, -316, -4, -305, -98, 150, -63, -168], [2032, -944, 52, 292, 660, 586, 38, 951, 222, 116], [7662, -178, 554, 423, 222, 934, -115, -60, 49, 123], [-4724, -3245, -511, 38, -661, 421, 230, 801, 91, -348], [-187, 2167, 482, -303, -915, 49, 50, 442, 9, 227], [-3413, -2107, 381, 28, 41, 202, 487, -558, 145, -187], [1689, -1055, -242, -245, 104, 1014, -179, 202, -153, -174], [-4331, -1322, 804, -152, 251, 571, -93, -70, 400, -340], [-3506, -2442, -548, 20, 225, -407, 363, 114, -317, -333], [-18572, -787, 211, 683, 566, 377, -186, 458, -197, 185], [2876, 3430, 153, 29, -432, -95, -281, 1400, -40, -28], [-14348, -2258, -85, -380, -869, -50, 431, -37, 181, -622], [2799, -917, 207, 353, 890, 701, -145, 409, -202, 357], [-5425, 1614, -637, -393, -406, 109, -106, 289, 65, 294], [334, -1653, -238, -219, -403, -10, 33, -344, 40, -224], [-5627, 2341, -512, -271, -57, 33, 490, -534, 169, -337], [-3087, -3062, -280, -12, -930, -614, 371, 647, -112, 114], [-4095, 341, -185, 526, 512, -211, -89, 52, 387, 163], [2742, 2814, 70, -246, -1282, -282, 280, 544, 44, 248], [13894, 896, 703, -40, -331, -256, -104, 482, 103, 31], [-12099, -1728, -96, -314, -410, -322, 241, -363, 35, -500], [-6615, 1550, 171, 177, -500, -743, -54, 891, -97, -252], [8552, 310, 780, -226, -1223, -527, 325, 162, 123, 37], [18626, -1076, -327, 290, 122, -134, -88, 1147, 194, 148], [1879, 455, -423, 258, 68, -219, -606, -93, -515, 48], [5257, -3027, 240, 820, 825, 905, -575, 305, -274, 474], [-39, 160, 233, -855, -94, 203, 1164, 37, -243, -390], [11018, -2555, 598, -207, -841, -636, -255, -356, -120, 352], [-9500, -1879, -141, 426, 151, 31, -198, -729, 99, 2], [10689, -1470, -454, 200, 252, -324, 213, -256, -515, 282], [10034, -1187, -219, -348, 383, -295, -164, -256, 347, 392], [-10509, -3470, 582, -504, 362, 656, 319, 475, 341, -126], [8795, -112, -581, 18, 488, 175, 1, -431, 125, 201], [-10071, -1467, -501, 54, 425, 14, -40, -868, -252, -232], [-7657, 11, -340, -396, -253, -384, 839, -589, 256, -413], [6248, 2009, 336, 212, 1356, 252, 85, -388, -202, 289], [15143, -1640, 768, -695, -417, 117, 223, -942, 433, -112], [18679, 770, -401, -505, -526, -384, -242, -1210, 274, -145], [-24230, -79, -47, 60, 285, 1023, -70, -366, -13, 50], [-20409, -1231, 775, 371, -395, 476, -232, -516, -473, 518], [2303, 7238, 113, 240, -26, 307, -573, -172, 486, 563], [-8544, 356, 675, 1014, 322, 95, -92, -701, -395, 517], [14173, -3703, -100, -351, -507, -963, -277, 74, 379, -678], [-6994, -2233, 198, -163, -1029, -1039, 391, 1157, -208, -313], [9836, -72, -1001, 244, -620, -628, 128, 787, -120, 142], [-13509, 101, -195, 487, -652, 735, 223, 217, -161, -407], [-15834, -1660, -18, 966, 1545, 1123, -691, 296, 147, 79], [473, 2103, 638, -622, -494, -924, 246, -336, 119, 629], [-8047, -1735, 824, -214, -465, -321, 43, -614, 292, 214], [10674, -4076, 316, -110, -78, 486, 624, -320, -580, 182], [-23384, -1460, -984, 219, 452, 338, -289, -25, 405, -791], [18162, 2516, 1, 826, 807, 320, 190, 30, -473, -193], [-3622, 637, -601, 1034, 683, 829, 578, 439, -125, -440], [-18714, 1241, 336, -867, -711, -1242, 475, 565, 204, 90], [1430, 4697, 73, 164, 594, -315, -380, -1152, -300, 223], [-31761, -4806, 596, -208, 9, 177, 214, 760, 230, 57], [-9259, -1886, 36, -100, 310, 1288, -553, -1303, 546, 304], [30131, -892, -770, -819, 193, 141, -688, 134, 371, -307], [3130, -1507, -308, -747, -708, 1102, 46, 192, 703, -222], [-12215, -2297, 689, 291, -87, -1020, -376, 145, 182, 124], [-11473, 1820, -228, 804, 296, 338, -717, -87, -329, 882], [-4770, 256, -70, 246, 1359, -255, -363, 38, -92, 463], [2232, -4250, -217, -309, 539, 190, 762, -613, 112, -415], [-16300, -4257, 218, 378, 1713, 949, -491, -1218, -231, 463], [-2508, 2932, 277, -264, -667, -64, 447, 658, -375, 60], [11149, 3149, -771, 440, 440, -301, -32, -643, -447, 422], [-4437, 3071, 941, 885, 295, -352, 84, 403, -688, 548], [-5928, 2379, -1384, -517, -22, -298, -462, 301, 152, -440], [-325, -1892, -56, -355, -695, 7, 122, 1688, 139, -479], [5427, -4086, -164, -800, -29, -695, -277, -734, 356, -208], [1333, -3289, 585, 617, -256, 609, 87, 291, 546, -147], [701, -2010, 1054, 175, -166, 522, 1223, 198, 24, 342], [28479, -3931, 393, 3, -1029, -1010, -54, -640, 121, 492], [12453, -3375, 162, 788, 1040, 1152, 95, 490, -125, 264], [-4257, -2837, 1247, 748, -87, -514, -374, 1104, 78, 210], [1772, 1946, 292, -722, -845, -301, 505, -738, -77, 57], [13756, -686, -192, 88, -96, -1180, -448, 578, -76, 36], [15051, -592, 490, -817, -1500, 54, 28, -1166, -2, -565], [-1094, -3020, 862, 522, 227, -481, -453, 624, -309, 669], [28674, 2799, -537, 324, 112, 283, -263, 2422, 468, -390], [-20938, 1657, -1471, 42, 413, 457, -38, 931, 453, -106], [-11284, 4371, 182, 158, 718, 1394, 425, -2187, 72, -19], [-12041, -628, -802, -191, 770, 1870, -34, -2051, 182, -579], [-11481, 319, -1022, 24, -588, -2122, 1096, 237, -19, -81], [3629, 3161, -1586, -211, -1416, -240, 13, 640, -8, 42], [10340, 2390, -234, -1019, -1420, 223, 451, -614, -47, 232], [-8412, -129, 273, -269, 532, 763, -1358, -1311, 543, 435], [16495, -320, -831, -817, -758, 1053, -364, 2053, 570, -802], [18386, -2969, 791, -512, 3, -697, 656, 554, -601, -518], [-10580, -5710, -91, 733, 1203, 10, -66, -1209, 68, 665], [-801, 522, 87, -147, 943, -1046, -213, 557, -830, 187], [-1098, -1559, -1290, 10, -177, -93, -861, 344, -103, -161], [-28738, -1773, -283, 278, 2022, 777, -327, -1427, -396, 926], [9304, 689, -1506, -1, 796, 1146, 148, 1947, 265, -614], [-17148, -1502, 632, -308, 107, 239, -265, -938, 243, -495], [-12797, -1671, -170, -665, -483, -411, -40, 444, 345, -337], [-28967, 1593, -1120, -456, -731, 446, 379, 215, 546, -625], [5907, -4137, 1254, -1177, -753, 87, 702, -1838, -487, 547], [18589, -1895, 49, -447, -318, -203, -1225, 957, 848, -253], [-3213, 1398, 155, 253, 686, -1536, -894, -1229, 300, 465], [-1002, 2715, 1898, 226, 811, 1561, 476, -849, 565, 140], [5572, 3815, 757, 10, 1813, 528, -32, -1358, -363, 107], [-22701, 844, 1168, 1002, -608, -328, 61, 368, -225, 376], [-29104, -283, 83, 1259, 1160, -25, -900, -448, -170, 159], [-24591, -3869, 565, -851, -733, 867, 1012, -367, 73, -365], [2871, -4961, 157, -1343, -934, -73, 1183, 224, -186, -815], [2531, -4390, 876, -29, -1034, 376, 328, -1108, -459, 67], [-35694, -1067, -1438, 896, -822, 952, 435, 1052, -162, 539], [-10052, 2957, 462, -1324, 60, -1096, 805, -1887, -376, -399], [-27464, -439, -307, 1037, 825, -322, 1667, -1040, -727, -62], [15982, 1058, 878, 719, 738, -1284, -441, 2137, -392, 365], [-1854, 4996, 256, 443, -972, -962, -211, -2049, 162, 649], [-444, -1984, -2103, -408, -488, -1234, -874, -454, 382, -784], [2321, -6782, -485, 938, 1053, 1018, -564, -2171, -140, 470], [-11636, 2318, -1628, -780, -332, -818, -532, 1794, 143, -532], [-4146, -91, -603, -1367, -227, -128, -395, 105, 872, -16], [-9272, -614, -310, -518, -618, -1556, 1590, 68, 366, -1024], [-12625, -1066, 570, 684, 1162, 1518, -863, -1805, -373, 210], [-47755, -1716, 1382, -821, -66, 384, 202, -417, -92, -929], [-1775, -3182, 386, -140, -391, -651, 517, -394, 896, -8], [6082, 3959, -36, -26, -1977, -927, 372, 2451, -85, -244], [-14082, -703, -342, 1035, 236, -938, 202, -708, 467, 86], [504, 1449, 670, 461, 144, 762, 1192, -337, 127, -844], [-13912, 2759, -278, -922, -1629, 251, 702, -166, 227, -244], [13734, -7127, -110, -1167, -427, -2497, -179, 484, 296, -709], [29858, -813, -582, -430, -514, -688, 343, -1402, -953, 429], [5024, -512, -131, 66, -157, 1654, -571, -3131, 941, 1340], [-4885, -3908, 26, 47, -188, -1272, 1012, 2189, -386, -1043], [-35361, -90, -1129, 289, 842, 539, 372, -1836, -506, 562], [7706, -2487, 71, -1956, -256, -3231, 525, -1150, -208, -620], [-10962, -5610, 86, -319, -42, 1974, 167, -995, 426, 239], [15141, -2144, 594, -1085, -2981, -1985, 961, -1618, -617, -1032], [425, -10664, 1399, -120, 1330, 1769, -793, -1052, 623, 639], [38796, -970, 205, -332, 1513, -118, 1344, -1216, -689, -253], [10970, 3089, -1494, -442, -1781, 59, -346, 774, 275, -102], [2606, -4221, 672, 1334, -9, 251, -228, -412, 337, 496], [-2426, -344, 974, -1735, -1132, -729, -711, 1282, -273, 424], [591, 2341, 2261, -509, -2839, -1319, 1482, 1357, -333, 495], [-12749, 5603, -1063, 426, 3481, 1994, -1402, -136, -1158, 466], [-6963, -113, -2731, 569, 48, 479, -1511, -203, 358, 1061], [-16226, 3810, 533, 2786, 2541, 1604, 45, 2565, -452, -44], [-9359, 2679, 134, 186, 1684, -538, 1292, 1605, -780, -583], [-19063, 4429, -513, 1283, 3389, 2564, -816, 945, -331, -278], [-33403, 838, -1961, 1395, 1632, 741, -740, 507, 221, -330], [24103, -5613, -1190, -193, -1264, 108, 553, -1154, -186, -812], [-15027, -6618, 1456, 1150, 187, 727, -583, -1128, 658, 492], [-32025, -2504, 1310, 953, 931, 1273, -1609, -2988, -57, 30], [-3441, 954, -1080, -528, -386, 327, -587, 4461, 577, 357], [-2976, 1172, -148, 2978, 4509, 1257, -1101, -346, -305, 205], [6244, -6538, 1326, -1206, -376, -352, 2086, -2449, -820, -470], [23670, -2818, 1582, 439, -1445, -1028, 980, 596, 160, -1023], [35334, 8843, 412, -531, -1164, 1472, 282, -1063, 1271, -912], [31443, -441, 395, -1150, -1369, -496, -445, -1850, 930, 327], [-9537, 3643, 1045, -145, 959, 834, -307, 214, 489, -67], [2756, 1184, 1358, -903, 550, 924, -1840, -1970, 511, 1100], [12891, -10117, -1095, -217, 2184, 733, 197, -1199, 420, -1229], [9222, 2408, 333, 2493, 2450, 903, -475, 883, -57, 1238], [-47646, -6562, 783, -754, -1726, -411, 1328, -261, -491, 749], [-16933, 5699, 564, 736, 502, -722, -162, 335, -7, 143], [25952, 1387, 1851, -38, -962, 1132, 399, -1447, 918, -1115], [15187, 7983, -116, -730, -609, -1309, 1069, -1680, 26, -322], [-6117, 5555, 1813, -139, -1744, 892, -53, 1772, 626, -972], [-15097, 1569, -1149, -472, 721, 598, -230, -330, 1906, 394], [-17533, 4629, 503, 748, 452, -225, -288, -732, -728, -560], [35710, -6163, -405, -2425, -821, 1342, 217, -3415, 586, -360], [18622, 344, -1675, 1397, -81, -870, 1587, 3006, -512, -1508], [-13759, 7057, 638, 123, 3530, 222, 452, 490, -1150, 445], [28919, 1707, 407, 1252, -108, -779, -834, 1287, -601, 752], [27616, -3012, -32, 128, 210, 52, -450, -1128, 26, 1788], [11718, 6765, 123, -147, 3709, 2448, -1837, -2625, 390, -986], [20280, 6341, -985, 1242, 3422, 1308, -1141, 1848, -464, 223], [-27628, 3116, 943, 1383, -162, -227, -1445, 1636, -127, -130], [63719, -238, 1705, -848, 151, 238, 1074, 1638, 493, -1184], [28038, -432, -1170, -80, 72, -532, 464, 1026, 676, -578], [10524, -3915, 1598, -1072, -3020, -1178, 2331, 977, 60, -359], [17035, 1819, 269, 1605, -626, -1831, 1107, 265, 61, 605], [45346, 5723, 692, -12, 569, -989, 709, 1072, -1181, 1241], [34629, 3085, -1349, 2703, 1146, 701, 251, 841, 135, 737], [-18360, 3923, 126, -620, -1182, 1030, 1059, -266, 235, 825], [7453, -8531, -1416, 29, -90, 284, 1743, 2488, -592, -746], [21763, -10649, 945, -1816, -1144, 731, 298, -598, 1020, 260], [3457, 9656, 148, -336, -1712, -116, 1373, -739, -1254, -992], [-32343, -261, -1818, -832, -1280, -4626, 652, 602, -713, -873], [-12663, 13144, 2253, -581, -190, -1527, -664, -764, -204, 1514], [-30092, 3460, 678, -1728, -4042, -2410, 2242, 26, 925, 306], [76067, 11953, 628, -1055, -1255, 213, 1728, 1399, 129, -1573], [23106, 5161, -681, 981, 2236, 937, -1964, 712, -1453, 1127], [-7434, 12389, 329, -277, 2422, 2081, -995, 1350, -1315, 132], [-17928, -6334, 464, -463, 1994, 2304, -1899, -2457, 552, 1265], [-31719, 1005, -464, -337, -1016, -880, 2461, -1391, 536, -468], [669, 7115, -2985, 1230, 985, -1072, -1010, 3638, -1110, -1198], [5337, 3761, -1833, -116, -3296, -385, 406, 1044, -825, -1396], [-19589, 9966, -1361, 1976, 68, 2281, -1641, 3358, 407, -931], [-25541, -1910, -649, 1523, 2019, -1938, -653, -641, -594, 1327], [7399, 12145, 910, -1960, -3979, -1710, 501, 2754, 36, 531], [-9010, 13370, 467, 736, 2650, 1301, -3210, -1580, -56, 885], [9175, -7748, 611, -2104, -2120, -2497, 753, -102, 36, -917], [-13805, 1931, -551, 1113, -715, 639, -1852, 2936, 2059, -765], [14392, 127, -1530, 391, 2186, -794, -2332, 836, 581, -228], [-41808, -7633, -127, -1676, -2018, -465, 75, -1070, 1052, -1706], [-65532, 1206, -1502, -1445, -2469, -963, 2337, -3900, -230, -1797], [7470, 4600, 497, 532, 3527, 254, 568, 1404, -273, -1361], [-32824, -14954, 1750, -2361, -2901, -3568, 2704, -189, -232, -331], [28794, -1674, 2661, 969, 1018, 1551, -2265, 997, 623, 496], [-20666, -5163, -1046, 1670, 1951, 2679, -2020, -963, 111, 730], [-13016, -3017, 830, 998, 1076, -1618, 1655, -243, -218, -1583], [-55499, -7120, 2345, -2215, -4358, -1009, 846, -87, 1373, -162], [31022, 8220, -1409, 2723, 76, 1363, 433, 1357, 331, 686], [-45563, 2920, -2055, 89, 68, -2663, 32, 83, 499, -482], [-15652, 19634, -2120, -210, -382, -868, -1424, 4474, 426, -1086], [-44431, 7126, 2178, -977, 384, -792, -650, -315, 1086, 151], [-17271, 2453, -2533, -849, 286, 1739, -701, -995, -248, 873], [58738, -4083, 208, 2092, -885, -1815, 852, 408, -87, 396], [-105681, -5396, -1710, 1957, 2344, 950, -1754, -312, 1878, -213], [44854, 6256, -1725, 970, -902, -995, 1691, 1778, -472, -456], [5203, 2812, -1074, 225, 2774, 488, 716, -2052, 1264, -1273], [-41849, 578, 368, 809, 22, -1010, -3178, -2607, -500, 95], [39601, 15880, 86, -104, -472, 806, 1167, 17, -257, -400], [-7870, -4662, -139, -701, 1286, -535, 3437, -1890, -2321, -334], [-2703, -3453, -1566, 766, 3535, -1166, -1287, 1718, 488, -301], [21512, -1556, 2830, 510, 3886, 4334, -2566, -3693, 124, 162], [-40175, 7736, -99, 1993, 45, 584, -2619, -599, -630, 651], [101, -843, 472, -1055, 1624, -792, 2197, 1340, 3, -2220], [-74808, -70, -195, -176, 757, -2708, -121, -782, -519, 752], [-29950, 12957, 888, -1230, 1872, 2604, -193, -1824, -407, -1163], [45086, 10587, 1555, -1136, -827, -2240, 2560, 2572, -529, -1419], [12909, 4391, 4946, 470, 2240, 2098, 1708, 2194, 173, -1], [42840, -3727, -384, -2637, -4162, 530, 208, -1997, 2461, -1968], [-81317, -542, 830, 293, 233, -4449, 1501, 2245, -679, -2052], [-25724, -12162, -362, -2529, -1355, -78, 426, -49, 2512, -2425], [-41646, 2540, 640, 896, -2962, -3184, -2222, -2410, 488, 1450], [93985, -13057, 825, 633, -167, -687, -672, -1858, 917, 353], [-51656, -5151, -1903, 1304, 2820, 401, -317, -4302, -402, -350], [-20515, -7323, 2197, -2448, -585, 470, 259, -3273, 1218, 885], [-46528, 2475, -705, -480, 514, 59, -27, -5382, -902, 794], [-39800, 17881, 1340, -347, 850, -1572, 20, -547, -903, -160], [-5835, 8613, 199, 2720, -1066, -1547, 642, 1764, -1024, 104], [-37698, 3840, 1648, 660, -707, 1533, 713, -3508, -1907, 1181], [22695, 3624, 950, -2215, -1766, -2670, 2156, 4584, -940, 1937], [-17251, -7113, -2411, -779, -1195, 2575, 612, -3860, -949, -869], [2555, 6940, -598, 1708, -1412, -2688, 113, 1532, 395, 202], [1906, 8321, 2175, -1268, -2308, -139, 2493, -1853, 480, -1180], [-35530, -6357, -965, 2358, 1941, -1198, 455, 962, -1053, 1280], [-343, 6335, -1212, 1914, 1982, 492, 1816, 3821, -1081, -795], [14684, -10049, -1314, 245, 2640, 2900, -1020, 1269, 1009, -2378], [-54561, 8996, 1414, -1650, 337, -2832, -2438, -2199, -8, 2560], [24541, 1373, 323, -49, 1656, -421, 1831, 4135, -982, -465], [-46058, 1249, -1548, 0, -853, 1929, 574, 4060, 82, 834], [14633, 17473, -272, -1173, -262, -1242, 2548, 510, -1210, 481], [39109, -5709, 2539, 661, 1354, -901, 563, -3285, -592, 909], [39381, -2367, 2505, 2712, 4267, 5966, -2968, 952, -446, 952], [-60264, 9177, -1301, 766, -717, -568, -514, 4262, -223, 651], [-3715, -9419, 2705, 855, 2262, 3321, -2929, -3491, 316, 1323], [69421, -836, 770, 1843, 1728, 2312, -1642, 1289, 224, 1005], [-57970, 2089, -3075, -2580, -2704, 329, 915, -196, 366, -1122], [-79879, 5885, 388, -44, 1509, 1033, 105, -4322, -1154, 1692], [7800, 5165, 2588, -221, -1646, 1608, -507, -3106, 763, -541], [70501, -516, 985, -926, 2498, 2229, -1447, 421, -599, -1441], [-2323, -6509, 832, 1472, 2605, 2422, -2619, -1575, -1640, -1557], [4465, -15249, 2510, -525, -2262, -458, 3235, -124, -1845, 1506], [-78192, -1803, -4202, 1354, 1055, 1837, -2464, -982, -1081, 1688], [25559, -12234, 976, 2138, 1369, 68, -2790, -1155, 272, 2106], [28322, -13665, 1234, -509, 2427, -1908, -961, -2796, 228, 1032], [42456, -11891, -815, 2449, 1555, -448, -1619, 2542, 407, 400], [-86881, -1899, 3088, -1962, -2128, -2074, 669, -1020, -383, 370], [25726, 11952, 500, -1259, 130, -832, -945, -2849, 2112, 847], [-22903, 4948, 118, -839, -3032, -1024, -1088, -3441, -1586, 2125], [-8962, -5437, 186, 2488, 637, 1009, 1117, 376, -389, 845], [11716, 3009, 1597, -1478, -2355, -4258, 806, 2283, -1, 1009], [-7101, -7209, 1742, -1869, -2825, 261, -1860, 2768, 1475, 525], [-20655, -6554, -932, -1161, 63, 3225, 2017, -1133, 2339, -2314], [-84482, -642, 54, 2526, 1934, -1028, -2322, 1152, -110, 266], [-22058, 6059, 946, -2063, -815, 3246, 1037, -759, -434, 1308], [-33945, 764, 71, 95, -1324, -1424, -482, 6816, 688, -1299], [-35679, -8629, -2534, -238, -139, 1534, -3339, -497, 318, -21]];
    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_j();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_1870_4_a_j(: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_j();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_1870_4_a_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1870_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![1239820, 2545931, 1064495, -269951, -177203, 8357, 9025, -138, -168, 1, 1]>],Snew);
    return Vf;
end function;