
// Make newform 1568.3.d.n in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1568_d();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1568_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_1568_3_d_n();".
// 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_1568_3_d_n();".
// 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], [0, 2, 0, 0, 0, 0, 0, 0], [12, 0, 38, 0, 13, 0, 1, 0], [0, 32, 0, 42, 0, 13, 0, 1], [24, 0, -2, 0, -9, 0, -1, 0], [0, -8, 0, -38, 0, -13, 0, -1], [40, 0, 46, 0, 13, 0, 1, 0], [0, 76, 0, 64, 0, 15, 0, 1]];
    Rf_basisdens := [1, 1, 2, 2, 2, 1, 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_1568_d();"
function MakeCharacter_1568_d()
    N := 1568;
    order := 2;
    char_gens := [1471, 197, 1473];
    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_1568_d_Hecke();"
function MakeCharacter_1568_d_Hecke(Kf)
    N := 1568;
    order := 2;
    char_gens := [1471, 197, 1473];
    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, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1, 0, 0, 0, 1], [-4, 0, -1, 0, 0, 0, 0, 0], [2, 0, 0, 0, -1, 0, -1, 0], [0, 3, 0, -2, 0, 0, 0, 0], [0, 6, 0, 2, 0, 0, 0, 1], [-10, 0, 2, 0, 0, 0, 0, 0], [0, 6, 0, 0, 0, 1, 0, 1], [-22, 0, 0, 0, -4, 0, 2, 0], [-18, 0, 0, 0, 2, 0, -4, 0], [0, 0, 0, 7, 0, 2, 0, 1], [0, 6, 0, 4, 0, -1, 0, -3], [6, 0, -2, 0, -4, 0, 2, 0], [0, 3, 0, 8, 0, 0, 0, -2], [24, 0, -7, 0, 2, 0, 2, 0], [0, -6, 0, -13, 0, 2, 0, -3], [0, 0, 0, 4, 0, -1, 0, -5], [-34, 0, -2, 0, 3, 0, 3, 0], [0, 12, 0, 18, 0, 1, 0, -1], [0, 3, 0, 14, 0, -4, 0, 2], [10, 0, 0, 0, -1, 0, 5, 0], [-66, 0, 6, 0, 5, 0, -1, 0], [16, 0, 5, 0, -6, 0, -6, 0], [0, -6, 0, 4, 0, -2, 0, 8], [0, -18, 0, 1, 0, -2, 0, 5], [26, 0, 16, 0, -8, 0, 10, 0], [-20, 0, 7, 0, -2, 0, -5, 0], [0, -6, 0, 4, 0, 2, 0, 7], [0, -9, 0, -34, 0, 0, 0, -6], [58, 0, -12, 0, 0, 0, 0, 0], [0, 33, 0, 18, 0, 0, 0, 0], [-30, 0, -16, 0, 12, 0, 0, 0], [0, 30, 0, 2, 0, 2, 0, 1], [-84, 0, 11, 0, 2, 0, 2, 0], [0, 0, 0, -7, 0, 0, 0, -5], [0, 42, 0, 36, 0, 0, 0, 4], [76, 0, 15, 0, 0, 0, -12, 0], [0, 6, 0, -25, 0, 4, 0, -5], [-36, 0, -29, 0, -10, 0, 2, 0], [0, 24, 0, 42, 0, -9, 0, 7], [32, 0, 1, 0, -12, 0, 3, 0], [6, 0, 30, 0, 8, 0, 2, 0], [0, -42, 0, 0, 0, -2, 0, 4], [0, -6, 0, 39, 0, 2, 0, -15], [0, 24, 0, 12, 0, -4, 0, 18], [0, 27, 0, 38, 0, 10, 0, 6], [4, 0, -1, 0, 6, 0, 18, 0], [-94, 0, 4, 0, -6, 0, -6, 0], [0, 18, 0, -28, 0, -6, 0, -3], [-18, 0, 2, 0, -9, 0, 9, 0], [0, 21, 0, -2, 0, 2, 0, -12], [-50, 0, 20, 0, 14, 0, -10, 0], [0, 48, 0, 32, 0, 5, 0, -3], [44, 0, 7, 0, 4, 0, -8, 0], [0, 36, 0, 24, 0, 2, 0, 16], [18, 0, -8, 0, 0, 0, -24, 0], [66, 0, 36, 0, 10, 0, -14, 0], [0, 15, 0, 16, 0, -14, 0, 2], [176, 0, 1, 0, 12, 0, 0, 0], [0, -57, 0, -42, 0, 2, 0, 12], [0, 24, 0, -68, 0, -3, 0, 3], [230, 0, 4, 0, 2, 0, -16, 0], [-146, 0, 2, 0, -8, 0, 22, 0], [0, 0, 0, -53, 0, -16, 0, -21], [80, 0, -43, 0, 30, 0, -3, 0], [0, 24, 0, 27, 0, -10, 0, -11], [4, 0, -5, 0, 8, 0, 8, 0], [-62, 0, 38, 0, -16, 0, 38, 0], [0, -54, 0, 42, 0, 0, 0, -11], [0, 120, 0, 16, 0, 8, 0, -6], [370, 0, 32, 0, -16, 0, -4, 0], [0, 36, 0, -5, 0, 0, 0, 27], [0, 102, 0, 76, 0, -15, 0, 3], [-262, 0, -8, 0, 12, 0, 18, 0], [300, 0, 7, 0, -8, 0, -20, 0], [244, 0, -21, 0, -22, 0, -1, 0], [-134, 0, 26, 0, -22, 0, 2, 0], [0, 21, 0, -96, 0, 6, 0, -6], [202, 0, -44, 0, -4, 0, 32, 0], [0, 30, 0, 8, 0, -12, 0, 25], [562, 0, 40, 0, -5, 0, 7, 0], [0, -60, 0, 8, 0, 7, 0, -17], [0, -66, 0, -67, 0, 4, 0, -3], [290, 0, 32, 0, -4, 0, -4, 0], [40, 0, 41, 0, 2, 0, 29, 0], [-100, 0, 23, 0, -32, 0, -8, 0], [0, -60, 0, 38, 0, 17, 0, -43], [0, -33, 0, 38, 0, 6, 0, 18], [0, 6, 0, -68, 0, 3, 0, 15], [0, 102, 0, 18, 0, -10, 0, 19], [0, -66, 0, -35, 0, 22, 0, -9], [0, 6, 0, -93, 0, -12, 0, -19], [0, 48, 0, -48, 0, -3, 0, 21], [-388, 0, 15, 0, 0, 0, 36, 0], [346, 0, -18, 0, 24, 0, -12, 0], [0, -57, 0, -64, 0, -36, 0, 10], [42, 0, -76, 0, 28, 0, 28, 0], [0, -84, 0, 13, 0, -28, 0, 11], [-26, 0, -66, 0, -36, 0, 6, 0], [0, 45, 0, 8, 0, -20, 0, 46], [-196, 0, -9, 0, 2, 0, -13, 0], [0, 132, 0, -49, 0, -2, 0, 25], [-70, 0, -2, 0, -6, 0, -12, 0], [0, -27, 0, -42, 0, 0, 0, 0], [-146, 0, -40, 0, 36, 0, -24, 0], [0, 48, 0, 24, 0, 29, 0, 7], [-158, 0, -20, 0, 3, 0, -3, 0], [0, -24, 0, -76, 0, -6, 0, -14], [-114, 0, 14, 0, -48, 0, 36, 0], [56, 0, 17, 0, 38, 0, -55, 0], [0, -105, 0, -20, 0, -6, 0, 18], [0, -132, 0, 28, 0, -19, 0, 43], [-252, 0, -101, 0, 6, 0, -21, 0], [0, -27, 0, -24, 0, 30, 0, -36], [0, 6, 0, -52, 0, -20, 0, -26], [-290, 0, 62, 0, -4, 0, -28, 0], [0, 60, 0, -3, 0, 10, 0, -15], [-128, 0, 21, 0, -30, 0, 6, 0], [82, 0, 100, 0, 22, 0, 10, 0], [-244, 0, -81, 0, 16, 0, -20, 0], [0, 138, 0, 77, 0, -18, 0, -11], [0, -33, 0, -54, 0, -12, 0, -38], [134, 0, -78, 0, -8, 0, 4, 0], [338, 0, 84, 0, 48, 0, -6, 0], [0, -54, 0, -52, 0, 13, 0, -9], [0, -138, 0, -120, 0, 14, 0, -18], [464, 0, 37, 0, -10, 0, 50, 0], [0, 0, 0, 25, 0, -40, 0, 3], [0, 186, 0, 54, 0, 42, 0, -9], [0, 6, 0, -52, 0, -2, 0, 3], [-426, 0, -78, 0, 28, 0, 4, 0], [-122, 0, -124, 0, -10, 0, 8, 0], [686, 0, -46, 0, -29, 0, -47, 0], [520, 0, 17, 0, -18, 0, 30, 0], [0, 15, 0, 58, 0, 0, 0, -36], [-580, 0, -97, 0, 28, 0, -8, 0], [168, 0, 25, 0, 50, 0, 5, 0], [0, 123, 0, 64, 0, -30, 0, 10], [-70, 0, 52, 0, -16, 0, 44, 0], [0, -36, 0, -216, 0, -19, 0, 25], [0, -162, 0, 105, 0, 4, 0, 15], [-752, 0, -55, 0, 16, 0, 4, 0], [0, -6, 0, 140, 0, 38, 0, 20], [300, 0, 51, 0, 2, 0, 50, 0], [-598, 0, 22, 0, -84, 0, 36, 0], [0, 165, 0, -54, 0, 8, 0, 14], [0, -24, 0, 114, 0, -13, 0, -25], [-86, 0, 0, 0, -64, 0, -10, 0], [-6, 0, -2, 0, 54, 0, -12, 0], [0, 138, 0, -53, 0, -2, 0, -5], [0, -210, 0, -92, 0, -12, 0, 24], [0, -102, 0, -99, 0, 4, 0, 13], [0, 30, 0, -84, 0, -24, 0, 39], [0, 156, 0, -44, 0, 47, 0, -25], [-254, 0, 108, 0, -83, 0, 13, 0], [-370, 0, -14, 0, 49, 0, -95, 0], [320, 0, 49, 0, -4, 0, 32, 0], [0, 36, 0, 141, 0, 26, 0, -55], [-326, 0, -68, 0, -8, 0, -20, 0], [0, 198, 0, 206, 0, -36, 0, -7], [0, 171, 0, 208, 0, 18, 0, 8], [2, 0, -68, 0, 6, 0, -54, 0], [0, 138, 0, -44, 0, -28, 0, -10], [0, -24, 0, -230, 0, 25, 0, -1], [144, 0, 113, 0, 48, 0, -36, 0], [-248, 0, 133, 0, -48, 0, -21, 0], [-548, 0, 39, 0, -16, 0, 56, 0], [0, 6, 0, 197, 0, 0, 0, 57], [-900, 0, 75, 0, 10, 0, -62, 0], [0, 0, 0, 104, 0, 49, 0, -23], [538, 0, -112, 0, -50, 0, 34, 0], [0, -6, 0, 288, 0, -1, 0, 1], [-958, 0, 92, 0, 7, 0, -35, 0], [0, 30, 0, -23, 0, 24, 0, -1], [622, 0, -58, 0, 60, 0, -48, 0], [0, 252, 0, 40, 0, -13, 0, 61], [904, 0, 149, 0, -56, 0, 40, 0], [0, -90, 0, -288, 0, -34, 0, 11], [0, 21, 0, 128, 0, 46, 0, 56], [242, 0, -44, 0, -68, 0, 58, 0], [-282, 0, 110, 0, 49, 0, -23, 0], [0, -186, 0, -120, 0, 54, 0, 13], [-316, 0, -101, 0, 88, 0, -128, 0], [878, 0, -14, 0, 76, 0, -50, 0], [0, -189, 0, -30, 0, -28, 0, -32], [234, 0, 116, 0, -52, 0, -28, 0], [0, -150, 0, -344, 0, 31, 0, -13], [402, 0, -10, 0, 60, 0, 18, 0], [0, 162, 0, 41, 0, -32, 0, 83], [0, -246, 0, -9, 0, -4, 0, 61], [-260, 0, 59, 0, -58, 0, 14, 0], [0, -150, 0, 143, 0, 10, 0, 19], [-422, 0, 80, 0, 47, 0, -31, 0], [40, 0, 153, 0, -50, 0, 49, 0], [-18, 0, 110, 0, 52, 0, -8, 0], [666, 0, 18, 0, -32, 0, -74, 0], [0, 252, 0, -8, 0, 49, 0, -67], [-178, 0, 82, 0, -4, 0, -10, 0], [0, -54, 0, -80, 0, 13, 0, 133], [400, 0, -51, 0, 38, 0, -46, 0], [-750, 0, 82, 0, -26, 0, 88, 0], [0, 159, 0, -40, 0, 68, 0, -46], [-408, 0, 173, 0, 68, 0, -52, 0], [0, 18, 0, -260, 0, -15, 0, 29], [0, -444, 0, -71, 0, 0, 0, -55], [-204, 0, 7, 0, 32, 0, 89, 0], [0, -183, 0, -278, 0, -36, 0, 6], [916, 0, -141, 0, -2, 0, -53, 0], [424, 0, 49, 0, 2, 0, 62, 0], [0, -210, 0, 146, 0, -14, 0, 41], [0, -153, 0, 184, 0, 2, 0, -106], [0, -180, 0, -108, 0, -41, 0, 79], [1582, 0, -4, 0, 28, 0, 34, 0], [0, -204, 0, 90, 0, -1, 0, -25], [878, 0, -18, 0, 33, 0, -33, 0], [0, 144, 0, 72, 0, 61, 0, -89], [-378, 0, 154, 0, -76, 0, 8, 0], [270, 0, 38, 0, 0, 0, -48, 0], [0, -36, 0, 56, 0, 3, 0, -45], [746, 0, 108, 0, -44, 0, 16, 0], [0, -438, 0, -260, 0, 50, 0, -31], [0, -141, 0, -74, 0, -96, 0, 40], [-1058, 0, 70, 0, -84, 0, -12, 0], [-582, 0, 100, 0, -35, 0, -53, 0], [0, 66, 0, -288, 0, -58, 0, 85], [0, 216, 0, 28, 0, -47, 0, 33], [0, 216, 0, 59, 0, -30, 0, 31], [358, 0, 194, 0, 0, 0, -12, 0], [0, -291, 0, 4, 0, 2, 0, 42], [0, 156, 0, -70, 0, 65, 0, -67], [-102, 0, -76, 0, 16, 0, -68, 0], [0, -165, 0, -196, 0, -24, 0, 32], [0, -156, 0, -224, 0, 18, 0, 36], [-22, 0, 60, 0, -121, 0, 83, 0], [162, 0, -112, 0, -100, 0, 56, 0], [0, 246, 0, 121, 0, -10, 0, -65], [0, 60, 0, 116, 0, -39, 0, 19], [0, -144, 0, 325, 0, -2, 0, 83], [0, -81, 0, -216, 0, 18, 0, 80], [0, 24, 0, 160, 0, -1, 0, -45], [374, 0, -138, 0, 32, 0, -106, 0], [770, 0, 10, 0, -114, 0, 72, 0], [0, 174, 0, 96, 0, 0, 0, 130], [0, -432, 0, -320, 0, 36, 0, -32], [0, -345, 0, 50, 0, -30, 0, 108], [0, 60, 0, -93, 0, -12, 0, -31], [0, -24, 0, -370, 0, -23, 0, 79], [-622, 0, 56, 0, 0, 0, -84, 0], [-582, 0, 74, 0, 40, 0, 58, 0], [0, 132, 0, 100, 0, 35, 0, 45], [114, 0, -252, 0, 107, 0, 5, 0], [168, 0, 161, 0, -86, 0, 58, 0], [0, 78, 0, -381, 0, -26, 0, 49], [-1090, 0, -162, 0, 48, 0, 48, 0], [0, 309, 0, 250, 0, 0, 0, -16], [1048, 0, 37, 0, 24, 0, 12, 0], [146, 0, -330, 0, -50, 0, 82, 0], [0, -126, 0, 148, 0, 56, 0, 95], [0, -252, 0, 225, 0, -28, 0, -87], [880, 0, -115, 0, 74, 0, 74, 0], [936, 0, 225, 0, -94, 0, -46, 0], [-1194, 0, -122, 0, 75, 0, 33, 0], [0, 129, 0, -268, 0, -50, 0, -32], [522, 0, 252, 0, 0, 0, 0, 0], [306, 0, -156, 0, 75, 0, -99, 0], [0, 102, 0, 13, 0, 38, 0, 73], [554, 0, -224, 0, 0, 0, -6, 0], [452, 0, -153, 0, -14, 0, 82, 0], [0, -264, 0, -15, 0, -84, 0, -7], [122, 0, 84, 0, 89, 0, -157, 0], [0, -126, 0, -84, 0, -10, 0, -77], [1734, 0, 36, 0, 76, 0, -56, 0], [0, 108, 0, 84, 0, -5, 0, -143], [0, 84, 0, -113, 0, 48, 0, -111], [318, 0, 58, 0, -56, 0, -74, 0], [-364, 0, -129, 0, -60, 0, -3, 0], [0, 339, 0, -2, 0, -28, 0, -138], [0, 168, 0, -316, 0, 20, 0, 66], [0, 204, 0, -232, 0, -29, 0, 103], [0, 6, 0, -348, 0, 4, 0, -24], [-16, 0, -127, 0, -28, 0, -16, 0], [0, -285, 0, -364, 0, 52, 0, 112], [0, 198, 0, 232, 0, 70, 0, 29], [-54, 0, 268, 0, 68, 0, -112, 0], [-562, 0, 266, 0, 16, 0, -98, 0], [0, 6, 0, 180, 0, 0, 0, -4], [658, 0, -86, 0, 6, 0, 108, 0], [518, 0, 22, 0, 36, 0, 90, 0], [0, 51, 0, 382, 0, -28, 0, 14], [1568, 0, -99, 0, 54, 0, -171, 0], [0, -141, 0, -164, 0, -72, 0, -136], [306, 0, 24, 0, 52, 0, -68, 0], [-1148, 0, -145, 0, -70, 0, 26, 0], [0, 420, 0, 236, 0, 6, 0, 28], [1268, 0, 95, 0, 70, 0, -98, 0], [0, 165, 0, -146, 0, 10, 0, 104], [0, -15, 0, 48, 0, 72, 0, 68], [258, 0, 98, 0, 80, 0, -172, 0], [-1430, 0, 24, 0, 8, 0, 122, 0], [0, 36, 0, 46, 0, 33, 0, -111]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1568_d_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1568_3_d_n();".
// 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_1568_3_d_n(:prec:=8)
    chi := MakeCharacter_1568_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_1568_3_d_n();".
// 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_1568_3_d_n( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1568_d();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<3,R![1024, 0, 3584, 0, 848, 0, 56, 0, 1]>,<5,R![128, 224, -76, 0, 1]>],Snew);
    return Vf;
end function;