
// Make newform 1792.2.m.g in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1792_m();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1792_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_1792_2_m_g();".
// 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_1792_2_m_g();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [4, -40, 164, -344, 390, -336, 358, -180, 351, -176, 118, -24, 67, -48, 12, -4, 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], [-29073536866216359, 117377507327509198, -301042761683687430, 330162633044914154, -298674348575977988, 317962271773663747, -141663658022557777, 316269746406518514, -158494098831050719, 109855023226949419, -16311504998557221, 59571828256046246, -44591424589229034, 11056775295709911, -3722676599840684, 951071408409672], [22416575382206, -121829545946822, 253762122985590, -315437625800966, 247799490169192, -297759021619953, 125536721618373, -285346377635636, 136856641603546, -98359361008081, 16633551650999, -52647402989314, 39378227440746, -9774129145049, 3268059368601, -837450978918], [63352765090121984, -285278940866108728, 640181323544103480, -950165080048245094, 567587652935576758, -974932204477243482, 215321576232905127, -856904562132546654, 359150264381483384, -323008880354869584, 27728735279128781, -141252009753288336, 120429826515046084, -29239824225526546, 9848563721439349, -2704100770805192], [-23048604152387462, 194573129558701754, -502632258726641150, 562177999739357012, -515646310273577514, 534273028711390981, -240129108623449166, 546976894209326142, -280841928485519762, 187581053285797687, -24742665676005658, 104476272119691108, -78294768665013192, 19424222999220833, -6572201638917102, 1674708372990976], [-258618081490, 1753345508964, -4768566345236, 6274129258728, -4492931472132, 6516717498206, -1643327598977, 6018321521990, -2719627979686, 2258419134670, -152629602893, 1035106924390, -869648666130, 211530176114, -71829768307, 19482487322], [-124297662602168868, 849908894353444156, -2095030105848071860, 2566105999528852478, -2042609308803956566, 2518330312414188084, -909797757822592589, 2427731722617841338, -1161231004486048088, 863513038753683928, -101252104556846217, 440818146003185412, -344785787247940018, 84898454002472672, -28658627888228153, 7498893603309034], [-67882571420950212, 447008615232415754, -1152862769202227570, 1283713884161744232, -1173798486360141284, 1224404821394753001, -549310814953693356, 1240943173396670972, -633782556466103087, 428257247412482512, -59330090045209703, 236350861493329618, -176863864075565747, 43873064609843573, -14818624514131492, 3777555552239611], [40980131050682892, -314841413375322204, 917338120456251020, -1263918842903687457, 857235288719333779, -1363528429379028841, 261476413468482641, -1231844713236319142, 540760231449412867, -476344981375704222, 18177688506737658, -205792432068434953, 180471639613998717, -43592489723122903, 14866011666638747, -4111165082614591], [339029565430912, -3001512409125524, 10174933047931800, -15153946647046832, 8947496261644624, -17151627123727186, 1835649209159641, -14919834611631202, 6135862988795822, -6032292554488402, 15018673117033, -2359965597354778, 2216205890956042, -529691956965078, 181410266124727, -51700125227286], [-58837164424030928, 435161639642974356, -1206798639331144120, 1612124569733992598, -1143547375046559696, 1698017523089689604, -391651315022393869, 1557941182908479308, -700440973017072543, 591816357963522438, -32882698304956797, 265978766975545407, -226796911018514863, 55026059693644252, -18723422330113773, 5111890261955639], [-69616014115651576, 472716677119123542, -1321246981077163610, 1703428508268658061, -1251632447632723287, 1789141729619286818, -453843017266031758, 1650583194286411736, -751717640243443631, 623516248794297746, -40441701960073524, 285186819270035739, -239788425805503616, 58296781349821544, -19813878646531791, 5374657323581928], [76096265993090204, -493126775820972468, 1351849139305683920, -1760055912567976994, 1269554917909688188, -1847016073682336012, 458715003921674597, -1697590220722951414, 766246241691993109, -641433639158466729, 41301296869441296, -291627635161742131, 246097516841643734, -59803135064160756, 20318406884992724, -5522619438975152], [13545912097023734, -105659607438284102, 308964463100290878, -415638376318740034, 291324658777882928, -443797052249781231, 94218727843551051, -405109873988720704, 180665252133307975, -155431896656409780, 7085686180956252, -68547510138283141, 59261194792100792, -14345307664530663, 4888822756910656, -1342976102346028], [1133976629719396, -8262089065435772, 23746847574694880, -30280524171409216, 22789052228712772, -31568902874141438, 8291064774952483, -29521345230669606, 13589173271460526, -11070904840803886, 714420636220699, -5137895187302654, 4295184660226986, -1045387256303994, 355577051279181, -96105262004818], [129759186731597904, -988212428548741298, 2966846397725994870, -3971125038086180174, 2775101054643465278, -4254657735688371947, 886977360247710202, -3881717238759491924, 1724470044458942519, -1493003685079757954, 64154006218803931, -654936333530095316, 568446387146979339, -137516440256165211, 46882114975152344, -12901040348769007]];
    Rf_basisdens := [1, 2586996236383195, 1646719437545, 5173992472766390, 2586996236383195, 18265555126, 5173992472766390, 2586996236383195, 2586996236383195, 28585593772190, 2586996236383195, 2586996236383195, 2586996236383195, 517399247276639, 28585593772190, 2586996236383195];
    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_1792_m();"
