
// Make newform 1856.4.a.be in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1856_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_1856_4_a_be();".
// 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_1856_4_a_be();".
// 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 := [5, 0, -51, 0, 92, 0, -19, 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, 10, 0, -1, 0, 0, 0, 0], [-10, 0, 2, 0, 0, 0, 0, 0], [-32, 0, 100, 0, -20, 0, 1, 0], [0, 5, 0, 76, 0, -18, 0, 1], [-42, 0, 158, 0, -36, 0, 2, 0], [0, 90, 0, -182, 0, 38, 0, -2], [0, -165, 0, 441, 0, -94, 0, 5]];
    Rf_basisdens := [1, 1, 1, 1, 1, 1, 1, 1];
    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_1856_a();"
function MakeCharacter_1856_a()
    N := 1856;
    order := 1;
    char_gens := [639, 581, 321];
    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_1856_a_Hecke(Kf)
    return MakeCharacter_1856_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+1)]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 4;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0], [3, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1, 0, 0, 0], [0, 1, 0, 0, -1, 0, 1, 0], [-2, 0, -2, 1, 0, -1, 0, 0], [-17, 0, 2, -3, 0, -1, 0, 0], [0, 9, 0, 0, 0, 0, -3, 1], [0, -4, 0, 0, 5, 0, 0, 2], [-29, 0, 0, 0, 0, 0, 0, 0], [0, -8, 0, 0, 6, 0, -6, -7], [-42, 0, -10, -10, 0, -4, 0, 0], [-93, 0, -8, -1, 0, -3, 0, 0], [0, 26, 0, 0, 12, 0, 5, 1], [0, 6, 0, 0, -3, 0, 7, 15], [72, 0, -21, -9, 0, 14, 0, 0], [0, 35, 0, 0, 6, 0, 0, -11], [99, 0, -27, 3, 0, 4, 0, 0], [0, 34, 0, 0, 12, 0, -10, 2], [0, 0, 0, 0, 22, 0, -20, -30], [-448, 0, 0, -8, 0, -20, 0, 0], [0, 21, 0, 0, -26, 0, 41, 0], [0, 9, 0, 0, -14, 0, -30, -33], [-399, 0, -82, 13, 0, 15, 0, 0], [-299, 0, 8, 5, 0, 61, 0, 0], [384, 0, 44, 4, 0, 2, 0, 0], [0, 72, 0, 0, -6, 0, 28, 38], [0, -17, 0, 0, -32, 0, 26, -5], [13, 0, -36, -16, 0, 27, 0, 0], [-536, 0, 40, 54, 0, -8, 0, 0], [0, 119, 0, 0, 8, 0, -13, -41], [0, -36, 0, 0, -93, 0, 9, 60], [-760, 0, -60, 16, 0, 42, 0, 0], [0, -37, 0, 0, 46, 0, -16, 37], [334, 0, 9, -29, 0, 74, 0, 0], [0, 58, 0, 0, 19, 0, 4, -2], [-85, 0, -103, 57, 0, -24, 0, 0], [0, -189, 0, 0, 62, 0, 14, -38], [0, -70, 0, 0, 50, 0, 48, -16], [316, 0, 60, 78, 0, -6, 0, 0], [0, -196, 0, 0, -46, 0, 52, 62], [-383, 0, 27, -96, 0, -22, 0, 0], [0, 172, 0, 0, -7, 0, 61, 100], [-749, 0, 378, 59, 0, -37, 0, 0], [210, 0, 88, 76, 0, -124, 0, 0], [0, -256, 0, 0, 75, 0, 44, -60], [0, -436, 0, 0, 47, 0, 88, -73], [0, -14, 0, 0, -94, 0, -134, -60], [0, -294, 0, 0, -56, 0, 50, 64], [-43, 0, 109, 7, 0, 74, 0, 0], [-1957, 0, -313, -46, 0, -31, 0, 0], [0, -376, 0, 0, 85, 0, 106, 34], [-1519, 0, 108, -80, 0, -112, 0, 0], [0, 272, 0, 0, -45, 0, -120, -119], [-1000, 0, -140, 49, 0, 108, 0, 0], [0, -161, 0, 0, -11, 0, -224, 60], [-881, 0, 347, 11, 0, -126, 0, 0], [0, 25, 0, 0, 175, 0, -82, 16], [22, 0, -172, 160, 0, 164, 0, 0], [729, 0, -256, 274, 0, -42, 0, 0], [0, 199, 0, 0, 30, 0, -188, -23], [790, 0, 178, 200, 0, 136, 0, 0], [0, -720, 0, 0, -40, 0, 27, 95], [0, -392, 0, 0, -15, 0, -11, -288], [688, 0, 431, -29, 0, -223, 0, 0], [-3849, 0, -365, -149, 0, 10, 0, 0], [0, 304, 0, 0, -131, 0, 184, 19], [1753, 0, 108, 247, 0, -55, 0, 0], [0, -814, 0, 0, 348, 0, 140, 0], [-3772, 0, -62, 121, 0, -187, 0, 0], [-2944, 0, -367, -264, 0, 3, 0, 0], [0, -515, 0, 0, 50, 0, 147, 384], [0, 254, 0, 0, 25, 0, -139, -134], [-3991, 0, -206, -6, 0, 27, 0, 0], [0, -43, 0, 0, -152, 0, 97, 289], [0, 974, 0, 0, -361, 0, -26, 26], [-262, 0, -320, 290, 0, -84, 0, 0], [-3145, 0, -417, 82, 0, 260, 0, 0], [-247, 0, 296, -378, 0, 236, 0, 0], [2382, 0, -344, 396, 0, -168, 0, 0], [0, -292, 0, 0, -340, 0, 292, -70], [-2093, 0, 869, -1, 0, 162, 0, 0], [0, 1006, 0, 0, 141, 0, 130, 56], [3716, 0, -42, 380, 0, 234, 0, 0], [0, 582, 0, 0, 437, 0, -312, 64], [0, -73, 0, 0, 178, 0, -141, -25], [-3942, 0, -386, -24, 0, -444, 0, 0], [3540, 0, 167, -72, 0, 269, 0, 0], [-1254, 0, 1050, -200, 0, -18, 0, 0], [0, 942, 0, 0, 35, 0, 406, 284], [0, -892, 0, 0, -122, 0, -235, 11], [0, 482, 0, 0, -318, 0, -360, -363], [0, 1258, 0, 0, 221, 0, 206, -110], [0, 478, 0, 0, 516, 0, -401, -189], [0, -521, 0, 0, -516, 0, 22, 345], [0, 364, 0, 0, -492, 0, 24, -33], [952, 0, 676, 125, 0, -339, 0, 0], [-4812, 0, -891, -343, 0, -87, 0, 0], [0, 1254, 0, 0, -506, 0, -178, -14], [-504, 0, 1098, 500, 0, -188, 0, 0], [0, -1287, 0, 0, 428, 0, 434, -115], [2646, 0, 239, -274, 0, 219, 0, 0], [0, 944, 0, 0, 629, 0, -72, -297], [4396, 0, 816, -30, 0, -244, 0, 0], [0, 1000, 0, 0, -2, 0, 604, 532], [-3657, 0, -170, -775, 0, -139, 0, 0], [0, 1093, 0, 0, 186, 0, 288, 79], [-3850, 0, 223, 11, 0, 175, 0, 0], [0, -1942, 0, 0, -729, 0, 389, 705], [-1589, 0, -916, -729, 0, 147, 0, 0], [0, 426, 0, 0, 342, 0, 44, -107], [7627, 0, -100, 294, 0, 33, 0, 0], [-88, 0, -1072, 648, 0, 130, 0, 0], [0, 32, 0, 0, 1095, 0, -294, -341], [0, -1240, 0, 0, -368, 0, -98, -66], [-3701, 0, -1046, 885, 0, 327, 0, 0], [0, 891, 0, 0, 232, 0, 186, 179], [0, 1164, 0, 0, -19, 0, 212, 626], [6893, 0, 259, 295, 0, -82, 0, 0], [0, -505, 0, 0, -366, 0, 392, 84], [-1746, 0, -1397, 34, 0, -317, 0, 0], [-2483, 0, -957, 138, 0, -131, 0, 0], [11458, 0, -2382, -56, 0, 52, 0, 0], [0, 1856, 0, 0, 678, 0, 134, 84], [0, -1822, 0, 0, 552, 0, -490, 254], [480, 0, -103, -575, 0, -570, 0, 0], [1096, 0, -172, -873, 0, -739, 0, 0], [0, 926, 0, 0, 18, 0, -326, 52], [0, 480, 0, 0, -963, 0, -203, 248], [9530, 0, 972, 770, 0, 404, 0, 0], [0, 1019, 0, 0, 100, 0, -212, -992], [0, -598, 0, 0, 283, 0, 47, -526], [0, -1728, 0, 0, -703, 0, 831, 564], [8961, 0, -929, -379, 0, -70, 0, 0], [-3508, 0, 2019, -548, 0, -227, 0, 0], [-8639, 0, -1154, -665, 0, 233, 0, 0], [22807, 0, 137, -495, 0, 382, 0, 0], [0, -3626, 0, 0, -810, 0, 154, 512], [10395, 0, 1199, -617, 0, -270, 0, 0], [6080, 0, 618, -92, 0, 922, 0, 0], [0, -4017, 0, 0, 86, 0, 584, 1103], [20328, 0, -907, -79, 0, 528, 0, 0], [0, -1941, 0, 0, 696, 0, -925, -1517], [0, -3450, 0, 0, 267, 0, 674, -43], [4847, 0, 1803, 199, 0, 660, 0, 0], [0, -1633, 0, 0, 1456, 0, -365, -172], [2630, 0, 446, -868, 0, 564, 0, 0], [-5792, 0, -2686, -159, 0, -24, 0, 0], [0, -1354, 0, 0, 842, 0, -899, -1113], [0, -2722, 0, 0, -416, 0, -402, 120], [10272, 0, 2227, 311, 0, 378, 0, 0], [-9420, 0, -1650, -1090, 0, 180, 0, 0], [0, 195, 0, 0, -644, 0, 306, 143], [0, 6411, 0, 0, 385, 0, -178, -112], [0, -5313, 0, 0, -698, 0, 451, 703], [0, -2473, 0, 0, -815, 0, -2, 942], [0, -3864, 0, 0, -208, 0, 44, 170], [-9322, 0, -26, 420, 0, 386, 0, 0], [-6930, 0, 135, -978, 0, 335, 0, 0], [11909, 0, -2270, 172, 0, 701, 0, 0], [0, 1508, 0, 0, 428, 0, 1129, -29], [4739, 0, -393, -986, 0, 687, 0, 0], [0, 1626, 0, 0, -747, 0, 495, 419], [0, 831, 0, 0, 140, 0, -1047, 751], [-4178, 0, 4271, 169, 0, -565, 0, 0], [0, -800, 0, 0, 913, 0, -1567, -615], [0, 3314, 0, 0, -1112, 0, -630, -1184], [7764, 0, 4176, 488, 0, -308, 0, 0], [-4586, 0, 1125, -239, 0, 2001, 0, 0], [12656, 0, -2162, 1516, 0, -632, 0, 0], [0, -403, 0, 0, 2274, 0, -866, 345], [-23365, 0, 754, -1406, 0, 457, 0, 0], [0, -2516, 0, 0, 132, 0, 572, 246], [14612, 0, 2012, 970, 0, -428, 0, 0], [0, -3012, 0, 0, 1043, 0, -1736, -150], [-2356, 0, 229, -1340, 0, -553, 0, 0], [0, 7024, 0, 0, -12, 0, -290, -36], [11763, 0, 4211, -117, 0, -1018, 0, 0], [0, -5731, 0, 0, 58, 0, 705, 336], [-16220, 0, 182, 470, 0, -252, 0, 0], [0, -6281, 0, 0, 212, 0, -907, -522], [0, 6087, 0, 0, -390, 0, -726, 186], [-2050, 0, 1509, 894, 0, 205, 0, 0], [13084, 0, 2419, 1091, 0, -581, 0, 0], [0, -2456, 0, 0, 102, 0, 478, 644], [18985, 0, 2086, -810, 0, -2135, 0, 0], [-33337, 0, -1995, -1377, 0, -1122, 0, 0], [0, 5795, 0, 0, -314, 0, 717, 1831], [11265, 0, -638, -1193, 0, 1041, 0, 0], [0, -248, 0, 0, 1137, 0, -974, 124], [3021, 0, 2522, -444, 0, -1074, 0, 0], [0, 2078, 0, 0, -1311, 0, 104, -1217], [0, 4668, 0, 0, 508, 0, -17, -985], [9306, 0, 892, 538, 0, 110, 0, 0], [0, 5171, 0, 0, 1200, 0, -721, -1233], [-3296, 0, 2643, 412, 0, -851, 0, 0], [12462, 0, 3468, -1046, 0, -308, 0, 0], [-45600, 0, 868, -690, 0, -6, 0, 0], [-38551, 0, -1956, -380, 0, -950, 0, 0], [0, 5518, 0, 0, -180, 0, 524, -782], [-6091, 0, 297, 1403, 0, -376, 0, 0], [0, 166, 0, 0, -2475, 0, -936, 1116], [1073, 0, -1917, 735, 0, 1722, 0, 0], [-18191, 0, 2060, -1799, 0, 171, 0, 0], [0, 9385, 0, 0, 30, 0, -361, 1285], [1521, 0, 2702, -298, 0, 249, 0, 0], [0, -4850, 0, 0, -1863, 0, 775, 873], [0, 12176, 0, 0, -136, 0, -646, -1098], [-13454, 0, -3448, -131, 0, 874, 0, 0], [0, -271, 0, 0, -1793, 0, -2051, -994], [-19561, 0, 1828, -481, 0, 1515, 0, 0], [-190, 0, 518, -1372, 0, 1582, 0, 0], [0, 3218, 0, 0, -330, 0, -1512, 409], [0, -4431, 0, 0, -2127, 0, 1539, 1172], [0, -9982, 0, 0, -441, 0, -159, 594], [12328, 0, -4570, 2005, 0, -226, 0, 0], [0, -3160, 0, 0, -2220, 0, 2128, -508], [-12944, 0, -1310, -2552, 0, -1924, 0, 0], [0, 2732, 0, 0, -2436, 0, -968, -1584], [-13452, 0, 326, -266, 0, -504, 0, 0], [-38913, 0, 2347, 2391, 0, -1570, 0, 0], [0, -7638, 0, 0, -1573, 0, 806, -34], [11762, 0, 2570, 940, 0, 266, 0, 0], [0, -1494, 0, 0, 1589, 0, 1361, 669], [0, -8322, 0, 0, -104, 0, -48, 554], [-12168, 0, -800, 778, 0, 1160, 0, 0], [13112, 0, 736, 1960, 0, -1178, 0, 0], [0, 6812, 0, 0, 351, 0, -1313, 1244], [0, 5964, 0, 0, -2941, 0, -1545, 1605], [0, 6175, 0, 0, 4218, 0, -1330, -2037], [-37578, 0, -6338, -1102, 0, -26, 0, 0], [0, -14590, 0, 0, -390, 0, 1278, 930], [0, 6478, 0, 0, 1021, 0, -99, -1378], [-3160, 0, -1816, 784, 0, 1696, 0, 0], [0, -1356, 0, 0, 386, 0, 422, -1450], [0, 9901, 0, 0, -892, 0, 49, 221], [-33225, 0, 1992, 453, 0, -2285, 0, 0], [7617, 0, 1885, -601, 0, -494, 0, 0], [0, -1073, 0, 0, -2036, 0, 592, -1593], [0, -5933, 0, 0, -341, 0, -2380, -672], [0, -4914, 0, 0, 2120, 0, -1227, -1617], [0, -2766, 0, 0, -3650, 0, -258, 1080], [0, 2112, 0, 0, -2878, 0, -582, -1930], [-51772, 0, -2278, -848, 0, -238, 0, 0], [-34702, 0, 841, -1242, 0, 957, 0, 0], [0, -3710, 0, 0, 952, 0, 766, 2924], [0, -4176, 0, 0, 2145, 0, 780, -722], [0, -2267, 0, 0, -412, 0, -70, -1209], [0, 1326, 0, 0, -1172, 0, 2378, -316], [0, 8057, 0, 0, -1388, 0, -131, -1136], [-3297, 0, -6333, 2375, 0, 1456, 0, 0], [18672, 0, 3046, 495, 0, 390, 0, 0], [0, 1719, 0, 0, -2677, 0, 1032, 1398], [-23248, 0, 3030, 120, 0, 208, 0, 0], [5289, 0, -987, 47, 0, 1974, 0, 0], [0, -9188, 0, 0, 1490, 0, 308, 1428], [-34931, 0, 65, 1351, 0, -1400, 0, 0], [0, -1006, 0, 0, 4053, 0, -2586, 1831], [59612, 0, 4078, -2286, 0, -1920, 0, 0], [-41161, 0, 1513, -1432, 0, 1531, 0, 0], [0, 7618, 0, 0, 3329, 0, 491, -1238], [0, -616, 0, 0, 212, 0, -1059, -1997], [-46268, 0, -2326, -2906, 0, -1668, 0, 0], [-29389, 0, -589, 775, 0, 2954, 0, 0], [-815, 0, -1274, 4655, 0, 1147, 0, 0], [0, -3037, 0, 0, 3211, 0, -641, -518], [20984, 0, 4032, 1400, 0, 1622, 0, 0], [-12801, 0, 4434, -1271, 0, -271, 0, 0], [0, 13131, 0, 0, -2630, 0, -1469, -1277], [-27843, 0, -6724, 56, 0, -849, 0, 0], [-44592, 0, 937, -1765, 0, 830, 0, 0], [0, 2964, 0, 0, -4366, 0, -750, 1942], [-30805, 0, -1221, 2316, 0, 293, 0, 0], [0, -10461, 0, 0, -1432, 0, 2399, 1907], [-22350, 0, 9626, 1882, 0, -1870, 0, 0], [0, -10351, 0, 0, 2617, 0, -818, 1346], [0, 6839, 0, 0, -2036, 0, 1355, -1757], [8919, 0, 8200, -3236, 0, -1117, 0, 0], [-65900, 0, -1416, -1912, 0, -888, 0, 0], [0, -2791, 0, 0, 3502, 0, 668, 1207], [0, 6754, 0, 0, -134, 0, -762, 3916], [0, 5846, 0, 0, -3812, 0, -2484, -836], [0, -12412, 0, 0, 1626, 0, -140, -1916], [-19542, 0, 2561, 2758, 0, 117, 0, 0], [0, -2568, 0, 0, 317, 0, 2467, -136], [0, -1672, 0, 0, 789, 0, -121, -848], [-23865, 0, 1164, -2363, 0, 317, 0, 0], [57793, 0, -1197, -1345, 0, -1934, 0, 0], [0, -2748, 0, 0, -2467, 0, 2798, 272], [-51421, 0, -1698, 1030, 0, -966, 0, 0], [1999, 0, -3617, 2902, 0, -1700, 0, 0], [0, -9793, 0, 0, -778, 0, 990, 2165], [-16197, 0, 6316, 726, 0, 1524, 0, 0], [0, 12543, 0, 0, -1058, 0, -2138, 1920], [9326, 0, 300, -160, 0, -1928, 0, 0], [15254, 0, 517, -281, 0, -2920, 0, 0], [0, 7297, 0, 0, 2796, 0, 1201, -658], [9844, 0, -5219, -701, 0, 1094, 0, 0], [0, 4947, 0, 0, 2168, 0, 1142, -1969], [0, -903, 0, 0, -2036, 0, 2955, 3857], [-69551, 0, -626, 2363, 0, 1235, 0, 0], [73070, 0, 4395, 4050, 0, 2543, 0, 0], [0, 12174, 0, 0, 2369, 0, -2213, -1954], [0, -5113, 0, 0, -5159, 0, 1377, -122], [0, 8905, 0, 0, -1500, 0, 3839, 2345], [-27706, 0, -6413, -3319, 0, -1731, 0, 0], [0, -2640, 0, 0, 793, 0, -2154, -3049], [12924, 0, -7216, -537, 0, -1831, 0, 0], [0, -9164, 0, 0, 1323, 0, -2196, -2132], [-16143, 0, 1482, -2586, 0, 893, 0, 0], [0, 14482, 0, 0, -1299, 0, 2946, 864], [79965, 0, 5069, 3551, 0, 1604, 0, 0], [70954, 0, -3037, 2818, 0, -2057, 0, 0], [0, -4063, 0, 0, 3348, 0, -3490, 355], [0, 362, 0, 0, 2727, 0, -2400, 2034], [-76831, 0, -62, 2542, 0, 140, 0, 0], [0, -6343, 0, 0, -4698, 0, -1027, 729], [0, 14562, 0, 0, -1922, 0, 2560, 1924], [-23770, 0, -3527, -423, 0, 2097, 0, 0], [29729, 0, -58, 3663, 0, 4061, 0, 0], [0, -16401, 0, 0, 410, 0, 2866, 2068], [-33476, 0, -4894, -3851, 0, -1834, 0, 0], [6610, 0, 7202, 5484, 0, 26, 0, 0], [0, 5649, 0, 0, 2639, 0, 608, -2288], [-65211, 0, 10050, 2442, 0, -1244, 0, 0], [9055, 0, 6702, -437, 0, -3563, 0, 0], [0, 2128, 0, 0, -1890, 0, 3534, 10], [0, -6052, 0, 0, -74, 0, -1332, -2020], [0, -3361, 0, 0, -3684, 0, 3211, -458], [52015, 0, -7368, 4254, 0, -2135, 0, 0], [-53688, 0, -4412, 116, 0, 1410, 0, 0], [63464, 0, -8076, -1637, 0, -873, 0, 0], [0, 6432, 0, 0, -1810, 0, -2728, 608], [0, 4664, 0, 0, 23, 0, 733, 2008], [0, 6248, 0, 0, 2620, 0, 4451, -735], [0, 10508, 0, 0, 3710, 0, -1892, -2212], [53026, 0, -488, 176, 0, -2456, 0, 0], [95592, 0, 10994, -2602, 0, -3948, 0, 0], [-72826, 0, 2148, 5484, 0, -2822, 0, 0], [0, 1904, 0, 0, 4672, 0, -5882, -5364], [1735, 0, 9655, -2501, 0, 272, 0, 0], [87460, 0, -1815, 3316, 0, 931, 0, 0], [-25371, 0, -3235, -1379, 0, -5586, 0, 0], [0, -28, 0, 0, -2410, 0, 5658, 4108], [82616, 0, -1860, -126, 0, -230, 0, 0], [0, -5317, 0, 0, 1491, 0, -107, -2974], [-5181, 0, -10045, 3743, 0, 1864, 0, 0], [0, 17212, 0, 0, -2705, 0, -3155, -4460], [0, 2465, 0, 0, 204, 0, 3663, 1956], [28368, 0, 32, -7414, 0, -240, 0, 0], [0, -8877, 0, 0, 1708, 0, 1166, -1255], [-109464, 0, -5195, 3952, 0, 2243, 0, 0], [-50174, 0, -14594, -3384, 0, -1148, 0, 0], [0, 24236, 0, 0, -1867, 0, -2180, -2402], [-114003, 0, 4285, -2223, 0, 304, 0, 0], [66643, 0, 3766, -1427, 0, 2027, 0, 0], [0, 12859, 0, 0, 283, 0, 4130, -476], [0, 7907, 0, 0, -670, 0, 90, -2377], [-9837, 0, -6578, 2173, 0, -3071, 0, 0], [0, 17534, 0, 0, -3130, 0, -2698, 2404], [-14389, 0, 1526, 3428, 0, -4787, 0, 0], [56701, 0, -3035, -1090, 0, 2539, 0, 0], [0, 9079, 0, 0, -1348, 0, 2889, -2090], [0, 11756, 0, 0, -2534, 0, 3092, 3602], [0, -3573, 0, 0, -2967, 0, -5031, -1954], [-24735, 0, 7466, -4975, 0, 2629, 0, 0], [48742, 0, 9942, 2338, 0, 4060, 0, 0], [0, 7260, 0, 0, -56, 0, -2110, 2530], [109882, 0, -10138, 2600, 0, -2264, 0, 0], [0, 10966, 0, 0, 2185, 0, 2298, 3885], [0, 3048, 0, 0, -2078, 0, 1160, 5322], [0, 480, 0, 0, 731, 0, -5156, -2176], [-48806, 0, -4660, 804, 0, 4576, 0, 0], [0, -11012, 0, 0, -7945, 0, 2746, 1170], [-12483, 0, -3745, -2318, 0, 1706, 0, 0], [0, -10009, 0, 0, -2546, 0, -5437, -2529], [0, 11325, 0, 0, 3369, 0, -1368, 192], [49707, 0, -1298, -3163, 0, -35, 0, 0], [-58866, 0, -883, -1237, 0, -1493, 0, 0], [-108596, 0, 2443, 811, 0, 829, 0, 0], [-93702, 0, 3300, 3054, 0, -2634, 0, 0], [-52318, 0, -8439, -1799, 0, -2329, 0, 0], [0, -12655, 0, 0, 5072, 0, 1425, 5254], [85575, 0, -1028, -1487, 0, -5525, 0, 0], [0, -6695, 0, 0, 856, 0, 1202, 617], [0, -8468, 0, 0, -3751, 0, -1522, 3464], [0, 9720, 0, 0, 2377, 0, -3851, 456], [76204, 0, 3169, 45, 0, 5274, 0, 0], [0, 13305, 0, 0, 3450, 0, -4496, -4856], [0, 14088, 0, 0, -7077, 0, -2299, 3712], [-14000, 0, 15382, 4310, 0, 478, 0, 0], [-63064, 0, 1992, 4133, 0, -6481, 0, 0], [0, -6521, 0, 0, -660, 0, 2224, -2400], [0, 21253, 0, 0, -5613, 0, -1857, 1058], [0, -19458, 0, 0, 1548, 0, -1632, -3525], [29660, 0, -55, -77, 0, -1747, 0, 0], [0, -16042, 0, 0, -3092, 0, 4130, 2294], [-49902, 0, 6906, 2974, 0, 3450, 0, 0], [0, 18654, 0, 0, -1134, 0, 198, -392], [-82586, 0, 1762, 9892, 0, -640, 0, 0], [-13132, 0, 9984, 178, 0, -182, 0, 0], [147692, 0, -7284, -4066, 0, 3136, 0, 0], [0, 5666, 0, 0, -801, 0, 3523, 5306], [112313, 0, 4217, -3642, 0, -1741, 0, 0], [-92086, 0, -10827, -1105, 0, -3126, 0, 0], [0, 17250, 0, 0, 7525, 0, 1012, -3400], [212383, 0, -1660, 1762, 0, 475, 0, 0], [118221, 0, -4226, -2277, 0, 581, 0, 0], [0, -5425, 0, 0, 8553, 0, 1725, 2438], [0, -3290, 0, 0, -1314, 0, -2534, -314], [12354, 0, 18925, 4318, 0, -595, 0, 0], [-100482, 0, 2844, -5121, 0, -963, 0, 0], [0, -8073, 0, 0, -10372, 0, 5388, 3895], [0, -10725, 0, 0, -9808, 0, 616, 3445], [-17733, 0, 11492, -1893, 0, 4567, 0, 0], [-63968, 0, 6774, -7366, 0, 1056, 0, 0], [0, -4919, 0, 0, -2993, 0, 3164, 5216], [0, -2918, 0, 0, -4296, 0, 3624, -4820], [136310, 0, 3660, 326, 0, 4682, 0, 0], [0, -10991, 0, 0, 682, 0, 2917, 1540], [20318, 0, -3312, -4736, 0, -2392, 0, 0], [-87314, 0, 6666, -6432, 0, -1198, 0, 0], [0, -9627, 0, 0, -2939, 0, -866, 44], [0, -7259, 0, 0, -2091, 0, -3569, -5430], [-107439, 0, -9164, -5286, 0, -1012, 0, 0], [161979, 0, -7042, 2026, 0, -3761, 0, 0], [0, 19809, 0, 0, 6678, 0, -5050, -2137], [133210, 0, -13950, -5014, 0, 2776, 0, 0], [0, -4705, 0, 0, -340, 0, -3168, -2615], [0, 27548, 0, 0, 3222, 0, -1494, -2657]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1856_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1856_4_a_be();".
// 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_1856_4_a_be(:prec:=8)
    chi := MakeCharacter_1856_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_1856_4_a_be();".
// 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_1856_4_a_be( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1856_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![465125, 0, -87256, 0, 5442, 0, -128, 0, 1]>,<5,R![4623, 530, -136, -10, 1]>,<7,R![242208000, 0, -18982336, 0, 403200, 0, -1244, 0, 1]>],Snew);
    return Vf;
end function;