
// Make newform 1152.3.m.d in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1152_m();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1152_m_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_1152_3_m_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_1152_3_m_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 := [65536, 0, -24576, 0, 2560, 0, 1408, 0, -752, 0, 88, 0, 10, 0, -6, 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, 0, 0, 0], [-20480, 0, -24064, 0, 5504, 0, 944, 0, -472, 0, 110, 0, 14, 0, -5, 0], [409600, 0, 22016, 0, -13696, 0, 4880, 0, -712, 0, -214, 0, -22, 0, 1, 0], [0, -167936, 0, 9728, 0, 26624, 0, -1360, 0, -424, 0, 326, 0, -34, 0, -17], [0, 26624, 0, 30208, 0, -9536, 0, -1328, 0, 784, 0, -170, 0, -14, 0, 11], [0, 51200, 0, -1024, 0, -4032, 0, 816, 0, -48, 0, -62, 0, 6, 0, 1], [188416, 0, 3584, 0, 3200, 0, -4144, 0, 344, 0, -94, 0, -94, 0, 13, 0], [0, -94208, 0, -512, 0, 6656, 0, -880, 0, 8, 0, 114, 0, -6, 0, -3], [237568, 0, -70144, 0, -6784, 0, 6928, 0, -1448, 0, -70, 0, 74, 0, -7, 0], [0, -151552, 0, 94720, 0, -2048, 0, -6416, 0, 1912, 0, -98, 0, -74, 0, 11], [0, 137216, 0, -51200, 0, -1088, 0, 4336, 0, -1088, 0, 34, 0, 46, 0, -7], [0, 135680, 0, -51968, 0, -2672, 0, 4600, 0, -1142, 0, 4, 0, 55, 0, -7], [778240, 0, -64000, 0, -76672, 0, 10832, 0, -616, 0, -1006, 0, 146, 0, 37, 0], [65536, 0, -150016, 0, 33152, 0, 10640, 0, -4072, 0, 554, 0, 122, 0, -47, 0], [0, 987136, 0, -506368, 0, -256, 0, 41072, 0, -10408, 0, 398, 0, 470, 0, -77], [-1163264, 0, 492032, 0, 16256, 0, -43024, 0, 10760, 0, -202, 0, -490, 0, 79, 0]];
    Rf_basisdens := [1, 12288, 12288, 24576, 12288, 1024, 12288, 2048, 4096, 6144, 3072, 3072, 12288, 12288, 24576, 12288];
    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_1152_m();"
function MakeCharacter_1152_m()
    N := 1152;
    order := 4;
    char_gens := [127, 901, 641];
    v := [2, 1, 4];
    // 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_1152_m_Hecke();"
