
// Make newform 2312.4.a.k in Magma, downloaded from the LMFDB on 23 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_2312_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_2312_4_a_k();".
// 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_2312_4_a_k();".
// 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 := [1152, 0, -1780, 0, 756, 0, -95, 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, 4, 0, 0, 0, 0, 0, 0], [0, -3402, 0, 2159, 0, -284, 0, 3], [12168, 0, 8318, 0, -3127, 0, 35, 0], [0, 47900, 0, -33588, 0, 5485, 0, -59], [-22844, 0, 20634, 0, -3781, 0, 41, 0], [35292, 0, -28386, 0, 4217, 0, -45, 0], [0, -15160, 0, 48702, 0, -9989, 0, 109]];
    Rf_basisdens := [1, 1, 172, 172, 1032, 172, 172, 1032];
    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_2312_a();"
function MakeCharacter_2312_a()
    N := 2312;
    order := 1;
    char_gens := [1735, 1157, 1737];
    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_2312_a_Hecke(Kf)
    return MakeCharacter_2312_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, 0, -1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, -1, -1, 0, -1, 0, 0, 0], [0, 0, -2, 0, 1, 0, 0, 1], [5, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0], [-5, 0, 0, 1, 0, 0, -1, 0], [0, -5, 0, 0, 0, 0, 0, 1], [0, 0, -18, 0, -5, 0, 0, 2], [0, -5, -14, 0, 4, 0, 0, -3], [0, -4, 28, 0, -1, 0, 0, 0], [0, 4, 2, 0, -16, 0, 0, -6], [-3, 0, 0, 1, 0, -4, 1, 0], [41, 0, 0, 1, 0, 0, -3, 0], [-57, 0, 0, -3, 0, 10, 3, 0], [11, 0, 0, -1, 0, 4, -1, 0], [0, -16, -74, 0, 5, 0, 0, -6], [-73, 0, 0, -3, 0, 4, -9, 0], [0, -29, 31, 0, -27, 0, 0, 6], [0, -20, 6, 0, 26, 0, 0, -6], [0, -5, -64, 0, -16, 0, 0, -11], [-297, 0, 0, -1, 0, 16, -9, 0], [19, 0, 0, 4, 0, 18, 1, 0], [0, 24, -140, 0, 22, 0, 0, -16], [165, 0, 0, -4, 0, 6, -9, 0], [152, 0, 0, 0, 0, -16, -16, 0], [0, 30, -15, 0, 4, 0, 0, -2], [0, -4, 2, 0, -69, 0, 0, 18], [0, -20, 74, 0, 58, 0, 0, -6], [-156, 0, 0, 0, 0, 40, 4, 0], [0, -6, -91, 0, -64, 0, 0, -10], [-541, 0, 0, 0, 0, -17, 22, 0], [0, 4, 26, 0, -21, 0, 0, -9], [950, 0, 0, 16, 0, 10, 2, 0], [662, 0, 0, -14, 0, -24, 22, 0], [1529, 0, 0, -5, 0, 2, 17, 0], [0, 26, -152, 0, -15, 0, 0, 7], [0, -11, -311, 0, -59, 0, 0, 40], [0, -36, 224, 0, 65, 0, 0, 60], [-2333, 0, 0, -11, 0, -12, 3, 0], [0, 4, 54, 0, 5, 0, 0, 22], [787, 0, 0, 23, 0, -40, -1, 0], [0, 20, -202, 0, -72, 0, 0, -22], [0, 148, -58, 0, 161, 0, 0, 6], [0, -19, 132, 0, 116, 0, 0, 43], [0, -62, -221, 0, 20, 0, 0, -22], [2447, 0, 0, -1, 0, 80, -21, 0], [0, -34, 308, 0, -135, 0, 0, 35], [2543, 0, 0, 8, 0, 40, -5, 0], [0, -184, 200, 0, -88, 0, 0, -36], [183, 0, 0, -1, 0, -24, -53, 0], [0, -72, 104, 0, -158, 0, 0, -36], [1653, 0, 0, -13, 0, 80, 17, 0], [2669, 0, 0, 12, 0, 11, 52, 0], [404, 0, 0, -16, 0, 48, -92, 0], [0, -104, 522, 0, 19, 0, 0, 78], [395, 0, 0, -17, 0, -16, -1, 0], [0, 140, 410, 0, -25, 0, 0, -142], [-2094, 0, 0, 0, 0, -13, 7, 0], [0, 236, 250, 0, -15, 0, 0, -27], [4238, 0, 0, -32, 0, 44, -68, 0], [1857, 0, 0, -15, 0, -48, -15, 0], [0, 5, 49, 0, 429, 0, 0, 24], [0, -344, -112, 0, -302, 0, 0, 80], [0, -56, -222, 0, 117, 0, 0, 78], [3917, 0, 0, -47, 0, -52, 97, 0], [0, 28, 406, 0, 322, 0, 0, 14], [0, 150, 544, 0, 97, 0, 0, 27], [-3013, 0, 0, 1, 0, 56, 61, 0], [5278, 0, 0, 48, 0, 5, -7, 0], [7451, 0, 0, -29, 0, -16, -33, 0], [0, 49, 169, 0, -73, 0, 0, 30], [4381, 0, 0, -12, 0, 62, 87, 0], [0, -500, -349, 0, -220, 0, 0, 200], [-6338, 0, 0, -50, 0, -136, -114, 0], [1651, 0, 0, -4, 0, 6, 109, 0], [0, -244, -112, 0, 387, 0, 0, 12], [0, 128, 512, 0, 38, 0, 0, 44], [-2453, 0, 0, -11, 0, -261, -88, 0], [0, -60, 37, 0, 392, 0, 0, -12], [1613, 0, 0, -20, 0, 138, 19, 0], [0, 107, -208, 0, -328, 0, 0, 101], [7949, 0, 0, -16, 0, -30, -93, 0], [0, 391, 1271, 0, -367, 0, 0, -74], [-305, 0, 0, 21, 0, 168, -133, 0], [0, 4, -646, 0, 480, 0, 0, -186], [5061, 0, 0, 132, 0, -166, -109, 0], [-1841, 0, 0, 21, 0, 188, -107, 0], [-766, 0, 0, 30, 0, -224, -62, 0], [-1975, 0, 0, 127, 0, 40, -83, 0], [0, 285, 396, 0, 396, 0, 0, -113], [0, -455, -467, 0, 267, 0, 0, 198], [-7561, 0, 0, 13, 0, 212, -73, 0], [0, 230, 483, 0, 672, 0, 0, -118], [0, -111, -303, 0, -489, 0, 0, 98], [5026, 0, 0, 68, 0, 26, 22, 0], [0, -380, -122, 0, -68, 0, 0, 94], [-3139, 0, 0, 31, 0, 52, -155, 0], [0, 372, 202, 0, 233, 0, 0, 2], [0, -582, 757, 0, -576, 0, 0, -74], [6469, 0, 0, 0, 0, -118, -21, 0], [-1429, 0, 0, 63, 0, 180, 103, 0], [6021, 0, 0, 23, 0, 48, 107, 0], [0, 76, -1651, 0, 236, 0, 0, -200], [2823, 0, 0, 72, 0, 185, -44, 0], [-1763, 0, 0, 131, 0, -412, 37, 0], [925, 0, 0, 71, 0, 64, 315, 0], [-11280, 0, 0, -104, 0, -96, 72, 0], [0, -184, 2704, 0, 328, 0, 0, 84], [0, -33, -1150, 0, 632, 0, 0, -179], [-4494, 0, 0, 60, 0, -74, 234, 0], [0, -80, 1676, 0, -128, 0, 0, -184], [0, -122, 1424, 0, 89, 0, 0, -269], [8241, 0, 0, -143, 0, 104, -155, 0], [0, -176, -4, 0, 594, 0, 0, 272], [0, -60, -157, 0, -504, 0, 0, 324], [13381, 0, 0, -7, 0, -160, -7, 0], [0, 200, -444, 0, 1369, 0, 0, 84], [-7115, 0, 0, 85, 0, -64, 37, 0], [-1638, 0, 0, -24, 0, 532, 124, 0], [0, -692, -990, 0, -528, 0, 0, -386], [0, 572, -16, 0, -525, 0, 0, -332], [0, -564, 859, 0, 540, 0, 0, 248], [0, 432, -710, 0, -1391, 0, 0, 209], [-3483, 0, 0, 80, 0, 462, -193, 0], [0, -408, -2276, 0, -351, 0, 0, -412], [0, 575, 1643, 0, 685, 0, 0, 102], [-2881, 0, 0, -153, 0, -176, 147, 0], [-414, 0, 0, -64, 0, -474, -34, 0], [-12221, 0, 0, 89, 0, 280, 15, 0], [0, -281, -370, 0, -1060, 0, 0, 493], [0, 59, -109, 0, -991, 0, 0, 414], [16551, 0, 0, 88, 0, -46, 29, 0], [-7649, 0, 0, -140, 0, 435, 294, 0], [8291, 0, 0, 92, 0, 35, -166, 0], [-5785, 0, 0, 208, 0, 208, -69, 0], [0, 84, -34, 0, -957, 0, 0, 327], [4870, 0, 0, 164, 0, -454, -282, 0], [0, 440, -256, 0, 486, 0, 0, 160], [0, 726, -16, 0, 1019, 0, 0, 125], [0, 524, -1384, 0, 975, 0, 0, -292], [0, 163, 1180, 0, 380, 0, 0, -99], [0, 382, 2771, 0, 660, 0, 0, -146], [-11595, 0, 0, 159, 0, -420, 327, 0], [0, -193, 1667, 0, -709, 0, 0, -460], [0, 960, 404, 0, 453, 0, 0, -516], [0, 176, -1260, 0, 250, 0, 0, -52], [6515, 0, 0, 83, 0, -632, -205, 0], [-4656, 0, 0, 300, 0, -40, -240, 0], [0, 988, -2978, 0, 495, 0, 0, -66], [0, 1356, 1238, 0, 1330, 0, 0, 62], [-13347, 0, 0, 139, 0, -340, 61, 0], [0, -687, -2312, 0, -156, 0, 0, 71], [0, 64, -1462, 0, 501, 0, 0, 477], [0, 491, -917, 0, -601, 0, 0, -712], [11515, 0, 0, -33, 0, 952, 15, 0], [0, -1128, 1828, 0, -146, 0, 0, -464], [-14715, 0, 0, 139, 0, -177, -94, 0], [0, 1380, 2296, 0, 875, 0, 0, -620], [0, 556, 3758, 0, -989, 0, 0, 183], [-8569, 0, 0, 144, 0, -146, -271, 0], [8953, 0, 0, -99, 0, 352, 205, 0], [-20749, 0, 0, -21, 0, -528, 155, 0], [-7191, 0, 0, -301, 0, 168, 223, 0], [0, -1365, 1235, 0, 177, 0, 0, 386], [0, 463, 1963, 0, -355, 0, 0, -50], [0, -308, -2194, 0, 629, 0, 0, -458], [0, 1364, 926, 0, 1856, 0, 0, -518], [0, -236, 958, 0, 397, 0, 0, -610], [-29987, 0, 0, -111, 0, 116, 17, 0], [12409, 0, 0, 132, 0, 138, -225, 0], [0, 701, -3006, 0, 1944, 0, 0, -397], [-25169, 0, 0, -296, 0, -354, -327, 0], [4788, 0, 0, 352, 0, -136, -76, 0], [0, -412, 4534, 0, -66, 0, 0, 154], [0, -642, -144, 0, -2405, 0, 0, -91], [0, -140, 7326, 0, -411, 0, 0, 278], [4641, 0, 0, 321, 0, 328, 229, 0], [13579, 0, 0, -136, 0, -308, 11, 0], [-2114, 0, 0, -234, 0, 840, 206, 0], [0, -228, -4198, 0, -1401, 0, 0, -741], [0, 696, 3794, 0, 1141, 0, 0, 46], [32794, 0, 0, -156, 0, -660, 336, 0], [8746, 0, 0, -190, 0, 8, 282, 0], [-1187, 0, 0, 340, 0, -342, 163, 0], [0, -248, -3288, 0, -2093, 0, 0, 224], [21743, 0, 0, -273, 0, 264, -481, 0], [0, 40, 2540, 0, 2070, 0, 0, -156], [0, -2189, 554, 0, -1092, 0, 0, 405], [0, -252, 470, 0, -570, 0, 0, -530], [0, -716, -1767, 0, -2680, 0, 0, -884], [-5475, 0, 0, 175, 0, 236, -355, 0], [2791, 0, 0, 332, 0, -852, -201, 0], [0, 1094, 4908, 0, -973, 0, 0, 525], [0, 416, 2464, 0, -1380, 0, 0, -84], [0, 1384, 3380, 0, 1336, 0, 0, 388], [0, -1156, -2488, 0, 1643, 0, 0, 1324], [0, 1588, 186, 0, 934, 0, 0, 986], [26578, 0, 0, -6, 0, -360, 154, 0], [0, -1156, -442, 0, -1519, 0, 0, 494], [0, -1029, 4788, 0, -396, 0, 0, 9], [-47306, 0, 0, 96, 0, 586, -350, 0], [-1043, 0, 0, 172, 0, -5, -124, 0], [-4403, 0, 0, -171, 0, -216, 125, 0], [-6601, 0, 0, 348, 0, 152, 467, 0], [5696, 0, 0, -492, 0, -80, 424, 0], [-14237, 0, 0, -387, 0, 684, 187, 0], [0, -180, -2550, 0, -2946, 0, 0, -226], [-17183, 0, 0, 445, 0, -268, 5, 0], [0, 1328, 2488, 0, 1418, 0, 0, 604], [-5585, 0, 0, 88, 0, 138, -499, 0], [0, -1879, -254, 0, -1996, 0, 0, 139], [-36653, 0, 0, -195, 0, 704, 567, 0], [0, -2131, -3322, 0, 988, 0, 0, 583], [0, 976, -2812, 0, 58, 0, 0, -100], [24726, 0, 0, -18, 0, -664, -426, 0], [-9090, 0, 0, 140, 0, 504, -972, 0], [0, 1617, 838, 0, 304, 0, 0, -689], [36513, 0, 0, -140, 0, -516, 841, 0], [3869, 0, 0, 287, 0, -24, 419, 0], [0, 1853, -1199, 0, -411, 0, 0, -232], [-6447, 0, 0, 295, 0, -955, -52, 0], [0, -1399, 5781, 0, 1517, 0, 0, -1304], [-23329, 0, 0, 493, 0, -236, -49, 0], [27949, 0, 0, 300, 0, 228, 189, 0], [0, -1300, 3078, 0, -998, 0, 0, 354], [0, 361, 2445, 0, -1693, 0, 0, 42], [49856, 0, 0, 352, 0, -184, -304, 0], [0, -496, -735, 0, 1700, 0, 0, 916], [4038, 0, 0, -452, 0, 140, 568, 0], [0, 992, 947, 0, -4852, 0, 0, 412], [5631, 0, 0, -189, 0, -432, 883, 0], [24569, 0, 0, -304, 0, -234, 515, 0], [66349, 0, 0, 67, 0, 448, 89, 0], [5403, 0, 0, 471, 0, -688, 511, 0], [0, -60, -2930, 0, 3452, 0, 0, -702], [0, 2292, -3312, 0, 179, 0, 0, 540], [0, 1622, -6459, 0, -1568, 0, 0, 682], [27533, 0, 0, -47, 0, -816, -735, 0], [0, 748, 2993, 0, -1212, 0, 0, 1160], [7971, 0, 0, -161, 0, -396, -65, 0], [42557, 0, 0, -51, 0, -688, 425, 0], [7019, 0, 0, 304, 0, 1166, -131, 0], [0, -1812, 2734, 0, -718, 0, 0, 806], [0, 2105, 3741, 0, 205, 0, 0, -1452], [0, 907, -2970, 0, 2304, 0, 0, -383], [0, -1920, 3221, 0, -4916, 0, 0, 1012], [30579, 0, 0, -413, 0, -1072, 267, 0], [19499, 0, 0, -73, 0, 128, -1217, 0], [3761, 0, 0, -13, 0, -882, 981, 0], [0, 1544, 6848, 0, -532, 0, 0, -776], [30572, 0, 0, 464, 0, -680, -780, 0], [0, -2940, -8582, 0, 1598, 0, 0, 374], [-11277, 0, 0, -392, 0, -804, -461, 0], [43701, 0, 0, -401, 0, 1496, -983, 0], [0, 996, 3778, 0, -2095, 0, 0, -942], [0, 2240, -3233, 0, 76, 0, 0, 228], [0, 228, 1524, 0, -353, 0, 0, -680], [-19187, 0, 0, -136, 0, 1349, 302, 0], [0, 2065, -5923, 0, 4701, 0, 0, -1464], [-39129, 0, 0, 87, 0, -1192, -89, 0], [0, -548, 4448, 0, 2163, 0, 0, 1236], [0, 1216, 2836, 0, -2331, 0, 0, 1140], [0, 1160, -10032, 0, -1074, 0, 0, 1396], [11391, 0, 0, -435, 0, -1684, 279, 0], [-47698, 0, 0, 660, 0, -1076, 416, 0], [-11381, 0, 0, -603, 0, -55, -74, 0], [0, 2526, -4408, 0, -1247, 0, 0, -1485], [1685, 0, 0, 575, 0, 282, -1059, 0], [0, 1088, 64, 0, -1055, 0, 0, -1816], [-36237, 0, 0, 567, 0, -548, -529, 0], [68633, 0, 0, 155, 0, 300, 11, 0], [4153, 0, 0, -275, 0, 2840, -643, 0], [-68239, 0, 0, -713, 0, 439, 206, 0], [65375, 0, 0, 651, 0, 1296, 219, 0], [-37277, 0, 0, 483, 0, -608, 955, 0], [30753, 0, 0, -612, 0, 848, 13, 0], [-18205, 0, 0, 636, 0, 638, 125, 0], [10183, 0, 0, 559, 0, -296, -209, 0], [-47737, 0, 0, -17, 0, 664, -229, 0], [0, 1285, -3159, 0, 309, 0, 0, 1416], [0, 1917, -8706, 0, 156, 0, 0, 1383], [-19741, 0, 0, 729, 0, 430, -765, 0], [0, -4470, 3961, 0, -5912, 0, 0, 1238], [-39770, 0, 0, 922, 0, -1168, 406, 0], [0, 1028, 994, 0, 4052, 0, 0, -482], [0, 3112, 1832, 0, -4945, 0, 0, -1472], [-36898, 0, 0, 222, 0, 576, 686, 0], [31725, 0, 0, 352, 0, 774, -681, 0], [0, -552, 2082, 0, -2669, 0, 0, -218], [0, -944, -141, 0, -5652, 0, 0, -548], [-97343, 0, 0, -236, 0, 323, 416, 0], [0, -476, -1534, 0, -7871, 0, 0, 309], [0, -1180, 7530, 0, 1761, 0, 0, 618], [0, -1436, -822, 0, -349, 0, 0, 1298], [25582, 0, 0, -134, 0, 1136, -546, 0], [-17731, 0, 0, 668, 0, -884, 341, 0], [0, 2158, 11884, 0, -2307, 0, 0, 167], [-10267, 0, 0, -411, 0, 2680, -251, 0], [-5217, 0, 0, -32, 0, 14, -1015, 0], [17407, 0, 0, 900, 0, 404, -25, 0], [0, -1395, -4878, 0, -6720, 0, 0, -833], [0, 1350, 5200, 0, -1161, 0, 0, -311], [0, -4808, 1843, 0, -944, 0, 0, 488], [0, -948, -9734, 0, 2424, 0, 0, 1750], [55649, 0, 0, 225, 0, 1960, 1201, 0], [0, -1284, 9144, 0, 671, 0, 0, 860], [40776, 0, 0, -72, 0, 1232, -352, 0], [-36771, 0, 0, -417, 0, 756, 1295, 0], [0, 4911, -2952, 0, 3116, 0, 0, -1331], [0, 24, 6536, 0, 925, 0, 0, -360], [0, -5716, 442, 0, -6092, 0, 0, 1822], [-83495, 0, 0, 359, 0, 1296, -1115, 0], [71468, 0, 0, 320, 0, 552, -908, 0], [36821, 0, 0, 203, 0, -393, 1402, 0], [43485, 0, 0, 899, 0, 648, 337, 0], [0, -103, -1287, 0, -383, 0, 0, -1916], [0, 2944, -4232, 0, 2280, 0, 0, -8], [13087, 0, 0, 9, 0, -83, 1254, 0], [0, 822, -8968, 0, -5003, 0, 0, 1391], [0, -2644, 518, 0, 6348, 0, 0, -1026], [4098, 0, 0, -908, 0, -518, 534, 0], [16908, 0, 0, 88, 0, -472, 2668, 0], [0, 5484, 8606, 0, 632, 0, 0, -1682], [104733, 0, 0, 327, 0, -1192, -1101, 0], [0, -1256, -7170, 0, 4143, 0, 0, 1711], [0, -3536, 13290, 0, -723, 0, 0, 709], [0, 607, 13955, 0, -3379, 0, 0, 310], [0, -1980, -4436, 0, -5253, 0, 0, -1816], [0, -800, 3896, 0, -2751, 0, 0, -2112], [0, -1892, 9384, 0, -2865, 0, 0, 292], [0, -4013, -6685, 0, 1761, 0, 0, 2054], [-32675, 0, 0, -759, 0, -100, -767, 0], [0, -1720, 19453, 0, -120, 0, 0, 1696], [0, 802, -15013, 0, 1280, 0, 0, -1114], [60475, 0, 0, 577, 0, -2132, 113, 0], [0, -6308, 2354, 0, -7918, 0, 0, 1578], [0, 2736, -6216, 0, -4436, 0, 0, -364], [5575, 0, 0, 347, 0, -2184, -1133, 0], [44754, 0, 0, 688, 0, 824, -584, 0], [22014, 0, 0, 56, 0, 1848, 1376, 0], [0, -900, 572, 0, -5001, 0, 0, 928], [144652, 0, 0, 152, 0, -888, -764, 0], [-34167, 0, 0, 60, 0, -1132, 1129, 0], [0, 4996, 15601, 0, 1036, 0, 0, -912], [0, 2952, -1638, 0, -8635, 0, 0, -1098], [35071, 0, 0, 169, 0, -1340, -1073, 0], [0, 467, 3994, 0, 5780, 0, 0, 2349], [0, 2212, -4858, 0, -995, 0, 0, -2090], [83543, 0, 0, -797, 0, 1484, -677, 0], [0, 4060, -7302, 0, 996, 0, 0, 1314], [-53043, 0, 0, 103, 0, 1620, -313, 0], [0, -3119, -7107, 0, -6795, 0, 0, -2048], [-108465, 0, 0, -192, 0, 2096, 547, 0], [53363, 0, 0, 864, 0, -127, -1272, 0], [-54243, 0, 0, -847, 0, 1936, 2153, 0], [0, 1570, -6824, 0, -321, 0, 0, -1563], [0, 5580, 10226, 0, 2636, 0, 0, 2142], [116486, 0, 0, -958, 0, 240, -210, 0], [0, -1584, -6384, 0, -4533, 0, 0, 2456], [0, 6376, -7108, 0, 2468, 0, 0, -1464], [66471, 0, 0, 187, 0, 1904, -213, 0], [0, 2016, 4777, 0, 3100, 0, 0, -124], [-19083, 0, 0, 155, 0, 856, 905, 0], [-12806, 0, 0, -168, 0, -861, -2065, 0], [0, 3496, 542, 0, 3203, 0, 0, 1914], [-35491, 0, 0, 533, 0, 1456, -519, 0], [0, -840, -23504, 0, 2722, 0, 0, -1096], [-4301, 0, 0, -93, 0, -5016, 443, 0], [0, -3428, -9650, 0, 1717, 0, 0, -1327], [0, 5823, 7752, 0, 68, 0, 0, 1533], [-23555, 0, 0, 140, 0, 640, 105, 0], [63171, 0, 0, -41, 0, 120, 791, 0], [0, -5852, -13038, 0, 1959, 0, 0, 1170], [0, -938, -5084, 0, 2235, 0, 0, 1565], [0, 2819, 7447, 0, 4635, 0, 0, 732], [-17631, 0, 0, 480, 0, 1651, -960, 0], [57338, 0, 0, 504, 0, -1003, 233, 0], [33918, 0, 0, -412, 0, -568, -1140, 0], [0, -384, -2842, 0, -3093, 0, 0, -1574], [-475, 0, 0, -1125, 0, 769, -556, 0], [0, 537, -7244, 0, -9232, 0, 0, -3869], [0, 2576, 260, 0, -2084, 0, 0, -2556], [0, 5628, -2783, 0, 6436, 0, 0, -1568], [0, -5483, 5222, 0, 572, 0, 0, -2665], [105812, 0, 0, 348, 0, 864, -1020, 0], [21683, 0, 0, 284, 0, -3302, 849, 0], [0, 2478, -17796, 0, 1911, 0, 0, 769], [2238, 0, 0, -558, 0, -1432, -970, 0], [0, 372, 5402, 0, -2230, 0, 0, -2958], [0, 4468, -29438, 0, 121, 0, 0, -1238], [-138885, 0, 0, 815, 0, -548, -641, 0], [79709, 0, 0, 441, 0, 2996, 1129, 0], [-81842, 0, 0, -746, 0, 120, -1114, 0], [0, -4564, -3102, 0, -3240, 0, 0, -2238], [24829, 0, 0, -1515, 0, 248, 1129, 0], [-24891, 0, 0, -197, 0, 13, -1632, 0], [0, 1266, 3111, 0, 8140, 0, 0, 938], [-32359, 0, 0, -568, 0, -1154, -2445, 0], [0, -504, -11948, 0, 1747, 0, 0, -1068], [-6525, 0, 0, 508, 0, 259, -870, 0], [-13330, 0, 0, -710, 0, -760, -1562, 0], [0, -2788, -3910, 0, -5996, 0, 0, 1010], [4962, 0, 0, -772, 0, -2934, -370, 0], [0, -5429, 18926, 0, 1912, 0, 0, 2429], [60691, 0, 0, -960, 0, -2, -2267, 0], [113115, 0, 0, -724, 0, -885, 2298, 0], [99251, 0, 0, 643, 0, -2424, 1003, 0], [0, -3766, 9200, 0, 3963, 0, 0, 2273], [0, 3508, -2530, 0, -5534, 0, 0, -3258], [-2029, 0, 0, 348, 0, -1322, 1805, 0], [13783, 0, 0, 1243, 0, -3892, 299, 0], [0, -2394, -16039, 0, 64, 0, 0, -742], [54339, 0, 0, -643, 0, 2189, -670, 0], [0, 5680, -6924, 0, 9771, 0, 0, 108], [0, 341, -10771, 0, 5103, 0, 0, -2278], [0, 1995, 8038, 0, 5112, 0, 0, -3755], [0, 44, 22974, 0, -684, 0, 0, 2482], [45989, 0, 0, 337, 0, 1384, -703, 0], [-33121, 0, 0, 1189, 0, -2436, -203, 0], [0, -1524, 15960, 0, 1653, 0, 0, 676], [0, 7419, -21861, 0, 6185, 0, 0, -2650], [-72903, 0, 0, -1697, 0, -3068, -1503, 0], [0, 80, 4132, 0, -2930, 0, 0, -2940], [29569, 0, 0, -693, 0, -5428, 1123, 0], [0, -1516, 3842, 0, -1409, 0, 0, -805], [0, -7012, 3774, 0, -86, 0, 0, -1358], [-41425, 0, 0, -223, 0, -7084, -241, 0], [0, -1121, -14489, 0, 6855, 0, 0, -1552]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_2312_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_2312_4_a_k();".
// 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_2312_4_a_k(:prec:=8)
    chi := MakeCharacter_2312_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_2312_4_a_k();".
// 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_2312_4_a_k( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_2312_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![373248, 0, -106624, 0, 8760, 0, -174, 0, 1]>],Snew);
    return Vf;
end function;