
// Make newform 1150.3.d.b in Magma, downloaded from the LMFDB on 20 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1150_d();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1150_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_1150_3_d_b();".
// 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_1150_3_d_b();".
// 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 := [529, 0, 285578, 0, 696037, 0, 569634, 0, 184804, 0, 28310, 0, 2165, 0, 78, 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], [0, 76734676377, 0, 176966386308, 0, 143284317912, 0, 46294879486, 0, 7075107694, 0, 540300528, 0, 19450521, 0, 249266], [0, 713709368150605, 0, 1498538031694409, 0, 1019723267554884, 0, 300170143661102, 0, 43627262833926, 0, 3236490394640, 0, 114494825161, 0, 1452833849], [0, -543467028934999, 0, -2381127396806003, 0, -2682576222308196, 0, -978131496567898, 0, -158460209288026, 0, -12507983573336, 0, -459480090555, 0, -5957154299], [38708131230591, 0, 988318890938067, 0, 1353800445494324, 0, 517393068635482, 0, 85389448480554, 0, 6803101750504, 0, 251231034675, 0, 3266665611, 0], [885659459, 0, 92129883455, 0, 133890163508, 0, 51832164194, 0, 8586649314, 0, 684448696, 0, 25254583, 0, 328071, 0], [0, 8733597167783, 0, 65752777188627, 0, 83034850253508, 0, 31116072823834, 0, 5087217548666, 0, 402812007992, 0, 14808207659, 0, 191987899], [0, -4166619657821, 0, -71790826408533, 0, -97036544153580, 0, -36877647447520, 0, -6059544792898, 0, -480902133464, 0, -17699955559, 0, -229620557], [0, -191041726435967, 0, -1275713485281577, 0, -1570465425309456, 0, -585118020325518, 0, -95479887197410, 0, -7555326565548, 0, -277707100247, 0, -3600464285], [-44834433467221, 0, 3940822109052359, 0, 5840712005282452, 0, 2268003524367106, 0, 375976473404450, 0, 29972322851736, 0, 1105876709199, 0, 14365389855, 0], [0, -230413141490301, 0, 1289601599824063, 0, 2261389858800596, 0, 905732893319778, 0, 151934673265506, 0, 12184818665176, 0, 451130209015, 0, 5871432519], [0, 1797012737486483, 0, -9389110571369633, 0, -16682296962849452, 0, -6699116806549406, 0, -1125045586913054, 0, -90283361017128, 0, -3343956125401, 0, -43531256921], [82437933075262, -3055855317845943, 5987597192457438, -12636359913531483, 8640632102007032, -13669678513863444, 3335789410501956, -4910040557428682, 551450943599924, -788702245217370, 43888163873888, -61890479395272, 1617708410646, -2263755902763, 21002456926, -29269066035], [28012979344985, -3055855317845943, -7477536169138859, -12636359913531483, -11297228352398164, -13669678513863444, -4420040893973322, -4910040557428682, -735781705952346, -788702245217370, -58816507643080, -61890479395272, -2174316072571, -2263755902763, -28278344419, -29269066035], [6504254102973, -3055855317845943, 11210557588727913, -12636359913531483, 16500140438754044, -13669678513863444, 6398166721254382, -4910040557428682, 1060681057319710, -788702245217370, 84613633553592, -61890479395272, 3124787270393, -2263755902763, 40620036785, -29269066035], [78181554830047, -3055855317845943, 19272909387076131, -12636359913531483, 28188544007262900, -13669678513863444, 10906087984591930, -4910040557428682, 1804651216508106, -788702245217370, 143717482361288, -61890479395272, 5299632441843, -2263755902763, 68821388859, -29269066035]];
    Rf_basisdens := [1, 736991990, 3401955025840, 13607820103360, 6803910051680, 505359680, 114351429440, 121498393780, 1700977512920, 6803910051680, 1943974300480, 13607820103360, 13607820103360, 13607820103360, 13607820103360, 13607820103360];
    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_1150_d();"
