
// Make newform 230.4.b.a in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_230_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_230_b_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_230_4_b_a();".
// 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_230_4_b_a();".
// 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 := [1560250000, 0, 961600400, 0, 183184060, 0, 16036416, 0, 728073, 0, 17560, 0, 212, 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, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [862089169013562350, 0, 130992968757557240, 0, 11630063904988629, 0, 844061002553517, 0, 31796999102640, 0, 534359144753, 0, 3186868379, 0], [-349399293999970160, 0, -143349007643009696, 0, -17113281199655430, 0, -1060027581556725, 0, -35830636596552, 0, -585068510510, 0, -3499703585, 0], [-31018745255000, 0, -16286584250280, 0, -2338196775636, 0, -142227122813, 0, -4132854900, 0, -56463152, 0, -289581, 0], [-11718636801942706000, 0, -6998401679059936180, 0, -1050972509419489986, 0, -64661289576689253, 0, -1878146401786800, 0, -25582406911102, 0, -130865103661, 0], [0, 10343004883168433498800, 0, 2140250136020411445820, 0, 141829915665819432102, 0, 3396592715381521581, 0, 11731267396252320, 0, -553302086253686, 0, -5109264790403], [-22067604811859508475000, 4737027171360508063200, -12614487922741170151000, 1034963871490758904980, -1762031607651829994100, 110718511065104546178, -101318102481756497925, 5840748749653311384, -2802395334754738500, 153312401872801980, -36954775028636200, 1932103137868146, -185139331460725, 9297613576608], [0, -11180999413181600, 0, -5149286513241940, 0, -697518061615754, 0, -40849681155237, 0, -1155930465240, 0, -15504190478, 0, -78528469], [-22067604811859508475000, 5605977711807925435600, -12614487922741170151000, 1105286264529652540840, -1762031607651829994100, 31111404600714885924, -101318102481756497925, -2444156034271789803, -2802395334754738500, -141581134476549660, -36954775028636200, -2485405224121832, -185139331460725, -14406878367011], [26015723462652981340000, -5168044100910054506600, 15605126250757397257000, -1714372169926391895440, 2230072164412561892400, -180978293949048314904, 130490760442966435200, -9208768990763228937, 3608225438031285000, -246507496373665740, 46866526897616800, -3293692394542028, 229642540842400, -17013028715369], [26015723462652981340000, 5168044100910054506600, 15605126250757397257000, 1714372169926391895440, 2230072164412561892400, 180978293949048314904, 130490760442966435200, 9208768990763228937, 3608225438031285000, 246507496373665740, 46866526897616800, 3293692394542028, 229642540842400, 17013028715369], [0, 216134304422029615600, 0, 186449255521962680440, 0, 30371107726805052939, 0, 1900228325596386492, 0, 55178102284700640, 0, 748011503552023, 0, 3805919420404], [0, -5134147721185226373400, 0, -3178705667917618266160, 0, -448191100548218946516, 0, -25600458153130596723, 0, -689286446470969260, 0, -8724753222259912, 0, -41766387715051]];
    Rf_basisdens := [1, 1, 23726484615355650, 9490593846142260, 613694015800, 94905938461422600, 374878456922619270000, 374878456922619270000, 2424091362410000, 374878456922619270000, 374878456922619270000, 374878456922619270000, 18743922846130963500, 187439228461309635000];
    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_230_b();"
function MakeCharacter_230_b()
    N := 230;
    order := 2;
    char_gens := [47, 51];
    v := [1, 2];
    // 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_230_b_Hecke();"
