
// Make newform 1100.3.f.e in Magma, downloaded from the LMFDB on 27 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1100_f();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1100_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_1100_3_f_e();".
// 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_1100_3_f_e();".
// 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 := [400, 0, 7105, 0, 1611, 0, 83, 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, 790, 0, 69, 0, 1, 0, 0], [570, 0, 69, 0, 1, 0, 0, 0], [1420, 0, 1025, 0, 74, 0, 1, 0], [0, 5725, 0, 1591, 0, 83, 0, 1], [-1840, -19150, -1495, -4621, -84, -246, -1, -3], [1840, -19150, 1495, -4621, 84, -246, 1, -3], [0, 15485, 0, 3306, 0, 167, 0, 2]];
    Rf_basisdens := [1, 110, 110, 220, 220, 440, 440, 220];
    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_1100_f();"
function MakeCharacter_1100_f()
    N := 1100;
    order := 2;
    char_gens := [551, 177, 101];
    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_1100_f_Hecke();"
function MakeCharacter_1100_f_Hecke(Kf)
    N := 1100;
    order := 2;
    char_gens := [551, 177, 101];
    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, 0, 0, 0, 0, 0, 0, 0], [1, 0, -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, -1, 0], [0, 0, 0, 0, 0, 0, 0, -1], [0, -1, 0, 0, 1, 1, 1, 1], [0, 2, 0, 0, 2, -1, -1, -1], [-4, 0, 1, -2, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 3], [1, 0, 0, 2, 0, 1, -1, 0], [2, 0, -1, 3, 0, 2, -2, 0], [0, -6, 0, 0, -1, 3, 3, 3], [0, -2, 0, 0, -3, 2, 2, 4], [0, 0, 5, -1, 0, 2, -2, 0], [-13, 0, 0, -5, 0, 1, -1, 0], [20, 0, -5, 5, 0, -2, 2, 0], [0, 9, 0, 0, -4, 0, 0, -2], [6, 0, -6, -4, 0, 3, -3, 0], [-9, 0, 5, -1, 0, 3, -3, 0], [0, -3, 0, 0, 0, 5, 5, 0], [0, -5, 0, 0, -1, -4, -4, -5], [0, 15, 0, 0, 2, -3, -3, -5], [-6, 0, -20, -9, 0, -3, 3, 0], [-42, 0, 1, -2, 0, 6, -6, 0], [0, -13, 0, 0, -1, 2, 2, -6], [6, 0, 10, 13, 0, 2, -2, 0], [0, 8, 0, 0, -2, 3, 3, -3], [0, 3, 0, 0, -4, -2, -2, -9], [38, 0, -21, -1, 0, 3, -3, 0], [0, -15, 0, 0, 1, 6, 6, -1], [0, 15, 0, 0, -1, 6, 6, 0], [-36, 0, 24, -3, 0, 5, -5, 0], [0, -2, 0, 0, -2, -3, -3, 1], [0, 8, 0, 0, -6, -2, -2, -4], [0, -2, 0, 0, 3, 0, 0, -9], [50, 0, 36, 2, 0, 4, -4, 0], [-37, 0, -10, -3, 0, 0, 0, 0], [0, -2, 0, 0, -13, 2, 2, 7], [0, -14, 0, 0, -14, 6, 6, 9], [-127, 0, 70, 9, 0, -2, 2, 0], [-43, 0, 10, -11, 0, -5, 5, 0], [-72, 0, 0, -9, 0, 4, -4, 0], [0, -8, 0, 0, -8, 17, 17, 8], [0, 13, 0, 0, 17, -8, -8, -8], [54, 0, -80, 3, 0, 0, 0, 0], [0, -34, 0, 0, -1, 3, 3, 17], [80, 0, -59, -9, 0, -4, 4, 0], [0, -11, 0, 0, 14, -6, -6, 9], [87, 0, 25, 4, 0, 11, -11, 0], [0, -27, 0, 0, -6, 4, 4, -14], [0, 15, 0, 0, -8, -6, -6, 0], [0, 9, 0, 0, -7, -11, -11, 3], [-113, 0, -5, 6, 0, 2, -2, 0], [-97, 0, -15, 25, 0, -1, 1, 0], [0, -2, 0, 0, -3, -18, -18, -11], [-15, 0, 75, 10, 0, 9, -9, 0], [0, 14, 0, 0, -3, -14, -14, -27], [0, 26, 0, 0, 15, -10, -10, 3], [0, 8, 0, 0, 9, -8, -8, -19], [0, -7, 0, 0, -9, -9, -9, -19], [0, -6, 0, 0, -10, 0, 0, 12], [0, -19, 0, 0, -15, -5, -5, 35], [97, 0, 50, -30, 0, -5, 5, 0], [34, 0, -64, -16, 0, 12, -12, 0], [-273, 0, -9, 6, 0, -13, 13, 0], [114, 0, -95, -17, 0, -7, 7, 0], [0, 16, 0, 0, -8, -3, -3, -26], [0, 33, 0, 0, 28, -27, -27, -16], [0, -32, 0, 0, 12, 30, 30, 11], [-19, 0, 94, 40, 0, 5, -5, 0], [0, -66, 0, 0, -16, 12, 12, -12], [-252, 0, -59, -32, 0, -14, 14, 0], [0, -28, 0, 0, -5, 30, 30, 15], [-156, 0, 95, -27, 0, 9, -9, 0], [-83, 0, -21, 17, 0, -21, 21, 0], [146, 0, -90, -38, 0, 12, -12, 0], [289, 0, -105, 12, 0, -7, 7, 0], [-73, 0, -15, 9, 0, -6, 6, 0], [0, 14, 0, 0, -13, 29, 29, 13], [94, 0, -145, 7, 0, -11, 11, 0], [147, 0, 60, 9, 0, -21, 21, 0], [0, 32, 0, 0, -31, 4, 4, -31], [-163, 0, -6, -8, 0, 24, -24, 0], [0, -17, 0, 0, -21, 6, 6, -29], [128, 0, -84, 2, 0, -17, 17, 0], [326, 0, 35, 0, 0, -5, 5, 0], [0, 21, 0, 0, 0, 25, 25, 10], [0, -18, 0, 0, 27, -20, -20, -1], [253, 0, 14, 44, 0, 3, -3, 0], [-96, 0, 49, 17, 0, -10, 10, 0], [0, -42, 0, 0, -19, -10, -10, -19], [317, 0, 76, -44, 0, -3, 3, 0], [0, -40, 0, 0, 28, 30, 30, -15], [301, 0, -20, -3, 0, 3, -3, 0], [0, -32, 0, 0, 22, -8, -8, 40], [-383, 0, 100, 9, 0, 11, -11, 0], [-29, 0, -85, 37, 0, 6, -6, 0], [0, -18, 0, 0, -17, -7, -7, -48], [0, 73, 0, 0, -3, -22, -22, 6], [0, 5, 0, 0, 25, 15, 15, 28], [0, 8, 0, 0, -8, -8, -8, 31], [0, 21, 0, 0, -18, -8, -8, 4], [0, -11, 0, 0, 10, -31, -31, 8], [0, -47, 0, 0, -17, -6, -6, -14], [-171, 0, 69, 2, 0, 40, -40, 0], [-439, 0, -75, -14, 0, 6, -6, 0], [0, -20, 0, 0, 3, -7, -7, 9], [-15, 0, 35, -16, 0, -27, 27, 0], [0, 17, 0, 0, 2, -1, -1, 34], [0, -78, 0, 0, 30, 20, 20, -12], [0, 59, 0, 0, -31, 34, 34, -15], [337, 0, -75, -7, 0, 25, -25, 0], [-396, 0, 35, 81, 0, 2, -2, 0], [-545, 0, 90, -3, 0, 9, -9, 0], [295, 0, 70, -10, 0, 27, -27, 0], [-238, 0, -4, -10, 0, 24, -24, 0], [-808, 0, 61, 11, 0, 12, -12, 0], [-257, 0, -69, 52, 0, 3, -3, 0], [0, 85, 0, 0, 12, -19, -19, 5], [314, 0, 85, 35, 0, -20, 20, 0], [0, -28, 0, 0, -15, 60, 60, 29], [0, 64, 0, 0, 47, -18, -18, -6], [258, 0, -115, -83, 0, -15, 15, 0], [-437, 0, -40, 13, 0, 6, -6, 0], [0, 86, 0, 0, 13, -20, -20, 2], [210, 0, -10, 18, 0, 26, -26, 0], [336, 0, 65, -5, 0, -40, 40, 0], [342, 0, 144, -37, 0, 22, -22, 0], [0, -92, 0, 0, -24, 36, 36, 7], [0, -85, 0, 0, 32, 32, 32, -10], [0, -43, 0, 0, 2, 22, 22, 80], [718, 0, -40, 13, 0, -14, 14, 0], [-786, 0, -135, 27, 0, 18, -18, 0], [0, -22, 0, 0, -36, 47, 47, 6], [0, 8, 0, 0, 33, -53, -53, -39], [325, 0, 90, -39, 0, -17, 17, 0], [0, 8, 0, 0, -53, 32, 32, 19], [-105, 0, 81, -18, 0, -11, 11, 0], [0, -124, 0, 0, -46, 28, 28, 62], [0, 98, 0, 0, 35, -64, -64, -49], [0, 54, 0, 0, 21, -36, -36, -112], [-586, 0, 4, -64, 0, 42, -42, 0], [0, 30, 0, 0, -31, -1, -1, 10], [495, 0, -75, 8, 0, 21, -21, 0], [-765, 0, -140, -25, 0, -17, 17, 0], [0, 105, 0, 0, 27, 2, 2, 7], [0, -24, 0, 0, 5, 45, 45, 39], [-220, 0, 50, -72, 0, 21, -21, 0], [31, 0, 70, 118, 0, 7, -7, 0], [0, -98, 0, 0, 5, 30, 30, 38], [354, 0, 195, 40, 0, 50, -50, 0], [82, 0, 65, 35, 0, 41, -41, 0], [0, -166, 0, 0, -31, 44, 44, 15], [-204, 0, -80, -34, 0, 6, -6, 0], [-444, 0, -70, 92, 0, 0, 0, 0], [0, 82, 0, 0, 12, 2, 2, -96], [687, 0, -290, 14, 0, -33, 33, 0], [0, 62, 0, 0, -24, 41, 41, -38], [0, 38, 0, 0, -7, 30, 30, 61], [124, 0, 259, -43, 0, 10, -10, 0], [0, 120, 0, 0, 36, -69, -69, -62], [0, 1, 0, 0, -37, -32, -32, -107], [1007, 0, -70, -1, 0, 10, -10, 0], [-772, 0, -201, 85, 0, 21, -21, 0], [-363, 0, 89, 97, 0, 19, -19, 0], [331, 0, -195, 12, 0, -25, 25, 0], [0, 119, 0, 0, 1, -44, -44, -51], [0, 32, 0, 0, 91, -15, -15, -71], [-276, 0, -34, -56, 0, -58, 58, 0], [0, -175, 0, 0, -11, 7, 7, 10], [-877, 0, 240, 91, 0, -17, 17, 0], [0, -95, 0, 0, 13, 44, 44, 105], [0, 95, 0, 0, -66, 29, 29, -52], [159, 0, -190, 26, 0, 47, -47, 0], [169, 0, 115, 63, 0, -36, 36, 0], [0, 76, 0, 0, -31, -53, -53, 42], [-238, 0, -265, -79, 0, -58, 58, 0], [0, 8, 0, 0, 10, 60, 60, 108], [0, -100, 0, 0, -39, 4, 4, 90], [-1183, 0, -35, -37, 0, -25, 25, 0], [0, -25, 0, 0, 62, 5, 5, -30], [-166, 0, -129, -1, 0, -18, 18, 0], [0, 96, 0, 0, 0, -45, -45, 44], [-604, 0, 279, -15, 0, 10, -10, 0], [712, 0, 95, 13, 0, 56, -56, 0], [0, -76, 0, 0, 81, -34, -34, -6], [859, 0, -380, -61, 0, 44, -44, 0], [0, 98, 0, 0, 33, 3, 3, -29], [0, -38, 0, 0, 56, -38, -38, 24], [-548, 0, 156, 35, 0, -1, 1, 0], [0, 78, 0, 0, 63, -57, -57, -28], [588, 0, -95, 63, 0, -69, 69, 0], [111, 0, -205, 18, 0, 21, -21, 0], [0, -51, 0, 0, -41, -1, -1, 82], [579, 0, 56, -6, 0, -33, 33, 0], [0, -20, 0, 0, 28, -59, -59, -50], [598, 0, 369, -71, 0, -12, 12, 0], [0, -75, 0, 0, 22, -33, -33, -30], [0, -83, 0, 0, -33, -28, -28, -81], [0, 31, 0, 0, -9, 56, 56, 52], [0, 95, 0, 0, 104, -24, -24, -30], [-125, 0, 95, 44, 0, -53, 53, 0], [0, 43, 0, 0, 5, -21, -21, 51], [316, 0, -210, -30, 0, 50, -50, 0], [279, 0, 74, 17, 0, -95, 95, 0], [-462, 0, -340, 56, 0, 60, -60, 0], [0, -36, 0, 0, 26, 86, 86, 69], [0, 102, 0, 0, 44, -48, -48, -36], [-775, 0, 300, 115, 0, -29, 29, 0], [0, -124, 0, 0, 87, 52, 52, -7], [642, 0, -85, 79, 0, -30, 30, 0], [-639, 0, 84, 85, 0, 35, -35, 0], [-986, 0, -90, 62, 0, -27, 27, 0], [0, 224, 0, 0, 45, -34, -34, -37], [181, 0, 295, -121, 0, 18, -18, 0], [0, -124, 0, 0, 8, 18, 18, 102], [0, 9, 0, 0, 117, -33, -33, -7], [878, 0, -285, -10, 0, -16, 16, 0], [-191, 0, 254, 101, 0, -63, 63, 0], [0, 227, 0, 0, 7, -18, -18, -61], [0, 50, 0, 0, 7, -14, -14, -15], [-907, 0, 365, 71, 0, 20, -20, 0], [127, 0, 31, -70, 0, 19, -19, 0], [0, 50, 0, 0, 69, -1, -1, -153], [0, -176, 0, 0, -28, 62, 62, 53], [615, 0, 40, -29, 0, -62, 62, 0], [403, 0, -35, -59, 0, 31, -31, 0], [0, 24, 0, 0, 14, -46, -46, 44], [0, -39, 0, 0, -120, -11, -11, 27], [-269, 0, 16, 83, 0, -5, 5, 0], [0, 24, 0, 0, -48, 147, 147, 73], [0, -84, 0, 0, -11, -4, -4, 47], [0, -150, 0, 0, -165, 125, 125, 85], [-383, 0, 129, 192, 0, 19, -19, 0], [0, 50, 0, 0, -15, 40, 40, 63], [153, 0, 205, -41, 0, -52, 52, 0], [0, 3, 0, 0, -115, -20, -20, 96], [-1075, 0, -285, -130, 0, -72, 72, 0], [-213, 0, 200, 159, 0, -65, 65, 0], [-464, 0, 49, -175, 0, 45, -45, 0], [0, -208, 0, 0, -94, 119, 119, 74], [-535, 0, 205, -19, 0, 53, -53, 0], [444, 0, 185, -39, 0, -28, 28, 0], [0, 26, 0, 0, 72, -23, -23, 74], [0, 25, 0, 0, 22, 20, 20, -70], [-620, 0, -65, -66, 0, -18, 18, 0], [-1161, 0, 10, -141, 0, -7, 7, 0], [0, -139, 0, 0, -132, 111, 111, 107], [0, -22, 0, 0, 14, -46, -46, 42], [0, -238, 0, 0, -9, 26, 26, 28], [0, -272, 0, 0, 27, 61, 61, 51], [439, 0, 471, 25, 0, 65, -65, 0], [127, 0, 60, -6, 0, -18, 18, 0], [0, 289, 0, 0, 65, -40, -40, -6], [0, 80, 0, 0, -173, -5, -5, -70], [-164, 0, -295, -133, 0, -30, 30, 0], [0, -42, 0, 0, -33, -13, -13, -27], [-175, 0, -336, 59, 0, -71, 71, 0], [0, 72, 0, 0, -30, 105, 105, 116], [0, -14, 0, 0, -38, 32, 32, -44], [0, -196, 0, 0, -111, 119, 119, 136], [0, 178, 0, 0, -84, -116, -116, -39], [0, 113, 0, 0, 110, -100, -100, -155], [559, 0, -190, -178, 0, 58, -58, 0], [-1014, 0, -170, -158, 0, -57, 57, 0], [-2, 0, -355, 69, 0, 68, -68, 0], [48, 0, -405, 68, 0, 36, -36, 0], [0, 46, 0, 0, -4, -109, -109, -125], [0, -92, 0, 0, -3, 52, 52, -19], [-692, 0, 130, -112, 0, 86, -86, 0], [-898, 0, 161, 131, 0, 47, -47, 0], [75, 0, -395, -69, 0, 38, -38, 0], [0, -252, 0, 0, 115, 114, 114, -19], [0, 275, 0, 0, -71, 64, 64, -91], [1663, 0, -384, 42, 0, -27, 27, 0], [-40, 0, -24, 2, 0, 89, -89, 0], [0, 63, 0, 0, 125, -44, -44, -59], [0, -103, 0, 0, -100, 36, 36, 4], [0, -110, 0, 0, -67, -11, -11, 15], [0, 67, 0, 0, 55, 20, 20, -167], [455, 0, -235, -205, 0, 7, -7, 0], [0, -89, 0, 0, -52, 188, 188, 172], [0, 106, 0, 0, -26, 10, 10, -13], [0, -87, 0, 0, -91, -11, -11, 138], [165, 0, -425, -175, 0, -13, 13, 0], [1548, 0, -180, -33, 0, 60, -60, 0], [0, -253, 0, 0, 69, 64, 64, 44], [-70, 0, 75, 98, 0, 56, -56, 0], [0, -41, 0, 0, -17, 80, 80, 223], [-652, 0, 395, 83, 0, -64, 64, 0], [436, 0, -305, 51, 0, 46, -46, 0], [0, -52, 0, 0, -92, 53, 53, -36], [0, -219, 0, 0, -6, 197, 197, 37], [0, 142, 0, 0, 50, -70, -70, -55], [0, -101, 0, 0, 49, 48, 48, 158], [-1335, 0, 240, -58, 0, 39, -39, 0], [-1710, 0, 161, 21, 0, -4, 4, 0], [0, 64, 0, 0, -17, -46, -46, 38], [0, 38, 0, 0, 126, -9, -9, -49], [0, 182, 0, 0, -75, -55, -55, -19], [0, 4, 0, 0, -85, -30, -30, 92], [0, 193, 0, 0, 58, -196, -196, -124]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1100_f_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1100_3_f_e();".
// 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_1100_3_f_e(:prec:=8)
    chi := MakeCharacter_1100_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_1100_3_f_e();".
// 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_1100_3_f_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1100_f();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<3,R![26, 29, -20, -2, 1]>],Snew);
    return Vf;
end function;