
// Make newform 1792.3.g.d in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1792_g();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1792_g_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_1792_3_g_d();".
// 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_1792_3_g_d();".
// 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 := [4, 0, 56, 0, 53, 0, 14, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [8, 0, 24, 0, 11, 0, 1, 0], [20, 0, -16, 0, -11, 0, -1, 0], [0, 48, 0, 42, 0, 13, 0, 1], [0, 32, 0, 42, 0, 13, 0, 1], [0, 42, 0, 51, 0, 14, 0, 1], [0, 110, 0, 77, 0, 16, 0, 1], [-68, 0, -136, 0, -41, 0, -3, 0]];
    Rf_basisdens := [1, 4, 4, 4, 4, 4, 4, 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_1792_g();"
function MakeCharacter_1792_g()
    N := 1792;
    order := 2;
    char_gens := [1023, 1541, 1025];
    v := [1, 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_1792_g_Hecke();"
function MakeCharacter_1792_g_Hecke(Kf)
    N := 1792;
    order := 2;
    char_gens := [1023, 1541, 1025];
    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, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, -1, 0], [0, 0, 0, 0, 0, 1, 0, 0], [-4, 0, 1, 0, 0, 0, 0, -1], [0, 0, 0, 0, -2, 1, -1, 0], [-2, 0, 3, 0, 0, 0, 0, -1], [-11, 3, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 1, 2, 2, 0], [0, 0, 0, 0, 5, 2, -2, 0], [0, 0, 0, 3, -3, -4, 4, 0], [0, 0, 0, 6, -11, -6, -2, 0], [-18, -12, -3, 0, 0, 0, 0, 1], [28, 0, -5, 0, 0, 0, 0, -3], [0, 0, 0, 3, 5, 0, -8, 0], [0, 0, 0, 6, 3, -4, -4, 0], [-29, -3, 2, 0, 0, 0, 0, -2], [0, 0, 0, 0, 12, 19, -3, 0], [46, 6, 9, 0, 0, 0, 0, -1], [0, 0, 0, 0, 8, -4, -12, 0], [-34, 0, 10, 0, 0, 0, 0, -2], [0, 0, 0, -6, -30, 8, 0, 0], [53, 3, 14, 0, 0, 0, 0, 2], [10, 12, 6, 0, 0, 0, 0, -2], [66, 12, -3, 0, 0, 0, 0, 5], [0, 0, 0, 0, -8, 41, 7, 0], [0, 0, 0, 3, -11, -28, -12, 0], [22, -18, 11, 0, 0, 0, 0, -3], [0, 0, 0, -18, -13, 10, -18, 0], [-20, -6, -14, 0, 0, 0, 0, 0], [0, 0, 0, 3, -11, -2, -18, 0], [-127, -9, -6, 0, 0, 0, 0, 6], [-58, 0, -6, 0, 0, 0, 0, -6], [-39, -33, 0, 0, 0, 0, 0, 0], [0, 0, 0, -12, -15, 52, -4, 0], [0, 0, 0, 15, -11, -10, 6, 0], [0, 0, 0, 0, -42, 1, 15, 0], [28, 0, 5, 0, 0, 0, 0, -5], [0, 0, 0, -21, -51, -8, -8, 0], [0, 0, 0, -12, 38, -51, 3, 0], [106, -6, 17, 0, 0, 0, 0, -1], [0, 0, 0, -12, 18, -5, 37, 0], [0, 0, 0, -12, -72, -68, 4, 0], [32, 30, -14, 0, 0, 0, 0, 4], [0, 0, 0, -6, 3, 0, 40, 0], [0, 0, 0, 21, -21, -20, -4, 0], [-162, 6, 21, 0, 0, 0, 0, -13], [0, 0, 0, 12, 12, 60, 28, 0], [125, 27, -24, 0, 0, 0, 0, -16], [0, 0, 0, -12, -2, -73, -23, 0], [94, 0, 20, 0, 0, 0, 0, -4], [0, 0, 0, -9, 65, -30, 18, 0], [18, -36, 1, 0, 0, 0, 0, 1], [29, -21, 18, 0, 0, 0, 0, -10], [50, 48, 4, 0, 0, 0, 0, 12], [0, 0, 0, 24, 40, -36, 4, 0], [0, 0, 0, -12, 22, -19, 3, 0], [0, 0, 0, 18, 30, 20, 36, 0], [0, 0, 0, -24, 9, -64, -32, 0], [-66, 48, 24, 0, 0, 0, 0, 16], [-49, -15, -44, 0, 0, 0, 0, -12], [0, 0, 0, 12, -88, -35, -13, 0], [-111, -57, 6, 0, 0, 0, 0, -14], [0, 0, 0, -12, 148, -24, 0, 0], [230, -36, -23, 0, 0, 0, 0, 5], [0, 0, 0, -30, 73, -40, -16, 0], [-212, 0, 27, 0, 0, 0, 0, 37], [80, -66, 62, 0, 0, 0, 0, 8], [84, 24, 19, 0, 0, 0, 0, 21], [0, 0, 0, 0, 2, 53, 11, 0], [62, -108, -14, 0, 0, 0, 0, 30], [0, 0, 0, -27, 111, -22, -22, 0], [0, 0, 0, 60, -28, -60, 4, 0], [0, 0, 0, 12, 185, -92, 12, 0], [-56, 36, 27, 0, 0, 0, 0, -27], [0, 0, 0, 51, 101, 96, -24, 0], [0, 0, 0, 6, -131, 98, 22, 0], [0, 0, 0, -12, 150, -91, -21, 0], [244, 42, -24, 0, 0, 0, 0, 22], [-134, 48, -43, 0, 0, 0, 0, -3], [-405, 21, -24, 0, 0, 0, 0, 0], [0, 0, 0, 36, 101, 128, -16, 0], [0, 0, 0, -15, -1, -122, -26, 0], [-562, -24, 17, 0, 0, 0, 0, 21], [0, 0, 0, 30, -46, 76, 20, 0], [-202, -66, -15, 0, 0, 0, 0, -1], [290, 0, -28, 0, 0, 0, 0, -12], [-40, -54, -26, 0, 0, 0, 0, 36], [0, 0, 0, 24, -50, -143, -17, 0], [0, 0, 0, 30, -106, 188, 52, 0], [185, -33, 0, 0, 0, 0, 0, -24], [0, 0, 0, 3, -139, 12, 36, 0], [0, 0, 0, 51, -15, 98, 18, 0], [-74, -66, -75, 0, 0, 0, 0, -13], [378, -6, -17, 0, 0, 0, 0, -31], [0, 0, 0, -24, 120, -60, -36, 0], [0, 0, 0, 36, -194, 93, 51, 0], [346, -72, 27, 0, 0, 0, 0, 3], [199, 57, -118, 0, 0, 0, 0, -26], [0, 0, 0, 0, -21, -244, 20, 0], [-136, 84, -95, 0, 0, 0, 0, -17], [0, 0, 0, -42, 13, 24, 96, 0], [-13, 45, 106, 0, 0, 0, 0, -26], [196, 30, 12, 0, 0, 0, 0, -10], [-328, 132, 31, 0, 0, 0, 0, -23], [70, 12, 26, 0, 0, 0, 0, -10], [141, 27, 0, 0, 0, 0, 0, 0], [146, 120, -38, 0, 0, 0, 0, -14], [0, 0, 0, 24, 24, -160, 72, 0], [-158, -12, 10, 0, 0, 0, 0, 10], [0, 0, 0, -12, -140, 8, -40, 0], [0, 0, 0, 84, -57, -50, 2, 0], [-56, 186, 34, 0, 0, 0, 0, 0], [-25, 105, -36, 0, 0, 0, 0, 12], [0, 0, 0, -66, 122, 200, 48, 0], [-252, -54, 28, 0, 0, 0, 0, 58], [-69, -27, -126, 0, 0, 0, 0, 6], [0, 0, 0, -3, 107, -68, 92, 0], [0, 0, 0, 24, 145, 158, -30, 0], [72, -60, 45, 0, 0, 0, 0, -5], [0, 0, 0, -36, 64, 93, 3, 0], [82, -24, -2, 0, 0, 0, 0, -66], [0, 0, 0, 36, 122, -69, 85, 0], [170, 138, 43, 0, 0, 0, 0, 29], [-183, -33, -2, 0, 0, 0, 0, 50], [0, 0, 0, -12, -67, -66, 82, 0], [0, 0, 0, -54, 169, 42, 126, 0], [0, 0, 0, -27, -77, -96, 8, 0], [0, 0, 0, 69, 171, 120, 8, 0], [0, 0, 0, 60, 232, 83, 77, 0], [-100, 0, -123, 0, 0, 0, 0, -37], [0, 0, 0, 93, 15, -270, 66, 0], [0, 0, 0, -3, 107, -18, -2, 0], [0, 0, 0, -24, -213, 174, -46, 0], [-122, 36, 59, 0, 0, 0, 0, 63], [-686, 36, 91, 0, 0, 0, 0, -61], [0, 0, 0, -48, -260, -19, -29, 0], [217, 15, -36, 0, 0, 0, 0, 36], [0, 0, 0, -36, -290, 157, -77, 0], [-168, 90, -70, 0, 0, 0, 0, 40], [-133, -123, -100, 0, 0, 0, 0, -20], [0, 0, 0, 60, -35, 32, 80, 0], [0, 0, 0, -18, -414, 164, 12, 0], [582, -162, 3, 0, 0, 0, 0, -19], [0, 0, 0, -12, -376, 115, -35, 0], [0, 0, 0, 3, -283, 188, -116, 0], [0, 0, 0, -48, -150, -105, -103, 0], [-598, 240, -83, 0, 0, 0, 0, 13], [381, -165, 10, 0, 0, 0, 0, 22], [0, 0, 0, 12, -240, -28, 76, 0], [0, 0, 0, -54, 43, 222, 74, 0], [6, 132, -64, 0, 0, 0, 0, 20], [350, -138, -1, 0, 0, 0, 0, -7], [0, 0, 0, 105, 79, -120, -24, 0], [-294, -102, 1, 0, 0, 0, 0, -17], [0, 0, 0, -15, 183, -222, -30, 0], [0, 0, 0, 78, -166, -332, 44, 0], [254, -192, 159, 0, 0, 0, 0, 19], [-370, -288, -62, 0, 0, 0, 0, 30], [0, 0, 0, 36, 160, 35, 77, 0], [-528, -36, 133, 0, 0, 0, 0, -29], [326, 24, 8, 0, 0, 0, 0, -48], [0, 0, 0, 99, 313, 202, -86, 0], [-661, -171, 46, 0, 0, 0, 0, 26], [2, -120, -38, 0, 0, 0, 0, 58], [0, 0, 0, -69, 157, -148, 76, 0], [0, 0, 0, 12, 448, 152, -48, 0], [0, 0, 0, 84, -72, 77, -125, 0], [-248, 54, -170, 0, 0, 0, 0, -32], [0, 0, 0, -72, 274, -81, -79, 0], [782, 6, 57, 0, 0, 0, 0, -57], [0, 0, 0, -72, -450, -231, 23, 0], [0, 0, 0, 0, 208, -340, 52, 0], [-538, -168, -32, 0, 0, 0, 0, -64], [0, 0, 0, -3, 579, 8, 0, 0], [-958, -84, -88, 0, 0, 0, 0, -32], [-122, 30, -73, 0, 0, 0, 0, -23], [0, 0, 0, -108, 311, 94, -46, 0], [0, 0, 0, -126, 46, -200, -96, 0], [0, 0, 0, 96, 452, -197, 133, 0], [0, 0, 0, 45, 531, -226, 46, 0], [491, 21, -82, 0, 0, 0, 0, -102], [0, 0, 0, 126, 121, 14, -54, 0], [-282, -144, -16, 0, 0, 0, 0, -68], [0, 0, 0, 93, 147, 298, -134, 0], [0, 0, 0, 216, 158, 19, 141, 0], [0, 0, 0, 126, -439, -92, -12, 0], [69, -189, 52, 0, 0, 0, 0, 60], [-234, -48, 178, 0, 0, 0, 0, 18], [0, 0, 0, -75, -613, -212, 36, 0], [-402, 84, -122, 0, 0, 0, 0, 34], [2, 162, 179, 0, 0, 0, 0, -51], [-210, 246, -73, 0, 0, 0, 0, 57], [0, 0, 0, 72, -130, -191, 15, 0], [-722, 150, 11, 0, 0, 0, 0, 29], [-422, -156, -16, 0, 0, 0, 0, -48], [40, 198, -78, 0, 0, 0, 0, -76], [0, 0, 0, 60, 9, -22, -154, 0], [-666, 84, 168, 0, 0, 0, 0, -44], [0, 0, 0, -126, 142, 428, 36, 0], [0, 0, 0, 6, 89, 124, -68, 0], [0, 0, 0, -27, -133, 188, 292, 0], [0, 0, 0, 84, -200, -27, 59, 0], [750, -228, -52, 0, 0, 0, 0, 72], [319, -159, 250, 0, 0, 0, 0, 22], [0, 0, 0, -120, -204, -125, 189, 0], [0, 0, 0, 9, -529, 148, 28, 0], [-160, 444, 55, 0, 0, 0, 0, -55], [204, -114, -178, 0, 0, 0, 0, 64], [929, 183, -114, 0, 0, 0, 0, -30], [916, -102, -12, 0, 0, 0, 0, 98], [0, 0, 0, -60, -212, -143, -113, 0], [0, 0, 0, -105, 397, 166, 54, 0], [-889, 153, 112, 0, 0, 0, 0, -104], [0, 0, 0, 90, 126, -404, -76, 0], [1582, 12, 95, 0, 0, 0, 0, -29], [0, 0, 0, 102, -282, 44, 52, 0], [-878, 132, -9, 0, 0, 0, 0, -9], [0, 0, 0, 72, 72, -544, -56, 0], [0, 0, 0, -84, 189, 358, -86, 0], [0, 0, 0, -48, 135, -182, -10, 0], [0, 0, 0, 18, -130, 108, 84, 0], [746, 120, -96, 0, 0, 0, 0, -40], [0, 0, 0, 219, 301, 362, -38, 0], [-155, -141, 328, 0, 0, 0, 0, 56], [0, 0, 0, 72, -529, -358, -26, 0], [-582, -36, -182, 0, 0, 0, 0, -6], [0, 0, 0, -33, 609, -518, -54, 0], [0, 0, 0, -108, 52, -348, 28, 0], [20, 216, 121, 0, 0, 0, 0, -1], [0, 0, 0, 12, -179, 230, -182, 0], [307, -291, 36, 0, 0, 0, 0, -44], [0, 0, 0, -78, 218, 524, 4, 0], [102, 168, 40, 0, 0, 0, 0, -64], [619, 165, -104, 0, 0, 0, 0, 8], [0, 0, 0, -78, -370, -36, 108, 0], [22, -408, 87, 0, 0, 0, 0, 11], [0, 0, 0, 156, 81, -20, -156, 0], [238, 246, -35, 0, 0, 0, 0, 75], [0, 0, 0, -30, -202, -272, 40, 0], [-1444, 144, -89, 0, 0, 0, 0, 81], [783, 81, -26, 0, 0, 0, 0, 98], [0, 0, 0, -12, -308, 84, 92, 0], [0, 0, 0, 138, -187, 84, 212, 0], [-770, -372, 68, 0, 0, 0, 0, -16], [0, 0, 0, -87, -105, -260, -260, 0], [0, 0, 0, -216, -424, -280, 8, 0], [545, -345, 198, 0, 0, 0, 0, -78], [-432, 60, 5, 0, 0, 0, 0, 43], [0, 0, 0, 12, 728, -296, -112, 0], [0, 0, 0, 84, 311, 308, 28, 0], [582, -36, -110, 0, 0, 0, 0, 86], [0, 0, 0, 66, 134, -120, 160, 0], [114, -204, 294, 0, 0, 0, 0, 70], [0, 0, 0, 144, 84, -245, 133, 0], [1602, -78, -127, 0, 0, 0, 0, 23], [0, 0, 0, 0, -545, 450, -66, 0], [-691, -309, 16, 0, 0, 0, 0, -16], [0, 0, 0, 12, -524, -71, -73, 0], [146, 264, 213, 0, 0, 0, 0, 149], [0, 0, 0, 63, -359, 146, -302, 0], [-1152, 252, 3, 0, 0, 0, 0, -115], [0, 0, 0, 0, -440, -559, -33, 0], [0, 0, 0, 48, 468, -645, 85, 0], [1194, 84, -223, 0, 0, 0, 0, -7], [-1201, 129, 118, 0, 0, 0, 0, 82], [0, 0, 0, 0, -261, 252, -252, 0], [306, -348, 42, 0, 0, 0, 0, 90], [-50, 102, -41, 0, 0, 0, 0, -111], [0, 0, 0, -6, 277, 206, -230, 0], [0, 0, 0, 96, 226, 357, -85, 0], [-204, 264, -245, 0, 0, 0, 0, -91], [122, -492, -144, 0, 0, 0, 0, -8], [0, 0, 0, 63, 105, 94, 174, 0], [-1734, 264, -12, 0, 0, 0, 0, 28], [0, 0, 0, -54, -114, 256, 296, 0], [-536, 84, -255, 0, 0, 0, 0, 63], [0, 0, 0, 18, -159, 448, 72, 0], [364, -114, 30, 0, 0, 0, 0, -96], [-347, 339, -54, 0, 0, 0, 0, 166], [0, 0, 0, 84, -716, 12, 172, 0], [0, 0, 0, 102, -566, 380, 148, 0], [0, 0, 0, -3, 699, 72, 40, 0], [0, 0, 0, -12, 8, 5, 171, 0], [1171, 285, 44, 0, 0, 0, 0, 164], [0, 0, 0, -99, -365, 362, -198, 0], [-54, -360, -200, 0, 0, 0, 0, -112], [0, 0, 0, -114, -281, -512, 184, 0], [0, 0, 0, -3, -357, 8, 8, 0], [-658, -204, -214, 0, 0, 0, 0, 14], [0, 0, 0, -54, -259, -356, -148, 0], [1477, 51, 98, 0, 0, 0, 0, 14], [-1568, 450, 126, 0, 0, 0, 0, -108], [515, 141, -80, 0, 0, 0, 0, -208], [0, 0, 0, 120, -153, 72, -8, 0], [0, 0, 0, 96, -574, 13, -189, 0], [0, 0, 0, 210, 262, 20, 68, 0], [0, 0, 0, 168, -634, 179, -67, 0], [749, -165, -74, 0, 0, 0, 0, 114], [207, -15, -148, 0, 0, 0, 0, -140], [258, -504, -187, 0, 0, 0, 0, -3], [0, 0, 0, -114, 715, -366, -154, 0], [0, 0, 0, -18, -74, 420, 156, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1792_g_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1792_3_g_d();".
// 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_1792_3_g_d(:prec:=8)
    chi := MakeCharacter_1792_g();
    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_1792_3_g_d();".
// 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_1792_3_g_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1792_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<3,R![32, -48, -20, 4, 1]>],Snew);
    return Vf;
end function;