
// Make newform 1296.3.g.j in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1296_g();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1296_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_1296_3_g_j();".
// 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_1296_3_g_j();".
// 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, 32, 0, 36, 0, 11, 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, 12, 0, 3, 0, 0, 0, 0], [0, 10, 0, 7, 0, 1, 0, 0], [0, 0, 14, 0, 8, 0, 1, 0], [-4, 0, -2, 0, -5, 0, -1, 0], [0, 66, 0, 87, 0, 30, 0, 3], [0, -50, 0, -95, 0, -32, 0, -3], [43, 0, 84, 0, 30, 0, 3, 0]];
    Rf_basisdens := [1, 1, 1, 1, 1, 2, 2, 1];
    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_1296_g();"
function MakeCharacter_1296_g()
    N := 1296;
    order := 2;
    char_gens := [1135, 325, 1217];
    v := [1, 2, 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_1296_g_Hecke();"
function MakeCharacter_1296_g_Hecke(Kf)
    N := 1296;
    order := 2;
    char_gens := [1135, 325, 1217];
    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], [0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0], [0, -1, 1, 0, 0, 0, 1, 0], [-1, 0, 0, 1, 1, 0, 0, 0], [1, 0, 0, 0, -1, 0, 0, -1], [0, 0, -1, 0, 0, 3, 1, 0], [0, 1, 3, 0, 0, 1, 0, 0], [-17, 0, 0, 1, 3, 0, 0, 0], [0, -3, -1, 0, 0, 3, 2, 0], [-4, 0, 0, -4, -1, 0, 0, 2], [-15, 0, 0, -4, -1, 0, 0, 2], [0, 6, -2, 0, 0, -3, -2, 0], [0, -2, 10, 0, 0, 2, -5, 0], [-30, 0, 0, 6, -3, 0, 0, 0], [0, -4, 14, 0, 0, 7, 2, 0], [-3, 0, 0, -7, -1, 0, 0, -2], [0, -3, 1, 0, 0, -6, -3, 0], [0, -5, 19, 0, 0, -1, -5, 0], [9, 0, 0, -2, 1, 0, 0, -1], [0, -9, 5, 0, 0, -3, -2, 0], [0, -2, 23, 0, 0, -6, 5, 0], [-22, 0, 0, -4, 3, 0, 0, 0], [3, 0, 0, 6, 3, 0, 0, 4], [-81, 0, 0, -9, -6, 0, 0, 0], [0, 12, 8, 0, 0, 0, -9, 0], [0, 6, 19, 0, 0, 13, 7, 0], [-18, 0, 0, -2, 1, 0, 0, -4], [-14, 0, 0, 8, 4, 0, 0, -5], [0, 12, -10, 0, 0, -18, 2, 0], [0, -10, 23, 0, 0, 10, 11, 0], [35, 0, 0, -14, -7, 0, 0, -4], [0, 6, -12, 0, 0, -9, 10, 0], [-125, 0, 0, -3, -1, 0, 0, -4], [0, -15, -23, 0, 0, 21, -6, 0], [-21, 0, 0, 11, -10, 0, 0, 4], [0, -12, 18, 0, 0, 12, 16, 0], [0, 0, 14, 0, 0, -10, 17, 0], [-59, 0, 0, 11, -8, 0, 0, -2], [0, 10, 26, 0, 0, -18, -10, 0], [38, 0, 0, 0, 3, 0, 0, -4], [0, 0, 10, 0, 0, 16, -11, 0], [87, 0, 0, 2, -1, 0, 0, -8], [-110, 0, 0, -2, 0, 0, 0, 0], [0, 9, -5, 0, 0, -9, -1, 0], [0, -15, 34, 0, 0, -3, 2, 0], [0, -12, 26, 0, 0, -12, 17, 0], [0, -19, -17, 0, 0, 18, 19, 0], [-15, 0, 0, -5, 16, 0, 0, 2], [161, 0, 0, -2, -10, 0, 0, -1], [0, 33, -11, 0, 0, 1, 4, 0], [-35, 0, 0, 4, -8, 0, 0, -2], [0, 26, -19, 0, 0, -5, -31, 0], [137, 0, 0, -50, 2, 0, 0, 2], [0, -5, -3, 0, 0, -29, 12, 0], [-4, 0, 0, 36, -5, 0, 0, -14], [0, 18, 52, 0, 0, -6, -18, 0], [-71, 0, 0, -9, -18, 0, 0, -6], [262, 0, 0, 36, 11, 0, 0, -1], [0, 12, -11, 0, 0, -36, -35, 0], [-121, 0, 0, -31, 6, 0, 0, 0], [0, 30, -3, 0, 0, -9, -27, 0], [0, -29, -29, 0, 0, -1, 10, 0], [107, 0, 0, -46, -16, 0, 0, -4], [-19, 0, 0, -29, 17, 0, 0, -10], [0, 15, 34, 0, 0, 3, -34, 0], [-7, 0, 0, -6, 6, 0, 0, 2], [0, -29, -69, 0, 0, 16, 27, 0], [1, 0, 0, 45, 6, 0, 0, -14], [195, 0, 0, -16, -7, 0, 0, -4], [0, 22, -34, 0, 0, -12, 20, 0], [0, 9, -91, 0, 0, -21, -24, 0], [-57, 0, 0, -3, -9, 0, 0, -16], [0, 3, 96, 0, 0, -30, 8, 0], [0, -4, -72, 0, 0, 26, -15, 0], [-207, 0, 0, -25, 14, 0, 0, 2], [150, 0, 0, 62, 5, 0, 0, 4], [221, 0, 0, 56, 9, 0, 0, 6], [127, 0, 0, -38, 4, 0, 0, 16], [0, 71, -38, 0, 0, -57, 16, 0], [211, 0, 0, -41, 19, 0, 0, 4], [0, 22, -54, 0, 0, -8, -48, 0], [-129, 0, 0, 74, 17, 0, 0, -11], [0, 9, 63, 0, 0, 39, 24, 0], [0, 64, -30, 0, 0, -41, 12, 0], [171, 0, 0, 46, 25, 0, 0, 1], [-195, 0, 0, -32, 7, 0, 0, 14], [87, 0, 0, 41, -37, 0, 0, 8], [0, 27, -101, 0, 0, -15, -52, 0], [0, -48, -107, 0, 0, 13, 7, 0], [0, -45, -13, 0, 0, 35, 8, 0], [0, -66, 106, 0, 0, 48, -40, 0], [0, -12, -44, 0, 0, -59, -20, 0], [0, -12, -36, 0, 0, 87, -18, 0], [0, 9, -55, 0, 0, 101, -7, 0], [-21, 0, 0, -33, -21, 0, 0, -12], [333, 0, 0, -8, 22, 0, 0, 19], [0, -57, -23, 0, 0, -21, 27, 0], [-410, 0, 0, 46, 16, 0, 0, 4], [0, -57, 101, 0, 0, -30, -69, 0], [76, 0, 0, -74, -3, 0, 0, -6], [0, 41, 21, 0, 0, -70, -3, 0], [163, 0, 0, -94, 28, 0, 0, 4], [0, 33, -87, 0, 0, -60, -1, 0], [-105, 0, 0, -16, -1, 0, 0, -11], [0, 54, -86, 0, 0, 37, 46, 0], [-112, 0, 0, -134, -19, 0, 0, 14], [0, -68, 78, 0, 0, 34, 21, 0], [-111, 0, 0, 2, 17, 0, 0, 10], [0, -66, -48, 0, 0, 0, 19, 0], [62, 0, 0, -78, 57, 0, 0, 12], [539, 0, 0, -12, -5, 0, 0, -20], [0, -45, 103, 0, 0, -30, -57, 0], [0, -90, 36, 0, 0, -42, 2, 0], [-55, 0, 0, 76, 8, 0, 0, -22], [0, -15, 207, 0, 0, 24, 15, 0], [0, 74, 2, 0, 0, -44, -28, 0], [-177, 0, 0, -51, 48, 0, 0, 0], [0, -61, 100, 0, 0, 75, -62, 0], [-63, 0, 0, -67, 2, 0, 0, 10], [-170, 0, 0, -88, -7, 0, 0, -9], [-105, 0, 0, 87, 30, 0, 0, -24], [0, 38, 91, 0, 0, 57, 19, 0], [0, 24, -217, 0, 0, -60, 11, 0], [-70, 0, 0, 20, -21, 0, 0, 0], [-343, 0, 0, 49, -32, 0, 0, -30], [0, 16, 88, 0, 0, -64, 64, 0], [0, -21, 117, 0, 0, 39, 48, 0], [85, 0, 0, 39, 3, 0, 0, -18], [0, 93, -46, 0, 0, 24, -58, 0], [0, -56, 72, 0, 0, 112, 15, 0], [0, -12, 204, 0, 0, 18, -31, 0], [-566, 0, 0, -108, 0, 0, 0, 0], [182, 0, 0, -64, 39, 0, 0, 15], [-116, 0, 0, -10, 62, 0, 0, 45], [-506, 0, 0, -60, -1, 0, 0, -4], [0, -18, -185, 0, 0, 30, -33, 0], [271, 0, 0, 99, -13, 0, 0, 8], [-37, 0, 0, -14, -67, 0, 0, -31], [0, -36, 157, 0, 0, 69, 7, 0], [-799, 0, 0, -5, -1, 0, 0, 2], [0, 81, -19, 0, 0, -117, 46, 0], [0, 6, -42, 0, 0, 90, 66, 0], [336, 0, 0, -66, -87, 0, 0, -2], [0, -94, 174, 0, 0, 92, 69, 0], [785, 0, 0, 27, -9, 0, 0, 18], [224, 0, 0, 70, -7, 0, 0, 17], [0, -21, 177, 0, 0, 42, 49, 0], [0, 22, 200, 0, 0, -66, 2, 0], [251, 0, 0, -1, 11, 0, 0, -28], [-498, 0, 0, 64, 43, 0, 0, 4], [0, -12, -179, 0, 0, -27, -25, 0], [0, -41, -59, 0, 0, -43, -20, 0], [0, 66, -232, 0, 0, 51, 16, 0], [0, 73, 61, 0, 0, 83, 64, 0], [0, 18, 270, 0, 0, -60, 60, 0], [-626, 0, 0, -24, 41, 0, 0, -1], [788, 0, 0, 38, 5, 0, 0, -46], [133, 0, 0, -107, 24, 0, 0, -42], [0, 49, 9, 0, 0, -44, -111, 0], [-109, 0, 0, -102, 49, 0, 0, 25], [0, -33, 295, 0, 0, -9, -78, 0], [0, 57, 59, 0, 0, 29, 53, 0], [-681, 0, 0, -62, 58, 0, 0, 16], [0, 185, 131, 0, 0, -29, -52, 0], [0, -30, -148, 0, 0, -66, 18, 0], [-189, 0, 0, -37, 86, 0, 0, 4], [-228, 0, 0, -62, -59, 0, 0, -22], [-429, 0, 0, 135, 57, 0, 0, -12], [0, -22, 196, 0, 0, -33, 52, 0], [63, 0, 0, -25, -73, 0, 0, -8], [0, -1, 65, 0, 0, -11, -28, 0], [127, 0, 0, -248, -53, 0, 0, 16], [0, 30, -62, 0, 0, 102, -19, 0], [144, 0, 0, 78, -84, 0, 0, -39], [0, 66, 202, 0, 0, -63, -110, 0], [-292, 0, 0, -158, -55, 0, 0, 26], [0, 96, -64, 0, 0, -96, -128, 0], [561, 0, 0, 113, 2, 0, 0, 34], [0, -48, 222, 0, 0, -48, 77, 0], [0, -22, 16, 0, 0, -15, 142, 0], [453, 0, 0, 19, -104, 0, 0, -10], [855, 0, 0, -4, -13, 0, 0, 5], [0, -54, 190, 0, 0, -110, 25, 0], [-811, 0, 0, -47, -19, 0, 0, 62], [120, 0, 0, 64, 76, 0, 0, 62], [0, -48, -249, 0, 0, 12, -29, 0], [-1167, 0, 0, -72, 6, 0, 0, 58], [0, -140, -52, 0, 0, 132, 20, 0], [161, 0, 0, -194, 85, 0, 0, -9], [0, 59, -71, 0, 0, -48, 73, 0], [0, -126, -81, 0, 0, 141, 7, 0], [865, 0, 0, -47, -6, 0, 0, -30], [0, 100, -195, 0, 0, 73, 27, 0], [-201, 0, 0, 112, -2, 0, 0, 16], [-23, 0, 0, 2, 11, 0, 0, -54], [-87, 0, 0, -87, -18, 0, 0, 10], [-335, 0, 0, -70, -38, 0, 0, 58], [0, 120, -130, 0, 0, -106, -190, 0], [485, 0, 0, -117, 46, 0, 0, 46], [0, -162, -202, 0, 0, 126, 31, 0], [153, 0, 0, 285, 30, 0, 0, -14], [-147, 0, 0, -230, 34, 0, 0, -58], [0, 28, 49, 0, 0, -127, -101, 0], [1002, 0, 0, 116, 59, 0, 0, 32], [0, 66, 32, 0, 0, 66, 46, 0], [0, -162, 42, 0, 0, 87, 150, 0], [57, 0, 0, -142, 92, 0, 0, 26], [0, -66, 252, 0, 0, 27, -82, 0], [97, 0, 0, 0, 15, 0, 0, 31], [-215, 0, 0, -57, -19, 0, 0, -22], [0, -78, 40, 0, 0, 114, -81, 0], [0, 15, -502, 0, 0, 11, 86, 0], [0, 144, 58, 0, 0, 118, 73, 0], [-103, 0, 0, -36, -18, 0, 0, -30], [0, -39, -197, 0, 0, -33, 94, 0], [-791, 0, 0, -76, 49, 0, 0, -14], [0, -62, -218, 0, 0, -88, -80, 0], [1001, 0, 0, 53, -15, 0, 0, 42], [-199, 0, 0, 199, 37, 0, 0, -54], [0, -6, 186, 0, 0, 240, 111, 0], [-767, 0, 0, -44, -87, 0, 0, -6], [0, -42, -242, 0, 0, 60, 124, 0], [0, -28, -440, 0, 0, -9, -26, 0], [-23, 0, 0, 287, -46, 0, 0, -6], [198, 0, 0, -136, 14, 0, 0, -73], [0, 202, 144, 0, 0, -170, -30, 0], [0, 249, -267, 0, 0, -207, 46, 0], [0, -163, 90, 0, 0, -151, -24, 0], [-287, 0, 0, 199, 34, 0, 0, 10], [0, 72, 98, 0, 0, -48, -52, 0], [0, -3, 77, 0, 0, -75, -112, 0], [293, 0, 0, -54, 64, 0, 0, 22], [0, -39, -90, 0, 0, 93, 76, 0], [0, -16, -370, 0, 0, 52, 113, 0], [1244, 0, 0, 166, 67, 0, 0, -27], [42, 0, 0, -96, -81, 0, 0, -48], [0, 140, 58, 0, 0, -189, -122, 0], [0, -40, -210, 0, 0, 14, 234, 0], [0, -22, 16, 0, 0, -123, 34, 0], [0, 78, -266, 0, 0, 210, -6, 0], [0, -174, 10, 0, 0, 12, -21, 0], [1136, 0, 0, -150, -15, 0, 0, -18], [-1065, 0, 0, -240, -15, 0, 0, -48], [0, 16, -126, 0, 0, -14, 87, 0], [0, -60, 164, 0, 0, 216, 136, 0], [0, 71, -55, 0, 0, 40, 167, 0], [0, -57, -148, 0, 0, -45, -160, 0], [0, 10, -38, 0, 0, -16, -224, 0], [-753, 0, 0, -35, -23, 0, 0, 80], [13, 0, 0, -34, -95, 0, 0, -29], [0, 61, -271, 0, 0, 231, -118, 0], [-402, 0, 0, 64, 94, 0, 0, -49], [1477, 0, 0, -149, -84, 0, 0, 30], [0, 19, 2, 0, 0, 264, 2, 0], [-474, 0, 0, 70, 73, 0, 0, 68], [0, -165, 10, 0, 0, -33, -14, 0], [1010, 0, 0, 158, 60, 0, 0, 48], [-391, 0, 0, -36, 27, 0, 0, -57], [0, 195, -203, 0, 0, 33, 122, 0], [0, 172, -390, 0, 0, -167, -42, 0], [741, 0, 0, -323, 58, 0, 0, -34], [-302, 0, 0, 48, 27, 0, 0, -8], [-378, 0, 0, 220, -11, 0, 0, -41], [0, -81, 131, 0, 0, 132, 89, 0], [976, 0, 0, 44, 79, 0, 0, 22], [419, 0, 0, -100, -54, 0, 0, 12], [0, 57, 239, 0, 0, 18, -55, 0], [179, 0, 0, 97, 167, 0, 0, 44], [647, 0, 0, -25, -49, 0, 0, -16], [0, -102, -186, 0, 0, -66, -2, 0], [-203, 0, 0, 150, 132, 0, 0, 6], [0, -60, -98, 0, 0, -180, 15, 0], [-747, 0, 0, -2, -53, 0, 0, -10], [0, -36, -40, 0, 0, -120, 48, 0], [0, -20, -147, 0, 0, -188, -123, 0], [-681, 0, 0, -79, -1, 0, 0, 40], [117, 0, 0, 38, 125, 0, 0, -5], [0, 45, -329, 0, 0, 82, 19, 0], [0, -192, 226, 0, 0, 4, -137, 0], [0, -198, -152, 0, 0, 18, 253, 0], [0, 105, -311, 0, 0, -11, -134, 0], [-345, 0, 0, -7, 152, 0, 0, 16], [0, 18, 134, 0, 0, 117, -12, 0], [0, -129, 313, 0, 0, 145, -95, 0], [-1210, 0, 0, 76, 103, 0, 0, 12], [249, 0, 0, 169, -110, 0, 0, -62], [0, -132, 110, 0, 0, 186, 63, 0], [-1895, 0, 0, -42, 62, 0, 0, 71], [729, 0, 0, 105, -45, 0, 0, -102], [0, -269, -48, 0, 0, 94, -60, 0], [-1187, 0, 0, -106, 16, 0, 0, 46], [0, 127, -47, 0, 0, 38, 37, 0], [519, 0, 0, -265, 56, 0, 0, -32], [-47, 0, 0, -61, -2, 0, 0, -86], [0, 171, -269, 0, 0, 267, -112, 0], [-905, 0, 0, -279, 41, 0, 0, 32], [0, -32, 186, 0, 0, 88, -60, 0], [0, -264, -181, 0, 0, 336, -17, 0], [-659, 0, 0, 8, -10, 0, 0, -42], [918, 0, 0, -80, -89, 0, 0, 28], [0, -312, 40, 0, 0, 228, 4, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1296_g_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1296_3_g_j();".
// 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_1296_3_g_j(:prec:=8)
    chi := MakeCharacter_1296_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_1296_3_g_j();".
// 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_1296_3_g_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1296_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<5,R![36, 9, -57, 3, 1]>,<17,R![84168, 1908, -822, -3, 1]>],Snew);
    return Vf;
end function;