
// Make newform 1050.3.l.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1050_l();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1050_l_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_1050_3_l_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_1050_3_l_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 := [1, 0, 0, 0, 23, 0, 0, 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, 19, 0, 0, 0, 1, 0, 0], [0, 29, 0, 0, 0, 1, 0, 0], [0, 0, 24, 0, 0, 0, 1, 0], [23, 0, 0, 0, 2, 0, 0, 0], [0, 0, -22, 0, 0, 0, -1, 0], [0, 0, 0, -91, 0, 0, 0, -4], [0, 0, 0, 139, 0, 0, 0, 6]];
    Rf_basisdens := [1, 5, 5, 5, 5, 1, 5, 5];
    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_1050_l();"
function MakeCharacter_1050_l()
    N := 1050;
    order := 4;
    char_gens := [701, 127, 451];
    v := [4, 3, 4];
    // 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_1050_l_Hecke();"
function MakeCharacter_1050_l_Hecke(Kf)
    N := 1050;
    order := 4;
    char_gens := [701, 127, 451];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [1, 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 := 3;
    raw_aps := [[-1, 0, 0, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [-4, 3, 1, 0, -1, 0, 3, -1], [-5, 0, 0, 5, 0, 0, -5, -1], [5, 1, -9, 5, 0, 0, 0, 0], [0, -2, 7, 3, 0, -1, 2, 7], [1, 0, 0, -1, -1, -1, 8, -1], [0, 4, 9, -4, 0, 1, -4, 9], [12, -6, -2, 0, -6, 0, -6, 2], [-14, 15, -4, -14, -2, 2, 0, 0], [-20, -10, 2, 0, 0, 0, -10, -2], [8, 0, 0, -8, -1, -1, 13, -2], [-8, -13, -7, -8, 9, -9, 0, 0], [-10, 0, 0, 10, 2, 2, -12, 4], [0, -20, 5, 15, 0, -11, 20, 5], [-16, 16, -16, 0, -8, 0, 16, 16], [38, 7, -4, 38, 1, -1, 0, 0], [30, -1, -19, 0, 1, 0, -1, 19], [-3, 0, 0, 3, 2, 2, -19, 27], [0, 6, 19, -29, 0, -6, -6, 19], [-8, 0, 0, 8, -2, -2, -6, -4], [0, 29, 2, -5, 0, -5, -29, 2], [-34, -42, -12, -34, 2, -2, 0, 0], [49, 9, -14, 0, 21, 0, 9, 14], [14, 0, 0, -14, 7, 7, 11, 25], [-10, 4, -10, -10, 20, -20, 0, 0], [0, -30, 20, 33, 0, 0, 30, 20], [68, 0, 0, -68, 9, 9, 34, 1], [-14, -11, -4, -14, -1, 1, 0, 0], [-105, 34, 27, 0, 25, 0, 34, -27], [4, 72, -6, 4, 12, -12, 0, 0], [0, 60, 9, 7, 0, -3, -60, 9], [0, 0, 9, 8, 0, -1, 0, 9], [-77, 20, -29, 0, -22, 0, 20, 29], [76, -14, 22, 76, 2, -2, 0, 0], [-8, 0, 0, 8, 22, 22, 6, 22], [-64, -39, 3, -64, 3, -3, 0, 0], [-3, 0, 0, 3, -14, -14, -3, 11], [0, 0, -2, 164, 0, -12, 0, -2], [155, 41, -26, 0, 21, 0, 41, 26], [110, -52, 24, 0, 6, 0, -52, -24], [84, 0, 0, -84, 12, 12, 53, 54], [94, -74, -33, 94, -1, 1, 0, 0], [0, -14, 14, -132, 0, -28, 14, 14], [-48, -28, -30, 0, 12, 0, -28, 30], [-8, 0, 0, 8, 9, 9, -17, 31], [52, 31, -43, 52, -15, 15, 0, 0], [0, 94, 4, -84, 0, -10, -94, 4], [-56, 0, 0, 56, -15, -15, -86, 11], [0, -52, -20, -162, 0, -10, 52, -20], [7, -19, -28, 0, -1, 0, -19, 28], [3, 16, 1, 0, 17, 0, 16, -1], [-20, 0, -78, -20, 18, -18, 0, 0], [-51, 0, 0, 51, -35, -35, 52, 7], [0, -22, -22, -82, 0, 48, 22, -22], [37, 64, -17, 0, -17, 0, 64, 17], [-8, 74, 32, -8, -46, 46, 0, 0], [-14, 34, 55, 0, 43, 0, 34, -55], [18, 0, 0, -18, 16, 16, -70, -84], [-123, 0, 0, 123, 2, 2, 69, 11], [-88, -101, -39, -88, -19, 19, 0, 0], [147, -4, 53, 0, -55, 0, -4, -53], [-215, 0, 0, 215, 6, 6, -13, -85], [-222, 24, 17, -222, -29, 29, 0, 0], [125, -84, 1, 0, -56, 0, -84, -1], [86, -32, 6, 86, -54, 54, 0, 0], [19, 186, -93, 19, 9, -9, 0, 0], [0, 69, 0, -341, 0, 13, -69, 0], [110, 0, 0, -110, -26, -26, -158, 48], [0, 89, -53, -12, 0, 5, -89, -53], [116, -22, -6, 116, -46, 46, 0, 0], [-202, 0, 0, 202, -18, -18, 159, 54], [0, -180, -37, -147, 0, -8, 180, -37], [-42, 0, 0, 42, 17, 17, -59, 61], [0, -66, -39, 38, 0, 57, 66, -39], [-18, 106, -16, -18, -22, 22, 0, 0], [248, 106, 15, 0, 41, 0, 106, -15], [0, -27, -50, -227, 0, -21, 27, -50], [0, 156, -38, -246, 0, 48, -156, -38], [233, 16, -26, 0, -64, 0, 16, 26], [-36, -108, 20, 0, -98, 0, -108, -20], [14, 0, 0, -14, 12, 12, 214, 18], [0, 152, -31, 351, 0, -53, -152, -31], [-258, 0, 0, 258, 22, 22, 222, -44], [0, -154, -31, 342, 0, 45, 154, -31], [-8, -69, 174, -8, 28, -28, 0, 0], [41, -41, 46, 0, -5, 0, -41, -46], [236, 0, 0, -236, 18, 18, -66, -114], [-118, -36, 26, -118, -46, 46, 0, 0], [0, -190, 7, -217, 0, 37, 190, 7], [-140, -69, -60, -140, -11, 11, 0, 0], [-96, -15, 69, 0, -127, 0, -15, -69], [0, 84, 150, 18, 0, 32, -84, 150], [-442, 0, 0, 442, 4, 4, -98, 28], [0, 37, -90, 35, 0, 87, -37, -90], [192, -58, 16, 0, 118, 0, -58, -16], [-382, 0, 0, 382, -40, -40, -134, -70], [177, 70, -18, 0, 30, 0, 70, 18], [322, -105, 66, 322, -9, 9, 0, 0], [260, -38, 153, 260, 19, -19, 0, 0], [320, 0, 0, -320, 8, 8, -208, 6], [0, 6, 137, 226, 0, 23, -6, 137], [-11, 222, -21, 0, 2, 0, 222, 21], [443, 121, 35, 443, -26, 26, 0, 0], [-48, -371, -47, -48, 55, -55, 0, 0], [-452, 0, 0, 452, 40, 40, 132, -28], [0, 9, 33, 56, 0, 149, -9, 33], [126, 174, -12, 0, 86, 0, 174, 12], [-246, 201, 17, -246, 69, -69, 0, 0], [86, 0, 0, -86, -42, -42, -109, 38], [260, -50, 227, 260, 45, -45, 0, 0], [0, 138, 61, -139, 0, -23, -138, 61], [135, -182, 21, 0, 114, 0, -182, -21], [206, 70, -119, 0, 119, 0, 70, 119], [-124, 0, 0, 124, -26, -26, 46, -190], [-312, 128, -150, -312, 8, -8, 0, 0], [-38, 0, 0, 38, -38, -38, 20, 112], [0, -132, 80, -136, 0, 146, 132, 80], [115, -257, -54, 0, -29, 0, -257, 54], [228, 0, 0, -228, -74, -74, 246, 4], [-438, -232, 82, -438, 4, -4, 0, 0], [365, 0, 0, -365, 25, 25, -106, -51], [334, -314, -72, 0, -102, 0, -314, 72], [-420, -212, -126, 0, 180, 0, -212, 126], [0, 152, -58, 300, 0, -164, -152, -58], [0, 26, 220, 30, 0, -26, -26, 220], [-60, 51, -63, -60, 57, -57, 0, 0], [-302, 0, 0, 302, 32, 32, -330, 174], [0, -122, 55, -491, 0, 98, 122, 55], [226, 0, 0, -226, 114, 114, 38, -64], [532, -16, 0, 0, 42, 0, -16, 0], [-80, 115, 122, -80, 154, -154, 0, 0], [-740, -40, -64, 0, 72, 0, -40, 64], [0, -90, 58, 64, 0, -132, 90, 58], [12, 0, 0, -12, 60, 60, -42, -140], [462, 51, -59, 462, 115, -115, 0, 0], [91, -329, 73, 91, 136, -136, 0, 0], [0, 84, 103, -618, 0, -163, -84, 103], [8, 196, 24, 0, -58, 0, 196, -24], [782, 76, 100, 0, 64, 0, 76, -100], [134, 0, 0, -134, -3, -3, 235, -20], [221, -322, -263, 221, -83, 83, 0, 0], [0, 253, 82, 439, 0, 159, -253, 82], [0, 78, 81, 941, 0, 21, -78, 81], [-438, 0, 0, 438, 18, 18, -56, -116], [242, 640, 36, 242, -34, 34, 0, 0], [0, 174, -120, -170, 0, 184, -174, -120], [203, 0, 0, -203, 103, 103, 328, 77], [352, -242, 48, 352, -10, 10, 0, 0], [36, -54, -20, 0, 158, 0, -54, 20], [380, 0, 0, -380, 61, 61, -39, -248], [-122, -368, -280, -122, 50, -50, 0, 0], [-164, -126, -114, -164, 138, -138, 0, 0], [530, -71, -149, 0, -99, 0, -71, 149], [0, 396, -119, 97, 0, -84, -396, -119], [0, 211, 0, -899, 0, -33, -211, 0], [-498, -120, 52, -498, 94, -94, 0, 0], [-796, 174, -16, 0, 86, 0, 174, 16], [-506, -76, -68, -506, 26, -26, 0, 0], [466, 0, 0, -466, -77, -77, 312, -235], [-204, 130, -288, -204, 40, -40, 0, 0], [-445, 160, 81, 0, -121, 0, 160, -81], [-148, -390, -233, -148, -33, 33, 0, 0], [-106, 0, 0, 106, -94, -94, -332, 142], [-297, 16, 215, 0, 34, 0, 16, -215], [499, -169, 293, 499, 96, -96, 0, 0], [0, -238, -260, 455, 0, 134, 238, -260], [-21, 0, 0, 21, 126, 126, 405, 85], [0, 161, 197, -294, 0, -49, -161, 197], [295, -217, 110, 0, -29, 0, -217, -110], [850, 227, -21, 0, -51, 0, 227, 21], [636, 0, 0, -636, -68, -68, -296, 212], [0, 302, -231, -139, 0, 11, -302, -231], [0, 167, -134, 739, 0, -155, -167, -134], [631, 46, 107, 0, 26, 0, 46, -107], [504, 116, -126, 0, -100, 0, 116, 126], [-570, 0, 0, 570, -29, -29, 347, 165], [0, -114, -238, -338, 0, -176, 114, -238], [-594, -27, 296, -594, -79, 79, 0, 0], [18, -258, 76, 0, -90, 0, -258, -76], [182, 0, 0, -182, -26, -26, 25, 590], [-126, -322, 324, -126, -94, 94, 0, 0], [55, 0, 0, -55, 41, 41, -438, 377], [0, -314, 24, 716, 0, -102, 314, 24], [-114, 139, -56, -114, -66, 66, 0, 0], [-56, 0, 0, 56, -16, -16, -540, -130], [0, 242, 138, 233, 0, 134, -242, 138], [-467, -96, -133, 0, 123, 0, -96, 133], [150, 0, 0, -150, -186, -186, -142, -32], [-105, 0, 0, 105, -23, -23, -284, 169], [351, -272, 9, 0, -32, 0, -272, -9], [-476, -46, 76, 0, 222, 0, -46, -76], [373, 154, 441, 373, -19, 19, 0, 0], [-140, 0, 0, 140, 142, 142, -174, -318], [703, -48, 16, 0, 138, 0, -48, -16], [256, 0, 0, -256, 10, 10, 383, 380], [-13, 37, 109, -13, -244, 244, 0, 0], [-158, 0, 0, 158, -48, -48, -386, 260], [0, -82, -388, -84, 0, 122, 82, -388], [-48, 264, 204, 0, -110, 0, 264, -204], [654, -26, 72, 654, 2, -2, 0, 0], [0, 616, -32, 548, 0, -52, -616, -32], [0, -148, -164, 860, 0, -12, 148, -164], [-588, 338, -182, -588, -138, 138, 0, 0], [0, -122, 180, 98, 0, -164, 122, 180], [-558, 0, 0, 558, 144, 144, 368, -178], [0, 202, 221, -472, 0, -73, -202, 221], [-910, -186, 64, 0, -22, 0, -186, -64], [424, -371, -232, 424, 104, -104, 0, 0], [553, 421, -70, 0, 69, 0, 421, 70], [-404, 0, 0, 404, -199, -199, -331, -70], [468, -608, -284, 468, -64, 64, 0, 0], [0, -270, -249, -569, 0, -217, 270, -249], [869, 5, -84, 0, 151, 0, 5, 84], [-232, -865, 88, -232, -111, 111, 0, 0], [39, 255, 144, 0, 1, 0, 255, -144], [23, 80, 41, 23, -45, 45, 0, 0], [84, 0, 0, -84, 155, 155, 332, 63], [33, -460, 174, 0, -106, 0, -460, -174], [0, -112, 103, -167, 0, 107, 112, 103], [0, -38, -91, 180, 0, -249, 38, -91], [112, 0, 0, -112, 85, 85, -241, 462], [-146, 405, 271, -146, -115, 115, 0, 0], [0, -188, 126, 892, 0, -44, 188, 126], [127, 0, 0, -127, -20, -20, 131, -113], [0, 415, -369, -94, 0, -47, -415, -369], [478, 131, -59, 478, 203, -203, 0, 0], [-492, -407, 25, 0, 49, 0, -407, -25], [-1400, 0, 0, 1400, -24, -24, 9, -18], [0, 620, 64, -828, 0, -82, -620, 64], [828, 200, -32, 0, 110, 0, 200, 32], [424, -182, 253, 0, 57, 0, -182, -253], [162, 0, 0, -162, -51, -51, 797, -177], [-188, -692, 146, -188, -4, 4, 0, 0], [0, 82, 58, -1368, 0, -20, -82, 58], [482, 0, 0, -482, 65, 65, 44, 339], [0, 275, -337, 42, 0, 117, -275, -337], [-340, 302, 30, 0, -140, 0, 302, -30], [43, 0, 0, -43, -165, -165, -142, -87], [49, -56, -21, 0, 283, 0, -56, 21], [28, 0, 0, -28, 180, 180, 636, 202], [0, 56, -90, 445, 0, 134, -56, -90], [435, 0, 0, -435, 196, 196, -519, -1], [0, 194, 437, 457, 0, 21, -194, 437], [330, -158, -524, 330, 8, -8, 0, 0], [-340, 436, 4, 0, -234, 0, 436, -4], [0, -408, 196, -660, 0, 218, 408, 196], [-786, 0, 0, 786, -138, -138, 696, 216], [-482, 344, -150, -482, 134, -134, 0, 0], [-454, 718, -72, 0, -70, 0, 718, 72], [486, 556, -194, 486, 192, -192, 0, 0], [0, -281, -80, -957, 0, -85, 281, -80], [-649, 0, 0, 649, -24, -24, -311, 171], [0, -448, 122, 624, 0, -228, 448, 122], [-157, 376, -400, 0, -44, 0, 376, 400], [958, 297, 451, 958, -39, 39, 0, 0], [625, -97, -197, 625, 16, -16, 0, 0], [289, 321, -261, 289, 0, 0, 0, 0], [-944, 0, 0, 944, 88, 88, -38, -60], [363, -500, 601, 363, 15, -15, 0, 0], [0, 474, 144, -516, 0, -118, -474, 144], [352, 0, 0, -352, 170, 170, -168, -362], [-115, -69, -191, -115, 354, -354, 0, 0], [0, 532, -174, 1346, 0, -54, -532, -174], [0, 916, 195, -52, 0, -87, -916, 195], [-1143, -75, -98, 0, -195, 0, -75, 98], [174, 0, 0, -174, 83, 83, -613, -366], [32, 0, 0, -32, 7, 7, -332, -471], [-1476, 226, -114, 0, -328, 0, 226, 114], [-988, 4, -304, -988, 140, -140, 0, 0], [-350, 0, 0, 350, -182, -182, -276, 8], [0, 284, -85, 2157, 0, -114, -284, -85], [1, 375, -753, 1, -96, 96, 0, 0], [1346, 0, 0, -1346, -103, -103, -707, 145], [-31, 584, 411, -31, 135, -135, 0, 0], [0, -22, 450, 10, 0, -38, 22, 450], [1013, 140, -118, 0, 342, 0, 140, 118], [-943, -622, 105, 0, -85, 0, -622, -105], [-1032, 0, 0, 1032, 125, 125, 79, 249], [432, -20, -498, 0, -52, 0, -20, 498], [-478, -115, 383, -478, 121, -121, 0, 0], [459, -67, -330, 0, -107, 0, -67, 330], [-76, -609, 369, -76, -187, 187, 0, 0], [1020, 429, 347, 0, -473, 0, 429, -347], [-552, 0, 0, 552, 272, 272, -39, -10], [-362, 642, -703, -362, -139, 139, 0, 0], [0, 794, 304, -438, 0, -146, -794, 304], [0, -296, 404, 186, 0, -152, 296, 404], [82, -388, 191, 0, 267, 0, -388, -191], [-832, -774, 268, -832, 70, -70, 0, 0], [-310, 0, 0, 310, 239, 239, 950, -137], [1717, -254, -343, 0, -177, 0, -254, 343], [-800, 0, 0, 800, -130, -130, 867, 8], [0, 169, -154, 997, 0, 135, -169, -154], [-38, -264, -226, 0, 134, 0, -264, 226], [-13, 0, 0, 13, -212, -212, -751, -217], [0, -456, -100, 1368, 0, 336, 456, -100], [556, 534, 840, 556, -114, 114, 0, 0], [565, 0, 0, -565, 212, 212, 67, -43], [672, -218, 70, 672, 246, -246, 0, 0], [0, -174, -11, 673, 0, -296, 174, -11]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1050_l_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1050_3_l_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_1050_3_l_a(:prec:=8)
    chi := MakeCharacter_1050_l();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(1999) - 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_1050_3_l_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_1050_3_l_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1050_l();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![625, -160, -82, 16, 1]>,<13,R![1157776, 1377280, 819200, -131040, 20648, 6720, 800, 40, 1]>],Snew);
    return Vf;
end function;