function MakeCharacter_1792_m()
    N := 1792;
    order := 4;
    char_gens := [1023, 1541, 1025];
    v := [4, 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_1792_m_Hecke();"
function MakeCharacter_1792_m_Hecke(Kf)
    N := 1792;
    order := 4;
    char_gens := [1023, 1541, 1025];
    char_values := [[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], [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, 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, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, -1, 1, 0, 0, -1, 0, 0, 0, -1, 0, 1], [1, 0, -1, 1, -1, -1, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0], [-1, 1, 0, 2, -1, 0, 2, 1, 0, -1, 0, 0, 0, 0, 1, 0], [0, -1, 1, -1, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 1], [0, 0, 2, -1, 0, 0, 1, 0, 0, -1, -1, 0, 0, -1, -1, 3], [0, 0, 1, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 1], [-1, -1, 0, 1, -2, 0, 1, 1, 0, 1, -1, 0, -1, 0, -1, 0], [0, 0, -2, 0, 2, 0, -2, -2, 2, 3, 2, 0, 0, 0, 0, -2], [0, 0, 0, -1, 0, 0, 1, 0, 1, 0, -1, -1, 1, 0, 0, 2], [-1, 0, 0, 0, 0, -1, -1, 0, -2, -1, -1, 0, 0, 0, 0, 0], [3, 1, 0, 0, 2, 0, 0, -1, 1, 1, 1, 1, 1, 0, -1, 0], [-4, -2, -1, 0, -1, -2, 2, 2, 0, -1, 0, 0, 0, 2, 0, 0], [-1, 0, -1, 0, 1, -1, -1, -1, 4, 2, 0, 0, 0, 0, 0, -1], [0, 2, -1, 0, 1, 2, 0, 0, 0, 0, 2, 0, 1, 2, 0, -2], [4, 1, 2, -5, 3, -3, 0, -3, 0, 0, 1, 2, 3, 1, -1, 2], [0, 0, -1, 1, 0, 2, -1, 0, 0, -1, -1, 0, 1, 0, -1, 0], [0, 0, -4, 1, 0, 0, -1, 0, -1, 1, 2, 1, 1, 3, 1, -2], [-3, -3, 0, 0, -1, 0, 0, 1, 2, 2, -1, 2, -1, 0, -2, 0], [2, 0, -3, 2, -3, -2, 0, 2, 0, 0, 0, -3, -2, 0, 4, -2], [0, 0, 0, 0, 0, 2, 0, 0, 0, -1, 0, 0, 1, 1, -1, 0], [-7, -3, 0, -1, 1, 0, -1, -1, 3, 3, 0, 3, 0, 0, -3, 0], [3, 2, 0, 0, 2, 1, -1, -2, -3, -2, -1, 0, 0, -2, 0, 0], [0, 0, 1, 0, 0, 6, 0, 0, -1, 1, 4, 1, -1, 3, 1, -2], [-2, -3, -2, 0, -1, 1, -1, 0, -2, 1, 2, 0, 0, 3, 0, -3], [0, 2, -3, 4, -1, 2, 0, 0, 0, 0, 2, 2, 0, 2, 1, -2], [2, 0, 0, -2, 3, 0, -2, -3, 2, 2, 3, 2, 3, 0, -2, 0], [-6, -4, 0, 2, -3, 0, 2, 3, 0, 0, -2, 0, -2, 0, 0, 0], [-1, -1, 3, -2, 2, 0, 0, -3, 0, 0, -1, 3, 0, -1, 0, 4], [0, 0, -1, 0, 0, 4, 0, 0, -1, 1, -1, 1, 3, 2, 1, 0], [1, 0, -2, 0, 2, 1, -3, -5, 0, 2, 2, 0, 0, 0, 0, -5], [0, -2, -2, 0, 0, 2, 0, 3, 2, 3, -2, 0, 0, 2, 0, 1], [0, 0, 0, -1, 0, 0, 1, 0, 2, 1, 3, -2, -4, -1, 1, 1], [1, 2, -4, 5, -2, 1, 0, 4, 0, 0, 2, -1, -1, 2, 4, -6], [3, 2, -1, 3, 1, -1, 0, 3, 0, 0, 2, -2, -1, 2, 1, -5], [0, 0, -3, 0, 0, -2, 0, 0, 1, -1, 0, -1, -3, -3, -1, 0], [-3, 2, -3, 3, -1, 5, 0, 0, 0, 0, 2, -3, 3, 2, 4, -2], [-11, -4, 1, 1, -3, 7, 0, 2, 0, 0, -4, 2, -5, -4, 1, 2], [0, -2, -3, 0, 1, 2, -4, 0, -4, -2, 1, 0, 0, 2, 0, -2], [9, -1, 0, -3, 4, 0, -3, -5, 4, 1, 2, 4, 2, 0, -1, 0], [-4, 0, 0, 2, -2, 0, 2, 3, -3, -2, -2, -3, -2, 0, 2, 0], [-2, -2, 3, 0, -5, 0, 4, 0, -2, 1, 0, 0, 0, 2, 0, -2], [0, 0, -3, 1, 0, -8, -1, 0, -2, 1, 2, 2, 1, 3, 1, 0], [5, -2, 2, 3, 0, -7, 0, 0, 0, 0, -2, 0, -1, -2, 1, 2], [-4, 2, 0, -1, 0, 0, -1, -2, 3, 0, 0, 3, 0, 0, 0, 0], [-1, -2, 5, -7, 3, -1, 0, -1, 0, 0, -2, 2, 2, -2, -4, 3], [-5, 0, 2, 0, -2, -5, 1, 0, -1, 4, 1, 0, 0, 0, 0, 0], [0, 0, -3, 2, 0, -6, -2, 0, 3, -2, -1, -3, 1, 0, -2, 0], [2, -4, 0, -2, 1, 0, -2, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 7, 0, -2, 3, 0, -2, -3, 4, 1, 4, 4, 4, 0, -1, 0], [6, 2, 1, 0, 1, 4, 0, -2, -1, 4, 4, 0, 0, -2, 0, 0], [0, 0, 0, -1, 0, 0, -1, 4, -1, 2, -2, -1, -2, 0, -2, 0], [0, 0, 1, 1, 0, -2, -1, 0, -2, 1, 1, 2, -3, -2, 1, -2], [3, 4, -1, 3, 3, 1, 0, -2, 0, 0, 4, 1, 3, 4, 0, -2], [-2, -4, 0, -5, 4, 0, -5, 0, -1, 2, 0, -1, 0, 0, -2, 0], [4, -2, -4, 0, 2, 6, -8, -3, 2, 1, 2, 0, 0, 2, 0, -5], [0, 0, 8, -2, 0, -2, 2, 0, -6, -5, -4, 6, 2, -2, -5, 4], [1, 5, 3, 0, 2, -4, 2, -3, -1, -6, 1, 0, 0, -5, 0, 2], [5, 2, 1, 0, 1, 3, -5, -2, 5, -2, 3, 0, 0, -2, 0, 0], [-1, -1, 2, -6, 1, 0, 0, -3, 0, 0, -1, 3, -4, -1, -6, 4], [0, 0, 6, -1, 0, -6, 1, 0, 1, -2, -4, -1, -6, -10, -2, 2], [0, 0, 2, 1, 0, 0, -1, 0, 1, 0, -1, -1, -5, -6, 0, -2], [-10, -4, 4, 2, 0, 6, 0, 4, 0, 0, -4, 2, -8, -4, 1, 0], [6, 1, -5, 0, 6, 5, -7, -1, 2, 1, -2, 0, 0, -1, 0, 0], [10, 4, 0, -4, 5, 0, -4, -5, 0, 2, 1, 0, 1, 0, -2, 0], [-3, 2, -1, 0, 3, -5, -1, -2, 4, 5, -5, 0, 0, -2, 0, 0], [4, -2, 2, -2, 0, -6, 0, 4, 0, 0, -2, -6, -3, -2, -6, -2], [-6, -2, 0, 1, -4, 0, 1, 4, -1, 0, -4, -1, -4, 0, 0, 0], [0, 0, -4, 3, 0, -8, -3, 0, 2, -3, -1, -2, 2, 1, -3, 1], [4, 0, 0, 0, 2, 0, 0, -2, 0, -4, -2, 0, -2, 0, 4, 0], [-2, 0, -1, 0, 1, -2, 0, -3, 4, 3, -2, 0, 0, 0, 0, -3], [7, -4, 2, 0, -6, 11, 3, 6, -4, 1, -3, 0, 0, 4, 0, 2], [-9, 3, 0, 3, 0, 0, 3, 3, 0, -3, 3, 0, 3, 0, 3, 0], [4, -2, -1, 0, -1, 6, -4, -2, -2, -3, -2, 0, 0, 2, 0, -4], [4, 2, -2, -2, 0, -2, 0, -2, 0, 0, 2, -2, -1, 2, 2, 0], [-2, -6, 0, -4, 2, 0, -4, -1, -1, -2, -4, -1, -4, 0, 2, 0], [0, 0, 0, 0, 0, -2, 0, 0, 0, 0, -3, 0, 3, 0, 0, -4], [-1, -1, -4, -2, -5, 0, 0, -1, 0, 0, -1, -5, -2, -1, 0, 2], [-4, 2, 6, 0, -4, -6, 4, 1, -6, -1, 2, 0, 0, -2, 0, 3], [-4, -6, 0, -2, -5, 0, -2, -3, 0, 0, -2, 0, -2, 0, 0, 0], [-5, 3, 0, 3, -7, 0, 3, -1, -1, -1, 2, -1, 2, 0, 1, 0], [0, 0, -2, 0, 0, -4, 0, 0, 2, 0, 0, -2, 4, 4, 0, -6], [0, -5, 3, 0, -8, 5, 5, 7, -6, -1, -2, 0, 0, 5, 0, 2], [2, -6, 0, 4, -9, 0, 4, 8, -7, -4, -1, -7, -1, 0, 4, 0], [0, 0, 5, -4, 0, 0, 4, 0, -6, -4, 3, 6, 1, 4, -4, -1], [2, 0, -6, 10, -6, -2, 0, 6, 0, 0, 0, -6, -3, 0, 2, -6], [-3, 7, 0, 9, -8, 0, 9, 3, -2, -5, 2, -2, 2, 0, 5, 0], [-2, -5, -2, 9, -7, -3, 0, 4, 0, 0, -5, -2, 0, -5, 2, 1], [11, 1, 0, -2, -2, 0, -2, -3, 3, -1, 1, 3, 1, 0, 1, 0], [0, 0, -8, 5, 0, -4, -5, 0, 10, 7, -1, -10, -4, -5, 7, -5], [7, 0, -3, 0, 3, 7, -5, -6, 4, 7, 3, 0, 0, 0, 0, -6], [-7, -2, 3, 1, 1, 5, 0, -3, 0, 0, -2, 4, 5, -2, -1, 5], [0, 0, 0, -6, 0, 0, 6, 0, -2, -2, 6, 2, 2, 8, -2, -2], [4, -2, 6, -2, 4, -6, 0, 2, 0, 0, -2, -2, -1, -2, 2, 0], [0, 0, 4, 1, 0, -4, -1, 0, -1, 2, -7, 1, -1, -8, 2, 8], [-8, -7, -2, 0, -5, -1, 1, 6, -2, -4, -3, 0, 0, 7, 0, -1], [4, 6, -4, -2, 2, 2, 0, -1, 0, 0, 6, 4, 4, 6, 3, -5], [12, 1, -3, 5, -2, -11, 0, -2, 0, 0, 1, 2, 3, 1, -1, 1], [8, 4, -4, 8, 0, -4, 0, -2, 0, 0, 4, -4, 8, 4, 3, -2], [-10, 5, -5, 3, 0, 15, 0, -2, 0, 0, 5, 0, 2, 5, 2, -3], [0, 0, -11, 8, 0, -8, -8, 0, 4, 2, 1, -4, 7, 8, 2, -7], [6, -3, -9, 0, 6, 9, -7, -1, 0, -1, 0, 0, 0, 3, 0, -4], [4, -4, 0, 1, -2, 0, 1, -2, 1, -2, -2, 1, -2, 0, 2, 0], [-2, 1, 1, 0, 0, -3, 3, -4, 2, 0, 7, 0, 0, -1, 0, -3], [8, -4, 0, 3, -6, 0, 3, 4, -5, 0, -2, -5, -2, 0, 0, 0], [0, 0, -6, 4, 0, -4, -4, 0, 8, -4, -4, -8, 0, -4, -4, -2], [0, 0, 6, -2, 0, 14, 2, 0, 0, 3, -2, 0, -7, -9, 3, 4], [-4, -2, 0, -5, 6, 0, -5, -4, 5, 8, 2, 5, 2, 0, -8, 0], [10, 2, -2, 0, 4, 8, -2, -5, -4, -3, 0, 0, 0, -2, 0, -3], [0, 0, -8, 8, 0, 6, -8, 0, 7, 2, 0, -7, -2, -2, 2, -7], [-3, -5, 0, 0, -5, 2, 8, 5, 3, 0, 3, 0, 0, 5, 0, 0], [0, 0, -2, 2, 0, 4, -2, 0, -4, 2, -4, 4, 8, 4, 2, 2], [-14, -10, 0, -2, 0, 0, -2, -3, 1, 2, -2, 1, -2, 0, -2, 0], [-4, -1, -4, -5, -5, 3, 0, 2, 0, 0, -1, -8, 2, -1, 0, -1], [0, 0, -1, -1, 0, 12, 1, 0, 4, -1, 0, -4, 1, 1, -1, 4], [-8, 4, -3, -2, 1, 12, 0, -3, 0, 0, 4, 2, 8, 4, -3, -1], [3, -2, 8, -9, 6, -5, 0, -1, 0, 0, -2, -2, -1, -2, 1, 3], [5, 6, -4, 0, 10, -1, -7, -8, 11, 6, 7, 0, 0, -6, 0, -2], [6, 2, 0, -2, 0, 0, -2, -4, -6, -3, -6, -6, -6, 0, 3, 0], [-2, 6, -4, 0, 10, -8, -4, -6, 12, 2, 1, 0, 0, -6, 0, 0], [3, 4, 5, 0, -1, -1, 1, -3, -4, -3, -3, 0, 0, -4, 0, 1], [-2, 2, 1, -4, 3, 4, 0, 0, 0, 0, 2, -1, -6, 2, -4, -2], [6, 2, -4, 8, -2, -4, 0, 3, 0, 0, 2, -6, -2, 2, 13, -5], [-6, 0, 2, 0, -2, -6, 6, 4, -2, -5, -6, 0, 0, 0, 0, 4], [11, -1, 0, -1, 6, 0, -1, -5, 0, -1, -1, 0, -1, 0, 1, 0], [0, 0, 3, -6, 0, -6, 6, 0, -5, -3, 0, 5, -5, -5, -3, 4], [-2, 2, 3, -10, 5, 4, 0, -10, 0, 0, 2, 2, 9, 2, -8, 8], [5, 4, -5, 7, -1, -1, 0, -1, 0, 0, 4, 6, 3, 4, 9, -3], [0, 0, 2, -1, 0, 8, 1, 0, -2, -3, -1, 2, 2, 1, -3, -7], [-4, -6, 0, 2, -3, 0, 2, 5, -2, 6, -4, -2, -4, 0, -6, 0], [12, 4, 1, 0, 3, 8, 2, -5, 6, 3, 8, 0, 0, -4, 0, -1], [0, 0, -10, 4, 0, 10, -4, 0, 4, 2, 1, -4, 5, 6, 2, -6], [3, 13, 0, -4, 17, 0, -4, -9, 2, 3, 6, 2, 6, 0, -3, 0], [-4, 0, -1, 0, 1, -4, 2, -2, 10, 0, 1, 0, 0, 0, 0, -2], [13, 6, -9, 7, -3, -7, 0, 1, 0, 0, 6, -6, 2, 6, 12, -7], [-5, 2, 7, -3, 9, 7, 0, 0, 0, 0, 2, 3, 3, 2, -4, -2], [0, 0, -1, 4, 0, 4, -4, 0, 0, 8, 5, 0, -1, 4, 8, -5], [9, 5, -1, 0, 6, 4, -6, -7, 7, -2, -3, 0, 0, -5, 0, -2], [-4, -4, 3, 0, -7, 0, 10, 3, 2, -1, -2, 0, 0, 4, 0, -1], [0, 0, -1, -1, 0, 10, 1, 0, -8, 1, -1, 8, 5, 4, 1, 0], [2, 5, -6, 0, 11, -3, -5, 2, 0, -1, -4, 0, 0, -5, 0, 7], [2, 0, 4, -6, 4, -2, 0, -6, 0, 0, 0, 6, 7, 0, -4, 6], [0, 0, 1, -1, 0, -8, 1, 0, 0, -7, 0, 0, -5, -5, -7, 0], [9, 8, 6, 0, 2, 1, 3, -6, 1, -8, 1, 0, 0, -8, 0, 2], [0, 0, -6, 3, 0, -8, -3, 0, -5, 0, -7, 5, 7, 0, 0, 8], [-20, 0, -2, 0, 2, -20, 0, -4, 7, -2, -6, 0, 0, 0, 0, -4], [3, 1, 0, 7, -8, 0, 7, 3, -4, -1, -2, -4, -2, 0, 1, 0], [-6, 6, -7, 4, -1, 12, 0, 2, 0, 0, 6, -6, 8, 6, 5, -8], [-14, -6, 0, 9, -12, 0, 9, 8, -3, 0, -8, -3, -8, 0, 0, 0], [0, -1, 1, 7, 0, -1, 0, 2, 0, 0, -1, 2, -1, -1, 7, -1], [0, 0, 7, 0, 0, 14, 0, 0, -11, -7, -2, 11, -5, -7, -7, 8], [-1, 6, 11, 0, -5, -7, 13, 0, -8, -11, -9, 0, 0, -6, 0, 6], [-2, 8, 0, 6, 7, 0, 6, -1, 6, -2, 0, 6, 0, 0, 2, 0], [0, 0, -1, 5, 0, 10, -5, 0, -4, -1, 5, 4, -1, 4, -1, -6], [15, 3, 0, 1, 7, 0, 1, -9, 7, 7, 6, 7, 6, 0, -7, 0], [0, 0, 4, -4, 0, -10, 4, 0, -6, -3, -2, 6, -3, -5, -3, 6], [13, 2, 3, -5, 5, -11, 0, -6, 0, 0, 2, 1, 5, 2, -10, 4], [-14, -3, 1, -1, -2, 11, 0, -2, 0, 0, -3, 2, 1, -3, 5, 5], [0, 0, 0, -2, 0, 0, 2, 0, -6, -4, 8, 6, 0, 8, -4, 4], [0, 0, 6, 1, 0, -16, -1, 0, 0, 1, 1, 0, -6, -5, 1, 5], [1, 2, 0, 0, 2, -1, 7, 1, -4, -4, 2, 0, 0, -2, 0, 3], [8, 0, 0, 2, 3, 0, 2, 2, 1, -4, -3, 1, -3, 0, 4, 0], [0, 0, -5, 3, 0, -4, -3, 0, -2, -1, -6, 2, 3, -3, -1, -4], [-7, -3, 0, 2, 3, 0, 2, -5, -6, 0, 3, -6, 3, 0, 0, 0], [8, 0, -2, 0, 2, 8, -4, 2, -4, 0, 1, 0, 0, 0, 0, 2], [4, 4, 0, 2, 6, 0, 2, 3, -3, -4, 2, -3, 2, 0, 4, 0], [-9, -6, -5, 0, -1, -3, 1, -2, 3, 0, -1, 0, 0, 6, 0, -8], [2, 1, 6, 0, -5, 1, 9, 7, 0, 5, -2, 0, 0, -1, 0, 8], [10, 4, -3, -4, 1, -6, 0, -12, 0, 0, 4, 0, 11, 4, -6, 8], [0, 0, -3, 5, 0, 6, -5, 0, -4, 3, 11, 4, -3, 8, 3, -2], [0, 0, -12, 8, 0, 6, -8, 0, 2, 9, 8, -2, -6, 2, 9, -14], [11, -7, 0, -6, 6, 0, -6, 7, 1, 5, -3, 1, -3, 0, -5, 0], [0, 0, 4, -7, 0, 0, 7, 0, -3, -5, 2, 3, 9, 11, -5, 12], [-19, -6, -1, 0, -5, -13, 1, 3, 2, 3, 5, 0, 0, 6, 0, -3], [4, -6, 2, 0, -8, 10, 6, 7, 8, 3, 4, 0, 0, 6, 0, 1], [0, 0, 2, -3, 0, 14, 3, 0, -7, 2, 8, 7, 4, 12, 2, -10], [-5, -6, 5, 1, -1, -1, 0, 4, 0, 0, -6, -9, -11, -6, 2, 2], [10, 16, 0, -2, 11, 0, -2, -5, -4, -4, 4, -4, 4, 0, 4, 0], [3, 6, 0, -3, 6, 3, 0, -9, 0, 0, 6, 8, 8, 6, 0, 3], [14, 4, 2, 0, 2, 10, 4, -2, -12, -3, 2, 0, 0, -4, 0, 2], [0, 0, 2, 6, 0, 6, -6, 0, 2, 3, -6, -2, -3, -9, 3, -2], [8, 2, 0, -4, -1, 0, -4, -9, 2, 4, 8, 2, 8, 0, -4, 0], [7, -2, 1, 0, -3, 9, 5, 6, -5, -4, -7, 0, 0, 2, 0, 4], [0, -4, -6, 2, -10, -4, 0, 6, 0, 0, -4, -18, 0, -4, 3, -2], [9, 0, -4, 5, -4, -9, 0, 7, 0, 0, 0, -10, 2, 0, -2, -7], [0, 0, -1, 4, 0, 8, -4, 0, -5, -1, 7, 5, 3, 10, -1, -4], [7, 13, 0, 0, 2, 0, 0, -7, -3, -5, 1, -3, 1, 0, 5, 0], [-12, -2, 0, 0, -2, 0, 0, -4, 2, 0, -2, 2, -2, 0, 0, 0], [7, -2, -2, 0, 0, 9, -5, -7, -2, 1, -1, 0, 0, 2, 0, -9], [12, -1, -3, -1, -4, -13, 0, -2, 0, 0, -1, -8, 5, -1, -3, 3], [-9, 6, -2, 3, 4, 15, 0, 0, 0, 0, 6, 13, -3, 6, 12, -6], [1, 2, 6, -7, 8, 1, 0, -1, 0, 0, 2, 8, -7, 2, 3, -1], [0, 0, -4, 7, 0, 8, -7, 0, 7, 3, 2, -7, -11, -9, 3, -12], [10, 4, 0, -6, 11, 0, -6, -17, 0, 6, 7, 0, 7, 0, -6, 0], [-10, 2, -8, 8, -6, 12, 0, 3, 0, 0, 2, -2, -2, 2, 9, -5], [6, 10, 0, -1, 8, 0, -1, -8, 1, 4, 4, 1, 4, 0, -4, 0], [0, 0, -4, -9, 0, -18, 9, 0, 1, -2, -2, -1, 10, 8, -2, 0], [-4, 2, 5, -4, 7, 6, 0, -4, 0, 0, 2, 2, 2, 2, -7, 2], [-27, -9, 0, 4, -6, 0, 4, 3, 5, -3, -3, 5, -3, 0, 3, 0], [-4, 4, 3, 0, 1, -8, 10, 0, -2, -8, -9, 0, 0, -4, 0, 4], [0, -8, 0, -5, -4, 0, -5, 2, -7, 4, -4, -7, -4, 0, -4, 0], [-18, -3, -1, 0, -2, -15, 3, 2, 2, 14, 5, 0, 0, 3, 0, -1], [-3, 0, -1, 5, -1, 3, 0, 2, 0, 0, 0, -1, -5, 0, 2, -2], [5, -1, 0, -6, 6, 0, -6, -9, 5, -3, -3, 5, -3, 0, 3, 0], [-7, 0, -1, 5, -1, 7, 0, 2, 0, 0, 0, 2, 1, 0, 3, -2], [0, 0, 6, 2, 0, 6, -2, 0, 3, 0, 6, -3, -10, -4, 0, -3], [-9, -5, -8, 0, 3, -4, -10, 1, 3, 2, -3, 0, 0, 5, 0, -4], [-2, -2, 0, -8, 6, 0, -8, -5, 3, 4, 0, 3, 0, 0, -4, 0], [12, 8, -1, 0, 9, 4, -6, -12, 6, -4, -5, 0, 0, -8, 0, -4], [0, 0, -10, 7, 0, 16, -7, 0, 0, 11, 5, 0, -2, 3, 11, -7], [-7, 1, -2, 0, 3, -8, 2, 1, -3, -4, 5, 0, 0, -1, 0, 2], [0, 0, -18, 10, 0, 8, -10, 0, -8, -4, 6, 8, 4, 10, -4, -14], [0, 0, -12, 10, 0, 14, -10, 0, 2, 6, 3, -2, -7, -4, 6, -14], [-19, -1, 0, 3, -6, 0, 3, -3, -2, 1, 4, -2, 4, 0, -1, 0], [-11, -9, 0, -6, -1, 0, -6, 5, 8, 3, -4, 8, -4, 0, -3, 0], [0, 0, 4, 0, 0, -8, 0, 0, 6, 2, -6, -6, 4, -2, 2, -8], [-10, -4, 9, -14, 5, 6, 0, -5, 0, 0, -4, -2, -4, -4, -3, 9], [4, -8, -5, 0, -3, 12, 0, 5, -12, -1, 0, 0, 0, 8, 0, -3], [0, 0, -20, 10, 0, 16, -10, 0, 8, 2, 6, -8, 6, 12, 2, -18], [-8, 0, 0, -6, 2, 0, -6, -6, 2, 5, 2, 2, 2, 0, -5, 0], [-12, -2, 0, 2, 1, 0, 2, -1, 4, 0, 6, 4, 6, 0, 0, 0], [10, -1, -4, 9, -5, -11, 0, 4, 0, 0, -1, -16, 0, -1, 2, -3], [4, 0, -1, 0, 1, 4, -14, -3, 2, 5, 4, 0, 0, 0, 0, -3], [0, 0, -2, -5, 0, 16, 5, 0, 1, -7, 6, -1, -1, 5, -7, 4], [4, -10, 0, -2, -7, 0, -2, 7, -16, -4, -6, -16, -6, 0, 4, 0], [0, 0, -6, 9, 0, -6, -9, 0, 3, 4, -4, -3, -6, -10, 4, -4], [-3, 0, 15, 0, -15, -3, 19, 11, -2, -5, -5, 0, 0, 0, 0, 11], [-10, -8, -5, 4, -13, 2, 0, 9, 0, 0, -8, -8, -8, -8, 5, -1], [1, 13, -6, -2, 7, 12, 0, -11, 0, 0, 13, 3, 14, 13, 0, -2], [1, -1, 0, 9, -10, 0, 9, 17, -2, -1, -10, -2, -10, 0, 1, 0], [0, 0, 0, 4, 0, -2, -4, 0, 6, -3, -4, -6, -4, -8, -3, -2], [12, 2, 7, 0, -5, 10, 2, 0, 3, -6, 6, 0, 0, -2, 0, 2], [-18, -12, 0, -5, -4, 0, -5, 12, -5, 2, -12, -5, -12, 0, -2, 0], [11, 3, 0, -3, 13, 0, -3, -5, 9, -5, 0, 9, 0, 0, 5, 0], [14, 2, 0, 0, 2, 12, -2, 1, -8, -5, 2, 0, 0, -2, 0, 3], [-18, -7, -6, 0, -1, -11, 5, 5, 6, 11, -4, 0, 0, 7, 0, -2], [0, 0, 8, -2, 0, -20, 2, 0, 2, 4, -14, -2, 0, -14, 4, 8], [-15, -6, 9, -1, 3, 9, 0, 2, 0, 0, -6, 14, -13, -6, -7, 4], [16, 3, 3, 0, 0, 13, -1, 2, -8, -10, -13, 0, 0, -3, 0, 5], [0, 0, -8, 1, 0, 10, -1, 0, 1, 2, -2, -1, 6, 4, 2, 12], [-2, -10, 11, -12, 1, -8, 0, 2, 0, 0, -10, 2, -6, -10, -11, 8], [8, -2, 0, -4, 4, 0, -4, 4, 6, -2, -4, 6, -4, 0, 2, 0], [0, 0, -7, 2, 0, 2, -2, 0, 7, 1, 0, -7, 1, 1, 1, 2], [2, 4, 0, -1, 4, 0, -1, 10, 11, 0, 2, 11, 2, 0, 0, 0], [-9, -9, 7, -2, -2, 0, 0, 13, 0, 0, -9, -7, -16, -9, -8, -4], [3, 12, 9, 0, 3, -9, 9, 1, -6, -3, -11, 0, 0, -12, 0, 13], [-17, 19, 0, -2, 15, 0, -2, -11, 2, -4, 5, 2, 5, 0, 4, 0], [4, -4, -1, -4, -5, -8, 0, 1, 0, 0, -4, -4, 6, -4, -5, 3], [16, 6, 0, 2, -2, 0, 2, -4, -4, -4, -6, -4, -6, 0, 4, 0], [0, 0, 14, -2, 0, 0, 2, 0, -2, 4, 6, 2, -6, 0, 4, -8], [0, 0, 14, 3, 0, -20, -3, 0, 1, -3, -10, -1, -7, -17, -3, 12], [-2, 6, 1, -10, 7, 8, 0, 0, 0, 0, 6, -2, 5, 6, 4, -6], [-5, -2, -11, 17, -13, 3, 0, 16, 0, 0, -2, 4, -11, -2, 7, -14], [-4, -2, 10, 0, -12, -2, 6, -3, -12, 5, 8, 0, 0, 2, 0, -5], [-11, 2, 6, 0, -4, -13, 3, 3, 2, 2, 0, 0, 0, -2, 0, 5], [-2, 8, 12, 0, -4, -10, 10, -2, -10, -4, 3, 0, 0, -8, 0, 6], [0, 0, 8, 4, 0, -2, -4, 0, -4, 6, -3, 4, 1, -2, 6, 4], [-10, -4, 0, -10, 13, 0, -10, -13, 18, 6, -2, 18, -2, 0, -6, 0], [-3, 8, -2, -3, 6, 11, 0, -6, 0, 0, 8, 12, 11, 8, -7, -2], [-8, -2, -11, 0, 9, -6, -12, -4, 0, 8, -3, 0, 0, 2, 0, -6], [-8, 4, 7, -14, 11, 12, 0, -6, 0, 0, 4, 6, 5, 4, 0, 2], [5, 19, 0, 4, 5, 0, 4, -11, -4, -13, 6, -4, 6, 0, 13, 0], [-20, -7, 9, -11, 2, 13, 0, 0, 0, 0, -7, 0, -2, -7, -10, 7], [4, -2, -10, 20, -12, -6, 0, 7, 0, 0, -2, -14, -4, -2, 13, -5], [0, 0, 2, 1, 0, 12, -1, 0, -1, -3, -4, 1, 3, -1, -3, 4], [3, 2, 12, 0, -10, 1, 11, 7, -8, -5, 5, 0, 0, -2, 0, 9], [-4, -4, 6, 0, -10, 0, 10, 4, -2, 3, 2, 0, 0, 4, 0, 0], [11, 10, -10, 7, 0, -1, 0, 8, 0, 0, 10, -15, -1, 10, 4, -18], [-8, -5, 3, 9, -2, 3, 0, 7, 0, 0, -5, -4, 1, -5, 1, -2], [0, 0, 12, -4, 0, 6, 4, 0, -8, -7, -10, 8, 3, -7, -7, 16], [6, 0, 0, 4, -9, 0, 4, 1, -2, -4, 2, -2, 2, 0, 4, 0], [34, 10, 0, -5, 12, 0, -5, -2, -9, -2, 2, -9, 2, 0, 2, 0], [0, 0, 14, -6, 0, 4, 6, 0, -4, 6, -4, 4, -6, -10, 6, 8], [16, 11, 7, 0, 4, 5, -5, -10, 6, 3, 2, 0, 0, -11, 0, 1], [-4, 6, 5, -2, 11, 10, 0, -6, 0, 0, 6, 0, 10, 6, 13, 0], [0, 0, -14, 4, 0, -6, -4, 0, 9, 6, -2, -9, 6, 4, 6, -11], [13, 9, -6, -2, 3, -4, 0, -3, 0, 0, 9, 13, 8, 9, -6, -6], [-2, 2, 0, -4, 14, 0, -4, -16, 12, 2, 2, 12, 2, 0, -2, 0], [0, 0, -15, 9, 0, 6, -9, 0, 8, -5, -3, -8, 3, 0, -5, -12], [0, 0, 15, -7, 0, -12, 7, 0, -6, -7, -14, 6, 7, -7, -7, 26], [3, -6, -7, 0, 1, 9, -7, 2, -1, 10, -5, 0, 0, 6, 0, -4], [0, 8, 9, 0, -1, -8, 0, -2, 5, 2, 0, 0, 0, -8, 0, 6], [-22, -12, 0, -10, -5, 0, -10, 3, 2, 6, -4, 2, -4, 0, -6, 0], [0, -4, 0, -8, 0, 0, -8, -2, 10, 3, 0, 10, 0, 0, -3, 0], [-14, -10, -5, 0, -5, -4, 4, 6, -10, -9, 0, 0, 0, 10, 0, -4], [0, 0, 11, -1, 0, -16, 1, 0, -6, 1, 6, 6, -13, -7, 1, -6], [20, 4, 0, 1, -2, 0, 1, -2, 1, 2, 6, 1, 6, 0, -2, 0], [-10, -4, -2, -8, -6, 6, 0, 2, 0, 0, -4, 0, -4, -4, -7, 2], [-3, -3, 5, -14, 2, 0, 0, -13, 0, 0, -3, 7, 4, -3, -12, 16], [0, 0, 2, -6, 0, -6, 6, 0, -1, 4, -2, 1, 0, -2, 4, 13], [-5, -5, 6, 0, -11, 0, 10, 17, -17, -12, -13, 0, 0, 5, 0, 12], [6, -4, -9, 18, -13, -10, 0, 13, 0, 0, -4, -2, -18, -4, -1, -9], [6, 0, 3, -8, 3, -6, 0, 0, 0, 0, 0, 8, 1, 0, -14, 0], [0, -10, 0, -13, 4, 0, -13, -18, -1, 8, -2, -1, -2, 0, -8, 0], [-21, 0, 0, 0, 0, -21, 5, 2, 7, 16, 7, 0, 0, 0, 0, 2], [5, 1, 8, 0, -7, 4, 22, 1, 1, -6, 3, 0, 0, -1, 0, 2], [-11, 7, 1, 0, 8, 18, 0, -7, 0, 0, 7, 1, 10, 7, -6, 0], [0, 0, -6, 1, 0, 16, -1, 0, 1, 2, -1, -1, -1, -2, 2, 0], [2, -4, 4, -6, 0, -6, 0, -6, 0, 0, -4, 2, 18, -4, -15, 10], [-35, -13, 0, 7, -12, 0, 7, 15, -8, -1, -2, -8, -2, 0, 1, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1792_m_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1792_2_m_g();".
// 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_1792_2_m_g(:prec:=16)
    chi := MakeCharacter_1792_m();
    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_1792_2_m_g();".
// 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_1792_2_m_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1792_m();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![256, -512, 512, 6912, 25728, 17984, 5888, -1280, 1412, 1072, 416, -152, 40, 16, 8, -4, 1]>,<5,R![16384, -98304, 294912, -438272, 380416, -170496, 37376, -5184, 10500, -5344, 1024, 264, 104, -40, 8, 4, 1]>],Snew);
    return Vf;
end function;