
// Make newform 1152.3.m.f 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_f();".
// 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_f();".
// 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, -4096, 2560, 3584, 1408, -512, -496, -128, 88, 56, 10, -4, -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], [-753664, -528384, -23552, 112128, 73472, 1792, -25632, -15600, -2928, 1848, 1156, 170, -168, -134, -18, 5], [10231808, 3719168, -3177472, -2271744, -499456, 454272, 450272, 88528, -66544, -59096, -11868, 5530, 4536, 1234, -626, -347], [-1228800, -172032, 537600, 350720, 73472, -60800, -52256, -5136, 11728, 8376, 1684, -610, -528, -90, 110, 47], [1974272, 837632, -429568, -377856, -110464, 67008, 75248, 19792, -8056, -9224, -2082, 730, 714, 226, -89, -53], [41107456, 22466560, -4517888, -7073280, -3026432, 829440, 1598464, 641360, -19520, -156376, -54888, 5306, 14076, 6626, -448, -751], [14581760, 13664256, 4019200, -1328640, -1689856, -394880, 442848, 431088, 157776, -2088, -25772, -9010, 2064, 3430, 1230, 119], [-12972032, -9620480, -88064, 2280960, 1233664, -54240, -517568, -275680, -35600, 40172, 22056, 998, -3852, -2572, -244, 197], [-26214400, -4268032, 12336128, 6971904, 775424, -1748352, -1269472, -106640, 278960, 189400, 26652, -21122, -14184, -2666, 2242, 1063], [-8568832, -20942848, -16144384, -2188800, 2557952, 1824000, 66368, -716144, -468448, -122744, 28992, 30658, 5076, -4022, -3884, -995], [-6232064, -3969536, 538624, 1184256, 502912, -102288, -257408, -113704, -1448, 25118, 9756, -622, -2232, -1153, 20, 134], [-6053888, 3770368, 7066624, 2511360, -303872, -897600, -372128, 127664, 190768, 82544, 1188, -12838, -5256, 302, 1574, 545], [13975552, -11743232, -18839552, -6455808, 922624, 2421504, 933184, -401488, -508256, -219304, -528, 35366, 13356, -1186, -4300, -1417], [-5570560, -1472512, 2561024, 1423872, 217088, -338496, -271264, -23888, 59984, 41008, 6228, -4406, -2856, -578, 526, 265], [-25296896, -3891200, 12133888, 6497280, 602752, -1754880, -1210544, -52720, 302680, 190016, 22218, -22786, -13986, -2326, 2693, 1181], [80101376, 28983296, -21873664, -16501248, -3795712, 3329664, 3347744, 698896, -462928, -427352, -85236, 37810, 33552, 9178, -4382, -2519]];
    Rf_basisdens := [1, 12288, 368640, 40960, 30720, 368640, 122880, 92160, 368640, 368640, 46080, 184320, 368640, 61440, 184320, 368640];
    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, 0, -1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 0, 2, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, -1, 1, 0, -1, 0, 1, 0, 0, 0, -1, -1], [0, 1, 0, 1, 0, 0, -1, -1, 0, -1, 0, 0, 0, 0, 0, 0], [2, 0, -2, 0, 0, 0, -1, 0, 0, 1, 0, 0, -1, 2, 0, 1], [8, -1, 0, -2, 0, 2, 0, 0, 0, 0, -2, 2, 0, -2, 2, 0], [2, 0, 2, -1, 0, 3, -1, -2, 1, 0, 0, 0, 0, 0, 2, 1], [0, 0, 8, 0, 0, 2, 0, -1, -1, 1, 1, -2, -1, 0, 0, 2], [6, 0, -6, -1, 0, 0, 0, 0, -1, 2, 0, -1, -2, -1, 0, -1], [0, 0, 0, 0, -3, -2, -2, 1, 3, -1, -2, 2, 0, 2, 2, 1], [-10, 0, -10, 2, 0, 2, -1, -1, -2, 0, 1, 0, 0, 0, -2, 1], [0, 0, 24, 0, 3, -2, 2, 0, -2, 0, 2, 2, 0, -2, -2, -2], [-10, 2, 10, 3, 2, 0, 1, 0, 3, 2, 0, 1, 2, -2, 0, -1], [-8, 0, -8, -2, 0, -4, -2, 2, 2, 0, -2, 0, 0, 0, 0, 2], [2, -4, 2, 1, 4, -1, 1, 2, -1, 0, 5, 0, 0, 0, 1, -1], [-20, 1, 20, -2, 1, 0, -2, 0, -2, -2, 0, -2, -4, 0, 0, -2], [-32, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 6, 0, 4, -3, -1, -1, 0, 1, 0, 3, -1, 1, 1, -4], [0, 0, -8, 0, 6, -6, 0, 0, -5, 0, 2, 6, -2, 0, 0, 0], [-10, 0, 10, 0, 0, 0, -2, 0, 0, -2, 0, 3, -3, 4, 0, 2], [0, 0, -10, 0, 6, 0, 0, 0, -8, 0, 2, 0, -2, 0, 0, -4], [0, 6, 0, 2, 0, 2, -4, -2, 0, -2, 6, 2, 4, 2, -2, 0], [0, -10, 0, -6, -10, 0, 0, 0, -6, 0, 0, -1, -4, -2, 0, -2], [24, 0, 0, -5, 0, -4, -6, -1, 0, -1, -5, -4, -5, 0, 0, 0], [0, 0, 0, 6, 0, 6, 0, 0, -6, 0, 6, 0, 0, 0, -4, 0], [32, 8, 32, 5, -8, -3, -3, -4, -5, 0, -1, 0, 0, 0, 5, 3], [14, 8, 0, 12, 0, -6, 2, 2, 0, 2, 0, -6, -2, 2, -2, 0], [0, 0, 32, 0, 10, 2, 0, 3, -5, -3, -3, -2, 3, 0, 0, -2], [-20, 1, 20, 4, 1, 0, 4, 0, 4, 8, 0, -10, -2, 0, 0, 4], [0, 0, 0, 0, -15, -2, 10, -1, -3, 1, 12, 2, -2, -10, -10, -13], [-12, -5, -12, -4, 5, 18, -4, 4, 4, 0, -10, 0, 0, 0, 8, 4], [52, 10, -52, 2, 10, 0, -6, 0, 2, -4, 0, 1, -8, 4, 0, -2], [16, 4, 0, -3, 0, 8, -6, -3, 0, -3, -11, 8, -7, -4, 4, 0], [-4, -12, -4, -1, 12, -5, -1, -8, 1, 0, 3, 0, 0, 0, -3, 1], [-30, 0, 30, -8, 0, 0, 1, 0, -8, 7, 0, -10, -1, -2, 0, -1], [-56, -7, 0, -4, 0, -8, -4, 0, 0, 0, -4, -8, -6, 2, -2, 0], [-42, -12, -42, 7, 12, -7, -1, -6, -7, 0, -2, 0, 0, 0, 0, 1], [36, 0, -36, -2, 0, 0, 2, 0, -2, 10, 0, 14, 0, -8, 0, -6], [42, -16, -42, 1, -16, 0, -6, 0, 1, 6, 0, -7, -6, 7, 0, 1], [0, 0, -56, 0, -15, -2, 6, 6, -4, -6, 0, 2, 6, -6, -6, -10], [-4, 24, 0, 0, 0, -7, 5, 5, 0, 5, -10, -7, -1, -9, 9, 0], [26, -14, -26, 3, -14, 0, -7, 0, 3, -2, 0, -9, 6, 6, 0, -1], [-64, -14, 0, -3, 0, -8, -2, 3, 0, 3, 3, -8, 3, 0, 0, 0], [-12, 7, 12, 4, 7, 0, -4, 0, 4, 12, 0, -6, -2, 8, 0, 4], [0, 0, -120, 0, -20, 22, -4, 2, 3, -2, 8, -22, -12, 4, 4, 0], [-78, 0, 78, -12, 0, 0, 6, 0, -12, -6, 0, 5, 3, -4, 0, 2], [50, 12, -50, -11, 12, 0, 6, 0, -11, 2, 0, 13, 6, -1, 0, 5], [0, 0, 26, 0, -26, 14, -14, -6, 24, 6, -14, -14, 0, 14, 14, 20], [0, 0, 56, 0, 15, -4, 2, 8, 12, -8, -8, 4, 10, -2, -2, 2], [-28, -30, 0, 6, 0, -15, 7, -1, 0, -1, 10, -15, 3, 7, -7, 0], [114, 0, 114, -8, 0, -33, 12, 16, 8, 0, 15, 0, 0, 0, -8, -12], [-10, -30, 0, -12, 0, 16, -12, -4, 0, -4, -6, 16, -2, -4, 4, 0], [-48, 30, 0, -12, 0, -6, -4, 0, 0, 0, 2, -6, 6, -4, 4, 0], [56, -16, 56, -16, 16, 13, 0, 0, 16, 0, -2, 0, 0, 0, 2, 0], [0, 0, 72, 0, 12, 10, -12, -4, 17, 4, -10, -10, -2, 12, 12, 12], [-54, -12, 54, -9, -12, 0, 6, 0, -9, 2, 0, -33, -10, 1, 0, 7], [0, 0, 50, 0, 34, 6, -2, 2, 16, -2, -14, -6, 12, 2, 2, 4], [-40, 9, -40, 10, -9, -12, 10, 18, -10, 0, 6, 0, 0, 0, 8, -10], [-78, -18, 78, 1, -18, 0, 3, 0, 1, 6, 0, 19, 6, 2, 0, 5], [20, -9, -20, 14, -9, 0, 2, 0, 14, -6, 0, -2, 16, 8, 0, 10], [64, 6, 0, -16, 0, 6, 20, 4, 0, 4, 2, 6, 6, -4, 4, 0], [0, 0, -44, 0, -28, -33, 9, 3, 0, -3, -10, 33, 19, -9, -9, 4], [24, 14, 24, -2, -14, 29, -14, -8, 2, 0, -22, 0, 0, 0, 26, 14], [-4, 15, -4, -12, -15, -10, 0, -8, 12, 0, 14, 0, 0, 0, -8, 0], [-90, -8, 0, -36, 0, 25, 5, 11, 0, 11, -4, 25, -7, 3, -3, 0], [142, 12, 142, 12, -12, -1, 2, -6, -12, 0, -7, 0, 0, 0, -12, -2], [-62, -16, -62, 5, 16, 17, -11, 6, -5, 0, -25, 0, 0, 0, 19, 11], [34, -10, 0, 24, 0, -22, -2, 6, 0, 6, 6, -22, -16, 22, -22, 0], [-64, -62, 0, 14, 0, 12, 12, 2, 0, 2, 6, 12, 10, -4, 4, 0], [0, 0, 152, 0, -18, 18, -4, 1, 9, -1, -5, -18, 1, 4, 4, -22], [52, -20, -52, 3, -20, 0, 28, 0, 3, -16, 0, 27, 24, -25, 0, 3], [46, 0, 46, -30, 0, 16, 1, 1, 30, 0, -15, 0, 0, 0, 10, -1], [0, 0, -72, 0, -41, 14, -6, -20, 12, 20, -18, -14, 12, 6, 6, 30], [66, -16, -66, 5, -16, 0, 21, 0, 5, -2, 0, 9, -14, -16, 0, 5], [-132, 16, -132, -25, -16, 53, -17, -16, 25, 0, -27, 0, 0, 0, 27, 17], [0, 19, 0, -45, 0, 16, -19, -7, 0, -7, -28, 16, -28, 0, 0, 0], [0, 0, -20, 0, -6, 56, -28, 8, 46, -8, -26, -56, -2, 28, 28, 26], [-178, 0, 178, -28, 0, 0, 2, 0, -28, 10, 0, -17, 5, 20, 0, 22], [18, 32, -18, 23, 32, 0, 0, 0, 23, 18, 0, -27, -2, 15, 0, 15], [0, 0, 200, 0, 15, 20, 2, -18, -26, 18, 22, -20, -20, -2, -2, -18], [28, 0, 0, -16, 0, -40, -4, -10, 0, -10, -10, -40, 2, -12, 12, 0], [112, -6, 0, -41, 0, -4, 10, 9, 0, 9, -19, -4, 13, -32, 32, 0], [134, 0, 134, -36, 0, 51, -14, -6, 36, 0, -19, 0, 0, 0, 20, 14], [16, -3, 0, 15, 0, -32, 25, 9, 0, 9, 2, -32, 6, -4, 4, 0], [0, 0, 48, 0, -2, 10, 18, -10, 14, 10, -6, -10, 24, -18, -18, 10], [70, -14, 70, -1, 14, -37, 11, 10, 1, 0, -10, 0, 0, 0, -12, -11], [0, 0, 144, 0, 18, -10, 32, 9, 1, -9, 23, 10, 9, -32, -32, -30], [230, -28, -230, 8, -28, 0, -22, 0, 8, 14, 0, 3, -11, 28, 0, 6], [0, 0, -256, 0, 58, 34, 4, -8, 30, 8, 2, -34, 2, -4, -4, 24], [-8, 78, 0, -17, 0, 24, -4, 0, 0, 0, -16, 24, 0, -16, 16, 0], [-216, 11, -216, 12, -11, -2, 18, 14, -12, 0, 12, 0, 0, 0, -28, -18], [48, 27, -48, 14, 27, 0, -10, 0, 14, 6, 0, -96, -18, 24, 0, 14], [256, 6, 0, 46, 0, -28, -28, -10, 0, -10, 18, -28, 22, -4, 4, 0], [126, -18, 126, 23, 18, 1, -5, -6, -23, 0, -4, 0, 0, 0, -26, 5], [0, 0, 0, 0, -15, 16, 4, 11, 7, -11, -10, -16, 14, -4, -4, -27], [-182, -10, -182, 16, 10, -80, 29, 5, -16, 0, 21, 0, 0, 0, -26, -29], [-118, 8, -118, 13, -8, 7, 21, 18, -13, 0, 43, 0, 0, 0, -29, -21], [-146, 0, 146, -10, 0, 0, 1, 0, -10, 3, 0, 70, 23, 18, 0, 19], [-24, 22, -24, -18, -22, -33, 18, 8, 18, 0, -20, 0, 0, 0, 24, -18], [54, 36, -54, 20, 36, 0, 4, 0, 20, -16, 0, -15, 17, 16, 0, 20], [0, 0, 176, 0, 11, -22, -22, -5, 1, 5, -18, 22, -4, 22, 22, 19], [96, 13, 96, -18, -13, 68, -18, 14, 18, 0, -14, 0, 0, 0, 32, 18], [-2, -24, 0, 4, 0, -1, -5, 9, 0, 9, 32, -1, 19, 13, -13, 0], [-140, -25, -140, -20, 25, -56, 6, 6, 20, 0, 14, 0, 0, 0, -20, -6], [46, -8, 0, 44, 0, 6, 46, 14, 0, 14, 40, 6, 34, 6, -6, 0], [424, -7, 0, -62, 0, -6, -12, -6, 0, -6, -8, -6, -26, 18, -18, 0], [0, 0, 10, 0, -4, 45, 7, -25, -48, 25, 24, -45, -17, -7, -7, -4], [0, 0, -80, 0, -84, -42, 12, 3, 3, -3, 9, 42, 3, -12, -12, 2], [108, -16, -108, 11, -16, 0, -10, 0, 11, -40, 0, -27, -8, -19, 0, -29], [0, 0, 398, 0, 52, -42, 18, -18, -12, 18, 0, 42, 18, -18, -18, 4], [-144, -33, -144, -16, 33, 20, -28, 4, 16, 0, -8, 0, 0, 0, 8, 28], [-152, -8, 0, 57, 0, -28, -20, -24, 0, -24, 12, -28, -8, 20, -20, 0], [-8, 11, 0, 3, 0, 18, 7, -21, 0, -21, -32, 18, 2, -34, 34, 0], [-210, -2, 210, -8, -2, 0, -1, 0, -8, 41, 0, 2, -55, 2, 0, 1], [-344, 87, 0, -18, 0, 10, -28, 26, 0, 26, 0, 10, -6, 6, -6, 0], [-90, 22, -90, 7, -22, 55, -53, -38, -7, 0, -6, 0, 0, 0, 24, 53], [80, 35, -80, -28, 35, 0, 34, 0, -28, 10, 0, -58, 12, -60, 0, -26], [96, -4, -96, 49, -4, 0, 4, 0, 49, 8, 0, -27, 16, -11, 0, -7], [308, -84, 0, -60, 0, 12, 20, 18, 0, 18, -14, 12, 10, -24, 24, 0], [60, 34, -60, -6, 34, 0, -34, 0, -6, -12, 0, -5, -32, 8, 0, -26], [30, -44, 30, 28, 44, 39, -30, -30, -28, 0, -23, 0, 0, 0, 68, 30], [54, -18, -54, -4, -18, 0, -9, 0, -4, 25, 0, 18, 17, -6, 0, -15], [156, 0, 156, -50, 0, -49, -2, -4, 50, 0, -22, 0, 0, 0, 42, 2], [46, -68, -46, -15, -68, 0, 8, 0, -15, 10, 0, -17, -50, -31, 0, -23], [0, 0, 512, 0, -92, -6, 24, 0, 2, 0, 26, 6, -2, -24, -24, -44], [-88, 36, 0, -17, 0, -8, -42, 29, 0, 29, 5, -8, -19, 24, -24, 0], [-22, 20, -22, -41, -20, -55, 15, -2, 41, 0, 17, 0, 0, 0, -7, -15], [-304, -15, 304, -26, -15, 0, 26, 0, -26, -6, 0, 40, -38, -24, 0, 2], [-424, -103, 0, -80, 0, 54, -40, -20, 0, -20, -26, 54, -12, -14, 14, 0], [0, 0, 160, 0, -70, 26, -36, -40, 5, 40, -22, -26, -14, 36, 36, 64], [-114, 32, 114, 17, 32, 0, -14, 0, 17, 2, 0, -59, -34, 15, 0, 1], [0, 0, -88, 0, -35, -56, 4, 11, -53, -11, 34, 56, -30, -4, -4, -15], [12, -56, 0, 68, 0, -49, -17, 23, 0, 23, -10, -49, -19, 9, -9, 0], [-8, 6, 8, 38, 6, 0, 24, 0, 38, 24, 0, -57, 36, 18, 0, 42], [14, -14, -14, -18, -14, 0, -9, 0, -18, -35, 0, 40, -17, -10, 0, -19], [-152, -64, -152, 12, 64, -37, -20, 8, -12, 0, -60, 0, 0, 0, 36, 20], [0, 0, -408, 0, 23, -14, 18, -1, 25, 1, 38, 14, -20, -18, -18, -77], [-146, 22, -146, 22, -22, -24, -27, -19, -22, 0, -11, 0, 0, 0, -6, 27], [-244, -36, 244, 14, -36, 0, 16, 0, 14, -20, 0, 71, 28, -74, 0, -58], [488, -70, 0, -23, 0, -16, -16, 14, 0, 14, -26, -16, -34, 8, -8, 0], [300, -52, 300, 42, 52, -92, 20, -40, -42, 0, 60, 0, 0, 0, -20, -20], [176, 40, 176, 7, -40, -29, -33, -28, -7, 0, 9, 0, 0, 0, 19, 33], [-448, 126, 0, 26, 0, -26, -12, -28, 0, -28, -14, -26, -18, 4, -4, 0], [284, 20, -284, -21, 20, 0, -16, 0, -21, -8, 0, 75, 0, -21, 0, -37], [0, 0, -40, 0, -99, -34, 26, 15, -87, -15, 8, 34, 18, -26, -26, -25], [102, -24, 102, -12, 24, 10, -7, -7, 12, 0, -93, 0, 0, 0, 22, 7], [0, 0, -88, 0, 121, -94, 14, -18, 8, 18, 28, 94, -14, -14, -14, -58], [-26, -64, -26, 45, 64, 73, 5, -2, -45, 0, 23, 0, 0, 0, 27, -5], [306, -78, 0, -8, 0, -60, 28, 12, 0, 12, 14, -60, 38, -24, 24, 0], [438, 18, -438, -34, 18, 0, -11, 0, -34, 23, 0, -18, -53, -6, 0, -17], [176, 66, 0, 52, 0, -28, 56, 44, 0, 44, -8, -28, -12, 4, -4, 0], [34, -40, 34, -32, 40, 2, -45, -21, 32, 0, -83, 0, 0, 0, 42, 45], [0, 0, 408, 0, -89, -44, -6, 6, -56, -6, 14, 44, -20, 6, 6, 30], [-8, 32, 0, -15, 0, 76, 24, -6, 0, -6, 6, 76, 18, -12, 12, 0], [-136, 35, 0, -75, 0, -48, -13, 23, 0, 23, -66, -48, -62, -4, 4, 0], [0, 0, 194, 0, -96, -48, 16, 8, 40, -8, 24, 48, -8, -16, -16, -24], [382, -10, 382, 41, 10, 19, 13, 50, -41, 0, 22, 0, 0, 0, -12, -13], [420, 18, -420, -10, 18, 0, -18, 0, -10, -34, 0, -22, 24, 16, 0, -2], [0, 0, 88, 0, -145, 28, 16, 5, 5, -5, -10, -28, 26, -16, -16, -41], [-296, -124, 0, 29, 0, -56, -16, 2, 0, 2, -38, -56, -2, -36, 36, 0], [-462, -10, -462, 76, 10, -3, 38, 10, -76, 0, 103, 0, 0, 0, -52, -38], [368, -103, 0, 55, 0, -8, -31, -3, 0, -3, -14, -8, -50, 36, -36, 0], [-96, -48, 0, 20, 0, 162, 28, -20, 0, -20, 62, 162, 62, 0, 0, 0], [0, 0, 256, 0, -118, -26, -4, 4, 11, -4, -30, 26, 26, 4, 4, -16], [-270, -28, 270, 69, -28, 0, -14, 0, 69, 30, 0, -61, 42, 43, 0, 29], [-212, 38, 0, -54, 0, 24, -38, 24, 0, 24, -26, 24, 2, -28, 28, 0], [-214, -36, 214, 13, -36, 0, 17, 0, 13, 86, 0, -61, -62, 36, 0, 53], [184, 65, 184, 24, -65, 90, 26, 14, -24, 0, 8, 0, 0, 0, -36, -26], [84, 56, 84, -37, -56, 33, 27, 12, 37, 0, 25, 0, 0, 0, -21, -27], [-312, 155, 0, -96, 0, -8, 56, 30, 0, 30, -30, -8, -4, -26, 26, 0], [0, 0, -194, 0, -84, 44, -36, 20, 136, -20, -36, -44, 0, 36, 36, 0], [0, 0, 656, 0, 140, -30, 32, 6, 5, -6, -8, 30, 40, -32, -32, -8], [0, 0, 130, 0, 6, 58, -38, 14, -56, -14, -18, -58, -20, 38, 38, 36], [-128, 21, -128, -54, -21, 8, 10, 2, 54, 0, 42, 0, 0, 0, 24, -10], [316, 18, -316, -32, 18, 0, 40, 0, -32, -28, 0, 43, 48, -60, 0, -20], [-240, 132, 0, 37, 0, -52, -14, 5, 0, 5, 33, -52, 21, 12, -12, 0], [-54, -92, -54, -51, 92, 43, -43, -66, 51, 0, -15, 0, 0, 0, -7, 43], [0, 0, -424, 0, 126, 122, -8, -46, 65, 46, 20, -122, -28, 8, 8, 20], [-350, -6, 350, -48, -6, 0, 6, 0, -48, -26, 0, 85, 7, -44, 0, -38], [-12, -8, 12, -51, -8, 0, 42, 0, -51, 8, 0, -111, 56, -53, 0, -11], [0, 0, -290, 0, -6, -14, 50, 26, 92, -26, -2, 14, 52, -50, -50, -16], [0, 0, 72, 0, -93, 22, -30, -36, 116, 36, -58, -22, 28, 30, 30, 62], [242, -80, -242, -53, -80, 0, 55, 0, -53, 46, 0, 139, 18, -76, 0, -21], [-158, 52, -158, 7, -52, -17, -25, 10, -7, 0, -61, 0, 0, 0, 43, 25], [168, -81, -168, -10, -81, 0, -22, 0, -10, -22, 0, -120, -62, -16, 0, -38], [0, 0, -436, 0, -22, -7, 47, -21, -146, 21, 50, 7, -3, -47, -47, -2], [0, 0, -240, 0, -156, -16, 32, -22, -68, 22, 90, 16, -58, -32, -32, -76], [58, -36, 0, -56, 0, -14, 42, -22, 0, -22, -56, -14, -6, -50, 50, 0], [-64, 30, -64, 10, -30, -84, -2, -14, -10, 0, -34, 0, 0, 0, 40, 2], [-80, -49, 80, 114, -49, 0, -6, 0, 114, 18, 0, -32, 58, 56, 0, 50], [-470, -20, -470, -21, 20, 15, 19, -26, 21, 0, 6, 0, 0, 0, -36, -19], [-252, -143, 252, 4, -143, 0, 36, 0, 4, 8, 0, 10, 18, -96, 0, -60], [0, 0, -490, 0, 80, 6, -30, -2, -36, 2, -28, -6, -2, 30, 30, 20], [50, 68, 0, -52, 0, -39, 29, -9, 0, -9, 44, -39, -7, 51, -51, 0], [122, 40, 122, 9, -40, -153, 49, 74, -9, 0, 39, 0, 0, 0, -81, -49], [334, 26, 0, -48, 0, 94, -34, -46, 0, -46, 6, 94, 32, -26, 26, 0], [336, 130, 0, 152, 0, 40, -28, -50, 0, -50, 14, 40, 26, -12, 12, 0], [-560, 54, -560, 20, -54, -89, -40, -48, -20, 0, 0, 0, 0, 0, -36, 40], [0, 0, 40, 0, 26, -78, -28, -53, 39, 53, -11, 78, -17, 28, 28, 54], [532, 60, -532, 17, 60, 0, -12, 0, 17, 8, 0, -1, -64, 61, 0, 49], [-662, 68, 0, -84, 0, -21, -41, 17, 0, 17, -24, -21, -57, 33, -33, 0], [-110, 22, -110, -60, -22, 139, 28, 56, 60, 0, -29, 0, 0, 0, 64, -28], [494, 12, 494, 23, -12, 79, 31, 18, -23, 0, -24, 0, 0, 0, 46, -31], [0, 0, -136, 0, 106, 102, -16, 18, 87, -18, -48, -102, 32, 16, 16, 68], [-46, 8, 46, -108, 8, 0, 16, 0, -108, -28, 0, 31, 27, -88, 0, -72], [0, 0, 394, 0, 64, 86, -34, -10, 36, 10, -16, -86, -18, 34, 34, 76], [538, -10, 538, 18, 10, 30, 5, -35, -18, 0, 27, 0, 0, 0, -14, -5], [492, 76, 0, 36, 0, -99, 69, 29, 0, 29, 6, -99, -77, 83, -83, 0], [276, 18, -276, 22, 18, 0, -54, 0, 22, -84, 0, 5, 8, 24, 0, -30], [496, 28, 0, 139, 0, 28, 30, -29, 0, -29, 111, 28, 59, 52, -52, 0], [368, -24, 368, -78, 24, 152, -14, -50, 78, 0, 6, 0, 0, 0, 16, 14], [-64, -140, 0, 2, 0, -20, 72, 0, 0, 0, 44, -20, 12, 32, -32, 0], [0, 0, 304, 0, 16, 86, -2, 16, 56, -16, -18, -86, 16, 2, 2, 32], [0, 0, 168, 0, -84, 18, -88, 3, 41, -3, -59, -18, -29, 88, 88, 18], [184, 7, 0, -115, 0, -46, 5, 25, 0, 25, -2, -46, -20, 18, -18, 0], [184, -41, 0, -64, 0, -114, 28, -2, 0, -2, -72, -114, 2, -74, 74, 0], [-668, 62, -668, -8, -62, 25, -52, -20, 8, 0, -28, 0, 0, 0, -20, 52], [32, 12, -32, -69, 12, 0, 52, 0, -69, 52, 0, -251, -44, 7, 0, 59], [256, 38, 0, 13, 0, 28, -4, 2, 0, 2, -10, 28, -54, 44, -44, 0], [-504, -11, 0, -23, 0, 130, -55, -15, 0, -15, -40, 130, -22, -18, 18, 0], [0, 0, -224, 0, -12, -54, 0, -40, -81, 40, 18, 54, -18, 0, 0, -36], [174, 56, -174, 8, 56, 0, 94, 0, 8, -34, 0, 151, 81, -92, 0, 2], [404, 40, -404, -83, 40, 0, -26, 0, -83, -32, 0, -85, 32, 63, 0, 37], [0, 0, -34, 0, -28, 8, 36, 20, 20, -20, 44, -8, -8, -36, -36, -36], [0, 0, -320, 0, 54, -124, -28, -6, -70, 6, -58, 124, 30, 28, 28, 64], [152, 142, 0, 1, 0, -8, 8, -50, 0, -50, -34, -8, 38, -72, 72, 0], [-200, -87, -200, -28, 87, -202, 42, 14, 28, 0, -28, 0, 0, 0, 20, -42], [-104, 116, -104, 7, -116, -179, -9, 4, -7, 0, -117, 0, 0, 0, 73, 9], [66, -18, -66, -78, -18, 0, -17, 0, -78, -51, 0, 82, 81, 14, 0, -3], [0, 0, -80, 0, 110, 94, -16, 39, 79, -39, 13, -94, -29, 16, 16, -58], [0, 0, 118, 0, 30, -14, 58, -30, -156, 30, 42, 14, 16, -58, -58, -48], [-310, 20, -310, 78, -20, 34, 69, 45, -78, 0, 143, 0, 0, 0, -22, -69], [0, 0, -240, 0, -64, -18, -24, -2, 114, 2, 44, 18, -68, 24, 24, 40], [-440, -130, 0, -174, 0, 106, -84, -54, 0, -54, -78, 106, 0, -78, 78, 0], [488, 42, -488, 26, 42, 0, -6, 0, 26, 8, 0, 37, 92, 60, 0, 54], [-158, 12, -158, -56, -12, 65, 58, -14, 56, 0, 19, 0, 0, 0, -52, -58], [-312, -173, 0, -22, 0, 18, -68, -26, 0, -26, 20, 18, -18, 38, -38, 0], [-458, -72, 458, 28, -72, 0, 40, 0, 28, 76, 0, -235, -23, -8, 0, 32], [316, -129, 316, -46, 129, 30, 38, -18, 46, 0, -52, 0, 0, 0, 48, -38], [-632, -146, 0, -47, 0, -60, -6, -5, 0, -5, -73, -60, 11, -84, 84, 0], [252, -76, 252, -65, 76, 127, -25, 36, 65, 0, -93, 0, 0, 0, -63, 25], [-598, -24, 0, -4, 0, -66, 18, 46, 0, 46, -4, -66, 58, -62, 62, 0], [-48, 22, 0, 74, 0, 124, 4, 10, 0, 10, 78, 124, 66, 12, -12, 0], [0, 0, 976, 0, -84, 42, -8, 4, -33, -4, -2, -42, -6, 8, 8, 52], [-224, -64, 224, 130, -64, 0, -64, 0, 130, -28, 0, -90, -10, 116, 0, 52], [324, 85, 324, -114, -85, -26, -50, -18, 114, 0, -108, 0, 0, 0, -8, 50], [0, 0, -176, 0, 10, 96, -36, 38, 100, -38, 14, -96, -50, 36, 36, 16], [72, -44, 72, -47, 44, -111, -7, 48, 47, 0, -121, 0, 0, 0, 81, 7], [258, -76, 0, 80, 0, -90, 50, 2, 0, 2, -16, -90, 2, -18, 18, 0], [-392, 147, 0, 90, 0, 34, -36, 10, 0, 10, -8, 34, -30, 22, -22, 0], [0, 0, 238, 0, 164, -58, -38, 38, -64, -38, 56, 58, -94, 38, 38, 0], [-610, -150, -610, -7, 150, -81, 101, 42, 7, 0, 60, 0, 0, 0, -50, -101], [-196, -28, 196, 2, -28, 0, -20, 0, 2, -76, 0, 104, -32, -36, 0, -56], [428, -84, -428, 49, -84, 0, 6, 0, 49, -4, 0, 205, 92, -29, 0, -23], [24, -21, 24, -128, 21, -128, -24, 72, 128, 0, -120, 0, 0, 0, 40, 24], [318, -28, -318, 71, -28, 0, -55, 0, 71, 82, 0, -163, -10, 86, 0, 31], [0, 0, 724, 0, -96, 152, -76, -34, 120, 34, -66, -152, -10, 76, 76, 152], [0, 0, -40, 0, 44, -234, 112, 3, -215, -3, 105, 234, 7, -112, -112, -166], [192, 2, -192, -34, 2, 0, 42, 0, -34, 46, 0, 124, 18, 24, 0, 66], [-268, 64, 268, 17, 64, 0, -80, 0, 17, -44, 0, 131, -116, 49, 0, -31], [-416, -44, -416, 61, 44, -59, 53, -56, -61, 0, 101, 0, 0, 0, -5, -53], [-136, -113, 0, 1, 0, -154, -11, -11, 0, -11, 70, -154, -48, 118, -118, 0], [-140, 241, 140, -54, 241, 0, 22, 0, -54, -2, 0, 42, 40, -32, 0, -10], [696, 4, 696, 6, -4, -139, 30, 8, -6, 0, 92, 0, 0, 0, -140, -30], [0, 0, 110, 0, 28, -22, 26, 54, 88, -54, 40, 22, -14, -26, -26, -72], [378, 64, 378, 54, -64, 52, 31, -73, -54, 0, 75, 0, 0, 0, -42, -31], [4, -138, -4, 24, -138, 0, 16, 0, 24, -52, 0, -109, -48, -84, 0, -68], [-194, 84, -194, 1, -84, -1, -23, -22, -1, 0, -59, 0, 0, 0, 153, 23], [544, 49, -544, -52, 49, 0, 48, 0, -52, 24, 0, 16, -24, -160, 0, -112], [0, 0, 574, 0, -44, -26, -94, 14, 104, -14, -88, 26, -6, 94, 94, -24], [0, 0, -256, 0, -12, 122, -76, -41, 97, 41, -63, -122, -13, 76, 76, 130], [362, -184, 0, 152, 0, 80, 8, -72, 0, -72, 64, 80, 32, 32, -32, 0], [-240, -122, 0, -15, 0, 60, 8, 20, 0, 20, -56, 60, 44, -100, 100, 0], [38, 142, 38, 60, -142, -139, 16, 76, -60, 0, -31, 0, 0, 0, -40, -16], [692, -72, 692, 65, 72, 227, -55, -56, -65, 0, 139, 0, 0, 0, -51, 55], [0, 0, -490, 0, 24, -113, 101, 13, -112, -13, 92, 113, 9, -101, -101, -180], [-20, 14, 20, -26, 14, 0, -60, 0, -26, 12, 0, -172, -100, 100, 0, 40], [0, 0, 832, 0, 98, -16, 60, -66, -206, 66, 134, 16, -74, -60, -60, -56], [432, 86, 0, -75, 0, 72, -102, 37, 0, 37, -91, 72, -99, 8, -8, 0], [8, 21, 0, -118, 0, 42, -8, 44, 0, 44, -70, 42, -64, -6, 6, 0], [184, -8, -184, -13, -8, 0, -54, 0, -13, -52, 0, -47, 20, -31, 0, -85], [454, 50, 454, 46, -50, -244, -11, -43, -46, 0, 33, 0, 0, 0, -86, 11], [0, 0, 640, 0, 78, 88, -12, -12, 180, 12, -60, -88, 48, 12, 12, 4], [-308, -78, 0, 146, 0, -179, 55, 7, 0, 7, 118, -179, 67, 51, -51, 0], [856, 140, -856, -2, 140, 0, -62, 0, -2, 8, 0, 23, -16, 4, 0, -58], [272, -72, 0, -145, 0, 76, 56, 4, 0, 4, -80, 76, -88, 8, -8, 0], [170, -254, 0, 8, 0, 66, -90, -34, 0, -34, -6, 66, -44, 38, -38, 0], [442, -94, 442, 115, 94, 39, -33, -58, -115, 0, 30, 0, 0, 0, 64, 33], [196, -110, -196, -18, -110, 0, -106, 0, -18, -34, 0, 34, -16, 80, 0, -26], [0, 0, -266, 0, -20, -44, -104, -16, 92, 16, -180, 44, 76, 104, 104, 68], [452, 60, 452, 54, -60, -90, -62, -46, -54, 0, -72, 0, 0, 0, 24, 62], [-318, 164, -318, 19, -164, 93, 83, -46, -19, 0, 143, 0, 0, 0, -73, -83], [-698, -14, -698, 61, 14, 165, 9, -70, -61, 0, 198, 0, 0, 0, -44, -9], [0, 0, 512, 0, -24, -110, 96, -34, -175, 34, 144, 110, -48, -96, -96, -112], [-1000, 102, 1000, 124, 102, 0, -82, 0, 124, -40, 0, 33, 4, 50, 0, -32], [-534, -90, -534, 36, 90, -81, 16, 80, -36, 0, -65, 0, 0, 0, -56, -16], [-70, 2, 70, -50, 2, 0, -75, 0, -50, 55, 0, 188, -103, 58, 0, -17], [0, 0, -276, 0, 12, -33, 49, -17, 68, 17, 98, 33, -49, -49, -49, -56], [-306, -88, -306, -61, 88, 101, -109, 18, 61, 0, 2, 0, 0, 0, 156, 109], [0, 0, -976, 0, 136, 130, 40, -46, -3, 46, 20, -130, 20, -40, -40, 56]];
    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_f();".
// 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_f(: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_f();".
// 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_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1152_m();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<5,R![2117472256, -5171462144, 6315081728, -4258177024, 1663893504, -283883520, 12517376, -4026368, 6221952, -518400, 512, 8064, 6656, 32, 0, 0, 1]>,<7,R![-400880, -720640, -136576, 53248, 13704, -448, -224, 0, 1]>],Snew);
    return Vf;
end function;