
// Make newform 1470.3.f.a in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1470_f();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1470_f_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_1470_3_f_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_1470_3_f_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 := [81, 0, -36, 0, 7, 0, -4, 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, 81, 0, 35, 0, 7, 0, -4], [0, 801, 0, -133, 0, 49, 0, -10], [0, -63, 0, 5, 0, 1, 0, 2], [18, 0, 2, 0, 4, 0, -1, 0], [225, 0, -56, 0, 14, 0, -8, 0], [22, 0, 0, 0, 0, 0, -1, 0], [0, -81, 0, 19, 0, -7, 0, 4]];
    Rf_basisdens := [1, 189, 189, 27, 9, 63, 7, 27];
    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_1470_f();"
function MakeCharacter_1470_f()
    N := 1470;
    order := 2;
    char_gens := [491, 1177, 1081];
    v := [2, 2, 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1470_f_Hecke();"
function MakeCharacter_1470_f_Hecke(Kf)
    N := 1470;
    order := 2;
    char_gens := [491, 1177, 1081];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 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 := [[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0], [1, -3, 2, 0, 1, 0, 0, 0], [0, 0, 0, 4, 0, -2, 1, -1], [0, 0, 0, 1, 0, -7, -3, 2], [0, 0, 0, -7, 0, 9, -2, -1], [-3, -1, 2, 0, 3, 0, 0, 0], [9, -13, 2, 0, -1, 0, 0, 0], [0, 0, 0, 1, 0, 11, 2, 5], [24, 2, -1, 0, -5, 0, 0, 0], [0, 0, 0, -1, 0, 3, -19, -4], [-14, 5, 4, 0, 9, 0, 0, 0], [0, 0, 0, 20, 0, -2, -8, 2], [-8, 26, 8, 0, -4, 0, 0, 0], [0, 0, 0, -7, 0, -11, 21, -8], [0, 0, 0, -2, 0, 8, -16, 16], [30, 9, 8, 0, 3, 0, 0, 0], [1, -29, 6, 0, -7, 0, 0, 0], [0, 0, 0, 10, 0, -2, 25, 15], [-3, -13, 19, 0, 2, 0, 0, 0], [0, 0, 0, -15, 0, 3, -7, -34], [0, 0, 0, 11, 0, 41, -19, 4], [0, 0, 0, 20, 0, -36, -8, -18], [0, 0, 0, 15, 0, -7, 19, 14], [0, 0, 0, 5, 0, -72, 1, 20], [-15, 25, 24, 0, -1, 0, 0, 0], [-15, 20, -18, 0, 8, 0, 0, 0], [-50, 24, 6, 0, 8, 0, 0, 0], [-82, 57, -12, 0, -9, 0, 0, 0], [0, 0, 0, -40, 0, -30, -20, 24], [-79, -85, -8, 0, -1, 0, 0, 0], [0, 0, 0, 27, 0, 37, -8, 43], [84, 10, 26, 0, -20, 0, 0, 0], [54, -68, -6, 0, 0, 0, 0, 0], [0, 0, 0, -14, 0, 52, 76, 22], [-120, -86, 12, 0, -14, 0, 0, 0], [0, 0, 0, 11, 0, 71, 53, -20], [0, 0, 0, -26, 0, -6, 58, 18], [148, 12, 8, 0, -34, 0, 0, 0], [0, 0, 0, -40, 0, -37, 74, -4], [-94, 14, 24, 0, 28, 0, 0, 0], [-162, 96, -1, 0, -19, 0, 0, 0], [83, 47, 28, 0, -15, 0, 0, 0], [0, 0, 0, 36, 0, 16, 20, 26], [-86, -180, -6, 0, -4, 0, 0, 0], [0, 0, 0, -28, 0, -34, -18, 70], [0, 0, 0, 15, 0, -99, -21, 4], [0, 0, 0, 24, 0, 141, 32, -28], [-142, -146, 28, 0, -24, 0, 0, 0], [-92, 22, 12, 0, -50, 0, 0, 0], [0, 0, 0, 16, 0, -74, 82, 36], [0, 0, 0, 19, 0, -43, 97, -46], [0, 0, 0, 37, 0, -45, 33, -26], [-176, 158, -22, 0, -36, 0, 0, 0], [0, 0, 0, -6, 0, 110, 72, 10], [0, 0, 0, 36, 0, -8, -84, -34], [36, -6, 53, 0, -39, 0, 0, 0], [24, -70, 32, 0, -16, 0, 0, 0], [0, 0, 0, -91, 0, -80, 47, -62], [0, 0, 0, 2, 0, -40, -16, -6], [0, 0, 0, 1, 0, 64, 125, -38], [0, 0, 0, 73, 0, 1, -41, -52], [0, 0, 0, -4, 0, 70, -9, -49], [-17, -17, 2, 0, 5, 0, 0, 0], [-363, 11, -1, 0, 0, 0, 0, 0], [242, -6, -37, 0, 49, 0, 0, 0], [-56, -2, -36, 0, 0, 0, 0, 0], [0, 0, 0, 48, 0, 152, 100, -12], [0, 0, 0, -107, 0, -37, 45, -90], [335, 233, -58, 0, 89, 0, 0, 0], [0, 0, 0, 85, 0, 38, -73, -24], [-294, 160, -41, 0, -29, 0, 0, 0], [27, 241, -37, 0, 26, 0, 0, 0], [0, 0, 0, 4, 0, -22, 34, -88], [217, -155, -12, 0, 45, 0, 0, 0], [0, 0, 0, -78, 0, -52, -45, 69], [106, 58, 18, 0, -58, 0, 0, 0], [0, 0, 0, -114, 0, -71, 48, -54], [0, 0, 0, 30, 0, -102, -152, -42], [-41, -154, -72, 0, 0, 0, 0, 0], [-148, 6, -42, 0, -26, 0, 0, 0], [0, 0, 0, -60, 0, 4, 71, 109], [0, 0, 0, -62, 0, 118, -110, -86], [-4, -152, 6, 0, 80, 0, 0, 0], [-106, -156, 42, 0, -44, 0, 0, 0], [138, -80, -59, 0, -39, 0, 0, 0], [0, 0, 0, -123, 0, 35, -109, 4], [-8, 145, 34, 0, 53, 0, 0, 0], [0, 0, 0, 16, 0, 172, -54, -72], [0, 0, 0, 102, 0, 220, 80, -56], [-172, 77, -32, 0, 11, 0, 0, 0], [-168, -270, 14, 0, 32, 0, 0, 0], [75, -115, -41, 0, -6, 0, 0, 0], [0, 0, 0, -116, 0, -222, 132, -104], [0, 0, 0, 180, 0, -122, -40, -82], [0, 0, 0, 150, 0, 102, 38, -56], [0, 0, 0, -83, 0, -10, -327, 18], [-305, 100, -52, 0, -40, 0, 0, 0], [206, -306, -74, 0, -64, 0, 0, 0], [-146, -252, -44, 0, -36, 0, 0, 0], [0, 0, 0, -222, 0, -38, 8, -8], [-211, 131, 60, 0, -15, 0, 0, 0], [157, -237, 23, 0, -94, 0, 0, 0], [0, 0, 0, 264, 0, 54, -1, 69], [0, 0, 0, -1, 0, 371, -5, 0], [0, 0, 0, -89, 0, -217, 81, -22], [-506, -276, -18, 0, 98, 0, 0, 0], [0, 0, 0, 46, 0, -219, -136, 8], [0, 0, 0, 157, 0, -174, -233, -64], [72, 472, 16, 0, 74, 0, 0, 0], [-210, -38, 6, 0, -60, 0, 0, 0], [0, 0, 0, -97, 0, 31, -312, 49], [-162, 292, -4, 0, 4, 0, 0, 0], [687, -185, 18, 0, 33, 0, 0, 0], [0, 0, 0, -23, 0, 194, -195, -38], [0, 0, 0, 83, 0, 117, -73, 0], [55, -81, -76, 0, -165, 0, 0, 0], [802, 162, 6, 0, 26, 0, 0, 0], [0, 0, 0, 84, 0, -37, -114, 32], [-282, 358, -9, 0, -55, 0, 0, 0], [0, 0, 0, -163, 0, 11, 171, 6], [-345, -141, 60, 0, 21, 0, 0, 0], [0, 0, 0, 151, 0, 75, -100, -3], [-137, 111, 42, 0, 189, 0, 0, 0], [-134, -142, 88, 0, -124, 0, 0, 0], [0, 0, 0, -166, 0, 80, 126, -124], [0, 0, 0, 137, 0, -66, 105, 0], [0, 0, 0, 134, 0, 144, -109, 135], [123, -239, -21, 0, -156, 0, 0, 0], [391, 507, 80, 0, -81, 0, 0, 0], [313, 381, -43, 0, 44, 0, 0, 0], [622, 50, 86, 0, 36, 0, 0, 0], [0, 0, 0, -91, 0, 173, 309, 164], [0, 0, 0, 18, 0, -143, -30, -30], [0, 0, 0, -281, 0, -63, 15, 144], [0, 0, 0, 70, 0, -222, -366, -124], [0, 0, 0, -89, 0, 269, -103, -156], [-328, -28, -20, 0, 234, 0, 0, 0], [0, 0, 0, -264, 0, 118, -30, -52], [-597, 149, 6, 0, -13, 0, 0, 0], [-272, 316, 88, 0, 54, 0, 0, 0], [-84, -258, -82, 0, 138, 0, 0, 0], [0, 0, 0, 158, 0, -77, 26, -70], [0, 0, 0, -171, 0, 181, -59, 122], [0, 0, 0, -150, 0, 312, -75, -205], [0, 0, 0, 131, 0, -253, -21, 92], [0, 0, 0, -174, 0, -102, -94, 98], [280, -640, 74, 0, 126, 0, 0, 0], [-190, -254, 142, 0, 72, 0, 0, 0], [0, 0, 0, 82, 0, -280, -100, -24], [-398, 115, -46, 0, -223, 0, 0, 0], [0, 0, 0, 33, 0, 387, 113, 148], [254, 71, -142, 0, 17, 0, 0, 0], [-895, -271, 2, 0, -61, 0, 0, 0], [-27, -707, -3, 0, 108, 0, 0, 0], [0, 0, 0, 237, 0, -487, 215, 46], [0, 0, 0, -246, 0, -56, -103, 167], [0, 0, 0, 187, 0, 299, 43, -72], [131, -217, 4, 0, -33, 0, 0, 0], [-252, -438, 56, 0, 60, 0, 0, 0], [306, -367, 194, 0, 79, 0, 0, 0], [0, 0, 0, 306, 0, -176, -136, 48], [-165, 339, 84, 0, 7, 0, 0, 0], [0, 0, 0, -233, 0, 49, -143, -240], [199, -239, -67, 0, 142, 0, 0, 0], [0, 0, 0, 58, 0, 92, 107, 85], [-407, -54, 72, 0, 110, 0, 0, 0], [0, 0, 0, -171, 0, 621, 29, -16], [818, 446, -8, 0, -118, 0, 0, 0], [0, 0, 0, 182, 0, -382, 178, -22], [-35, 13, 48, 0, 203, 0, 0, 0], [-722, -258, -31, 0, -177, 0, 0, 0], [0, 0, 0, -119, 0, 191, -164, 127], [0, 0, 0, 50, 0, -308, -80, 130], [-563, 229, 99, 0, 310, 0, 0, 0], [-566, -244, -26, 0, -100, 0, 0, 0], [0, 0, 0, 84, 0, -276, 136, -36], [0, 0, 0, -170, 0, -571, -184, 162], [398, 319, 244, 0, -125, 0, 0, 0], [0, 0, 0, 129, 0, 373, 9, 190], [-66, 546, 5, 0, 223, 0, 0, 0], [0, 0, 0, 26, 0, 532, 124, 216], [988, 358, -136, 0, 34, 0, 0, 0], [0, 0, 0, -112, 0, -8, 156, 196], [540, -806, -52, 0, -58, 0, 0, 0], [0, 0, 0, 421, 0, -318, -11, 192], [487, -626, -116, 0, -128, 0, 0, 0], [0, 0, 0, -105, 0, -359, 235, 218], [0, 0, 0, 464, 0, 312, 281, -5], [325, 313, -218, 0, 221, 0, 0, 0], [-122, 656, 88, 0, -148, 0, 0, 0], [0, 0, 0, -252, 0, -80, 280, -106], [-521, 261, 18, 0, 41, 0, 0, 0], [0, 0, 0, -181, 0, -391, -203, 394], [461, 340, -68, 0, 92, 0, 0, 0], [-80, 184, 316, 0, 18, 0, 0, 0], [0, 0, 0, 32, 0, 746, -144, 44], [0, 0, 0, 31, 0, -69, 307, -22], [-678, 22, 126, 0, 44, 0, 0, 0], [0, 0, 0, -83, 0, -161, -610, 17], [0, 0, 0, -26, 0, 216, -64, 30], [0, 0, 0, -560, 0, 440, 76, 62], [0, 0, 0, 97, 0, -207, 551, -116], [0, 0, 0, -92, 0, 564, 22, 138], [0, 0, 0, -354, 0, -68, 292, 118], [654, -118, -42, 0, 184, 0, 0, 0], [426, -756, -150, 0, -118, 0, 0, 0], [0, 0, 0, 386, 0, -330, 74, -118], [714, 730, 41, 0, 131, 0, 0, 0], [0, 0, 0, -115, 0, -319, -667, 158], [402, 410, -42, 0, 308, 0, 0, 0], [0, 0, 0, 178, 0, -402, -162, -70], [0, 0, 0, 271, 0, 677, -371, 150], [0, 0, 0, -10, 0, 577, -436, -84], [-592, -126, -48, 0, 334, 0, 0, 0], [0, 0, 0, -66, 0, 18, 94, 128], [-564, -408, -114, 0, 468, 0, 0, 0], [-94, -424, 246, 0, -64, 0, 0, 0], [-829, -200, 16, 0, -110, 0, 0, 0], [0, 0, 0, -65, 0, 835, -278, -171], [131, -65, -128, 0, -361, 0, 0, 0], [-380, 406, -272, 0, -182, 0, 0, 0], [0, 0, 0, -64, 0, 40, -262, 534], [346, -466, -132, 0, 108, 0, 0, 0], [0, 0, 0, -278, 0, 558, 102, 352], [16, 390, -128, 0, -306, 0, 0, 0], [0, 0, 0, 87, 0, 462, -251, -202], [-279, 173, -188, 0, -131, 0, 0, 0], [1252, 240, -47, 0, -89, 0, 0, 0], [0, 0, 0, -662, 0, -224, 104, 26], [-27, -63, -49, 0, -476, 0, 0, 0], [171, 127, 74, 0, -209, 0, 0, 0], [0, 0, 0, -259, 0, -330, -527, -44], [0, 0, 0, -149, 0, -473, 381, -312], [0, 0, 0, -508, 0, -455, 46, -2], [1215, 227, -232, 0, 95, 0, 0, 0], [494, 112, -86, 0, 14, 0, 0, 0], [0, 0, 0, 17, 0, 33, 755, 214], [365, -701, 152, 0, 17, 0, 0, 0], [0, 0, 0, 307, 0, 647, 34, -3], [0, 0, 0, 629, 0, -306, -187, -6], [-44, -36, -164, 0, 142, 0, 0, 0], [0, 0, 0, 350, 0, 700, -392, 6], [0, 0, 0, -40, 0, -2, -270, -28], [0, 0, 0, 223, 0, 120, -25, -348], [0, 0, 0, -363, 0, 433, -441, -458], [-1068, -352, -112, 0, 278, 0, 0, 0], [614, -304, -322, 0, 78, 0, 0, 0], [-54, 80, 25, 0, 417, 0, 0, 0], [0, 0, 0, -404, 0, -534, 358, -260], [-330, -560, 184, 0, -136, 0, 0, 0], [0, 0, 0, 274, 0, -19, 832, 172], [0, 0, 0, 48, 0, 520, -320, -252], [1093, 1107, -170, 0, 175, 0, 0, 0], [601, 632, -172, 0, 94, 0, 0, 0], [0, 0, 0, -161, 0, 514, -317, -170], [0, 0, 0, 583, 0, 219, 449, 84], [0, 0, 0, 316, 0, -390, 770, -6], [-1206, -5, 156, 0, 15, 0, 0, 0], [-958, 1022, 152, 0, 186, 0, 0, 0], [0, 0, 0, -244, 0, -653, 392, -456], [0, 0, 0, 118, 0, 804, -241, -9], [0, 0, 0, -298, 0, 574, -48, -494], [0, 0, 0, -217, 0, 213, -376, -675], [-419, 1173, -134, 0, 37, 0, 0, 0], [0, 0, 0, -26, 0, 178, 304, -68], [-668, 4, 136, 0, -334, 0, 0, 0], [1411, -935, -38, 0, -45, 0, 0, 0], [0, 0, 0, -90, 0, -1157, 340, -220], [-1708, 424, -108, 0, -226, 0, 0, 0], [0, 0, 0, 896, 0, 458, 173, -119], [351, -735, 179, 0, -22, 0, 0, 0], [0, 0, 0, 100, 0, -640, 644, -60], [0, 0, 0, 808, 0, -282, 106, 350], [1371, -425, 94, 0, 83, 0, 0, 0], [177, -238, -202, 0, 40, 0, 0, 0], [-13, 1040, -128, 0, 6, 0, 0, 0], [0, 0, 0, 66, 0, -68, -284, -592], [0, 0, 0, -2, 0, -342, -258, 624], [-329, -377, -87, 0, -212, 0, 0, 0], [0, 0, 0, 88, 0, 316, -234, 134], [0, 0, 0, -396, 0, 579, -44, -138], [0, 0, 0, 302, 0, -130, -358, 228], [-1371, -259, -58, 0, 37, 0, 0, 0], [596, -684, -195, 0, -153, 0, 0, 0], [1031, -415, -316, 0, -329, 0, 0, 0], [0, 0, 0, -529, 0, -591, 456, -185], [0, 0, 0, -1, 0, -87, 267, 552], [688, 1128, 128, 0, -32, 0, 0, 0], [0, 0, 0, 132, 0, -246, 278, 550], [-1839, -219, -74, 0, 109, 0, 0, 0], [0, 0, 0, -609, 0, -359, 405, 44], [-1406, -352, -207, 0, 235, 0, 0, 0], [0, 0, 0, -22, 0, -460, -42, -40], [0, 0, 0, -531, 0, 23, 116, -411], [0, 0, 0, 27, 0, -193, -5, -430], [0, 0, 0, 301, 0, 775, 685, -236], [0, 0, 0, -329, 0, -482, 321, -386], [0, 0, 0, 394, 0, 370, 294, -48], [666, -362, 218, 0, -8, 0, 0, 0], [1300, -748, -140, 0, -10, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1470_f_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1470_3_f_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_1470_3_f_a(:prec:=8)
    chi := MakeCharacter_1470_f();
    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_1470_3_f_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_1470_3_f_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1470_f();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![4744, 2048, -300, -4, 1]>],Snew);
    return Vf;
end function;