
// Make newform 1148.2.i.d in Magma, downloaded from the LMFDB on 27 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1148_i();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1148_i_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_1148_2_i_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_1148_2_i_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 := [121, -660, 2775, -5182, 8145, -4919, 5529, -2100, 2685, -568, 706, -87, 136, -8, 14, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [8034654060157036513, -25305199101655440, 12994566126392139, 5322936685577548599, -1869054719901640995, 3883000495870123846, -1299260518357132716, 2015604178438858179, -378221909206358939, 537049880243353760, -66921393935742251, 105335780848540510, -6485068468898700, 10806309789157715, -90657693823740, 780476607889860], [-628078471293921780, 2547382187843875614, 590253206031602881, 5569715434652918610, -609486967635570285, 3750335575508080305, 97689221463465279, 2073969357212179126, 18299549023342728, 577863348742651743, 25879304059559947, 117722757316174364, 3499967095918123, 12695442019345546, 780476607889860, 913292836654949], [-4049415427203613834, -799584084296194560, 2847832657552212838, 19906625080003062690, -2134144151886343350, 16442760501465139364, 2207270426229063267, 9150246496112283838, 252846882325812290, 2485803977795964337, 154194179133320250, 523330485571362028, 9305383784116747, 56677408200185342, 3812484629844360, 4572267508647047], [-54137605536294027660, 253720565374344881942, -1629897809507746106657, 1277346186935558250330, -1540678187372657723355, 782728947339221832921, -767752255836227766523, 376589330624672017654, -219330848018062886340, 95619591623053842749, -39407105956774649875, 18934153970045508190, -4085450739326494695, 1927451091102151942, -178204148988571706, 155044131612905963], [-49932150664970082960, 203832942589769042053, -99278396820069455332, 473509252635343784655, -105791547455390704452, 351933409938123713853, -22914601517441937377, 174195568380603844088, -8390538382601918157, 48588630007357744024, 305130039696101887, 9819613952551524221, 84120867721335663, 1087951016207688158, 62656408743567419, 80352162859543897], [-9663504211352675046, 164939854160950626191, -234615188241099955650, 458359202327735353965, -239611581423483956265, 316769660325561165489, -97092227044960187614, 153509540077818586308, -26075191499735155467, 40595890593155957297, -3672579397028554256, 7803833464961768633, -317134480546414834, 807957842515416180, 10046221203204439, 57098042844901980], [-11764752278995496543, 2372379908735092740, -8209698241432178119, -73536347235924406872, 11934414817022812395, -59243082582111251291, 1804220478619772214, -32516534755885227334, 450883738373513644, -9114112815581019613, -234208043010112029, -1828799575469276860, -42618731780100016, -196190324589487490, -10654557861806460, -13768306337420915], [132418327154742073, 6483231491927948340, -23514324919696431172, -131655043690298281791, 7415997838355686800, -114865264453888455221, -11481250003078998417, -64718726468327036347, -4170061753174424855, -18638450843813729299, -1644350388232390080, -3756035289132322702, -224733207884142661, -410086386678702503, -32072467399588440, -28084790708038187], [30206105399645762257, -494541205292733668733, 733568220305014599675, -1433629910524559096484, 739394346189369919740, -993021986431254858773, 305568546836809022718, -482700266196283198893, 82386015500475414730, -127695220462144763251, 11753873524378827529, -24570193984219251509, 1022739194797130202, -2542742935226983405, -29141428977552177, -179879371221494400], [399293950415621241420, -1686471009701311889821, 3605627230677670548928, -5105599504454018633775, 3308104027417853453307, -3461836791764849857929, 1443437174172852152354, -1667930633774952024110, 392965187406109033461, -437022940638726066505, 61873258476416051714, -83982043314345290699, 5809893155253891246, -8638680375870167960, 50103432857831551, -620256025308244210], [-47318936372584568483, 16522759326121596240, -58286360548016280931, -409157911452156282963, 57221674384605398715, -364267988458938672326, -8394903393088675650, -201653889660631616011, -2411817133067431037, -57242336149328628010, -2663333790829272573, -11460782503377672238, -381284216155455616, -1236835964953177307, -77242804403670180, -86629913538641744], [45600882501242652745, -17223451703662159560, 60006246503279072795, 484007321203375662927, -77209646535123967995, 412494921314283552724, -1331667690206489862, 227030960526941146685, -1250853133884803369, 63888911527086652802, 2076353231317732509, 12812180382380897186, 313743183676980932, 1377142928376159829, 78458574927513780, 97439698231600042], [428028607184168802240, -1824736229540487564698, 4662497746928432728640, -5867610390280262955450, 4282702635188819483166, -3873575309990599570968, 1931262538204968412792, -1885421991512997903409, 525991023983309494242, -490911922589610353345, 86894731226528281921, -94818453987311438191, 8392699134716861304, -9660382162145146246, 201746312306747582, -701394259253807519], [38855675475934455600, -165455963769864967928, 400975883068341362333, -528201088172267201040, 380469898316401499424, -347839987638179750526, 171251781949256722432, -170635286186528126926, 47019028360987770429, -44613237399977247962, 7706799959470290022, -8675846214483398614, 746043927916644528, -888366754218911572, 15750424683004205, -64903022546980538]];
    Rf_basisdens := [1, 1, 2715054164464095114, 2715054164464095114, 4072581246696142671, 89596787427315138762, 44798393713657569381, 29865595809105046254, 4072581246696142671, 8145162493392285342, 29865595809105046254, 89596787427315138762, 8145162493392285342, 8145162493392285342, 44798393713657569381, 4072581246696142671];
    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_1148_i();"