function MakeCharacter_1152_m_Hecke(Kf)
    N := 1152;
    order := 4;
    char_gens := [127, 901, 641];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 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, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 1, 0], [-2, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 0, 0, -1, 1, -1, 0, 0, -1, 0], [0, 0, 0, 0, -1, 1, 0, 0, 0, -1, 0, 0, 0, 0, -2, 0], [0, -8, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1], [-6, 6, -2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 2, 0, 0], [0, 0, 0, -2, 2, 2, 0, 1, 0, 0, 0, -1, 0, 0, 1, 0], [-2, -2, 0, 0, 0, 0, -1, 0, 2, 0, 0, 0, 0, -2, 0, -3], [0, 0, 0, 3, -3, -1, 0, 3, 0, 0, 0, 1, 0, 0, -1, 0], [0, 0, 0, -3, 0, 1, 0, 2, 0, 1, -2, -2, 0, 0, 0, 0], [0, 0, 0, 0, -6, 1, 0, 3, 0, -1, 3, 0, 0, 0, -2, 0], [2, 2, 0, 0, 0, 0, -2, 0, 6, 0, 0, 0, 0, -6, 0, -1], [-16, 16, -2, 0, 0, 0, 0, 0, 2, 0, 0, 0, -2, 2, 0, 0], [0, 0, 0, -6, -6, 0, 0, 0, 0, -4, 0, 2, 0, 0, 2, 0], [0, -6, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, -6, 0, 2], [0, 8, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, -2, 1, 0, -2], [0, 0, 0, 13, 0, -4, 0, 0, 0, -4, 0, -3, 0, 0, 0, 0], [0, 0, 0, 6, -6, 6, 0, 2, 0, 0, 0, 4, 0, 0, -4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, -2, 0, 0, 2], [0, 0, 0, 1, 0, 2, 0, 6, 0, 2, -6, 8, 0, 0, 0, 0], [-24, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 1, 0, 0, -1], [0, 0, 0, 0, 16, 3, 0, 5, 0, -3, 5, 0, 0, 0, -4, 0], [-4, -4, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 8, 0, 1], [0, 0, 0, 8, 8, 0, 0, 0, 0, -4, -4, 0, 0, 0, 0, 0], [0, -32, -3, 0, 0, 0, -3, 0, 0, 0, 0, 0, 1, -3, 0, 1], [0, 0, 0, -18, 0, -4, 0, 0, 0, -4, 0, -2, 0, 0, 0, 0], [0, 0, 0, 4, -4, 4, 0, 1, 0, 0, 0, -3, 0, 0, 3, 0], [-48, -48, 0, 0, 0, 0, 4, 0, -8, 0, 0, 0, 0, 8, 0, 4], [0, 0, 0, 1, 0, 0, 0, 2, 0, 0, -2, -4, 0, 0, 0, 0], [32, 0, -5, 0, 0, 0, 5, 0, 3, 0, 0, 0, 7, 0, 0, -7], [-4, -4, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 1], [-30, 30, 5, 0, 0, 0, 0, 0, -12, 0, 0, 0, 3, -12, 0, 0], [0, 0, 0, -19, -19, 0, 0, 0, 0, -3, 7, -9, 0, 0, -9, 0], [0, 0, 0, 0, -1, 3, 0, 4, 0, -3, 4, 0, 0, 0, -14, 0], [0, 0, 0, 16, 0, 1, 0, 7, 0, 1, -7, 12, 0, 0, 0, 0], [42, -42, 6, 0, 0, 0, 0, 0, -6, 0, 0, 0, 1, -6, 0, 0], [0, 0, 0, -3, 3, 1, 0, 5, 0, 0, 0, 15, 0, 0, -15, 0], [-4, 0, 1, 0, 0, 0, -1, 0, 18, 0, 0, 0, 8, 0, 0, -8], [0, 0, 0, -1, 0, 1, 0, -6, 0, 1, 6, -18, 0, 0, 0, 0], [-128, 0, -3, 0, 0, 0, 3, 0, 7, 0, 0, 0, 1, 0, 0, -1], [96, -96, 4, 0, 0, 0, 0, 0, -8, 0, 0, 0, -12, -8, 0, 0], [0, -120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12, -3, 0, -12], [0, 0, 0, -29, 0, 2, 0, -2, 0, 2, 2, -5, 0, 0, 0, 0], [2, -2, 2, 0, 0, 0, 0, 0, -10, 0, 0, 0, -7, -10, 0, 0], [0, 0, 0, -10, 10, -2, 0, -2, 0, 0, 0, 8, 0, 0, -8, 0], [0, 0, 0, 17, -17, -1, 0, -9, 0, 0, 0, -1, 0, 0, 1, 0], [-28, 0, -3, 0, 0, 0, 3, 0, 10, 0, 0, 0, -8, 0, 0, 8], [0, 0, 0, 0, -7, 2, 0, -6, 0, -2, -6, 0, 0, 0, 1, 0], [0, 0, 0, 18, 18, 0, 0, 0, 0, -2, 10, 8, 0, 0, 8, 0], [0, 0, 0, 6, 6, 0, 0, 0, 0, 10, -2, 10, 0, 0, 10, 0], [0, 0, 0, 0, -21, -10, 0, -8, 0, 10, -8, 0, 0, 0, 4, 0], [0, 168, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, -2, -9, 0, -2], [-54, 54, 2, 0, 0, 0, 0, 0, 6, 0, 0, 0, -1, 6, 0, 0], [0, 0, 0, 30, -30, -14, 0, -10, 0, 0, 0, -12, 0, 0, 12, 0], [112, 112, 0, 0, 0, 0, 6, 0, 26, 0, 0, 0, 0, -26, 0, -10], [0, 0, 0, -9, 0, -9, 0, -2, 0, -9, 2, 2, 0, 0, 0, 0], [112, -112, -6, 0, 0, 0, 0, 0, 6, 0, 0, 0, -6, 6, 0, 0], [0, 0, 0, 14, 14, 0, 0, 0, 0, 18, -2, 18, 0, 0, 18, 0], [0, -44, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, -8, -30, 0, -8], [0, 0, 0, 0, 27, -10, 0, 2, 0, 10, 2, 0, 0, 0, 24, 0], [-128, -128, 0, 0, 0, 0, -12, 0, -12, 0, 0, 0, 0, 12, 0, -12], [90, 0, 15, 0, 0, 0, -15, 0, 6, 0, 0, 0, 2, 0, 0, -2], [0, 0, 0, 0, 9, -8, 0, 0, 0, 8, 0, 0, 0, 0, -23, 0], [118, 118, 0, 0, 0, 0, -18, 0, -2, 0, 0, 0, 0, 2, 0, -7], [0, 0, 0, -10, -10, 0, 0, 0, 0, -2, 22, -12, 0, 0, -12, 0], [0, 0, 0, -16, -16, 0, 0, 0, 0, 10, -30, 4, 0, 0, 4, 0], [0, 184, 11, 0, 0, 0, 11, 0, 0, 0, 0, 0, 3, 7, 0, 3], [52, -52, -16, 0, 0, 0, 0, 0, 24, 0, 0, 0, -9, 24, 0, 0], [194, 194, 0, 0, 0, 0, -11, 0, -22, 0, 0, 0, 0, 22, 0, -9], [0, 0, 0, 27, -27, -9, 0, -21, 0, 0, 0, 9, 0, 0, -9, 0], [0, 0, 0, -21, 0, -1, 0, -8, 0, -1, 8, -2, 0, 0, 0, 0], [48, 48, 0, 0, 0, 0, 4, 0, 28, 0, 0, 0, 0, -28, 0, -25], [0, 0, 0, -64, -64, 0, 0, 0, 0, -8, 21, -13, 0, 0, -13, 0], [0, -20, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 6, 12, 0, 6], [0, 0, 0, 45, 0, 6, 0, -2, 0, 6, 2, 21, 0, 0, 0, 0], [-42, 42, -2, 0, 0, 0, 0, 0, 10, 0, 0, 0, 17, 10, 0, 0], [0, 0, 0, -7, 7, 19, 0, 3, 0, 0, 0, 15, 0, 0, -15, 0], [28, 0, -2, 0, 0, 0, 2, 0, 20, 0, 0, 0, -10, 0, 0, 10], [272, 0, -13, 0, 0, 0, 13, 0, -39, 0, 0, 0, -9, 0, 0, 9], [0, 0, 0, 0, 13, -10, 0, -6, 0, 10, -6, 0, 0, 0, 5, 0], [0, 0, 0, 2, 2, 0, 0, 0, 0, 30, -5, 7, 0, 0, 7, 0], [0, -48, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 2, 40, 0, 2], [0, 0, 0, 0, 29, 1, 0, 14, 0, -1, 14, 0, 0, 0, -22, 0], [0, 336, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 3, 35, 0, 3], [0, 0, 0, -83, 0, 14, 0, 18, 0, 14, -18, 21, 0, 0, 0, 0], [0, 0, 0, 44, -44, 6, 0, -6, 0, 0, 0, -8, 0, 0, 8, 0], [-376, 0, 4, 0, 0, 0, -4, 0, -3, 0, 0, 0, 16, 0, 0, -16], [0, 0, 0, 0, -50, -18, 0, -10, 0, 18, -10, 0, 0, 0, 38, 0], [288, -288, -2, 0, 0, 0, 0, 0, 6, 0, 0, 0, -2, 6, 0, 0], [0, 0, 0, -4, -4, 0, 0, 0, 0, -10, -2, -8, 0, 0, -8, 0], [0, 0, 0, 0, -67, 3, 0, 10, 0, -3, 10, 0, 0, 0, -50, 0], [0, 0, 0, 30, -30, 2, 0, -27, 0, 0, 0, -29, 0, 0, 29, 0], [-226, -226, 0, 0, 0, 0, -3, 0, -28, 0, 0, 0, 0, 28, 0, -5], [182, 182, 0, 0, 0, 0, -6, 0, 2, 0, 0, 0, 0, -2, 0, 17], [-274, 274, 17, 0, 0, 0, 0, 0, -38, 0, 0, 0, -29, -38, 0, 0], [0, 0, 0, 0, 15, 0, 0, -22, 0, 0, -22, 0, 0, 0, 20, 0], [0, 0, 0, -41, 0, -14, 0, -14, 0, -14, 14, 15, 0, 0, 0, 0], [0, 0, 0, -50, 50, 10, 0, 3, 0, 0, 0, 25, 0, 0, -25, 0], [288, 288, 0, 0, 0, 0, 22, 0, -42, 0, 0, 0, 0, 42, 0, 6], [-2, 0, 13, 0, 0, 0, -13, 0, 18, 0, 0, 0, -6, 0, 0, 6], [0, 0, 0, 0, 16, 2, 0, 22, 0, -2, 22, 0, 0, 0, -8, 0], [0, 0, 0, -72, -72, 0, 0, 0, 0, 12, -24, 20, 0, 0, 20, 0], [0, 0, 0, -33, -33, 0, 0, 0, 0, -11, 3, 9, 0, 0, 9, 0], [0, 10, -15, 0, 0, 0, -15, 0, 0, 0, 0, 0, -6, -70, 0, -6], [0, -256, -19, 0, 0, 0, -19, 0, 0, 0, 0, 0, 17, 53, 0, 17], [24, -24, 28, 0, 0, 0, 0, 0, 12, 0, 0, 0, -15, 12, 0, 0], [0, 0, 0, -56, 56, 8, 0, 36, 0, 0, 0, 12, 0, 0, -12, 0], [-240, -240, 0, 0, 0, 0, -28, 0, 12, 0, 0, 0, 0, -12, 0, 20], [488, 0, -12, 0, 0, 0, 12, 0, 59, 0, 0, 0, 16, 0, 0, -16], [0, 0, 0, 0, 0, 0, 0, 0, 0, -24, -3, -37, 0, 0, -37, 0], [-306, 306, 23, 0, 0, 0, 0, 0, 32, 0, 0, 0, -23, 32, 0, 0], [0, 0, 0, -7, -7, 0, 0, 0, 0, -25, -23, 7, 0, 0, 7, 0], [0, 0, 0, 0, 1, 17, 0, 18, 0, -17, 18, 0, 0, 0, 34, 0], [0, 0, 0, 10, 0, -6, 0, 18, 0, -6, -18, 34, 0, 0, 0, 0], [-240, 240, 8, 0, 0, 0, 0, 0, -8, 0, 0, 0, -23, -8, 0, 0], [-172, 0, -22, 0, 0, 0, 22, 0, -4, 0, 0, 0, 18, 0, 0, -18], [0, 0, 0, -61, 0, -4, 0, 2, 0, -4, -2, -60, 0, 0, 0, 0], [0, 0, 0, 0, -131, 20, 0, 20, 0, -20, 20, 0, 0, 0, -51, 0], [414, -414, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0], [0, 0, 0, 0, 77, 8, 0, -8, 0, -8, -8, 0, 0, 0, -16, 0], [130, -130, 22, 0, 0, 0, 0, 0, 58, 0, 0, 0, 39, 58, 0, 0], [0, 0, 0, 2, -2, 36, 0, 48, 0, 0, 0, 10, 0, 0, -10, 0], [472, 0, 7, 0, 0, 0, -7, 0, -3, 0, 0, 0, 23, 0, 0, -23], [278, 278, 0, 0, 0, 0, 14, 0, -18, 0, 0, 0, 0, 18, 0, -17], [-224, 224, 14, 0, 0, 0, 0, 0, -22, 0, 0, 0, 62, -22, 0, 0], [0, 0, 0, 11, 11, 0, 0, 0, 0, 1, 39, 13, 0, 0, 13, 0], [0, 464, -2, 0, 0, 0, -2, 0, 0, 0, 0, 0, 14, 19, 0, 14], [414, -414, 18, 0, 0, 0, 0, 0, -34, 0, 0, 0, -55, -34, 0, 0], [0, 0, 0, -82, 82, 2, 0, 25, 0, 0, 0, -41, 0, 0, 41, 0], [12, 0, -13, 0, 0, 0, 13, 0, 102, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -63, 0, 22, 0, 30, 0, 22, -30, 32, 0, 0, 0, 0], [418, -418, -29, 0, 0, 0, 0, 0, -30, 0, 0, 0, -31, -30, 0, 0], [0, 0, 0, 0, -21, 28, 0, 0, 0, -28, 0, 0, 0, 0, 24, 0], [0, 0, 0, -22, 22, 46, 0, -49, 0, 0, 0, 1, 0, 0, -1, 0], [-286, -286, 0, 0, 0, 0, 9, 0, 6, 0, 0, 0, 0, -6, 0, 11], [0, 0, 0, 21, 0, -4, 0, 20, 0, -4, -20, 32, 0, 0, 0, 0], [376, 0, -14, 0, 0, 0, 14, 0, -65, 0, 0, 0, 30, 0, 0, -30], [0, 0, 0, 0, 74, 25, 0, 3, 0, -25, 3, 0, 0, 0, 14, 0], [-244, -244, 0, 0, 0, 0, -40, 0, 48, 0, 0, 0, 0, -48, 0, -17], [0, 0, 0, 14, 14, 0, 0, 0, 0, -42, -6, -22, 0, 0, -22, 0], [-460, 460, 0, 0, 0, 0, 0, 0, -56, 0, 0, 0, 23, -56, 0, 0], [0, 0, 0, 68, -68, 28, 0, 49, 0, 0, 0, 53, 0, 0, -53, 0], [510, 510, 0, 0, 0, 0, -27, 0, 12, 0, 0, 0, 0, -12, 0, -29], [0, 0, 0, -35, 35, 13, 0, 17, 0, 0, 0, 23, 0, 0, -23, 0], [-350, -350, 0, 0, 0, 0, 30, 0, 38, 0, 0, 0, 0, -38, 0, -39], [0, 0, 0, 30, 30, 0, 0, 0, 0, 10, -58, 0, 0, 0, 0, 0], [270, -270, 5, 0, 0, 0, 0, 0, 30, 0, 0, 0, -9, 30, 0, 0], [0, 0, 0, 8, 8, 0, 0, 0, 0, -14, 66, -68, 0, 0, -68, 0], [-526, -526, 0, 0, 0, 0, 27, 0, 12, 0, 0, 0, 0, -12, 0, -19], [0, 0, 0, 5, -5, -17, 0, -1, 0, 0, 0, 19, 0, 0, -19, 0], [728, 0, -10, 0, 0, 0, 10, 0, -9, 0, 0, 0, -30, 0, 0, 30], [0, 0, 0, 2, 2, 0, 0, 0, 0, 38, -55, 81, 0, 0, 81, 0], [0, 194, -4, 0, 0, 0, -4, 0, 0, 0, 0, 0, 56, -40, 0, 56], [0, 0, 0, 0, 73, 27, 0, 34, 0, -27, 34, 0, 0, 0, -34, 0], [0, 0, 0, 160, 0, 9, 0, 7, 0, 9, -7, 92, 0, 0, 0, 0], [0, 0, 0, -114, 114, -6, 0, -17, 0, 0, 0, -43, 0, 0, 43, 0], [-136, 0, 34, 0, 0, 0, -34, 0, 95, 0, 0, 0, -18, 0, 0, 18], [0, 0, 0, 0, -33, 0, 0, -44, 0, 0, -44, 0, 0, 0, 127, 0], [0, 0, 0, -82, -82, 0, 0, 0, 0, -30, -1, -1, 0, 0, -1, 0], [0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 48, -12, 0, 0, -12, 0], [0, -784, 14, 0, 0, 0, 14, 0, 0, 0, 0, 0, -2, 61, 0, -2], [-342, 342, -74, 0, 0, 0, 0, 0, 10, 0, 0, 0, -31, 10, 0, 0], [-212, 0, -10, 0, 0, 0, 10, 0, -76, 0, 0, 0, -14, 0, 0, 14], [0, 0, 0, 53, 0, -45, 0, -12, 0, -45, 12, -34, 0, 0, 0, 0], [0, 0, 0, 0, -126, 22, 0, 6, 0, -22, 6, 0, 0, 0, -38, 0], [-456, -456, 0, 0, 0, 0, -40, 0, 40, 0, 0, 0, 0, -40, 0, 31], [0, 0, 0, -81, -81, 0, 0, 0, 0, 39, 37, -19, 0, 0, -19, 0], [0, -38, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, -24, 16, 0, -24], [0, 112, 48, 0, 0, 0, 48, 0, 0, 0, 0, 0, -40, -89, 0, -40], [0, 0, 0, -38, 38, 14, 0, -10, 0, 0, 0, -56, 0, 0, 56, 0], [368, 368, 0, 0, 0, 0, 2, 0, 22, 0, 0, 0, 0, -22, 0, -14], [0, 0, 0, -113, 0, 22, 0, 2, 0, 22, -2, 24, 0, 0, 0, 0], [-672, 0, 3, 0, 0, 0, -3, 0, 3, 0, 0, 0, -17, 0, 0, 17], [-270, -270, 0, 0, 0, 0, -38, 0, -22, 0, 0, 0, 0, 22, 0, -9], [0, -344, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 40, 139, 0, 40], [0, 0, 0, -161, 0, -8, 0, -4, 0, -8, 4, 31, 0, 0, 0, 0], [120, -120, 20, 0, 0, 0, 0, 0, -12, 0, 0, 0, 47, -12, 0, 0], [0, 0, 0, 2, -2, -10, 0, -18, 0, 0, 0, 8, 0, 0, -8, 0], [0, 0, 0, 67, -67, -53, 0, -17, 0, 0, 0, 9, 0, 0, -9, 0], [0, 0, 0, -151, 0, 17, 0, -24, 0, 17, 24, -14, 0, 0, 0, 0], [394, 394, 0, 0, 0, 0, 62, 0, -10, 0, 0, 0, 0, 10, 0, -71], [-432, 432, -34, 0, 0, 0, 0, 0, 78, 0, 0, 0, -18, 78, 0, 0], [0, -436, 39, 0, 0, 0, 39, 0, 0, 0, 0, 0, -16, -114, 0, -16], [0, 0, 0, -200, 200, 24, 0, 16, 0, 0, 0, -8, 0, 0, 8, 0], [190, 0, -10, 0, 0, 0, 10, 0, -36, 0, 0, 0, -16, 0, 0, 16], [0, 0, 0, 0, 146, -41, 0, -11, 0, 41, -11, 0, 0, 0, -50, 0], [32, -32, -34, 0, 0, 0, 0, 0, -18, 0, 0, 0, 62, -18, 0, 0], [0, 0, 0, 0, -3, -17, 0, 36, 0, 17, 36, 0, 0, 0, -6, 0], [0, 0, 0, 118, 0, 22, 0, -2, 0, 22, 2, 30, 0, 0, 0, 0], [0, 0, 0, 4, -4, -44, 0, 36, 0, 0, 0, 16, 0, 0, -16, 0], [50, 0, -45, 0, 0, 0, 45, 0, 14, 0, 0, 0, 62, 0, 0, -62], [-634, -634, 0, 0, 0, 0, 18, 0, 26, 0, 0, 0, 0, -26, 0, -79], [0, 0, 0, -18, -18, 0, 0, 0, 0, -6, 30, -40, 0, 0, -40, 0], [0, 0, 0, -156, -156, 0, 0, 0, 0, 46, -2, -32, 0, 0, -32, 0], [0, 0, 0, 0, 187, -38, 0, -38, 0, 38, -38, 0, 0, 0, 160, 0], [0, 392, -15, 0, 0, 0, -15, 0, 0, 0, 0, 0, -23, 113, 0, -23], [-764, 764, -8, 0, 0, 0, 0, 0, 80, 0, 0, 0, -7, 80, 0, 0], [118, 0, 1, 0, 0, 0, -1, 0, -70, 0, 0, 0, -10, 0, 0, 10], [0, 0, 0, 0, 53, 62, 0, -10, 0, -62, -10, 0, 0, 0, -19, 0], [0, 0, 0, 0, -149, -39, 0, -28, 0, 39, -28, 0, 0, 0, 70, 0], [0, -728, -12, 0, 0, 0, -12, 0, 0, 0, 0, 0, 40, -123, 0, 40], [0, 0, 0, -19, 0, 18, 0, -94, 0, 18, 94, -91, 0, 0, 0, 0], [0, 0, 0, 16, -16, -28, 0, -76, 0, 0, 0, -8, 0, 0, 8, 0], [-238, -238, 0, 0, 0, 0, -47, 0, 54, 0, 0, 0, 0, -54, 0, -29], [60, 0, 25, 0, 0, 0, -25, 0, 50, 0, 0, 0, 48, 0, 0, -48], [0, 0, 0, 117, 0, -28, 0, 10, 0, -28, -10, 4, 0, 0, 0, 0], [128, 0, -27, 0, 0, 0, 27, 0, 133, 0, 0, 0, 57, 0, 0, -57], [0, 0, 0, 0, -98, -25, 0, -51, 0, 25, -51, 0, 0, 0, 122, 0], [0, 0, 0, -98, -98, 0, 0, 0, 0, 16, -44, 30, 0, 0, 30, 0], [0, 304, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, -18, 184, 0, -18], [0, 120, -55, 0, 0, 0, -55, 0, 0, 0, 0, 0, 25, 3, 0, 25], [0, 0, 0, 46, 46, 0, 0, 0, 0, -22, 29, 25, 0, 0, 25, 0], [0, 0, 0, 177, 177, 0, 0, 0, 0, 43, -75, 87, 0, 0, 87, 0], [0, 0, 0, 0, -3, -6, 0, 66, 0, 6, 66, 0, 0, 0, -80, 0], [-64, 64, 20, 0, 0, 0, 0, 0, -12, 0, 0, 0, 31, -12, 0, 0], [-400, 0, -50, 0, 0, 0, 50, 0, 147, 0, 0, 0, -50, 0, 0, 50], [0, 0, 0, 28, 28, 0, 0, 0, 0, 60, 43, -7, 0, 0, -7, 0], [0, 608, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, -6, -195, 0, -6], [0, 0, 0, 41, 0, -14, 0, 18, 0, -14, -18, 97, 0, 0, 0, 0], [-856, 856, 60, 0, 0, 0, 0, 0, 28, 0, 0, 0, -49, 28, 0, 0], [0, 0, 0, -84, 84, -80, 0, 8, 0, 0, 0, -48, 0, 0, 48, 0], [0, 0, 0, -110, 110, 78, 0, 30, 0, 0, 0, 14, 0, 0, -14, 0], [328, 0, 58, 0, 0, 0, -58, 0, 143, 0, 0, 0, 46, 0, 0, -46], [0, 0, 0, 0, 70, -32, 0, -20, 0, 32, -20, 0, 0, 0, -58, 0], [-392, -392, 0, 0, 0, 0, -36, 0, 36, 0, 0, 0, 0, -36, 0, 73], [-270, 270, 23, 0, 0, 0, 0, 0, 30, 0, 0, 0, -27, 30, 0, 0], [0, 368, -43, 0, 0, 0, -43, 0, 0, 0, 0, 0, -63, -27, 0, -63], [0, 0, 0, -82, 82, -6, 0, 54, 0, 0, 0, -20, 0, 0, 20, 0], [-62, -62, 0, 0, 0, 0, 29, 0, 34, 0, 0, 0, 0, -34, 0, -1], [0, 0, 0, 6, -6, 4, 0, 0, 0, 0, 0, 62, 0, 0, -62, 0], [-296, 0, -68, 0, 0, 0, 68, 0, -48, 0, 0, 0, -6, 0, 0, 6], [0, 0, 0, -275, 0, -44, 0, -38, 0, -44, 38, -124, 0, 0, 0, 0], [0, 0, 0, 0, -49, 16, 0, -64, 0, -16, -64, 0, 0, 0, 15, 0], [0, 0, 0, -123, -123, 0, 0, 0, 0, -25, 73, -93, 0, 0, -93, 0], [0, 0, 0, -17, 0, -24, 0, -28, 0, -24, 28, -81, 0, 0, 0, 0], [-208, -208, 0, 0, 0, 0, -26, 0, 146, 0, 0, 0, 0, -146, 0, 54], [200, 0, -15, 0, 0, 0, 15, 0, -141, 0, 0, 0, -79, 0, 0, 79], [732, 732, 0, 0, 0, 0, -36, 0, 44, 0, 0, 0, 0, -44, 0, -23], [0, 0, 0, 60, 60, 0, 0, 0, 0, -60, -8, 36, 0, 0, 36, 0], [0, 0, 0, -88, -88, 0, 0, 0, 0, -18, -10, -92, 0, 0, -92, 0], [0, 176, -46, 0, 0, 0, -46, 0, 0, 0, 0, 0, -14, -107, 0, -14], [0, 0, 0, 76, 0, -7, 0, -1, 0, -7, 1, 104, 0, 0, 0, 0], [96, 96, 0, 0, 0, 0, -54, 0, -130, 0, 0, 0, 0, 130, 0, 138], [0, 0, 0, 166, -166, -46, 0, -54, 0, 0, 0, -6, 0, 0, 6, 0], [-1068, -1068, 0, 0, 0, 0, -4, 0, -180, 0, 0, 0, 0, 180, 0, 57], [0, 0, 0, -72, -72, 0, 0, 0, 0, 20, -16, 68, 0, 0, 68, 0], [0, 0, 0, -3, -3, 0, 0, 0, 0, -5, -27, 51, 0, 0, 51, 0], [0, 178, -38, 0, 0, 0, -38, 0, 0, 0, 0, 0, 40, 4, 0, 40], [0, 0, 0, 0, 339, 37, 0, 46, 0, -37, 46, 0, 0, 0, 50, 0], [0, 0, 0, -238, 0, 57, 0, 59, 0, 57, -59, 14, 0, 0, 0, 0], [-1000, 1000, 48, 0, 0, 0, 0, 0, -32, 0, 0, 0, 23, -32, 0, 0], [-144, -144, 0, 0, 0, 0, 68, 0, 24, 0, 0, 0, 0, -24, 0, -124], [0, 0, 0, 117, 0, 15, 0, 52, 0, 15, -52, -10, 0, 0, 0, 0], [0, -284, 14, 0, 0, 0, 14, 0, 0, 0, 0, 0, 50, 132, 0, 50], [0, 328, -23, 0, 0, 0, -23, 0, 0, 0, 0, 0, -15, -93, 0, -15], [0, 0, 0, -150, 0, -7, 0, -13, 0, -7, 13, -90, 0, 0, 0, 0], [-148, 148, -84, 0, 0, 0, 0, 0, -28, 0, 0, 0, 97, -28, 0, 0], [1048, 1048, 0, 0, 0, 0, -16, 0, -16, 0, 0, 0, 0, 16, 0, 31], [0, 0, 0, -126, -126, 0, 0, 0, 0, -18, -59, -51, 0, 0, -51, 0], [32, -32, -58, 0, 0, 0, 0, 0, 150, 0, 0, 0, 134, 150, 0, 0], [0, 0, 0, 0, 169, -18, 0, -36, 0, 18, -36, 0, 0, 0, 12, 0], [0, 0, 0, 112, -112, 68, 0, 36, 0, 0, 0, -24, 0, 0, 24, 0], [270, 270, 0, 0, 0, 0, -65, 0, 106, 0, 0, 0, 0, -106, 0, 13], [0, 0, 0, 159, 0, -22, 0, 54, 0, -22, -54, 24, 0, 0, 0, 0], [790, 790, 0, 0, 0, 0, -18, 0, -34, 0, 0, 0, 0, 34, 0, -33], [-544, 544, -48, 0, 0, 0, 0, 0, -84, 0, 0, 0, -32, -84, 0, 0], [0, -830, 90, 0, 0, 0, 90, 0, 0, 0, 0, 0, 24, 68, 0, 24], [0, 112, 53, 0, 0, 0, 53, 0, 0, 0, 0, 0, -15, 55, 0, -15], [-418, 0, 12, 0, 0, 0, -12, 0, -168, 0, 0, 0, -24, 0, 0, 24], [288, 0, -12, 0, 0, 0, 12, 0, 47, 0, 0, 0, 36, 0, 0, -36], [0, 0, 0, 0, 115, 8, 0, -12, 0, -8, -12, 0, 0, 0, -13, 0], [-1072, -1072, 0, 0, 0, 0, 36, 0, -52, 0, 0, 0, 0, 52, 0, -7], [0, -298, 55, 0, 0, 0, 55, 0, 0, 0, 0, 0, 54, 182, 0, 54], [0, 0, 0, -86, 0, -7, 0, -37, 0, -7, 37, -58, 0, 0, 0, 0], [0, 0, 0, -98, 98, -94, 0, -30, 0, 0, 0, -126, 0, 0, 126, 0], [720, 0, -53, 0, 0, 0, 53, 0, -61, 0, 0, 0, -49, 0, 0, 49], [0, 0, 0, 19, 19, 0, 0, 0, 0, -99, 91, 61, 0, 0, 61, 0], [268, -268, -56, 0, 0, 0, 0, 0, 112, 0, 0, 0, 57, 112, 0, 0], [-286, -286, 0, 0, 0, 0, -3, 0, 82, 0, 0, 0, 0, -82, 0, -33], [0, 0, 0, -34, 34, -74, 0, -74, 0, 0, 0, -166, 0, 0, 166, 0], [268, 0, -7, 0, 0, 0, 7, 0, -94, 0, 0, 0, 88, 0, 0, -88], [0, 0, 0, -149, 0, 6, 0, 44, 0, 6, -44, 212, 0, 0, 0, 0], [-176, 0, 24, 0, 0, 0, -24, 0, -207, 0, 0, 0, -96, 0, 0, 96], [0, 0, 0, 202, 202, 0, 0, 0, 0, 26, -114, 80, 0, 0, 80, 0], [0, 0, 0, 0, -47, 61, 0, -26, 0, -61, -26, 0, 0, 0, 82, 0], [0, 0, 0, -184, 0, -83, 0, -53, 0, -83, 53, -172, 0, 0, 0, 0], [0, 0, 0, 260, -260, 8, 0, 84, 0, 0, 0, 20, 0, 0, -20, 0], [0, 0, 0, 0, -132, 41, 0, 95, 0, -41, 95, 0, 0, 0, -128, 0], [714, 714, 0, 0, 0, 0, 22, 0, -50, 0, 0, 0, 0, 50, 0, -7], [0, 0, 0, 0, -29, 7, 0, -98, 0, -7, -98, 0, 0, 0, 94, 0], [0, 640, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 56, -129, 0, 56], [0, 0, 0, -69, 0, -8, 0, 110, 0, -8, -110, 100, 0, 0, 0, 0], [0, 0, 0, 0, 293, 38, 0, 18, 0, -38, 18, 0, 0, 0, -35, 0], [190, -190, -15, 0, 0, 0, 0, 0, -190, 0, 0, 0, -77, -190, 0, 0], [0, -564, 69, 0, 0, 0, 69, 0, 0, 0, 0, 0, 48, -150, 0, 48], [0, 0, 0, 0, 203, -5, 0, 16, 0, 5, 16, 0, 0, 0, -54, 0], [0, 304, -36, 0, 0, 0, -36, 0, 0, 0, 0, 0, 4, 135, 0, 4]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1152_m_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1152_3_m_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_1152_3_m_d(:prec:=16)
    chi := MakeCharacter_1152_m();
    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_1152_3_m_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_1152_3_m_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1152_m();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<5,R![9834496, 0, 0, 0, 915505152, 0, 0, 0, 7641216, 0, 0, 0, 6656, 0, 0, 0, 1]>,<7,R![100, -352, -112, 0, 1]>],Snew);
    return Vf;
end function;