function MakeCharacter_230_b_Hecke(Kf)
    N := 230;
    order := 2;
    char_gens := [47, 51];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
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, -2, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, -1, -1], [-9, 0, 3, 1, 1, 1, 2, -2, 0, -2, 2, 2, 0, 0], [0, -5, 0, 0, 0, 0, 3, 0, -8, 0, 3, -3, -4, -1], [0, 3, 0, 0, 0, 0, 5, 0, -5, 0, 3, -3, -2, 3], [12, 0, 4, 2, 5, 3, 3, -3, 0, -3, 8, 8, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0], [64, 0, 5, -5, 2, 14, 8, -8, 0, -8, 9, 9, 0, 0], [-14, 0, 7, 0, 1, 14, 9, -9, 0, -9, 9, 9, 0, 0], [0, -10, 0, 0, 0, 0, -3, -5, 28, 5, 12, -12, 21, 8], [-129, 0, 4, 13, -11, 20, 7, -7, 0, -7, 11, 11, 0, 0], [0, -2, 0, 0, 0, 0, 14, -2, -76, 2, -17, 17, 15, -11], [0, 56, 0, 0, 0, 0, 6, 11, 8, -11, -13, 13, -18, 2], [0, 12, 0, 0, 0, 0, -8, 18, -60, -18, 1, -1, -18, 21], [200, 0, 12, 11, -50, 2, 2, -2, 0, -2, -16, -16, 0, 0], [-255, 0, 3, -27, 39, -5, 15, -15, 0, -15, 10, 10, 0, 0], [0, 34, 0, 0, 0, 0, 9, 13, 42, -13, -18, 18, -27, -22], [-273, 0, 0, 31, 9, -54, -17, 17, 0, 17, -52, -52, 0, 0], [0, -56, 0, 0, 0, 0, 6, -5, -280, 5, 26, -26, -26, -14], [-110, 0, 66, -7, 6, -17, 30, -30, 0, -30, 35, 35, 0, 0], [0, 70, 0, 0, 0, 0, -21, -5, -224, 5, -39, 39, -6, -13], [106, 0, -52, 25, -14, -65, -40, 40, 0, 40, -3, -3, 0, 0], [0, 9, 0, 0, 0, 0, -17, -64, 105, 64, 33, -33, -17, 5], [-214, 0, -20, -59, -4, 34, -30, 30, 0, 30, 45, 45, 0, 0], [0, -109, 0, 0, 0, 0, -1, -38, -381, 38, 68, -68, 24, 20], [0, -198, 0, 0, 0, 0, -8, -62, 76, 62, -14, 14, 141, -8], [-76, 0, 78, 0, -75, 151, 25, -25, 0, -25, 78, 78, 0, 0], [0, 128, 0, 0, 0, 0, -77, -17, 204, 17, -98, 98, 119, 2], [0, -102, 0, 0, 0, 0, -90, 3, 228, -3, -72, 72, -34, -48], [-1080, 0, 35, 20, 34, 34, 34, -34, 0, -34, 60, 60, 0, 0], [0, -49, 0, 0, 0, 0, -45, 61, -612, -61, 122, -122, -134, 35], [314, 0, 149, 5, 6, -86, 22, -22, 0, -22, 11, 11, 0, 0], [18, 0, -148, 17, -117, 82, 5, -5, 0, -5, -131, -131, 0, 0], [-843, 0, -30, -38, -117, -20, 11, -11, 0, -11, -58, -58, 0, 0], [0, -214, 0, 0, 0, 0, -122, -28, -154, 28, -60, 60, 59, 54], [0, 237, 0, 0, 0, 0, -49, 80, 384, -80, -56, 56, -90, -49], [0, 160, 0, 0, 0, 0, 60, 202, -298, -202, -73, 73, -86, -34], [0, 277, 0, 0, 0, 0, -118, 189, 1101, -189, -127, 127, 26, -98], [474, 0, -71, 114, -134, -4, 74, -74, 0, -74, -35, -35, 0, 0], [-498, 0, -148, 10, -121, -255, -126, 126, 0, 126, -116, -116, 0, 0], [-1824, 0, -32, 38, 160, 354, 139, -139, 0, -139, 158, 158, 0, 0], [0, 314, 0, 0, 0, 0, -12, 63, 366, -63, -240, 240, 136, 4], [0, 99, 0, 0, 0, 0, 50, 144, -377, -144, -130, 130, 46, -134], [356, 0, 110, -169, -128, 85, 17, -17, 0, -17, 53, 53, 0, 0], [-650, 0, 96, 5, 110, 2, -148, 148, 0, 148, 103, 103, 0, 0], [0, -516, 0, 0, 0, 0, 54, -266, 54, 266, 294, -294, -14, 118], [0, -90, 0, 0, 0, 0, 75, 49, -2110, -49, -143, 143, 201, 65], [952, 0, 14, -103, -180, 97, -174, 174, 0, 174, 157, 157, 0, 0], [0, 290, 0, 0, 0, 0, -32, -15, 876, 15, -2, 2, 186, 130], [246, 0, -79, 97, -70, -10, 186, -186, 0, -186, -16, -16, 0, 0], [-276, 0, -140, -30, -356, 224, -131, 131, 0, 131, 78, 78, 0, 0], [-1544, 0, -82, -77, 1, -370, 2, -2, 0, -2, -193, -193, 0, 0], [0, 358, 0, 0, 0, 0, -222, 199, -378, -199, -459, 459, 50, -50], [0, 17, 0, 0, 0, 0, 98, -53, 555, 53, 60, -60, 55, -22], [2378, 0, 35, -79, 250, 370, -6, 6, 0, 6, 192, 192, 0, 0], [-1306, 0, 10, 162, 103, 258, 39, -39, 0, -39, -238, -238, 0, 0], [0, 110, 0, 0, 0, 0, -14, -153, 500, 153, -157, 157, 122, -180], [-2590, 0, 118, -53, -238, 175, -17, 17, 0, 17, -33, -33, 0, 0], [0, 220, 0, 0, 0, 0, -113, -51, 328, 51, 187, -187, 22, 63], [0, -18, 0, 0, 0, 0, -28, 96, 288, -96, 281, -281, -590, 145], [0, 551, 0, 0, 0, 0, 42, -205, 1389, 205, -73, 73, -150, -40], [-1680, 0, -179, 22, -450, 146, -132, 132, 0, 132, -17, -17, 0, 0], [0, 419, 0, 0, 0, 0, -559, -135, -542, 135, -341, 341, 270, -104], [0, 293, 0, 0, 0, 0, -265, 41, -2878, -41, 285, -285, -42, 187], [3064, 0, 543, 37, 618, 312, 218, -218, 0, -218, 569, 569, 0, 0], [0, 471, 0, 0, 0, 0, -143, -91, -2922, 91, 49, -49, -207, 20], [0, -273, 0, 0, 0, 0, 170, 79, -2069, -79, -14, 14, 72, 244], [-3414, 0, -139, 115, 28, -408, -466, 466, 0, 466, -558, -558, 0, 0], [0, -868, 0, 0, 0, 0, 100, -245, 698, 245, 136, -136, 90, 464], [-340, 0, -260, 225, -152, 383, -240, 240, 0, 240, -59, -59, 0, 0], [0, -256, 0, 0, 0, 0, -53, -613, -1528, 613, 197, -197, 884, 71], [0, -960, 0, 0, 0, 0, 145, -607, 298, 607, 604, -604, 304, 120], [-469, 0, -19, -372, 545, 50, -53, 53, 0, 53, 341, 341, 0, 0], [0, 764, 0, 0, 0, 0, 594, 50, 428, -50, 110, -110, 27, -364], [-1369, 0, 717, -182, 1647, 146, 453, -453, 0, -453, 719, 719, 0, 0], [0, -159, 0, 0, 0, 0, 384, 198, -877, -198, 17, -17, 50, -222], [802, 0, 270, 14, -472, -158, 61, -61, 0, -61, 206, 206, 0, 0], [282, 0, -627, -352, -105, 194, -185, 185, 0, 185, -85, -85, 0, 0], [2862, 0, 956, -115, -8, 69, 336, -336, 0, -336, 603, 603, 0, 0], [2390, 0, 202, 332, 811, -213, 292, -292, 0, -292, -214, -214, 0, 0], [2264, 0, 210, 7, -666, -299, 560, -560, 0, -560, -231, -231, 0, 0], [0, 1397, 0, 0, 0, 0, -142, 254, 2168, -254, -293, 293, -292, -212], [352, 0, 1069, -447, 949, 174, 683, -683, 0, -683, 523, 523, 0, 0], [0, -139, 0, 0, 0, 0, 61, 44, -1412, -44, -589, 589, 496, -309], [-694, 0, -566, 396, 417, 146, -301, 301, 0, 301, -9, -9, 0, 0], [0, -316, 0, 0, 0, 0, -75, -49, 70, 49, 443, -443, -188, -47], [-1364, 0, 1301, 206, 532, 628, 672, -672, 0, -672, 792, 792, 0, 0], [0, 654, 0, 0, 0, 0, 122, 692, -3744, -692, 180, -180, -708, 170], [0, 606, 0, 0, 0, 0, 438, 430, 3242, -430, 3, -3, -736, 137], [-28, 0, -254, -52, -964, -576, -601, 601, 0, 601, -134, -134, 0, 0], [0, -248, 0, 0, 0, 0, -416, 379, 558, -379, -453, 453, -830, -414], [1198, 0, 611, 187, 2440, -412, 424, -424, 0, -424, 141, 141, 0, 0], [-3150, 0, -625, -129, -534, -790, -422, 422, 0, 422, -870, -870, 0, 0], [0, -137, 0, 0, 0, 0, -675, 507, -1558, -507, 51, -51, -286, 0], [5934, 0, -747, -426, 614, -740, -110, 110, 0, 110, -484, -484, 0, 0], [3582, 0, 206, -332, 1094, 536, 410, -410, 0, -410, 1278, 1278, 0, 0], [0, 580, 0, 0, 0, 0, -227, 393, -4100, -393, -851, 851, 417, -191], [4288, 0, -893, 220, -1874, -1118, -600, 600, 0, 600, -1123, -1123, 0, 0], [0, 607, 0, 0, 0, 0, -1127, 942, 6928, -942, -945, 945, 120, 33], [0, -2052, 0, 0, 0, 0, 544, -358, 662, 358, 66, -66, 31, -318], [0, 766, 0, 0, 0, 0, 530, 8, -7038, -8, -377, 377, 926, 231], [54, 0, -878, 186, -124, -748, -445, 445, 0, 445, -1292, -1292, 0, 0], [9489, 0, -71, 26, 857, 546, -260, 260, 0, 260, 201, 201, 0, 0], [0, -1112, 0, 0, 0, 0, -342, -399, 1626, 399, 667, -667, 132, 34], [0, 1463, 0, 0, 0, 0, -562, 528, 3141, -528, 112, -112, -880, -754], [0, 2120, 0, 0, 0, 0, -518, 1106, -174, -1106, -830, 830, -736, -640], [4577, 0, 323, 244, 1391, 482, 411, -411, 0, -411, 68, 68, 0, 0], [1398, 0, -451, 448, -493, 776, 143, -143, 0, -143, 206, 206, 0, 0], [0, -3106, 0, 0, 0, 0, 262, -438, 9150, 438, 789, -789, 266, 906], [0, 2114, 0, 0, 0, 0, 483, -185, 6196, 185, 898, -898, -444, 580], [0, 767, 0, 0, 0, 0, -1022, -13, -2529, 13, -464, 464, -427, 8], [-3166, 0, 826, 389, 255, -300, 59, -59, 0, -59, 459, 459, 0, 0], [1638, 0, 1040, 661, 980, 1139, 490, -490, 0, -490, 327, 327, 0, 0], [-3214, 0, -868, 685, -750, 697, -520, 520, 0, 520, -1287, -1287, 0, 0], [0, -1446, 0, 0, 0, 0, -297, -87, -884, 87, 259, -259, -622, -225], [0, 938, 0, 0, 0, 0, -1380, 883, -1392, -883, -1232, 1232, 376, -32], [0, 255, 0, 0, 0, 0, 9, -632, 1348, 632, 287, -287, 1248, 151], [-1650, 0, -456, 400, -672, -84, -337, 337, 0, 337, -886, -886, 0, 0], [6079, 0, 1007, 670, -845, 44, -57, 57, 0, 57, 473, 473, 0, 0], [0, -298, 0, 0, 0, 0, -756, 547, 12694, -547, 124, -124, -1110, 118], [0, -2104, 0, 0, 0, 0, 386, -1424, 5116, 1424, 1161, -1161, -220, -649], [0, 1053, 0, 0, 0, 0, -1355, 598, 4552, -598, -1802, 1802, 542, -371], [-1870, 0, 818, -486, 1122, -190, 946, -946, 0, -946, 316, 316, 0, 0], [-3026, 0, 122, -252, -2587, -953, 122, -122, 0, -122, -658, -658, 0, 0], [-6309, 0, 909, -1129, 1799, 297, -124, 124, 0, 124, 672, 672, 0, 0], [5534, 0, -1510, 306, 199, 866, -177, 177, 0, 177, -712, -712, 0, 0], [0, 3153, 0, 0, 0, 0, -603, 538, 6399, -538, -837, 837, 622, 491], [0, -1880, 0, 0, 0, 0, 429, -1501, 3610, 1501, 927, -927, 148, 565], [982, 0, -1387, 921, -1170, -348, -24, 24, 0, 24, -1319, -1319, 0, 0], [0, 299, 0, 0, 0, 0, -736, 516, -3850, -516, -258, 258, -442, 727], [-826, 0, 1756, -21, -2202, 381, 134, -134, 0, -134, 815, 815, 0, 0], [0, -1334, 0, 0, 0, 0, 893, -275, -2542, 275, 1250, -1250, -967, 196], [-8310, 0, 1149, 106, -2019, 1728, 901, -901, 0, -901, 1085, 1085, 0, 0], [-5906, 0, 2318, 46, 2886, -1272, 1379, -1379, 0, -1379, 1090, 1090, 0, 0], [0, 496, 0, 0, 0, 0, 160, 672, 15052, -672, 211, -211, 937, -189], [0, -320, 0, 0, 0, 0, 2272, 234, 1118, -234, 275, -275, 624, -101], [0, -3632, 0, 0, 0, 0, 534, -938, -2462, 938, 842, -842, 1069, -762], [775, 0, -1813, -367, -1453, 516, -359, 359, 0, 359, -410, -410, 0, 0], [-8216, 0, -235, 151, 236, 2298, 734, -734, 0, -734, 502, 502, 0, 0], [4878, 0, 1666, 150, -1660, 590, -528, 528, 0, 528, 1012, 1012, 0, 0], [0, 1964, 0, 0, 0, 0, 24, 1973, -1976, -1973, -864, 864, 518, 648], [0, 3544, 0, 0, 0, 0, -1170, 1062, 4020, -1062, -583, 583, -146, -251], [7202, 0, 1304, -183, -1190, -608, 1808, -1808, 0, -1808, -351, -351, 0, 0], [12450, 0, -562, 555, 342, -1411, -1297, 1297, 0, 1297, 173, 173, 0, 0], [0, 105, 0, 0, 0, 0, 1035, -1497, -5458, 1497, -483, 483, 1168, -391], [0, 1244, 0, 0, 0, 0, -52, 1427, -13410, -1427, 1144, -1144, -3074, 728], [-7718, 0, 1695, -931, -1670, -726, 1510, -1510, 0, -1510, 130, 130, 0, 0], [0, 1572, 0, 0, 0, 0, -1620, 1071, -6994, -1071, -1018, 1018, 146, 846], [0, 2505, 0, 0, 0, 0, 1168, 343, 4429, -343, 1269, -1269, -1996, -334], [-10774, 0, -620, -662, 3442, -1160, -1421, 1421, 0, 1421, -586, -586, 0, 0], [0, 1733, 0, 0, 0, 0, -399, 519, 498, -519, -201, 201, -982, -769], [0, 460, 0, 0, 0, 0, -638, -35, 11946, 35, 285, -285, 2756, 1154], [0, -1590, 0, 0, 0, 0, 900, -892, 24354, 892, 846, -846, -187, -502], [-8020, 0, -3424, -395, -2840, 133, -1552, 1552, 0, 1552, -1679, -1679, 0, 0], [-10562, 0, 1270, -85, 4656, 2809, 1301, -1301, 0, -1301, 2229, 2229, 0, 0], [7724, 0, 809, -19, 3106, 1022, -180, 180, 0, 180, 1404, 1404, 0, 0], [0, 1427, 0, 0, 0, 0, 168, -752, 1500, 752, -281, 281, 1143, 240], [1405, 0, 2897, 548, 699, 1178, 1608, -1608, 0, -1608, 2753, 2753, 0, 0], [0, 1653, 0, 0, 0, 0, -2003, -602, 8576, 602, -1108, 1108, -402, 1153], [0, -3177, 0, 0, 0, 0, 14, -1845, -5785, 1845, 880, -880, 628, -794], [0, -3790, 0, 0, 0, 0, 1480, -1219, 9514, 1219, 1796, -1796, -158, 1368], [-7887, 0, 1801, -470, 1259, 1244, 2115, -2115, 0, -2115, 213, 213, 0, 0], [0, 1245, 0, 0, 0, 0, 368, 122, -9910, -122, -2166, 2166, 1749, -661], [0, -2009, 0, 0, 0, 0, 188, 505, -21681, -505, 727, -727, 294, -723], [-16191, 0, -967, 549, -3493, -3286, -823, 823, 0, 823, -612, -612, 0, 0], [0, -2894, 0, 0, 0, 0, 672, -1178, 15978, 1178, -129, 129, 2352, 370]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_230_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_230_4_b_a();".
// 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_230_4_b_a(:prec:=14)
    chi := MakeCharacter_230_b();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 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_230_4_b_a();".
// 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_230_4_b_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_230_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![2723378596, 0, 1302477653, 0, 231696639, 0, 19553159, 0, 852894, 0, 19539, 0, 223, 0, 1]>],Snew);
    return Vf;
end function;