function MakeCharacter_1150_d()
    N := 1150;
    order := 2;
    char_gens := [277, 51];
    v := [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_1150_d_Hecke();"
function MakeCharacter_1150_d_Hecke(Kf)
    N := 1150;
    order := 2;
    char_gens := [277, 51];
    char_values := [[1, 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]];
    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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 0, 1, -1, 0, -1, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 1, 3, 0, 0, 0, -1, 0, 0, 1, -1, 1, -1], [0, -1, 0, 1, 0, 0, 1, 1, -1, 0, -3, -1, 0, 0, 0, 0], [0, -1, -1, 0, 0, 0, -3, -1, 2, 0, 1, 0, 0, 0, 0, 0], [-1, -2, 0, -1, -1, -5, 0, -1, -2, 1, 0, 0, 0, 1, 1, -1], [-6, 3, 3, 3, -1, -6, 3, 0, -3, -1, -3, -3, 2, 2, 1, 1], [-8, 1, 1, 1, -5, -2, 1, 0, -1, 2, -1, -1, 0, 0, -1, 3], [0, 4, 4, 3, 0, 0, 7, 5, -2, 0, 2, 0, 0, 0, 0, 0], [-10, -1, -1, -1, -3, 2, -1, 0, 1, 1, 1, 1, 2, -4, 1, -1], [0, 3, 2, 1, 0, 0, 0, 1, -1, 0, 2, -5, 0, 0, 0, 0], [10, 2, 2, 2, -1, -6, 2, 0, -2, -2, -2, -2, 4, -2, 0, 2], [0, 0, 6, 5, 0, 0, -1, 1, 1, 0, 1, 1, 0, 0, 0, 0], [10, 3, 3, 3, 3, 1, 3, 0, -3, 0, -3, -3, -3, 0, 8, 1], [0, -4, -2, -11, 0, 0, -7, -8, 2, 0, 9, 5, 0, 0, 0, 0], [0, 2, 2, -11, 0, 0, -16, -6, 3, 0, 3, 4, 0, 0, 0, 0], [16, -1, -1, -1, 13, 16, -1, 0, 1, -2, 1, 1, 2, -4, 1, -1], [3, 0, 0, 0, -7, 9, 0, 0, 0, 7, 0, 0, -1, 3, 1, -3], [0, -3, -1, -22, 0, 0, -17, 1, 8, 0, 17, 6, 0, 0, 0, 0], [0, -4, -7, 7, 0, 0, 5, -3, -11, 0, -8, 8, 0, 0, 0, 0], [0, 16, 10, 1, 0, 0, 5, 10, 8, 0, 7, 3, 0, 0, 0, 0], [0, 0, 6, -2, 0, 0, 8, 10, 5, 0, -7, 3, 0, 0, 0, 0], [0, -1, -1, -1, 9, -19, -1, 0, 1, 10, 1, 1, -3, 0, 2, -1], [0, 4, -15, -14, 0, 0, -2, -14, -2, 0, 11, 7, 0, 0, 0, 0], [0, 7, -2, -22, 0, 0, -15, -4, 10, 0, 9, 16, 0, 0, 0, 0], [0, -4, -14, -9, 0, 0, -9, -6, 2, 0, -7, 9, 0, 0, 0, 0], [0, 4, 6, 7, 0, 0, 1, 9, -12, 0, -12, -12, 0, 0, 0, 0], [-2, 2, 2, 2, 9, 8, 2, 0, -2, -2, -2, -2, -8, -2, 6, 8], [-14, -2, -2, -2, -14, -3, -2, 0, 2, -10, 2, 2, -1, -4, 3, -2], [0, 14, 6, 2, 0, 0, -4, 14, 24, 0, 2, 0, 0, 0, 0, 0], [40, -5, -5, -5, -17, -40, -5, 0, 5, 0, 5, 5, -2, -4, -1, -3], [0, -6, 0, -14, 0, 0, -2, 4, 18, 0, -8, 6, 0, 0, 0, 0], [18, 2, 2, 2, -14, -39, 2, 0, -2, -6, -2, -2, -1, 0, -1, 6], [0, 23, -2, -7, 0, 0, 7, 7, 2, 0, -4, -8, 0, 0, 0, 0], [10, 2, 2, 2, -3, 40, 2, 0, -2, 14, -2, -2, 10, 2, -10, 2], [-52, 7, 7, 7, -12, 0, 7, 0, -7, 0, -7, -7, 10, 4, 4, -4], [-46, 0, 0, 0, -2, -32, 0, 0, 0, -6, 0, 0, -2, 0, 14, -12], [-38, -8, -8, -8, 2, -61, -8, 0, 8, 4, 8, 8, 1, -12, 21, -26], [0, -3, -12, 29, 0, 0, 23, 8, -12, 0, -17, 5, 0, 0, 0, 0], [0, 23, -8, -3, 0, 0, 5, 2, -5, 0, 22, 8, 0, 0, 0, 0], [-41, 16, 16, 16, -3, 7, 16, 0, -16, -5, -16, -16, 9, 7, 9, 7], [73, -2, -2, -2, -1, -15, -2, 0, 2, 17, 2, 2, -23, 1, 11, 7], [0, -26, -13, 27, 0, 0, 6, -7, -19, 0, -13, -14, 0, 0, 0, 0], [46, -3, -3, -3, -41, -25, -3, 0, 3, 10, 3, 3, -5, -4, 4, -1], [-30, 15, 15, 15, 6, 50, 15, 0, -15, -30, -15, -15, -2, 22, -12, 22], [0, 2, 12, -12, 0, 0, -27, -3, -4, 0, -2, -5, 0, 0, 0, 0], [0, 14, 26, 43, 0, 0, 23, 4, -22, 0, -11, -23, 0, 0, 0, 0], [103, 0, 0, 0, -9, -47, 0, 0, 0, 9, 0, 0, -15, 7, 11, -3], [36, 21, 21, 21, -11, 70, 21, 0, -21, 20, -21, -21, 16, 16, 13, -3], [0, -7, -6, 10, 0, 0, 4, 10, 6, 0, -20, 12, 0, 0, 0, 0], [0, -19, -4, -21, 0, 0, 15, 8, -19, 0, -30, 6, 0, 0, 0, 0], [-105, -6, -6, -6, -43, -103, -6, 0, 6, -27, 6, 6, -15, -1, -5, 9], [0, 9, 8, 32, 0, 0, 21, 32, -10, 0, -1, -24, 0, 0, 0, 0], [-56, 13, 13, 13, 17, 26, 13, 0, -13, 9, -13, -13, 22, 22, -25, 7], [30, 3, 3, 3, -27, 85, 3, 0, -3, 10, -3, -3, -19, 20, -10, 15], [-5, 2, 2, 2, 49, -73, 2, 0, -2, -3, -2, -2, -17, 15, 3, 3], [0, -11, -28, -63, 0, 0, -29, -32, 24, 0, 15, 43, 0, 0, 0, 0], [0, 6, 39, 31, 0, 0, 19, 19, -1, 0, -48, -22, 0, 0, 0, 0], [0, -30, 8, 19, 0, 0, 11, 47, -11, 0, 9, -21, 0, 0, 0, 0], [76, -21, -21, -21, 12, 96, -21, 0, 21, 56, 21, 21, -26, -12, 0, -4], [-198, 0, 0, 0, 12, 5, 0, 0, 0, 0, 0, 0, -5, -12, -1, 18], [0, 16, -6, 23, 0, 0, 17, -43, -7, 0, 15, 19, 0, 0, 0, 0], [98, -14, -14, -14, -4, 46, -14, 0, 14, -54, 14, 14, -8, 8, -18, -10], [-4, -7, -7, -7, 75, -64, -7, 0, 7, 24, 7, 7, -22, 0, 9, -1], [0, -9, -22, -64, 0, 0, -26, -18, 69, 0, 25, -1, 0, 0, 0, 0], [-34, -17, -17, -17, 50, 38, -17, 0, 17, -42, 17, 17, -26, -6, -4, 2], [-112, -21, -21, -21, 33, 2, -21, 0, 21, -33, 21, 21, -26, 0, -11, -5], [21, 10, 10, 10, -29, -17, 10, 0, -10, -43, -10, -10, 15, 1, -9, 13], [0, 35, -1, 10, 0, 0, -1, 15, 24, 0, -11, -4, 0, 0, 0, 0], [0, 24, 25, 1, 0, 0, 15, 15, -21, 0, -14, -18, 0, 0, 0, 0], [0, 27, -14, 22, 0, 0, 8, -26, -38, 0, -22, 4, 0, 0, 0, 0], [0, -24, 6, -46, 0, 0, -48, -26, 30, 0, 32, 20, 0, 0, 0, 0], [0, -19, -28, -122, 0, 0, -97, 0, 64, 0, 27, 36, 0, 0, 0, 0], [0, -38, -42, -46, 0, 0, -52, -32, 20, 0, -8, 18, 0, 0, 0, 0], [-151, -24, -24, -24, 7, 39, -24, 0, 24, -21, 24, 24, -31, -7, -3, -7], [0, -1, 18, -42, 0, 0, -16, 54, 46, 0, 44, -10, 0, 0, 0, 0], [66, -19, -19, -19, 47, 30, -19, 0, 19, -63, 19, 19, -30, -4, -9, 5], [0, 25, 21, 52, 0, 0, 39, 5, -20, 0, -61, -10, 0, 0, 0, 0], [0, 27, -32, 45, 0, 0, 63, -10, -40, 0, -11, -3, 0, 0, 0, 0], [0, -65, -21, -56, 0, 0, -81, -13, -6, 0, -25, 20, 0, 0, 0, 0], [0, -23, -34, -49, 0, 0, -7, 1, 3, 0, 3, 63, 0, 0, 0, 0], [-238, 2, 2, 2, -72, -11, 2, 0, -2, -32, -2, -2, -5, -12, 15, 6], [182, 24, 24, 24, -3, -92, 24, 0, -24, 2, -24, -24, 24, -10, 6, 28], [-16, -17, -17, -17, -49, -29, -17, 0, 17, 4, 17, 17, 7, 6, -24, -23], [0, 11, -14, -9, 0, 0, -51, -13, 43, 0, -51, 5, 0, 0, 0, 0], [58, 34, 34, 34, 22, -125, 34, 0, -34, 5, -34, -34, 27, 16, 3, 22], [238, -25, -25, -25, 20, 56, -25, 0, 25, -22, 25, 25, -16, -26, -12, 4], [0, -21, 33, 6, 0, 0, 50, 7, 4, 0, -38, -30, 0, 0, 0, 0], [0, -45, -58, -57, 0, 0, -65, -42, -11, 0, 28, 22, 0, 0, 0, 0], [-62, 8, 8, 8, -67, -24, 8, 0, -8, -86, -8, -8, 20, 18, -18, -4], [-56, -1, -1, -1, -27, 226, -1, 0, 1, 4, 1, 1, 4, -16, -9, 19], [28, -21, -21, -21, 115, 270, -21, 0, 21, 30, 21, 21, -68, 0, 1, 25], [0, 45, 21, -24, 0, 0, -20, 21, 14, 0, -64, 8, 0, 0, 0, 0], [-62, 2, 2, 2, -2, -19, 2, 0, -2, 65, -2, -2, -31, 0, -11, 46], [0, 34, 16, 98, 0, 0, 78, 52, -50, 0, -30, -8, 0, 0, 0, 0], [0, -64, 4, -10, 0, 0, -1, 5, -16, 0, 48, 17, 0, 0, 0, 0], [-268, -2, -2, -2, 84, 97, -2, 0, 2, 41, 2, 2, -23, 22, 41, -44], [70, 2, 2, 2, -51, 4, 2, 0, -2, -106, -2, -2, -26, -10, 4, 36], [0, 53, -32, -23, 0, 0, 21, -3, -14, 0, -10, -12, 0, 0, 0, 0], [0, 57, -1, -2, 0, 0, 24, -33, 0, 0, 74, 64, 0, 0, 0, 0], [0, 31, 14, -62, 0, 0, 8, 50, 68, 0, 92, -10, 0, 0, 0, 0], [0, 61, 10, 41, 0, 0, 23, -12, -63, 0, 0, -18, 0, 0, 0, 0], [181, 16, 16, 16, -25, -15, 16, 0, -16, -85, -16, -16, 31, 29, -7, -21], [18, -22, -22, -22, 27, 46, -22, 0, 22, -22, 22, 22, 12, -2, -28, -26], [6, 26, 26, 26, 64, 196, 26, 0, -26, 6, -26, -26, 38, 4, 38, -28], [-88, -4, -4, -4, 10, 18, -4, 0, 4, -94, 4, 4, 14, 0, -36, 14], [396, -5, -5, -5, 67, -38, -5, 0, 5, -3, 5, 5, -46, 22, 13, 1], [270, 47, 47, 47, 24, -164, 47, 0, -47, 86, -47, -47, 28, 38, -28, 56], [0, -73, 8, -46, 0, 0, -70, -20, 12, 0, 18, -6, 0, 0, 0, 0], [0, -75, -76, -75, 0, 0, -27, -3, 74, 0, 14, 56, 0, 0, 0, 0], [0, -44, -36, -86, 0, 0, -22, -12, 24, 0, 56, 18, 0, 0, 0, 0], [0, -3, -43, -122, 0, 0, -17, -31, 80, 0, -3, 32, 0, 0, 0, 0], [0, 22, 22, 91, 0, 0, 63, 46, -70, 0, -33, -19, 0, 0, 0, 0], [0, -110, -33, -27, 0, 0, -115, -69, -9, 0, -14, -28, 0, 0, 0, 0], [60, 8, 8, 8, 31, 298, 8, 0, -8, 60, -8, -8, -46, 16, -4, 50], [11, -10, -10, -10, -15, -1, -10, 0, 10, -39, 10, 10, -29, -37, 35, 11], [0, 43, -4, 29, 0, 0, -33, -38, 15, 0, -22, -20, 0, 0, 0, 0], [0, 144, 0, -20, 0, 0, -4, 4, 62, 0, 60, 4, 0, 0, 0, 0], [231, -38, -38, -38, 77, -93, -38, 0, 38, 57, 38, 38, 19, 7, -25, -77], [0, 50, 64, 31, 0, 0, -9, -11, 69, 0, 71, -47, 0, 0, 0, 0], [-302, 0, 0, 0, 39, -22, 0, 0, 0, 22, 0, 0, 30, -34, 34, -30], [-400, -10, -10, -10, -14, -252, -10, 0, 10, 36, 10, 10, 20, -4, 14, -50], [0, 3, -52, -153, 0, 0, -183, -46, 84, 0, 39, 83, 0, 0, 0, 0], [0, 7, -32, -133, 0, 0, -55, -66, 2, 0, 105, 23, 0, 0, 0, 0], [414, -1, -1, -1, 111, -393, -1, 0, 1, -86, 1, 1, -5, 8, -26, 21], [0, -48, 27, 75, 0, 0, 15, 29, -51, 0, -8, -34, 0, 0, 0, 0], [0, 95, 10, 27, 0, 0, 57, -15, 15, 0, 11, -9, 0, 0, 0, 0], [312, 27, 27, 27, 75, 246, 27, 0, -27, 30, -27, -27, 48, 4, -31, 33], [0, 70, 125, 136, 0, 0, 74, 108, 8, 0, -49, -83, 0, 0, 0, 0], [0, 57, -59, 24, 0, 0, 1, -31, 68, 0, 31, -62, 0, 0, 0, 0], [0, -10, 6, -99, 0, 0, -61, 87, 18, 0, 78, 26, 0, 0, 0, 0], [126, 53, 53, 53, -31, -78, 53, 0, -53, -69, -53, -53, 74, 42, 7, -17], [0, -51, 6, -80, 0, 0, -138, 8, 4, 0, -22, 8, 0, 0, 0, 0], [0, -35, 16, -2, 0, 0, 66, 88, -13, 0, 15, -61, 0, 0, 0, 0], [0, 119, 11, -74, 0, 0, -68, 57, 116, 0, 172, 10, 0, 0, 0, 0], [0, 89, 114, 147, 0, 0, 69, 67, -50, 0, -82, -82, 0, 0, 0, 0], [-60, 13, 13, 13, -221, -17, 13, 0, -13, -58, -13, -13, -9, 0, 18, 17], [136, 13, 13, 13, -37, 528, 13, 0, -13, -24, -13, -13, 58, -20, 5, -17], [-450, 50, 50, 50, -88, -138, 50, 0, -50, -22, -50, -50, 62, 34, -12, 16], [-208, 24, 24, 24, 77, -64, 24, 0, -24, 60, -24, -24, -12, 24, -28, 64], [0, -51, 7, -148, 0, 0, -90, -75, 72, 0, 58, 4, 0, 0, 0, 0], [-138, 35, 35, 35, -83, 223, 35, 0, -35, -56, -35, -35, 67, -8, -28, 39], [0, 12, 15, -89, 0, 0, 34, 57, 61, 0, 3, -34, 0, 0, 0, 0], [-584, -32, -32, -32, 8, 32, -32, 0, 32, -6, 32, 32, -58, -42, -10, 46], [-455, -8, -8, -8, -47, 173, -8, 0, 8, 25, 8, 8, -95, 9, 55, 15], [324, -21, -21, -21, -49, -176, -21, 0, 21, 80, 21, 21, 30, -32, -21, -19], [-238, 54, 54, 54, -83, 156, 54, 0, -54, -34, -54, -54, 22, 50, -36, 72], [80, 40, 40, 40, -38, 16, 40, 0, -40, 16, -40, -40, 120, -6, -32, -2], [0, 15, -4, -202, 0, 0, -182, -70, 126, 0, 104, 30, 0, 0, 0, 0], [154, -55, -55, -55, -38, -302, -55, 0, 55, 26, 55, 55, -74, -42, 40, -34], [-470, 36, 36, 36, 95, 130, 36, 0, -36, 50, -36, -36, -22, 6, 96, -8], [0, -107, -66, -68, 0, 0, 51, 48, -52, 0, -91, 76, 0, 0, 0, 0], [0, -11, -9, -70, 0, 0, 109, 147, -56, 0, -17, -12, 0, 0, 0, 0], [0, -128, -207, -187, 0, 0, -54, -41, 15, 0, -35, 82, 0, 0, 0, 0], [250, -3, -3, -3, 31, 32, -3, 0, 3, 157, 3, 3, -92, 0, 81, 5], [0, 8, 108, 124, 0, 0, -36, 32, 27, 0, -29, -77, 0, 0, 0, 0], [0, 221, 68, 136, 0, 0, 4, -12, 62, 0, -70, -84, 0, 0, 0, 0], [180, -34, -34, -34, -5, -326, -34, 0, 34, -116, 34, 34, 24, -8, -128, 44], [0, -12, -4, -158, 0, 0, -90, 24, 56, 0, 32, 144, 0, 0, 0, 0], [228, 18, 18, 18, -131, -140, 18, 0, -18, -164, -18, -18, 54, 4, -74, 52], [0, -88, 46, 82, 0, 0, 14, 38, -86, 0, 72, -80, 0, 0, 0, 0], [0, -34, -20, 151, 0, 0, 35, -67, -116, 0, -104, -78, 0, 0, 0, 0], [0, -117, -193, -172, 0, 0, -156, -63, 12, 0, -28, 136, 0, 0, 0, 0], [-326, -15, -15, -15, 7, 35, -15, 0, 15, -102, 15, 15, -13, -4, -68, 55], [198, 30, 30, 30, -22, 346, 30, 0, -30, 128, -30, -30, -18, 0, 52, 26], [0, 88, 114, 15, 0, 0, 47, 74, 158, 0, 163, -49, 0, 0, 0, 0], [531, 54, 54, 54, 85, 51, 54, 0, -54, -11, -54, -54, 7, 7, 55, 39], [0, 42, 47, 73, 0, 0, 80, 193, -55, 0, -95, -80, 0, 0, 0, 0], [174, -7, -7, -7, -19, -94, -7, 0, 7, -9, 7, 7, 46, -10, 31, -81], [0, -25, -34, -153, 0, 0, 21, 26, 121, 0, 222, 38, 0, 0, 0, 0], [0, 124, 24, -3, 0, 0, -71, -1, -11, 0, 59, 49, 0, 0, 0, 0], [262, -24, -24, -24, -130, 135, -24, 0, 24, -160, 24, 24, -11, -12, -31, 6], [0, -129, -184, 33, 0, 0, 103, -20, -78, 0, -95, -13, 0, 0, 0, 0], [-74, 24, 24, 24, 112, -241, 24, 0, -24, 6, -24, -24, -31, 28, -23, 74], [412, 41, 41, 41, -197, 2, 41, 0, -41, 47, -41, -41, 42, 8, 39, -7], [0, 139, 138, 166, 0, 0, 201, 222, -2, 0, -65, -86, 0, 0, 0, 0], [0, -5, -74, 0, 0, 0, -46, -50, -18, 0, 4, 150, 0, 0, 0, 0], [-104, -4, -4, -4, 43, 330, -4, 0, 4, -60, 4, 4, 52, -4, -32, -24], [0, 149, 39, 68, 0, 0, 43, -101, -106, 0, -5, -48, 0, 0, 0, 0], [-233, 20, 20, 20, -149, 311, 20, 0, -20, -87, -20, -20, 99, 39, -93, -5], [70, -26, -26, -26, 130, 42, -26, 0, 26, -4, 26, 26, 90, -20, -52, -70], [0, -2, -37, -149, 0, 0, -63, -103, 3, 0, -20, 80, 0, 0, 0, 0], [0, -81, 6, -82, 0, 0, 88, -72, -156, 0, 0, 22, 0, 0, 0, 0], [14, -90, -90, -90, 252, 64, -90, 0, 90, 6, 90, 90, -30, -12, -78, -60], [0, 147, 174, 246, 0, 0, 149, 10, -52, 0, -27, -140, 0, 0, 0, 0], [410, 5, 5, 5, 71, -182, 5, 0, -5, -107, -5, -5, 30, -36, 59, -43], [474, 1, 1, 1, -125, -417, 1, 0, -1, -114, -1, -1, 15, -28, -40, 55], [121, 48, 48, 48, 61, -115, 48, 0, -48, -19, -48, -48, -79, 21, 107, 47], [-312, 53, 53, 53, -238, -354, 53, 0, -53, 32, -53, -53, 84, 4, 34, -16], [0, 33, 128, 241, 0, 0, 145, -2, -55, 0, -92, -38, 0, 0, 0, 0], [-296, 41, 41, 41, 57, 613, 41, 0, -41, 8, -41, -41, 5, -34, 68, 43], [0, 30, 53, -8, 0, 0, 12, -58, 80, 0, -61, -85, 0, 0, 0, 0], [0, 197, 134, -51, 0, 0, 39, -3, 44, 0, 192, -60, 0, 0, 0, 0], [0, -101, 42, -93, 0, 0, -85, 34, -46, 0, 113, -41, 0, 0, 0, 0], [0, -136, -2, 6, 0, 0, -16, -154, 18, 0, -44, 18, 0, 0, 0, 0], [0, -138, -104, -42, 0, 0, 46, -132, -12, 0, 140, 36, 0, 0, 0, 0], [450, -6, -6, -6, -25, -98, -6, 0, 6, -66, 6, 6, 44, -2, -28, -26], [0, -172, -100, -94, 0, 0, -106, -122, -60, 0, 162, 60, 0, 0, 0, 0], [-472, 6, 6, 6, -42, 374, 6, 0, -6, -58, -6, -6, -10, 56, -44, 10], [-161, -62, -62, -62, 85, 247, -62, 0, 62, -35, 62, 62, 27, -13, 43, -181], [0, 149, 106, 219, 0, 0, -5, -130, -26, 0, -79, -71, 0, 0, 0, 0], [0, 100, 114, 416, 0, 0, 230, 110, -132, 0, -84, -140, 0, 0, 0, 0], [-179, -84, -84, -84, 107, 653, -84, 0, 84, 7, 84, 84, -101, -83, 41, -25], [0, 94, 37, 149, 0, 0, 70, 47, -117, 0, -41, 38, 0, 0, 0, 0], [468, -32, -32, -32, 65, 296, -32, 0, 32, 88, 32, 32, 54, -20, -34, -64], [-472, -21, -21, -21, 197, 284, -21, 0, 21, 7, 21, 21, 0, 0, 59, -101], [2, -34, -34, -34, -170, 117, -34, 0, 34, 26, 34, 34, -113, 12, 59, -26], [-43, -4, -4, -4, -125, -419, -4, 0, 4, 87, 4, 4, 55, -11, 69, -121], [-96, 72, 72, 72, 52, -49, 72, 0, -72, 67, -72, -72, 35, 100, 1, 8], [0, -27, 88, 181, 0, 0, 236, 89, -51, 0, -110, -21, 0, 0, 0, 0], [0, -173, -157, -59, 0, 0, -185, -106, -39, 0, -87, 33, 0, 0, 0, 0], [286, 13, 13, 13, -195, -279, 13, 0, -13, 46, -13, -13, 25, -20, 0, 21], [0, -318, -146, 15, 0, 0, -73, -140, -72, 0, 39, 57, 0, 0, 0, 0], [-928, -40, -40, -40, 143, -390, -40, 0, 40, 172, 40, 40, 48, -44, 30, -114], [434, 1, 1, 1, 253, -616, 1, 0, -1, -37, -1, -1, -16, 6, -19, 31], [0, -16, 149, -27, 0, 0, -127, 49, 197, 0, 88, -54, 0, 0, 0, 0], [-241, 94, 94, 94, 7, -147, 94, 0, -94, -117, -94, -94, 115, 19, 17, 37], [26, 91, 91, 91, -303, -952, 91, 0, -91, -3, -91, -91, 116, 100, -45, 11], [0, -76, 61, 33, 0, 0, -74, -15, 93, 0, 25, 18, 0, 0, 0, 0], [-638, 15, 15, 15, 111, -102, 15, 0, -15, 71, -15, -15, 62, 42, -19, -55], [0, 116, -52, 141, 0, 0, -26, 2, -141, 0, -57, -14, 0, 0, 0, 0], [-100, 20, 20, 20, -173, -434, 20, 0, -20, -128, -20, -20, 110, 24, -102, 8], [-144, 21, 21, 21, 9, -108, 21, 0, -21, -19, -21, -21, 96, -6, 13, -61], [0, -60, -106, 152, 0, 0, 198, 70, -85, 0, 21, 51, 0, 0, 0, 0], [160, -23, -23, -23, -11, -114, -23, 0, 23, -28, 23, 23, -132, 28, 29, 29], [0, 259, 171, 191, 0, 0, 123, 160, -43, 0, 39, -175, 0, 0, 0, 0], [-350, 17, 17, 17, 87, 119, 17, 0, -17, -70, -17, -17, 75, -64, 92, -69], [378, -14, -14, -14, -262, 54, -14, 0, 14, 16, 14, 14, 66, -84, 68, -78], [0, -350, -271, -177, 0, 0, -156, -261, -75, 0, 17, 198, 0, 0, 0, 0], [0, 231, 10, 67, 0, 0, 105, 20, 95, 0, 98, 22, 0, 0, 0, 0], [726, 101, 101, 101, -321, -601, 101, 0, -101, 0, -101, -101, 143, -20, 50, 29], [0, 135, 39, -236, 0, 0, -214, 131, 238, 0, 234, 4, 0, 0, 0, 0], [0, -22, -30, 86, 0, 0, -119, -157, -94, 0, -4, 139, 0, 0, 0, 0], [0, 364, -8, 16, 0, 0, 88, 20, 36, 0, -22, 14, 0, 0, 0, 0], [0, -324, -256, -14, 0, 0, -66, -104, -109, 0, 25, 113, 0, 0, 0, 0], [396, -63, -63, -63, -199, 516, -63, 0, 63, 54, 63, 63, -102, -52, 59, -31], [-284, 21, 21, 21, 183, -184, 21, 0, -21, -192, -21, -21, 130, -4, -95, 11], [0, -199, -47, -264, 0, 0, -194, -17, 68, 0, 82, 156, 0, 0, 0, 0], [284, 23, 23, 23, 237, 56, 23, 0, -23, -34, -23, -23, 30, -84, 113, -13], [-408, -80, -80, -80, 185, -32, -80, 0, 80, -64, 80, 80, -102, -24, -82, 48], [-246, -58, -58, -58, -22, 99, -58, 0, 58, 89, 58, 58, -193, -20, 79, 18], [-420, -30, -30, -30, -228, -274, -30, 0, 30, -80, 30, 30, -10, -90, 68, -28], [-470, -18, -18, -18, 80, -389, -18, 0, 18, 78, 18, 18, -67, 12, 129, -110], [-1124, 8, 8, 8, -79, -68, 8, 0, -8, 72, -8, -8, -90, 60, 114, -68], [0, 290, 164, 60, 0, 0, 70, 116, 0, 0, -76, -164, 0, 0, 0, 0], [0, 146, 114, -48, 0, 0, -46, 182, -6, 0, -90, -62, 0, 0, 0, 0], [0, 210, -107, 21, 0, 0, 67, -3, 7, 0, -168, 0, 0, 0, 0, 0], [0, 307, 4, 46, 0, 0, -102, -36, -22, 0, -192, -4, 0, 0, 0, 0], [0, 47, 46, 64, 0, 0, -18, -116, -10, 0, 218, 98, 0, 0, 0, 0], [0, -73, -151, -224, 0, 0, -86, -179, -22, 0, 50, 100, 0, 0, 0, 0], [0, 195, 108, 159, 0, 0, -11, -16, 154, 0, -135, 39, 0, 0, 0, 0], [278, -120, -120, -120, 90, -354, -120, 0, 120, 50, 120, 120, -28, -128, -14, -70], [468, 29, 29, 29, -87, 308, 29, 0, -29, -146, -29, -29, 154, -68, -41, 13], [0, 195, 128, 351, 0, 0, 269, 150, -144, 0, -39, -199, 0, 0, 0, 0], [0, 10, 141, 50, 0, 0, 198, 210, -64, 0, 25, -35, 0, 0, 0, 0], [149, -4, -4, -4, 153, -683, -4, 0, 4, 121, 4, 4, -51, 9, 83, -49], [-177, -56, -56, -56, 93, -511, -56, 0, 56, -5, 56, 56, -113, 19, 17, -35], [0, -27, 45, 162, 0, 0, 180, 167, -114, 0, -246, -172, 0, 0, 0, 0], [0, -59, -254, -108, 0, 0, -23, 58, -108, 0, 41, 94, 0, 0, 0, 0], [550, 37, 37, 37, -115, -257, 37, 0, -37, -170, -37, -37, 79, 2, -58, 51], [0, 146, 108, -239, 0, 0, -91, 31, 132, 0, 128, 70, 0, 0, 0, 0], [-276, 42, 42, 42, 88, 8, 42, 0, -42, -36, -42, -42, 36, -106, 108, 46], [0, -313, -281, -222, 0, 0, -321, -175, -18, 0, -159, 104, 0, 0, 0, 0], [0, 27, -68, -79, 0, 0, -81, 118, -30, 0, -83, -51, 0, 0, 0, 0], [0, -86, 118, 137, 0, 0, 77, -36, -196, 0, -197, -135, 0, 0, 0, 0], [0, 243, -68, -194, 0, 0, -53, -152, 142, 0, 53, 66, 0, 0, 0, 0], [-463, 20, 20, 20, -265, 381, 20, 0, -20, 39, -20, -20, 3, 25, -139, 151], [880, -91, -91, -91, 103, -122, -91, 0, 91, -73, 91, 91, 74, -4, -177, -75], [0, -187, -141, 66, 0, 0, -172, -127, -118, 0, 10, 20, 0, 0, 0, 0], [0, -49, -184, 101, 0, 0, 157, -21, -40, 0, -118, 0, 0, 0, 0, 0], [0, 228, 165, 189, 0, 0, 246, -13, -187, 0, 93, -36, 0, 0, 0, 0], [429, 72, 72, 72, 89, 1475, 72, 0, -72, 17, -72, -72, -9, 61, 75, 17], [-316, 12, 12, 12, -119, -612, 12, 0, -12, -52, -12, -12, -90, 76, 64, -26], [-306, 103, 103, 103, 244, -568, 103, 0, -103, 82, -103, -103, -42, 126, 58, 64], [1100, -51, -51, -51, -9, -797, -51, 0, 51, 110, 51, 51, -37, -44, -6, -15], [0, 41, -10, 50, 0, 0, 4, -28, 2, 0, -78, -114, 0, 0, 0, 0], [0, -24, 112, 390, 0, 0, 320, 84, -308, 0, -252, -154, 0, 0, 0, 0], [-204, -20, -20, -20, 377, 784, -20, 0, 20, -20, 20, 20, -182, 124, -18, 36], [0, -101, -160, -111, 0, 0, -63, 48, -39, 0, -106, 152, 0, 0, 0, 0], [0, -218, 44, 22, 0, 0, 75, 57, -186, 0, 142, -21, 0, 0, 0, 0], [0, -56, 138, 10, 0, 0, 0, 68, -8, 0, -4, -36, 0, 0, 0, 0], [-624, 127, 127, 127, -152, -736, 127, 0, -127, 24, -127, -127, 156, -64, 144, 18], [-278, -105, -105, -105, 85, 1037, -105, 0, 105, 118, 105, 105, -139, -48, 30, -53], [0, 226, -64, -85, 0, 0, -109, 83, 125, 0, 49, -57, 0, 0, 0, 0], [0, 85, 4, -430, 0, 0, -310, 4, 119, 0, 191, 67, 0, 0, 0, 0], [-332, 126, 126, 126, -108, 502, 126, 0, -126, 28, -126, -126, 174, -16, 56, 38], [236, -66, -66, -66, 122, -630, -66, 0, 66, -166, 66, 66, 98, -48, 12, -194], [0, -48, 188, -100, 0, 0, 0, 88, 146, 0, 38, 96, 0, 0, 0, 0], [0, 292, 185, -1, 0, 0, 25, -65, -37, 0, 96, 64, 0, 0, 0, 0], [372, 24, 24, 24, -40, 408, 24, 0, -24, -270, -24, -24, 30, 62, 2, -46], [0, 135, 83, 72, 0, 0, -149, 87, 160, 0, -179, 22, 0, 0, 0, 0], [159, -20, -20, -20, 45, 437, -20, 0, 20, 127, 20, 20, 27, 111, 9, -187], [0, -54, 82, 96, 0, 0, 106, 24, -26, 0, 146, -142, 0, 0, 0, 0], [0, -243, -132, -105, 0, 0, -33, 18, 61, 0, -114, -60, 0, 0, 0, 0], [-619, -158, -158, -158, 189, -575, -158, 0, 158, 131, 158, 158, -29, -163, -27, -97], [256, 57, 57, 57, -115, 270, 57, 0, -57, 40, -57, -57, 168, -40, 81, -95], [526, 40, 40, 40, 33, -1180, 40, 0, -40, -106, -40, -40, -38, 30, 56, 32], [0, -14, -50, 247, 0, 0, 49, -51, -102, 0, -226, -46, 0, 0, 0, 0], [0, 107, 134, -151, 0, 0, 31, 27, 276, 0, -46, -14, 0, 0, 0, 0], [0, -163, 136, 33, 0, 0, 99, 30, 93, 0, 240, -118, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1150_d_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1150_3_d_b();".
// 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_1150_3_d_b(:prec:=16)
    chi := MakeCharacter_1150_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_1150_3_d_b();".
// 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_1150_3_d_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1150_d();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<3,R![1336, -3704, -4114, 456, 829, -16, -52, 0, 1]>],Snew);
    return Vf;
end function;