
// Make newform 1764.3.d.h in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1764_d();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1764_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_1764_3_d_h();".
// 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_1764_3_d_h();".
// 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, -8, 0, 14, 0, -4, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [20, 0, 0, 0, 0, 0, 1, 0], [0, -10, 0, 126, 0, -35, 0, 10], [4, 0, -12, 0, 4, 0, -1, 0], [0, -96, 0, 91, 0, -28, 0, 5], [0, -8, 0, 91, 0, -28, 0, 8], [-18, 0, 56, 0, -14, 0, 4, 0], [0, -134, 0, 126, 0, -35, 0, 8]];
    Rf_basisdens := [1, 14, 14, 2, 7, 7, 7, 7];
    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_1764_d();"
function MakeCharacter_1764_d()
    N := 1764;
    order := 2;
    char_gens := [883, 785, 1081];
    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_1764_d_Hecke();"
function MakeCharacter_1764_d_Hecke(Kf)
    N := 1764;
    order := 2;
    char_gens := [883, 785, 1081];
    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], [0, 0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 1, 0, 0, 0], [0, 0, 1, 4, 0, -2, 0, 0], [0, 0, 3, -3, 0, 0, -2, 0], [0, 0, -2, -2, 0, -1, 4, 0], [2, 9, 0, 0, -1, 0, 0, 1], [-10, 5, 0, 0, 1, 0, 0, 3], [0, 0, 4, 14, 0, 3, 2, 0], [16, 9, 0, 0, 6, 0, 0, -2], [0, 0, 7, -13, 0, -5, 7, 0], [-14, 8, 0, 0, -2, 0, 0, -4], [0, 0, -8, 2, 0, 7, -11, 0], [18, 26, 0, 0, 6, 0, 0, -2], [0, 0, 12, -22, 0, 5, -7, 0], [0, 0, 5, -14, 0, 8, 6, 0], [-8, 12, 0, 0, -6, 0, 0, -2], [-28, -43, 0, 0, -1, 0, 0, 4], [0, 0, 15, 6, 0, -8, 14, 0], [-54, 28, 0, 0, -4, 0, 0, 0], [0, 0, 6, -6, 0, -14, -8, 0], [0, 0, 11, 23, 0, 16, 4, 0], [0, 0, -3, 10, 0, -4, -14, 0], [0, 0, 37, 11, 0, 3, -1, 0], [0, 0, -4, 18, 0, 9, 4, 0], [-82, 73, 0, 0, 3, 0, 0, 1], [2, 43, 0, 0, 0, 0, 0, 10], [-64, -12, 0, 0, 8, 0, 0, -7], [-56, -92, 0, 0, 6, 0, 0, 0], [0, 0, -10, -46, 0, 28, 4, 0], [-62, 59, 0, 0, -21, 0, 0, -5], [0, 0, 18, -36, 0, -6, 8, 0], [-34, 108, 0, 0, -4, 0, 0, -8], [62, 40, 0, 0, 10, 0, 0, -12], [0, 0, 25, -54, 0, 1, -4, 0], [-12, 20, 0, 0, -18, 0, 0, 6], [0, 0, 30, 40, 0, -23, -15, 0], [0, 0, 3, 17, 0, 46, 8, 0], [140, 95, 0, 0, -7, 0, 0, 6], [0, 0, -1, -44, 0, -13, 12, 0], [-56, -27, 0, 0, 31, 0, 0, -10], [-34, 56, 0, 0, 24, 0, 0, 6], [-32, -22, 0, 0, 6, 0, 0, -21], [0, 0, 34, -20, 0, -10, -16, 0], [-32, 56, 0, 0, 12, 0, 0, 10], [0, 0, 24, -24, 0, -20, 34, 0], [0, 0, 30, 20, 0, 61, 3, 0], [0, 0, 43, -48, 0, -13, -20, 0], [22, 159, 0, 0, -3, 0, 0, 11], [58, -117, 0, 0, -3, 0, 0, -3], [0, 0, 43, -26, 0, 3, 4, 0], [0, 0, 58, 64, 0, -49, -33, 0], [0, 0, 25, 29, 0, 5, 41, 0], [-32, -5, 0, 0, -7, 0, 0, 8], [0, 0, 31, 15, 0, -37, 15, 0], [0, 0, -34, 66, 0, 13, 58, 0], [-40, -6, 0, 0, -4, 0, 0, 20], [-150, 113, 0, 0, 7, 0, 0, 13], [0, 0, -8, 62, 0, 39, -22, 0], [0, 0, -7, 15, 0, 33, 45, 0], [0, 0, -96, 10, 0, -35, -4, 0], [0, 0, -50, -88, 0, -7, 5, 0], [0, 0, 21, -4, 0, -10, -12, 0], [60, -26, 0, 0, -34, 0, 0, -15], [-16, -224, 0, 0, -4, 0, 0, -18], [28, 49, 0, 0, -34, 0, 0, -10], [-46, 143, 0, 0, 13, 0, 0, -1], [0, 0, 27, 6, 0, 31, -44, 0], [0, 0, 7, -23, 0, -31, -91, 0], [162, -45, 0, 0, -19, 0, 0, 15], [0, 0, -26, 64, 0, -34, 94, 0], [-208, -86, 0, 0, 16, 0, 0, 6], [184, -104, 0, 0, -12, 0, 0, -26], [0, 0, -20, 88, 0, -32, -76, 0], [-302, -199, 0, 0, 29, 0, 0, -17], [0, 0, -37, -158, 0, 50, 38, 0], [78, -53, 0, 0, 13, 0, 0, 31], [0, 0, -57, -10, 0, 32, 98, 0], [0, 0, -56, -94, 0, -11, -5, 0], [-68, -16, 0, 0, 40, 0, 0, -36], [320, -79, 0, 0, 47, 0, 0, 18], [0, 0, -137, 96, 0, 65, -24, 0], [0, 0, 38, -4, 0, -44, -18, 0], [-88, -345, 0, 0, -27, 0, 0, -2], [112, 26, 0, 0, 38, 0, 0, -3], [56, 6, 0, 0, 12, 0, 0, -30], [0, 0, -37, 89, 0, 42, 32, 0], [300, 106, 0, 0, 2, 0, 0, -20], [0, 0, -60, 106, 0, -95, 15, 0], [0, 0, -148, 6, 0, -27, 5, 0], [402, -208, 0, 0, 18, 0, 0, 38], [390, -127, 0, 0, -5, 0, 0, 21], [-138, -362, 0, 0, 30, 0, 0, -18], [0, 0, -94, 50, 0, -28, 40, 0], [0, 0, 41, 93, 0, -73, -13, 0], [0, 0, -111, -77, 0, -29, 3, 0], [0, 0, -10, -24, 0, 20, -80, 0], [530, 122, 0, 0, -48, 0, 0, 28], [310, 168, 0, 0, -16, 0, 0, 54], [-360, -40, 0, 0, -8, 0, 0, -17], [0, 0, -94, 204, 0, -1, -7, 0], [414, -43, 0, 0, 33, 0, 0, 5], [-298, 302, 0, 0, 4, 0, 0, -16], [0, 0, -21, -152, 0, -141, -28, 0], [0, 0, 20, -58, 0, -17, 123, 0], [0, 0, 125, -213, 0, -18, -12, 0], [400, -227, 0, 0, -53, 0, 0, -30], [0, 0, 3, -48, 0, -24, 200, 0], [0, 0, -30, -128, 0, -100, -78, 0], [258, -405, 0, 0, 2, 0, 0, -4], [150, 467, 0, 0, 35, 0, 0, -21], [0, 0, -74, -152, 0, 104, -22, 0], [212, -330, 0, 0, 38, 0, 0, 34], [-114, -151, 0, 0, -33, 0, 0, 79], [0, 0, 222, -54, 0, -41, 88, 0], [0, 0, -104, 298, 0, 1, -45, 0], [542, 175, 0, 0, 59, 0, 0, -41], [120, 5, 0, 0, 31, 0, 0, -58], [0, 0, -23, 182, 0, 81, -80, 0], [182, 215, 0, 0, -28, 0, 0, 14], [0, 0, 177, 143, 0, -88, 18, 0], [-324, -147, 0, 0, -37, 0, 0, -36], [0, 0, -84, 36, 0, -58, -4, 0], [78, 91, 0, 0, -123, 0, 0, -1], [-238, -49, 0, 0, -16, 0, 0, 62], [0, 0, -100, 96, 0, 10, 186, 0], [0, 0, -76, -10, 0, -9, -156, 0], [0, 0, 223, 64, 0, -105, -92, 0], [28, -330, 0, 0, 50, 0, 0, 36], [28, -209, 0, 0, 25, 0, 0, -58], [-344, -158, 0, 0, -36, 0, 0, 10], [34, -397, 0, 0, 68, 0, 0, 14], [0, 0, 3, -445, 0, -20, -56, 0], [0, 0, 185, 84, 0, 85, 148, 0], [0, 0, 41, -81, 0, -122, 220, 0], [0, 0, 54, -252, 0, 146, 2, 0], [0, 0, -3, 127, 0, -63, 137, 0], [-294, -18, 0, 0, -66, 0, 0, 34], [0, 0, -280, -144, 0, -36, 28, 0], [4, 158, 0, 0, 58, 0, 0, -23], [-210, 370, 0, 0, 16, 0, 0, 42], [390, 85, 0, 0, 63, 0, 0, 11], [0, 0, 141, 188, 0, -224, -112, 0], [0, 0, -2, -4, 0, -81, -79, 0], [0, 0, 91, -34, 0, 77, -184, 0], [0, 0, 39, 187, 0, -88, -144, 0], [0, 0, 114, -158, 0, 3, -2, 0], [166, 147, 0, 0, -55, 0, 0, -1], [-226, -251, 0, 0, 74, 0, 0, 24], [0, 0, -113, -259, 0, -62, -156, 0], [-462, -446, 0, 0, 2, 0, 0, 10], [0, 0, -208, 174, 0, 153, -29, 0], [18, 216, 0, 0, -66, 0, 0, 68], [128, -737, 0, 0, -31, 0, 0, 38], [510, 264, 0, 0, 22, 0, 0, -24], [0, 0, 63, 115, 0, 40, 152, 0], [0, 0, -149, 364, 0, -112, 168, 0], [0, 0, 101, -355, 0, 19, -33, 0], [-266, -3, 0, 0, -101, 0, 0, 37], [-1034, 262, 0, 0, 50, 0, 0, 38], [84, -90, 0, 0, -86, 0, 0, 2], [0, 0, -122, -90, 0, -30, -368, 0], [126, 65, 0, 0, 45, 0, 0, -35], [0, 0, 204, -100, 0, -128, 46, 0], [642, -638, 0, 0, -94, 0, 0, -52], [0, 0, 33, 66, 0, 73, 220, 0], [-372, -506, 0, 0, -16, 0, 0, -46], [0, 0, 291, 137, 0, 151, 51, 0], [214, 551, 0, 0, 105, 0, 0, -33], [0, 0, 281, -198, 0, -62, -2, 0], [-868, 425, 0, 0, 3, 0, 0, -10], [90, 279, 0, 0, 22, 0, 0, -36], [0, 0, -18, 72, 0, 166, 228, 0], [0, 0, 137, -197, 0, -119, 345, 0], [402, -138, 0, 0, 28, 0, 0, -118], [-166, 105, 0, 0, 79, 0, 0, 51], [0, 0, -332, 82, 0, -69, 98, 0], [0, 0, 115, -146, 0, 45, 232, 0], [222, -148, 0, 0, 172, 0, 0, -2], [0, 0, 246, 114, 0, -64, -240, 0], [212, 463, 0, 0, 28, 0, 0, -16], [0, 0, 35, 153, 0, 171, 55, 0], [-90, -113, 0, 0, 81, 0, 0, 1], [0, 0, 219, -91, 0, -96, 234, 0], [760, -374, 0, 0, 4, 0, 0, 70], [0, 0, 200, 84, 0, 110, -158, 0], [58, -379, 0, 0, 106, 0, 0, -52], [0, 0, 412, -208, 0, 26, -72, 0], [0, 0, 17, 22, 0, 231, 156, 0], [-116, 487, 0, 0, 5, 0, 0, 42], [756, 524, 0, 0, -112, 0, 0, 44], [0, 0, -253, -95, 0, 23, -225, 0], [574, 227, 0, 0, -47, 0, 0, -55], [0, 0, 269, 31, 0, 26, -364, 0], [18, 589, 0, 0, 12, 0, 0, -70], [448, 565, 0, 0, 76, 0, 0, 4], [0, 0, 179, -205, 0, -214, 258, 0], [0, 0, -70, -172, 0, 229, 229, 0], [290, 530, 0, 0, 26, 0, 0, -88], [0, 0, 82, 36, 0, -40, 472, 0], [0, 0, 21, -508, 0, -164, -116, 0], [0, 0, 383, -110, 0, -67, 180, 0], [0, 0, 300, -60, 0, -176, -46, 0], [0, 0, 59, 425, 0, 182, -100, 0], [0, 0, -272, -152, 0, 300, 62, 0], [-404, 79, 0, 0, 81, 0, 0, -78], [-156, -148, 0, 0, 56, 0, 0, -55], [0, 0, 124, 370, 0, 269, 84, 0], [-132, 651, 0, 0, 40, 0, 0, -32], [0, 0, 37, 233, 0, -127, -231, 0], [-622, 422, 0, 0, 118, 0, 0, 98], [0, 0, 10, 202, 0, -20, 344, 0], [0, 0, 158, 428, 0, -105, 197, 0], [0, 0, -243, 368, 0, 51, -284, 0], [-1066, 624, 0, 0, -10, 0, 0, 44], [0, 0, -159, -117, 0, 245, 289, 0], [758, -1, 0, 0, 109, 0, 0, -83], [62, 367, 0, 0, -5, 0, 0, -47], [-682, -295, 0, 0, -172, 0, 0, 54], [0, 0, 42, -326, 0, -59, 246, 0], [-310, 94, 0, 0, -54, 0, 0, 18], [780, 146, 0, 0, -32, 0, 0, -20], [0, 0, 154, 346, 0, -28, -270, 0], [84, -1061, 0, 0, -10, 0, 0, 34], [0, 0, 231, -69, 0, -12, 284, 0], [-384, -567, 0, 0, 3, 0, 0, -18], [0, 0, 178, 242, 0, -43, -154, 0], [-980, -121, 0, 0, 125, 0, 0, 20], [-830, 65, 0, 0, 80, 0, 0, 10], [0, 0, -228, -590, 0, -189, -316, 0], [570, -140, 0, 0, 150, 0, 0, -86], [728, 226, 0, 0, -78, 0, 0, 73], [0, 0, -20, -590, 0, 147, -4, 0], [0, 0, 182, 130, 0, -364, -162, 0], [0, 0, 29, -182, 0, -81, -452, 0], [-1050, 416, 0, 0, -132, 0, 0, 2], [498, 571, 0, 0, 53, 0, 0, -31], [0, 0, -224, 488, 0, -154, 28, 0], [-1478, -151, 0, 0, -49, 0, 0, 3], [0, 0, -242, 332, 0, 70, 98, 0], [0, 0, 524, -176, 0, 74, 58, 0], [202, 642, 0, 0, 72, 0, 0, 100], [0, 0, 55, -57, 0, 63, -313, 0], [0, 0, 182, -220, 0, 173, -233, 0], [0, 0, -606, -302, 0, -111, -236, 0], [0, 0, -136, -266, 0, 155, 387, 0], [406, 1156, 0, 0, 72, 0, 0, -26], [-232, 745, 0, 0, 75, 0, 0, 56], [240, 566, 0, 0, -136, 0, 0, 38], [0, 0, -221, -99, 0, -109, 243, 0], [-44, -761, 0, 0, -171, 0, 0, 0], [0, 0, 117, 6, 0, -121, -372, 0], [0, 0, 195, 389, 0, 35, 91, 0], [-970, 203, 0, 0, 93, 0, 0, 25], [692, -535, 0, 0, 36, 0, 0, -28], [0, 0, -358, -94, 0, 25, 506, 0], [0, 0, -129, -7, 0, 89, 497, 0], [0, 0, -197, -356, 0, -11, 156, 0], [-754, -576, 0, 0, -140, 0, 0, -10], [666, 457, 0, 0, 3, 0, 0, -77], [0, 0, -499, -52, 0, 148, -92, 0], [0, 0, -401, 394, 0, -35, 180, 0], [0, 0, -269, 513, 0, 40, -2, 0], [0, 0, 212, 308, 0, -310, -256, 0], [498, -696, 0, 0, 16, 0, 0, -22], [0, 0, -93, 45, 0, -158, -160, 0], [62, 896, 0, 0, 76, 0, 0, -68], [-838, -757, 0, 0, -35, 0, 0, -81], [0, 0, -117, 62, 0, -305, 344, 0], [144, -326, 0, 0, -20, 0, 0, 60], [0, 0, -147, -50, 0, 89, -264, 0], [324, 612, 0, 0, 56, 0, 0, -140], [0, 0, 269, 278, 0, 211, -236, 0], [0, 0, -308, -118, 0, 347, -76, 0], [-330, -7, 0, 0, -149, 0, 0, 69], [376, -336, 0, 0, -36, 0, 0, 42], [1110, -16, 0, 0, 16, 0, 0, 82], [0, 0, -38, -428, 0, -131, 123, 0], [0, 0, -100, -552, 0, -340, -214, 0], [-504, 64, 0, 0, -82, 0, 0, -46], [0, 0, -590, -62, 0, -4, -252, 0], [0, 0, 41, 306, 0, -184, -46, 0], [0, 0, 394, -432, 0, -330, 536, 0], [896, -351, 0, 0, 15, 0, 0, 100], [-110, -1074, 0, 0, -56, 0, 0, 16], [948, -350, 0, 0, 178, 0, 0, 59], [0, 0, -38, -46, 0, -199, 166, 0], [0, 0, 43, 283, 0, -102, -6, 0], [546, -778, 0, 0, 86, 0, 0, -34], [0, 0, -28, 136, 0, -40, 542, 0], [386, -145, 0, 0, -29, 0, 0, 147], [0, 0, 438, -168, 0, -11, 295, 0], [-730, 1172, 0, 0, -112, 0, 0, -40], [0, 0, -379, -397, 0, 195, 179, 0], [0, 0, 156, 4, 0, -68, 682, 0], [0, 0, -427, -855, 0, 108, 192, 0], [0, 0, 354, -148, 0, -571, 119, 0], [0, 0, -250, 28, 0, 326, -12, 0], [0, 0, 339, 132, 0, -574, -56, 0], [762, -253, 0, 0, -123, 0, 0, 179], [416, -1276, 0, 0, -186, 0, 0, 18]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1764_d_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1764_3_d_h();".
// 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_1764_3_d_h(:prec:=8)
    chi := MakeCharacter_1764_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_1764_3_d_h();".
// 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_1764_3_d_h( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1764_d();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<5,R![196, 0, 1088, 0, 1052, 0, 64, 0, 1]>,<11,R![3292, 48, -124, 0, 1]>],Snew);
    return Vf;
end function;