
// Make newform 2178.3.d.l in Magma, downloaded from the LMFDB on 02 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_2178_d();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_2178_d_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_2178_3_d_l();".
// 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_2178_3_d_l();".
// 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 := [16, 0, -8, 0, 4, 0, -2, 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, 1, 0, 0], [-8, 0, 0, 4, -2, 0, 1, -1], [4, 0, -4, -4, 2, 1, 0, -1], [-16, 0, 16, -4, -4, 0, 2, -1], [8, 0, -8, 0, -2, 0, -3, 0], [-8, -32, 0, 8, -2, -4, 1, 2], [-8, 8, 0, -4, -4, 1, 2, 0]];
    Rf_basisdens := [1, 4, 8, 4, 8, 8, 8, 4];
    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_2178_d();"
function MakeCharacter_2178_d()
    N := 2178;
    order := 2;
    char_gens := [1937, 1333];
    v := [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_2178_d_Hecke();"
function MakeCharacter_2178_d_Hecke(Kf)
    N := 2178;
    order := 2;
    char_gens := [1937, 1333];
    char_values := [[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, 0, 0, 0], [4, 0, 0, 0, 0, 0, 1, 0], [0, -1, 0, -1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 4, 2, 3, 0, 0], [0, -8, 0, 0, -2, -1, 0, 0], [0, 1, 0, 5, 1, 1, 0, 0], [16, 0, 8, 0, 0, 0, -2, 0], [0, 5, 0, -1, 8, -1, 0, 0], [-16, 0, -2, 0, 0, 0, 1, 1], [3, 0, -4, 0, 0, 0, 1, 0], [0, -3, 0, 3, 2, -11, 0, 0], [0, 8, 0, -2, 0, -8, 0, 0], [-9, 0, -3, 0, 0, 0, 4, -2], [10, 0, 6, 0, 0, 0, 3, 12], [-17, 0, -17, 0, 0, 0, 8, 6], [0, -14, 0, 8, 12, 11, 0, 0], [12, 0, 2, 0, 0, 0, -6, 0], [34, 0, 8, 0, 0, 0, -9, 1], [0, 19, 0, 7, 8, 7, 0, 0], [0, 17, 0, 0, -24, -11, 0, 0], [0, 41, 0, -2, 10, 7, 0, 0], [-6, 0, -6, 0, 0, 0, 0, 18], [8, 0, -2, 0, 0, 0, -5, 2], [0, -20, 0, 14, 2, -13, 0, 0], [61, 0, -11, 0, 0, 0, 12, 2], [0, -13, 0, 5, -19, 9, 0, 0], [0, 44, 0, 2, 4, 14, 0, 0], [43, 0, 20, 0, 0, 0, 9, 22], [0, 47, 0, 20, 18, -23, 0, 0], [0, -32, 0, 10, -42, -6, 0, 0], [10, 0, 26, 0, 0, 0, 23, -4], [0, -57, 0, 11, 19, -1, 0, 0], [0, -14, 0, 4, 44, 5, 0, 0], [0, 53, 0, -13, 33, 5, 0, 0], [-87, 0, 18, 0, 0, 0, 15, 12], [102, 0, -24, 0, 0, 0, 53, 15], [0, 39, 0, -10, 12, -9, 0, 0], [0, -57, 0, -47, -28, -19, 0, 0], [-99, 0, -65, 0, 0, 0, 0, 28], [60, 0, -4, 0, 0, 0, 11, -36], [-29, 0, 23, 0, 0, 0, -4, 10], [0, 94, 0, 26, 4, 57, 0, 0], [0, 6, 0, -26, 6, -40, 0, 0], [-112, 0, -10, 0, 0, 0, -38, -28], [0, 109, 0, 8, -20, 25, 0, 0], [-77, 0, -87, 0, 0, 0, 20, -4], [0, -67, 0, 39, -31, -19, 0, 0], [-80, 0, -70, 0, 0, 0, -29, 18], [0, 32, 0, -20, 2, 33, 0, 0], [0, 63, 0, 53, 23, -21, 0, 0], [0, -44, 0, -26, -20, -10, 0, 0], [54, 0, -110, 0, 0, 0, 3, -11], [87, 0, -82, 0, 0, 0, 41, 20], [0, 96, 0, 42, -4, 20, 0, 0], [-40, 0, -50, 0, 0, 0, 25, -10], [0, 87, 0, 21, 19, 95, 0, 0], [0, 102, 0, -38, 64, 39, 0, 0], [0, 90, 0, -6, -28, -73, 0, 0], [0, -27, 0, -21, -25, -9, 0, 0], [0, 29, 0, 7, 56, 43, 0, 0], [0, 0, 0, -22, -94, -90, 0, 0], [-107, 0, 23, 0, 0, 0, 40, -4], [118, 0, -4, 0, 0, 0, 45, 14], [-24, 0, 26, 0, 0, 0, -3, -18], [-70, 0, 6, 0, 0, 0, -6, 18], [0, -7, 0, 49, 18, -1, 0, 0], [0, -55, 0, 34, -70, -97, 0, 0], [0, -277, 0, -13, -6, -19, 0, 0], [160, 0, 90, 0, 0, 0, -26, 28], [0, 189, 0, -57, 33, -31, 0, 0], [111, 0, -15, 0, 0, 0, -4, 32], [0, 118, 0, 32, -26, -14, 0, 0], [58, 0, -80, 0, 0, 0, -59, -45], [152, 0, -42, 0, 0, 0, -45, 35], [291, 0, 106, 0, 0, 0, -11, 24], [32, 0, -110, 0, 0, 0, 38, 0], [224, 0, 44, 0, 0, 0, 9, 8], [0, -230, 0, 20, -80, -15, 0, 0], [-240, 0, -56, 0, 0, 0, 66, -32], [-125, 0, 68, 0, 0, 0, 21, -4], [0, 79, 0, -92, -126, -67, 0, 0], [-155, 0, -96, 0, 0, 0, -69, 62], [0, 112, 0, 34, 42, 126, 0, 0], [-353, 0, 91, 0, 0, 0, -48, -14], [236, 0, 194, 0, 0, 0, -23, -46], [0, 166, 0, 72, -24, -125, 0, 0], [0, -294, 0, 50, -62, -68, 0, 0], [-200, 0, -78, 0, 0, 0, 50, 56], [-490, 0, 54, 0, 0, 0, -13, -7], [0, 73, 0, 54, 126, 111, 0, 0], [-227, 0, -15, 0, 0, 0, -12, -54], [0, -55, 0, -35, 37, 125, 0, 0], [101, 0, 87, 0, 0, 0, 92, -22], [0, -33, 0, -21, -185, -153, 0, 0], [-267, 0, -14, 0, 0, 0, 51, 22], [-265, 0, 76, 0, 0, 0, 9, -26], [0, -237, 0, 4, 164, 63, 0, 0], [0, -134, 0, 46, -160, -129, 0, 0], [0, 53, 0, 59, -133, -137, 0, 0], [0, -105, 0, -13, -30, -75, 0, 0], [0, -333, 0, 26, -72, 95, 0, 0], [0, 287, 0, 87, -32, 127, 0, 0], [0, -500, 0, -18, -58, -18, 0, 0], [-54, 0, 14, 0, 0, 0, 53, 116], [377, 0, 163, 0, 0, 0, 48, -52], [0, 26, 0, 88, -102, -6, 0, 0], [-12, 0, -226, 0, 0, 0, 23, 75], [0, 147, 0, -167, 32, -103, 0, 0], [0, -187, 0, -72, -42, 35, 0, 0], [0, 273, 0, -55, 20, 61, 0, 0], [-86, 0, 142, 0, 0, 0, 104, 6], [-51, 0, 189, 0, 0, 0, -72, 30], [-163, 0, 77, 0, 0, 0, -60, -106], [619, 0, 210, 0, 0, 0, -15, 40], [80, 0, -50, 0, 0, 0, -51, -87], [-230, 0, 110, 0, 0, 0, 43, 113], [37, 0, -214, 0, 0, 0, 51, 42], [0, -292, 0, -86, -18, -138, 0, 0], [180, 0, -8, 0, 0, 0, 34, -30], [0, -380, 0, -102, 38, -119, 0, 0], [0, -284, 0, -46, 98, -79, 0, 0], [198, 0, -82, 0, 0, 0, -2, -82], [134, 0, 178, 0, 0, 0, 105, 55], [0, -423, 0, -93, 42, -11, 0, 0], [18, 0, -134, 0, 0, 0, -55, 96], [-139, 0, -59, 0, 0, 0, -140, -48], [142, 0, -58, 0, 0, 0, 22, -110], [0, 281, 0, 31, -126, -127, 0, 0], [0, -15, 0, -80, -76, 77, 0, 0], [0, -263, 0, -122, -218, -9, 0, 0], [-185, 0, 37, 0, 0, 0, -52, -96], [-442, 0, 6, 0, 0, 0, 41, 40], [0, 302, 0, -140, -8, -109, 0, 0], [0, 222, 0, 12, -58, -186, 0, 0], [-351, 0, -8, 0, 0, 0, -153, -24], [0, 139, 0, -96, 120, 155, 0, 0], [-10, 0, -276, 0, 0, 0, 103, 18], [0, -218, 0, 104, -72, 125, 0, 0], [0, -511, 0, 195, -117, -65, 0, 0], [0, -103, 0, -67, -256, -207, 0, 0], [-148, 0, 100, 0, 0, 0, -71, -131], [0, -57, 0, -74, -156, 31, 0, 0], [557, 0, -142, 0, 0, 0, 23, -64], [105, 0, -191, 0, 0, 0, -104, 56], [0, -62, 0, -142, -8, -35, 0, 0], [0, -494, 0, -142, -62, -44, 0, 0], [586, 0, 234, 0, 0, 0, 62, 66], [264, 0, 28, 0, 0, 0, -45, -125], [0, 313, 0, 17, -16, 213, 0, 0], [-360, 0, 130, 0, 0, 0, 146, 44], [151, 0, 215, 0, 0, 0, -40, 128], [0, 381, 0, 67, 151, -121, 0, 0], [158, 0, 80, 0, 0, 0, -83, 7], [118, 0, 292, 0, 0, 0, 59, 17], [0, 551, 0, -112, -42, 9, 0, 0], [838, 0, 162, 0, 0, 0, 35, 76], [0, 14, 0, -44, -160, 29, 0, 0], [0, -268, 0, -136, 142, -141, 0, 0], [6, 0, -50, 0, 0, 0, -162, 118], [0, -271, 0, 11, -256, -9, 0, 0], [0, -368, 0, 82, 64, 216, 0, 0], [-183, 0, 145, 0, 0, 0, -48, -136], [-214, 0, -224, 0, 0, 0, 3, 66], [-1115, 0, 73, 0, 0, 0, -68, -48], [-394, 0, 102, 0, 0, 0, -218, -146], [0, 37, 0, 9, -74, -21, 0, 0], [0, -333, 0, -41, -186, -47, 0, 0], [-716, 0, 90, 0, 0, 0, -58, -56], [0, -491, 0, -149, -81, 191, 0, 0], [172, 0, 204, 0, 0, 0, -85, -104], [0, -569, 0, 139, -31, 181, 0, 0], [0, 134, 0, -86, -354, -40, 0, 0], [18, 0, -158, 0, 0, 0, 205, -77], [-479, 0, 74, 0, 0, 0, 171, -34], [0, 43, 0, 144, -2, 53, 0, 0], [260, 0, 174, 0, 0, 0, -31, 178], [0, -793, 0, -157, -131, -63, 0, 0], [0, 512, 0, -132, 10, -117, 0, 0], [-368, 0, 44, 0, 0, 0, -27, 21], [0, -545, 0, 136, -18, 169, 0, 0], [43, 0, 406, 0, 0, 0, 125, 94], [0, -37, 0, -79, 192, 285, 0, 0], [-1153, 0, -141, 0, 0, 0, 60, -46], [-808, 0, -146, 0, 0, 0, 133, 22], [0, -428, 0, 74, -258, 59, 0, 0], [1308, 0, 120, 0, 0, 0, 26, 52], [0, 149, 0, 167, -190, 9, 0, 0], [0, -155, 0, -53, 41, 141, 0, 0], [-1062, 0, -460, 0, 0, 0, 81, -74], [0, 163, 0, -129, -265, 39, 0, 0], [-768, 0, 148, 0, 0, 0, 109, 97], [1229, 0, 74, 0, 0, 0, -21, 98], [0, -500, 0, 214, -184, 60, 0, 0], [-380, 0, -426, 0, 0, 0, 233, 82], [0, 396, 0, 90, 298, 133, 0, 0], [-339, 0, -352, 0, 0, 0, -73, -290], [0, -501, 0, 319, 74, 141, 0, 0], [0, -221, 0, -96, -4, 327, 0, 0], [0, -489, 0, 145, 204, 113, 0, 0], [0, 432, 0, -278, 178, 98, 0, 0], [1042, 0, -16, 0, 0, 0, 25, -118], [0, -618, 0, 302, -68, -79, 0, 0], [-512, 0, -14, 0, 0, 0, -17, -125], [-220, 0, -84, 0, 0, 0, 66, 158], [791, 0, -265, 0, 0, 0, 216, 124], [0, 357, 0, 283, 163, 115, 0, 0], [0, -684, 0, -282, -266, -333, 0, 0], [-419, 0, -415, 0, 0, 0, 8, 106], [0, -240, 0, 78, 456, 286, 0, 0], [691, 0, -546, 0, 0, 0, -147, -76], [168, 0, 198, 0, 0, 0, 93, 157], [216, 0, -150, 0, 0, 0, -101, -189], [0, -12, 0, 164, 384, 232, 0, 0], [396, 0, -220, 0, 0, 0, -74, 62], [0, 571, 0, 99, 183, 431, 0, 0], [0, 689, 0, -417, 62, -7, 0, 0], [99, 0, -465, 0, 0, 0, 68, -66], [-430, 0, 86, 0, 0, 0, -273, -60], [0, 64, 0, 120, 186, 41, 0, 0], [0, -183, 0, 138, 12, 157, 0, 0], [404, 0, 528, 0, 0, 0, 10, 34], [709, 0, -65, 0, 0, 0, 216, -98], [0, -445, 0, 333, 279, 115, 0, 0], [0, 282, 0, 338, 106, -140, 0, 0], [577, 0, -260, 0, 0, 0, -149, -136], [-944, 0, -368, 0, 0, 0, -49, 207], [0, 495, 0, 136, 162, 185, 0, 0], [0, 660, 0, -152, 14, -34, 0, 0], [-282, 0, 46, 0, 0, 0, -260, 158], [0, 683, 0, 249, 255, 319, 0, 0], [0, -67, 0, -179, -171, -187, 0, 0], [0, 971, 0, 121, 22, 139, 0, 0], [-498, 0, -120, 0, 0, 0, -107, -17], [0, -893, 0, 298, -140, 31, 0, 0], [-397, 0, -200, 0, 0, 0, -3, -256], [0, 303, 0, 11, 232, -37, 0, 0], [-243, 0, 1, 0, 0, 0, 144, 20], [-327, 0, -439, 0, 0, 0, 304, -120], [256, 0, -344, 0, 0, 0, -37, -229], [0, 5, 0, -50, -302, -233, 0, 0], [-231, 0, -427, 0, 0, 0, 28, -170], [-1682, 0, -156, 0, 0, 0, 61, -138], [0, 846, 0, -32, 304, 307, 0, 0], [0, -465, 0, -307, -139, -287, 0, 0], [526, 0, 558, 0, 0, 0, 105, -25], [188, 0, 136, 0, 0, 0, 35, 311], [0, -613, 0, 360, 366, 193, 0, 0], [0, -240, 0, 80, -58, 406, 0, 0], [0, -330, 0, -304, -164, -243, 0, 0], [0, 412, 0, 164, 134, -465, 0, 0], [344, 0, 42, 0, 0, 0, 194, -260], [-243, 0, -594, 0, 0, 0, 131, 184], [0, 45, 0, -249, 24, -113, 0, 0], [0, 491, 0, 240, -10, -175, 0, 0], [763, 0, -332, 0, 0, 0, -107, 4], [0, -828, 0, 168, -340, -108, 0, 0], [-896, 0, -388, 0, 0, 0, 341, -100], [0, -305, 0, 5, 324, 105, 0, 0], [0, -519, 0, 72, -172, -423, 0, 0], [0, -567, 0, 198, -188, 193, 0, 0], [0, 565, 0, 307, 148, 143, 0, 0], [0, 132, 0, -134, 80, -294, 0, 0], [919, 0, 54, 0, 0, 0, 281, 172], [-880, 0, -214, 0, 0, 0, 225, -155], [-609, 0, 544, 0, 0, 0, 253, 258], [236, 0, 834, 0, 0, 0, -43, -50], [0, -1153, 0, 153, -13, 175, 0, 0], [0, 648, 0, 316, 238, 483, 0, 0], [37, 0, -198, 0, 0, 0, -17, 48], [1122, 0, -456, 0, 0, 0, -43, 51], [345, 0, 24, 0, 0, 0, 195, -170], [0, 460, 0, -34, 138, 594, 0, 0], [0, 638, 0, -112, 124, 127, 0, 0], [78, 0, 232, 0, 0, 0, -162, 62], [1068, 0, -136, 0, 0, 0, 347, 135], [0, -1019, 0, -99, -14, 107, 0, 0], [0, 55, 0, -257, -74, -55, 0, 0], [0, -1119, 0, -105, -41, 135, 0, 0], [0, 159, 0, 375, -37, 23, 0, 0], [-366, 0, 454, 0, 0, 0, -375, 15], [0, -76, 0, -214, 44, 276, 0, 0], [0, -1254, 0, -70, 20, 39, 0, 0], [0, 721, 0, 71, -299, 13, 0, 0], [-1338, 0, -284, 0, 0, 0, -318, -62], [1703, 0, 520, 0, 0, 0, 25, -244], [0, -641, 0, 263, -502, 169, 0, 0], [290, 0, 116, 0, 0, 0, 409, -33], [0, 275, 0, -9, -440, -393, 0, 0], [496, 0, 624, 0, 0, 0, -11, 108], [463, 0, 237, 0, 0, 0, -156, -170], [0, -480, 0, 54, 288, 114, 0, 0], [0, -1391, 0, -30, 232, 161, 0, 0], [0, -717, 0, 47, -42, 481, 0, 0], [0, -184, 0, -472, -126, -351, 0, 0], [-527, 0, -413, 0, 0, 0, 68, 254], [-1365, 0, 54, 0, 0, 0, -319, -156], [0, -1312, 0, 72, -340, -408, 0, 0], [0, 735, 0, -1, -219, 49, 0, 0], [0, 1176, 0, -392, 378, 15, 0, 0], [0, -104, 0, 22, 454, 205, 0, 0], [0, 1609, 0, -35, 261, -203, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_2178_d_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_2178_3_d_l();".
// 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_2178_3_d_l(:prec:=8)
    chi := MakeCharacter_2178_d();
    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_2178_3_d_l();".
// 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_2178_3_d_l( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_2178_d();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<5,R![-239, 166, 31, -14, 1]>],Snew);
    return Vf;
end function;