function MakeCharacter_1148_i()
    N := 1148;
    order := 3;
    char_gens := [575, 493, 785];
    v := [3, 2, 3];
    // 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_1148_i_Hecke();"
function MakeCharacter_1148_i_Hecke(Kf)
    N := 1148;
    order := 3;
    char_gens := [575, 493, 785];
    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, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    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 := 2;
    raw_aps := [[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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0], [-1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 1, 1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1], [0, 0, -1, -1, 0, 1, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, -1, 0, 0], [0, 1, 0, 0, 0, 0, 0, -1, 2, 0, 1, 2, 0, 1, -1, 0], [4, 0, 0, 0, 0, 1, -1, -4, 0, 0, 0, -1, 0, 0, 1, -1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, -1, 0, 0], [-3, 0, 0, -1, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, -2, 1], [0, 0, 0, 0, 1, 2, -1, 0, 0, -2, 0, 0, -2, -1, 1, -2], [0, 3, 0, 0, 0, 1, 0, -1, -1, -1, 1, -1, -1, -1, 1, -1], [0, 0, -1, 0, 0, 3, 0, 0, 0, 0, -1, 2, 0, 0, -1, 0], [0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 1, -2, 2, 1], [1, -1, 0, 1, 0, 0, 0, 0, 1, -2, 0, 0, -2, 1, 0, 0], [0, 2, 0, 0, 1, 2, -1, -2, 1, -2, 1, 1, -2, 0, 0, -2], [-2, 0, 0, -3, 0, -1, 2, 2, 0, 0, 0, 1, 0, 0, 2, 1], [-6, 0, -1, 0, 2, 0, 0, 0, -1, -1, 0, 0, -3, 0, 0, 0], [1, 0, -1, 3, 0, 5, -1, -1, 0, 0, -1, -1, 0, 0, -3, -1], [-3, 0, -2, 0, 0, 0, 0, 0, -2, 1, 0, 0, -2, -1, 0, 0], [0, 2, 0, 0, -1, 0, 1, 1, 0, 0, 0, 0, 0, -2, 2, 0], [0, 0, 0, -2, 0, -2, 2, 0, 0, 0, 0, 1, 0, 0, -1, 1], [2, 0, 2, -3, 0, -4, 3, -2, 0, 0, 2, 0, 0, 0, 1, 1], [0, -3, 0, 0, -1, -4, 1, 4, 0, 4, 2, 0, 0, -2, 2, 0], [-1, 1, -2, -1, 2, 0, 0, 0, 1, -1, 0, 0, -2, 1, 0, 0], [2, 0, 1, 0, 1, 0, 0, 0, -2, -3, 0, 0, 2, 4, 0, 0], [3, 0, 4, 1, 0, -4, 1, -3, 0, 0, 4, -1, 0, 0, 0, 0], [0, 0, 0, 0, 3, 0, -3, 0, 1, 0, 0, 1, 0, 2, -2, 0], [-1, -3, 3, 3, 3, 0, 0, 0, 1, -1, 0, 0, 2, 3, 0, 0], [10, 0, 2, -1, 0, 0, 1, -10, 0, 0, 2, -1, 0, 0, 1, 0], [0, -3, 0, 0, 1, -3, -1, 6, -2, 3, -2, -2, 0, -2, 2, 0], [0, -2, 0, 0, 1, -8, -1, -3, -2, 8, 0, -2, 2, -2, 2, 2], [9, 0, 5, 2, 0, -2, -3, -9, 0, 0, 5, -2, 0, 0, 3, -5], [-4, 1, 3, -1, 0, 0, 0, 0, -1, -4, 0, 0, 2, 0, 0, 0], [-1, 0, 3, 3, 0, 2, -4, 1, 0, 0, 3, -2, 0, 0, -1, -4], [0, 0, 0, 0, 1, 1, -1, 4, -6, -1, 0, -6, -3, -2, 2, -3], [4, -2, 1, 2, -3, 0, 0, 0, -1, 4, 0, 0, 3, 0, 0, 0], [3, 0, 5, 1, 0, -3, -1, -3, 0, 0, 5, 0, 0, 0, 1, 0], [0, 0, 0, 0, 5, 3, -5, 4, -2, -3, -3, -2, -3, 2, -2, -3], [-4, 2, -1, -2, -1, 0, 0, 0, -4, -1, 0, 0, -2, 0, 0, 0], [0, -3, 0, 0, 1, -3, -1, 1, -1, 3, -1, -1, -1, 3, -3, -1], [-4, -2, 0, 2, 3, 0, 0, 0, -5, 2, 0, 0, -3, -2, 0, 0], [-3, -3, -1, 3, -2, 0, 0, 0, -3, 4, 0, 0, 0, -5, 0, 0], [0, -2, 0, 0, -1, -5, 1, -1, -2, 5, 0, -2, -1, 3, -3, -1], [-2, 0, 3, 4, 0, -6, 4, 2, 0, 0, 3, 5, 0, 0, 3, 1], [3, 0, 1, -1, 0, 0, -5, -3, 0, 0, 1, -4, 0, 0, -1, -6], [7, -2, 0, 2, 1, 0, 0, 0, 1, -5, 0, 0, 3, 9, 0, 0], [0, 0, 0, 0, 2, 1, -2, -3, 0, -1, -4, 0, -3, 1, -1, -3], [-5, -1, 1, 1, 6, 0, 0, 0, 1, -2, 0, 0, 0, -1, 0, 0], [-3, 0, -5, 3, 0, -1, 0, 3, 0, 0, -5, -4, 0, 0, 1, 2], [0, -2, 0, 0, 2, 1, -2, -5, -5, -1, -4, -5, 0, 1, -1, 0], [0, 0, 0, 0, 0, 2, 0, -3, -3, -2, 0, -3, -5, -2, 2, -5], [5, 0, -5, -6, 0, -2, 3, -5, 0, 0, -5, 5, 0, 0, 2, 5], [0, -4, 0, 0, -3, -1, 3, 8, 1, 1, -3, 1, 4, 4, -4, 4], [-4, -1, 1, 1, -3, 0, 0, 0, 4, 2, 0, 0, -1, 2, 0, 0], [0, 0, 0, 0, 3, -4, -3, -2, -3, 4, 0, -3, 1, 3, -3, 1], [2, 2, -4, -2, -1, 0, 0, 0, 4, 1, 0, 0, 0, 2, 0, 0], [-1, 5, 1, -5, -1, 0, 0, 0, -1, -1, 0, 0, 0, -5, 0, 0], [0, 2, 0, 0, 1, -4, -1, -10, -1, 4, 4, -1, 3, -1, 1, 3], [-1, 0, 3, 3, 0, -1, 7, 1, 0, 0, 3, 4, 0, 0, 2, 3], [7, 0, -3, -2, 0, 2, -1, -7, 0, 0, -3, 2, 0, 0, -4, 4], [10, 0, 1, 6, 0, 2, 1, -10, 0, 0, 1, 0, 0, 0, 2, -1], [5, -1, 7, 1, -3, 0, 0, 0, -1, -4, 0, 0, 3, 0, 0, 0], [0, -1, 0, 0, 1, 0, -1, 3, -3, 0, 3, -3, -1, 3, -3, -1], [-2, 4, -3, -4, 3, 0, 0, 0, -7, 1, 0, 0, -5, 0, 0, 0], [0, 0, 0, 0, -6, 2, 6, -1, 0, -2, 4, 0, 1, -3, 3, 1], [2, 0, 0, 2, 0, -3, 10, -2, 0, 0, 0, 3, 0, 0, 3, 3], [0, 4, 0, 0, -3, 3, 3, -11, -3, -3, 3, -3, 1, 4, -4, 1], [9, 0, 5, -2, 0, -8, 3, -9, 0, 0, 5, 4, 0, 0, -3, 3], [-5, 1, -1, -1, 4, 0, 0, 0, -2, -2, 0, 0, -7, -3, 0, 0], [3, 0, 6, -2, 0, -9, 4, -3, 0, 0, 6, -2, 0, 0, 4, -2], [0, 9, 0, 0, 0, 6, 0, -7, 3, -6, 2, 3, -2, 2, -2, -2], [-9, 0, -3, 1, 0, -4, -4, 9, 0, 0, -3, 2, 0, 0, 3, 0], [2, 0, -4, 0, 0, 12, -1, -2, 0, 0, -4, -1, 0, 0, -3, 3], [0, -5, 0, 0, 4, -2, -4, 0, 1, 2, 4, 1, 3, 2, -2, 3], [-3, 5, -8, -5, -5, 0, 0, 0, 2, 7, 0, 0, 2, -4, 0, 0], [-12, 5, -4, -5, 1, 0, 0, 0, -7, 4, 0, 0, -4, -2, 0, 0], [0, -1, 0, 0, -5, -1, 5, -4, -2, 1, 4, -2, 0, 4, -4, 0], [-6, -1, -1, 1, 2, 0, 0, 0, -1, 1, 0, 0, -7, -7, 0, 0], [-4, 0, -3, 1, 0, 8, -10, 4, 0, 0, -3, -2, 0, 0, -3, -5], [1, 0, -4, -4, 0, -3, 8, -1, 0, 0, -4, 7, 0, 0, 2, 3], [-12, 4, -6, -4, 0, 0, 0, 0, 2, 0, 0, 0, -5, -7, 0, 0], [10, 0, -4, 3, 0, 1, -2, -10, 0, 0, -4, -1, 0, 0, -2, 1], [-4, 2, 4, -2, -2, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0], [-3, -5, -1, 5, -2, 0, 0, 0, 1, 2, 0, 0, -1, 6, 0, 0], [-4, 0, 1, -5, 0, -7, -5, 4, 0, 0, 1, -3, 0, 0, 5, -2], [0, -4, 0, 0, 5, 0, -5, 1, -4, 0, -3, -4, 0, -4, 4, 0], [0, -5, 0, 0, 7, 0, -7, -2, 3, 0, -3, 3, 1, 2, -2, 1], [2, -5, 5, 5, 0, 0, 0, 0, 4, 3, 0, 0, 1, 0, 0, 0], [2, 0, -5, 3, 0, 12, -2, -2, 0, 0, -5, 0, 0, 0, -8, 0], [-2, -1, 2, 1, -7, 0, 0, 0, 4, 2, 0, 0, 0, -5, 0, 0], [1, 0, 2, 10, 0, 0, -2, -1, 0, 0, 2, 1, 0, 0, -6, -1], [0, -2, 0, 0, -3, 3, 3, 8, 8, -3, 1, 8, 1, -2, 2, 1], [0, 0, 2, 0, 0, 6, -1, 0, 0, 0, 2, 3, 0, 0, -2, 6], [10, 0, -4, -3, 0, -4, 1, -10, 0, 0, -4, 5, 0, 0, 7, 0], [-2, -9, 10, 9, -1, 0, 0, 0, 1, 2, 0, 0, 6, -2, 0, 0], [0, -13, 0, 0, 1, -1, -1, 4, 0, 1, -3, 0, 1, -1, 1, 1], [0, -4, 0, 0, 2, 6, -2, -7, -3, -6, -7, -3, 3, 0, 0, 3], [-2, 0, 0, -4, 0, 3, -1, 2, 0, 0, 0, -1, 0, 0, 7, -5], [0, -3, 0, 0, 7, 5, -7, 8, 10, -5, 7, 10, -3, 1, -1, -3], [0, -5, 0, 0, -1, 2, 1, 0, 4, -2, -3, 4, 4, 10, -10, 4], [5, -3, 5, 3, -5, 0, 0, 0, 4, 1, 0, 0, 4, 2, 0, 0], [0, 0, -3, 2, 0, -1, -2, 0, 0, 0, -3, -8, 0, 0, -4, 3], [0, 8, 0, 0, 1, 8, -1, -2, 7, -8, 2, 7, 6, 8, -8, 6], [-6, -5, 3, 5, 0, 0, 0, 0, 0, 5, 0, 0, 4, -1, 0, 0], [4, 0, 3, -4, 0, -3, 3, -4, 0, 0, 3, 0, 0, 0, -6, -1], [0, 1, 0, 0, -6, -5, 6, -1, 0, 5, 2, 0, -3, -8, 8, -3], [-4, 0, 5, 0, 2, 0, 0, 0, 8, -12, 0, 0, 3, 1, 0, 0], [0, -6, 0, 0, -3, -8, 3, -11, -1, 8, 2, -1, -2, -5, 5, -2], [2, -6, 3, 6, -2, 0, 0, 0, 3, 8, 0, 0, 8, 5, 0, 0], [0, 6, 0, 0, -7, 6, 7, -5, 6, -6, 6, 6, -2, -4, 4, -2], [9, 1, 9, -1, 2, 0, 0, 0, 0, -1, 0, 0, 4, 4, 0, 0], [0, -5, 0, 0, 3, 6, -3, -9, 8, -6, 2, 8, -3, 0, 0, -3], [1, 0, 11, 4, 0, 1, -3, -1, 0, 0, 11, 1, 0, 0, 5, -2], [6, -5, 1, 5, -2, 0, 0, 0, 1, 1, 0, 0, -2, -4, 0, 0], [0, 5, 0, 0, -6, 0, 6, -7, 1, 0, 1, 1, 1, -5, 5, 1], [-9, 1, -4, -1, -3, 0, 0, 0, 1, -1, 0, 0, -1, -2, 0, 0], [-6, 0, -4, 5, 0, 3, 6, 6, 0, 0, -4, 3, 0, 0, -7, 4], [0, -13, 0, 0, -1, 1, 1, 7, 3, -1, -3, 3, 5, 1, -1, 5], [8, 0, 3, -2, 0, -7, 3, -8, 0, 0, 3, 9, 0, 0, 0, -2], [5, -9, 4, 9, 3, 0, 0, 0, -5, -1, 0, 0, 3, 12, 0, 0], [11, 0, -5, -3, 0, 1, -2, -11, 0, 0, -5, -3, 0, 0, -6, -4], [1, 0, -4, 1, 0, -6, -1, -1, 0, 0, -4, -7, 0, 0, -4, 2], [-15, 11, -8, -11, -2, 0, 0, 0, 0, 4, 0, 0, 3, 3, 0, 0], [-1, 0, 5, 8, 0, 2, -5, 1, 0, 0, 5, -7, 0, 0, 4, -5], [0, -1, 0, 0, -11, 1, 11, 2, 5, -1, 0, 5, 2, -5, 5, 2], [2, 3, 0, -3, 4, 0, 0, 0, -3, -6, 0, 0, -7, 1, 0, 0], [-12, 0, 3, -4, 0, 0, -3, 12, 0, 0, 3, 11, 0, 0, 3, 3], [-8, -1, 0, 1, -2, 0, 0, 0, -2, -1, 0, 0, 3, -2, 0, 0], [-8, 0, -7, 3, 0, 11, 1, 8, 0, 0, -7, 3, 0, 0, -13, 2], [6, 6, -6, -6, 1, 0, 0, 0, -6, -5, 0, 0, -4, -4, 0, 0], [0, -2, 0, 0, 3, -6, -3, 12, -11, 6, -4, -11, 3, 1, -1, 3], [0, 1, 0, 0, -1, -3, 1, -11, -11, 3, -5, -11, -1, 3, -3, -1], [0, 1, 8, -1, -1, 0, 0, 0, 4, -8, 0, 0, -6, 3, 0, 0], [0, 10, 0, 0, -7, 2, 7, -2, 0, -2, -3, 0, 0, -9, 9, 0], [1, 8, -4, -8, -2, 0, 0, 0, 6, 9, 0, 0, -1, -4, 0, 0], [6, 0, -4, 3, 0, 10, -3, -6, 0, 0, -4, 6, 0, 0, -5, 7], [0, 0, 0, 0, 3, 1, -3, -1, -3, -1, 4, -3, -8, 3, -3, -8], [4, 8, -5, -8, -2, 0, 0, 0, 5, -10, 0, 0, -5, 4, 0, 0], [0, -7, 0, 0, -1, -3, 1, 7, -5, 3, -11, -5, 3, 5, -5, 3], [-3, 0, 0, 0, 6, 0, 0, 0, 1, -5, 0, 0, -5, 7, 0, 0], [18, 5, 5, -5, -4, 0, 0, 0, -3, -6, 0, 0, 1, -1, 0, 0], [0, 5, 0, 0, 4, -3, -4, -5, -13, 3, 2, -13, -7, -1, 1, -7], [13, 0, -2, -1, 0, -2, 11, -13, 0, 0, -2, 7, 0, 0, -4, 8], [8, 0, 1, 3, 0, 11, -9, -8, 0, 0, 1, -6, 0, 0, -1, -3], [0, 0, 7, -4, 0, -14, 1, 0, 0, 0, 7, -4, 0, 0, -2, -3], [-4, 3, -12, -3, -8, 0, 0, 0, 7, 6, 0, 0, -4, -8, 0, 0], [11, -9, 2, 9, -4, 0, 0, 0, -4, 4, 0, 0, 8, -8, 0, 0], [-11, 0, -6, -5, 0, 4, 1, 11, 0, 0, -6, 6, 0, 0, -6, -1], [0, -6, 0, 0, -4, 6, 4, 17, 5, -6, 1, 5, 2, -7, 7, 2], [-3, -6, 1, 6, 6, 0, 0, 0, -10, 11, 0, 0, 1, -2, 0, 0], [-10, 0, -3, 1, 0, 0, -6, 10, 0, 0, -3, 2, 0, 0, 1, -3], [-14, 0, 0, 9, 0, -4, 1, 14, 0, 0, 0, -1, 0, 0, 2, 3], [9, -4, -3, 4, -4, 0, 0, 0, 0, -4, 0, 0, 8, 7, 0, 0], [0, 8, 0, 0, 2, 11, -2, 2, 3, -11, -6, 3, 2, 10, -10, 2], [-7, 0, -8, 2, 0, -8, -1, 7, 0, 0, -8, -6, 0, 0, 2, 0], [8, -4, -1, 4, -7, 0, 0, 0, 6, 3, 0, 0, 8, -6, 0, 0], [17, 8, -3, -8, -3, 0, 0, 0, 3, -3, 0, 0, -4, 4, 0, 0], [6, 0, 4, -2, 0, -5, -2, -6, 0, 0, 4, -10, 0, 0, 11, -8], [0, 12, 0, 0, -1, 0, 1, 1, -9, 0, 9, -9, -2, 3, -3, -2], [0, -6, 0, 0, 2, 3, -2, 4, 12, -3, -8, 12, -1, 0, 0, -1], [0, -2, 0, 0, 2, 8, -2, -18, 2, -8, 4, 2, -7, -2, 2, -7], [0, 4, 0, 0, 0, -7, 0, 2, -17, 7, 6, -17, 0, 6, -6, 0], [-16, -2, -9, 2, 1, 0, 0, 0, -5, 1, 0, 0, -7, 0, 0, 0], [0, 0, 13, 5, 0, -6, 2, 0, 0, 0, 13, 1, 0, 0, 2, 3], [0, -1, 0, 0, 0, -12, 0, -13, -4, 12, -3, -4, 4, -1, 1, 4], [9, -3, -1, 3, 3, 0, 0, 0, -6, 6, 0, 0, -1, 5, 0, 0], [-6, 0, 10, -1, 0, 6, 1, 6, 0, 0, 10, 3, 0, 0, 4, -9], [0, -13, 0, 0, 3, -4, -3, 6, -4, 4, -10, -4, 4, 4, -4, 4], [0, -5, 0, 0, 1, -10, -1, 13, -3, 10, 3, -3, -1, -7, 7, -1], [9, -10, 1, 10, -8, 0, 0, 0, 6, 1, 0, 0, 5, 0, 0, 0], [-2, -4, -2, 4, -5, 0, 0, 0, 8, 6, 0, 0, -3, -1, 0, 0], [0, -16, 0, 0, 2, 4, -2, -1, -3, -4, -1, -3, -4, 1, -1, -4], [11, -8, 11, 8, -2, 0, 0, 0, 10, 1, 0, 0, 0, -1, 0, 0], [-3, 0, -5, 9, 0, -9, -4, 3, 0, 0, -5, -8, 0, 0, -5, 2], [-1, 0, 2, 2, 0, -14, 5, 1, 0, 0, 2, -9, 0, 0, 7, -4], [4, 1, 10, -1, 0, 0, 0, 0, 0, 2, 0, 0, -3, -4, 0, 0], [-12, -4, 1, 4, 4, 0, 0, 0, 9, -7, 0, 0, 4, 11, 0, 0], [0, 0, 0, 4, 0, -1, -12, 0, 0, 0, 0, -13, 0, 0, -4, -4], [0, -8, 0, 0, -4, -19, 4, -2, -3, 19, -3, -3, 6, 8, -8, 6], [0, 2, 0, 0, 12, 9, -12, 3, 7, -9, 2, 7, -2, 7, -7, -2], [0, 3, 0, 0, 2, -5, -2, 3, -10, 5, 6, -10, 7, 2, -2, 7], [0, 0, 0, 0, -9, -11, 9, -6, 8, 11, 4, 8, 5, -8, 8, 5], [10, 0, 3, -8, 0, -18, -1, -10, 0, 0, 3, -1, 0, 0, 2, 4], [0, 1, 0, 0, -8, -13, 8, 11, -3, 13, 1, -3, -1, -3, 3, -1], [-10, 0, -4, -11, 0, 9, -4, 10, 0, 0, -4, 8, 0, 0, 0, -4], [7, 1, 4, -1, 5, 0, 0, 0, -12, 5, 0, 0, 6, 8, 0, 0], [-5, 0, -8, -1, 0, 2, 1, 5, 0, 0, -8, 2, 0, 0, 11, 4], [-9, 0, -1, -16, 0, -9, 1, 9, 0, 0, -1, 5, 0, 0, 4, 1], [0, 13, 0, 0, -2, 10, 2, 0, 2, -10, -4, 2, 2, 8, -8, 2], [0, -4, 0, 0, 6, -3, -6, 27, -4, 3, -9, -4, -1, -1, 1, -1], [0, -2, 0, 0, -8, 5, 8, 12, 12, -5, -3, 12, 10, 3, -3, 10], [-6, 0, -4, 1, 0, 4, -9, 6, 0, 0, -4, 2, 0, 0, -9, 3], [-6, -2, 2, 2, -3, 0, 0, 0, -2, 3, 0, 0, 8, -8, 0, 0], [-12, 0, -2, -18, 0, -18, -2, 12, 0, 0, -2, -3, 0, 0, -2, 10], [0, -4, 0, 0, 4, 8, -4, 7, 7, -8, -13, 7, -3, 2, -2, -3], [6, -3, -7, 3, -6, 0, 0, 0, 7, 14, 0, 0, 10, -2, 0, 0], [8, 0, 3, 2, 0, -1, 8, -8, 0, 0, 3, 4, 0, 0, 5, 8], [0, -6, 0, 0, -8, -9, 8, 26, -3, 9, -3, -3, 7, 9, -9, 7], [9, -1, 0, 1, -8, 0, 0, 0, 7, -7, 0, 0, 7, -4, 0, 0], [0, 9, 0, 0, -7, -6, 7, -2, -5, 6, 10, -5, -1, -4, 4, -1], [10, 0, 5, 13, 0, -12, -2, -10, 0, 0, 5, -10, 0, 0, -1, -3], [3, 0, 2, 1, 0, 3, -7, -3, 0, 0, 2, 4, 0, 0, -13, 0], [-13, 11, 2, -11, -1, 0, 0, 0, -7, -5, 0, 0, 3, 16, 0, 0], [0, 5, 0, 0, 3, 24, -3, 5, 6, -24, -5, 6, -5, -6, 6, -5], [-6, 0, -3, -1, 0, 13, -1, 6, 0, 0, -3, -7, 0, 0, -11, 2], [17, 3, -4, -3, 2, 0, 0, 0, -2, 2, 0, 0, -7, -7, 0, 0], [2, -11, -1, 11, -3, 0, 0, 0, 17, 4, 0, 0, 0, -8, 0, 0], [-1, 0, 6, 6, 0, 10, -1, 1, 0, 0, 6, 9, 0, 0, -11, 0], [0, -2, 0, 0, 4, 13, -4, 13, 7, -13, 7, 7, -4, -3, 3, -4], [-11, 0, 3, -9, 0, -1, -3, 11, 0, 0, 3, 3, 0, 0, -10, 10], [0, -3, 0, 0, -11, -15, 11, -3, 8, 15, 11, 8, 4, -1, 1, 4], [0, 12, 0, 0, 2, -2, -2, 14, 4, 2, 3, 4, -8, 9, -9, -8], [-7, 0, -1, 14, 0, 5, -4, 7, 0, 0, -1, -7, 0, 0, 1, -6], [-13, -4, -4, 4, 0, 0, 0, 0, 3, 0, 0, 0, -4, 6, 0, 0], [9, 0, 0, -4, 0, -1, -3, -9, 0, 0, 0, -4, 0, 0, -4, -2], [8, -1, -8, 1, 1, 0, 0, 0, 13, -6, 0, 0, -5, -1, 0, 0], [7, 0, 7, 0, 0, -4, 0, -7, 0, 0, 7, -3, 0, 0, -9, -2], [-26, 0, -3, -6, 0, 1, 1, 26, 0, 0, -3, -3, 0, 0, 5, 5], [4, 1, -10, -1, 0, 0, 0, 0, -6, 12, 0, 0, 0, -13, 0, 0], [-15, 6, 8, -6, -9, 0, 0, 0, -8, -3, 0, 0, 5, -2, 0, 0], [0, 0, -1, -13, 0, 13, -3, 0, 0, 0, -1, -2, 0, 0, -6, 0], [0, -5, 0, 0, 1, -11, -1, -8, -10, 11, -6, -10, -2, -2, 2, -2], [21, 0, 8, 9, 0, 6, 11, -21, 0, 0, 8, 4, 0, 0, 3, 0], [-7, 0, -10, -9, 0, 15, -3, 7, 0, 0, -10, 16, 0, 0, -8, 3], [0, -22, 0, 0, 7, 5, -7, -2, -7, -5, -2, -7, -2, 8, -8, -2], [0, -1, 0, 0, -7, 7, 7, 11, -2, -7, -4, -2, -2, 1, -1, -2], [14, 5, 8, -5, 13, 0, 0, 0, -2, 0, 0, 0, -6, -3, 0, 0], [0, -8, 0, 0, 5, 11, -5, -13, 9, -11, -6, 9, -5, -8, 8, -5], [9, 3, -5, -3, 7, 0, 0, 0, 7, -5, 0, 0, -5, 0, 0, 0], [0, 11, 0, 0, -8, -3, 8, -1, 1, 3, -5, 1, 5, -15, 15, 5], [0, 0, -10, -13, 0, -7, 4, 0, 0, 0, -10, -5, 0, 0, 3, 0], [-15, 0, -3, -7, 0, -8, 4, 15, 0, 0, -3, -11, 0, 0, 6, 4], [3, 16, -3, -16, -4, 0, 0, 0, 9, 8, 0, 0, 6, -10, 0, 0], [8, 3, -2, -3, 4, 0, 0, 0, -5, -3, 0, 0, 1, 3, 0, 0], [0, 10, 0, 0, 3, 8, -3, -9, 2, -8, 1, 2, -6, 0, 0, -6], [28, 0, 1, 5, 0, 13, -5, -28, 0, 0, 1, -2, 0, 0, -2, -4], [0, 2, 0, 0, 5, 11, -5, 0, 13, -11, -9, 13, 2, -4, 4, 2], [14, 0, 5, -13, 0, -5, 3, -14, 0, 0, 5, -3, 0, 0, 16, -1], [9, -5, -3, 5, -3, 0, 0, 0, 8, -3, 0, 0, 1, -7, 0, 0], [-1, 0, 6, 18, 0, 11, -7, 1, 0, 0, 6, -2, 0, 0, 3, -7], [9, -5, -3, 5, 10, 0, 0, 0, 0, -8, 0, 0, -12, -4, 0, 0], [0, -2, 0, 0, 5, -17, -5, -23, -8, 17, 5, -8, 0, 4, -4, 0], [0, -10, 0, 0, 1, 4, -1, 26, -7, -4, -10, -7, 4, 2, -2, 4], [-1, -4, -5, 4, -5, 0, 0, 0, 1, -8, 0, 0, 1, 13, 0, 0], [-3, -16, 2, 16, -10, 0, 0, 0, 7, 4, 0, 0, 8, -12, 0, 0], [1, 0, -5, -13, 0, 10, -3, -1, 0, 0, -5, -1, 0, 0, 1, -5], [0, 0, 0, 0, 4, 2, -4, -24, -6, -2, 2, -6, -6, 11, -11, -6], [2, -2, 19, 2, -5, 0, 0, 0, -4, -3, 0, 0, 3, 1, 0, 0], [0, -3, 0, 0, -1, -14, 1, 19, 6, 14, 12, 6, -6, -1, 1, -6], [-21, 0, 2, -3, 0, -4, 11, 21, 0, 0, 2, -9, 0, 0, 1, 9], [0, 0, 0, 0, -14, -12, 14, 20, -2, 12, 9, -2, 10, 5, -5, 10], [0, 1, 0, 0, 3, 1, -3, -24, -2, -1, 9, -2, 2, -4, 4, 2], [3, 6, 5, -6, 7, 0, 0, 0, 5, 0, 0, 0, 4, -6, 0, 0], [22, 0, -1, -2, 0, -19, 4, -22, 0, 0, -1, -2, 0, 0, 8, 7], [0, -13, 0, 0, 1, 10, -1, -10, 6, -10, -3, 6, 5, 13, -13, 5], [10, 14, -6, -14, -1, 0, 0, 0, -6, 9, 0, 0, -6, -4, 0, 0], [0, -2, 0, 0, 4, 10, -4, 12, 10, -10, 7, 10, -6, 7, -7, -6], [-5, 5, -9, -5, 0, 0, 0, 0, 2, -3, 0, 0, -2, -4, 0, 0], [0, -5, 0, 0, 3, 6, -3, 0, -5, -6, -16, -5, 0, 1, -1, 0], [21, 0, 3, 14, 0, -11, 9, -21, 0, 0, 3, -5, 0, 0, 15, 2], [-3, 3, -2, -3, 3, 0, 0, 0, 0, -3, 0, 0, 5, 19, 0, 0], [0, -1, -4, 1, 4, 0, 0, 0, 8, 2, 0, 0, -10, -5, 0, 0], [-18, 13, -13, -13, -10, 0, 0, 0, 11, 3, 0, 0, 0, -6, 0, 0], [0, -26, 0, 0, -7, -7, 7, -2, 4, 7, 2, 4, 8, -1, 1, 8], [18, 0, 4, -5, 0, -6, -1, -18, 0, 0, 4, 7, 0, 0, -6, -3], [0, 8, 0, 0, 7, 3, -7, 25, -1, -3, 2, -1, -2, -1, 1, -2], [0, 18, 0, 0, 13, 17, -13, -3, -5, -17, 0, -5, -12, 1, -1, -12], [-4, 0, 1, -6, 0, -20, -7, 4, 0, 0, 1, -12, 0, 0, 8, 5], [18, -11, 12, 11, 5, 0, 0, 0, 1, -4, 0, 0, -2, -10, 0, 0], [17, 0, 2, -17, 0, 10, 0, -17, 0, 0, 2, 7, 0, 0, -10, 4], [-15, 0, 0, -2, 0, 1, 2, 15, 0, 0, 0, 0, 0, 0, -6, -12], [0, -2, 0, 0, 4, 7, -4, 16, 3, -7, 1, 3, -5, -7, 7, -5], [-4, 0, 3, 2, 0, 14, -9, 4, 0, 0, 3, 6, 0, 0, 4, -7], [3, 0, 0, 6, 0, 2, 4, -3, 0, 0, 0, 9, 0, 0, 12, 7], [0, 4, 0, 0, 7, -7, -7, 10, -7, 7, 10, -7, -5, 9, -9, -5], [0, -13, 0, 0, 3, 16, -3, -12, 5, -16, -1, 5, 2, -1, 1, 2], [-16, 17, -3, -17, -1, 0, 0, 0, 3, 9, 0, 0, -5, -5, 0, 0], [1, 13, -15, -13, -1, 0, 0, 0, -3, -7, 0, 0, -7, -8, 0, 0], [8, 0, -2, -2, 0, -9, 7, -8, 0, 0, -2, -7, 0, 0, -2, -2], [1, 0, 6, 1, 0, -9, -7, -1, 0, 0, 6, -8, 0, 0, 5, -12], [0, 9, 0, 0, -8, -14, 8, 11, 5, 14, 9, 5, 0, -16, 16, 0], [9, -14, 3, 14, 10, 0, 0, 0, -8, 4, 0, 0, -7, -16, 0, 0], [0, -23, 0, 0, -9, -2, 9, 22, -7, 2, -11, -7, 7, -2, 2, 7], [3, -6, 6, 6, -3, 0, 0, 0, 1, 6, 0, 0, 6, 6, 0, 0], [0, -5, 0, 0, 5, -12, -5, -9, 3, 12, 9, 3, -2, -8, 8, -2], [0, -19, 0, 0, 7, -11, -7, 7, -16, 11, -8, -16, 3, 2, -2, 3], [-23, 0, -10, -1, 0, 9, -2, 23, 0, 0, -10, -8, 0, 0, -4, 3], [2, 5, -3, -5, -14, 0, 0, 0, -13, 13, 0, 0, -4, -14, 0, 0], [-13, -28, 0, 28, 3, 0, 0, 0, 9, 0, 0, 0, 8, 6, 0, 0], [0, -9, 0, 0, -6, -18, 6, 12, -4, 18, -10, -4, 11, 7, -7, 11], [-20, 0, -4, 13, 0, 12, -6, 20, 0, 0, -4, -5, 0, 0, -13, 0], [12, -6, 5, 6, 2, 0, 0, 0, 11, 9, 0, 0, 7, 0, 0, 0], [2, 0, -7, 12, 0, -9, -3, -2, 0, 0, -7, 1, 0, 0, 4, 6], [4, 6, -3, -6, 11, 0, 0, 0, -18, 3, 0, 0, -1, 7, 0, 0], [8, 0, -5, -17, 0, 8, -12, -8, 0, 0, -5, -14, 0, 0, -4, -10], [0, 0, -3, 4, 0, 7, 22, 0, 0, 0, -3, 19, 0, 0, 4, 12], [0, 13, 0, 0, 19, 8, -19, -6, -7, -8, 2, -7, -12, 9, -9, -12]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1148_i_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1148_2_i_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_1148_2_i_d(:prec:=16)
    chi := MakeCharacter_1148_i();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_1148_2_i_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_1148_2_i_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1148_i();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![121, 660, 2775, 5182, 8145, 4919, 5529, 2100, 2685, 568, 706, 87, 136, 8, 14, 0, 1]>,<11,R![9, 231, 6724, -21329, 57974, -61266, 65663, -29699, 32607, -14203, 8265, -2156, 884, -196, 63, -8, 1]>],Snew);
    return Vf;
end function;