
// Make newform 1089.3.c.m in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1089_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1089_c_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_1089_3_c_m();".
// 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_1089_3_c_m();".
// 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 := [83521, 0, -71672, 43316, 32427, -16804, -1619, 1868, 1520, 578, -577, 88, 77, -4, 3, -2, 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], [-43153595576226309686495647, 5765640005295629289418429, -7881075579364323988884836, 2784696249939055343599243, -1285772555995251420573024, -2916466161575039349931577, 173417624055188422449022, -232289772416918157487813, 49506865108677586484433, -49085688765268181850758, -48123502702325648748962, 5505899135438262627052, -3142889137307303128175, 603665761668368640859, -489076068461122451283, -5118046671123271072], [87548232770773285, 84006679985420530, 43546075769649555, -74422428601993325, 18238786120480205, 26580224433121053, -3000401551565675, 1143522707363375, -2042076941900150, 970794484128155, 396329540870948, -160608059534630, 37431650235165, -13694873409440, 7612440593330, -1196620054805], [-3016502091276299502163853, 6239620310303427315170932, 2725367713713220402774851, -3454853169668206970039381, -2899284905688159414026383, 188739032677142301868697, 359689551904902004493183, -61124185334789030582257, -98929721650791598640652, -70486258246526842691755, 11075544227701304479400, 7130001391847941303754, -1501040587522108900439, 11340540325899380678, -170195189005621991522, 110772223292616559581], [-3852111289316697053463740, 1768617021879347636164951, 487204295145717053117397, -2380391092219957518630737, 451761595671053956556583, -111270235594930389931339, -161638787120145941052387, 32204090145478587048213, -61964156582906808486062, 13969796006764590417448, -6413049280226468225533, -5204447702405357388148, 502957093333845754237, -421946922746206711963, 94556952146973365752, -62663748280134159380], [-10358907379526901455792970, -11854270036204790508484676, 5683566660645371578911573, -331867058370836509261413, -1445132485956622528706109, -318924716822197154520370, -728437164666172783463975, 189815808746797129337721, -35961847172466452881418, -26097423577090155234685, -5443134041278837144176, -10550450155024607104739, 1990070191856487308145, -896288267467192974544, 97800578201340651463, -91103608012569946247], [-20796741235259030368136243, 16005136245018598052513174, 8942645006085142477615377, -11617108568865974295515255, 3152774566201858360094701, 621551985943438654559695, -257224713787740556175171, 104237825940233572715185, -331179575316578516127764, 138539668212486981227629, -1301619909458847211258, -17779780045102206213782, 2137121814851796241745, -1459197633946223459032, 693153953445206321738, -220022054371202978027], [-771347781839850762230, 1220427399955036859005, 8569288085647399849, -1021878055471572811098, 419562897878523918533, 173666200235241080852, -52622614087140895119, -18495311978420991834, -25835636527821345653, 18481461281240971491, 1877030649542568202, -2352734303043296426, 342271797869305646, -137757484292541855, 96595086067747539, -24369863836783695], [62448816337649207684063087, -31106880041888624278187303, -36354372847836567070595786, 33332366741511498366923325, 875488142057279707187468, -4805720479241895464721969, 69150836603796213280496, -759106120403616486898307, 1001168229918578084609439, -187815706484451573137606, -126557445128392548474094, 46462638240783443711556, -11083341203195379407635, 5581753805286988008981, -2327854046290114537485, 331214275066397396578], [2326700697046292559758031, -919831796446951625112659, -10109472841637565639504916, 3600075300459734885770527, 6811586276607505895145280, -712773826444467637729457, -1144252658555549170678220, -91927305527432793814873, 187122049375273083182761, 180615363363583496231158, -47181706777028885775924, -23327421685018967669212, 3007124239661137238919, -241460383366094726593, 396271293857112362775, -346846663817408475336], [-1528524838084480278967976, -2302612646300234391423585, 1096602478426018247274321, 489546973039043406909558, -621951148353291269884475, -96903887929313182641538, 56518782117191086056949, 31440215226417970130710, -83683565215716791601, -19282799540413774394449, 2099731799037360256404, 2018079866614404196466, -203129756460236237424, 36957112534807647629, -56734590384175806489, 27841001391058287711], [11655149699405640386109225, -5362289602753199938134797, -6216187971145756538445718, 631002537638292209533883, 1801491819505295602632238, 1042816552025016489581611, -2106615682151562836025168, -64947380812895073686085, -14838493059808301198313, 24125594629075976001972, -1051882486226896470238, -55128918437669555904304, 8970360813785855460649, -3513644298666979364435, 901188862202916401331, -491794533520167608490], [-18337495305982233746732551, 5198924312299588660655566, 28218233032859070366205565, -28370972505874455264564597, -1547582697533981048296861, 5468585706172162446683881, -2601957057924215348257099, 895632462416637737420655, -1070825668818105880143790, 194182167290765317461477, 102156951448543758372016, -84986255321267976091904, 16718554763267774358099, -8045985534020736227770, 2806954437225253898934, -691034563587916915737], [63129557099007689485664241, -50510464121676799778673936, -20884555220267863820579845, 49134210651174921612242223, -10898837022540635238008519, -6235479095247208525965459, 1788288519805307742651413, -265504945153451273789049, 1319321835199372487091284, -539110377434202489812473, -107019855084457027909192, 89965673367961653663664, -15788136799018423755999, 7456596902957108195684, -3730989166437327889422, 849990483185904416025], [-39149589542397270244564119, 26185136215437696264540956, 14963042598215149832260602, -26828583686990890888136112, 5127081274242995649454220, 2722579385909269185871932, -1568622043815512853402511, 261068453994508556908628, -763341276304184014455963, 260639738173456415348277, 30835681828234576416313, -67625028031115812524375, 10690759718530261922245, -5475750913316501230191, 2098597115474769212497, -666110474896368591010], [129907195151503297187373233, -122782663782179497578784425, -5366727257661381628175906, 123142752521176196788848553, -40435037875517509387354522, -10495839243181498337480351, 7407138856127690604873560, 748068444337856889442125, 3128882321703874961336905, -1635736480009956866061230, -7454526513370189035702, 281231162053109020442988, -36040499637255171918253, 18935602585925518420309, -9030254723203551577571, 3084335617013753438064]];
    Rf_basisdens := [1, 4136026610381798610784394, 78081122146535134, 4136026610381798610784394, 2068013305190899305392197, 2068013305190899305392197, 4136026610381798610784394, 373996438229658975566, 4136026610381798610784394, 4136026610381798610784394, 243295682963635212399082, 4136026610381798610784394, 4136026610381798610784394, 4136026610381798610784394, 2068013305190899305392197, 4136026610381798610784394];
    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_1089_c();"
function MakeCharacter_1089_c()
    N := 1089;
    order := 2;
    char_gens := [848, 244];
    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_1089_c_Hecke();"
function MakeCharacter_1089_c_Hecke(Kf)
    N := 1089;
    order := 2;
    char_gens := [848, 244];
    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, 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, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, -1, 0, -1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 2, -2, 0, 0, 0, 0, -1, 1, 0], [0, 0, 0, 0, -1, 0, 3, -1, 1, 0, 0, 1, 0, 1, -2, 0], [0, 0, 0, 0, 1, 0, 3, -1, 0, 0, 0, -1, 0, -2, 0, 0], [-7, 1, -5, 0, 0, 2, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 4, 0, -1, 2, 1, 0, 0, -2, 0, -1, -1, 3], [6, 2, 6, -2, 0, 1, 0, 0, 0, -5, -1, 0, 1, 0, 0, 0], [-2, -3, 7, -3, 0, 1, 0, 0, 0, 0, 3, 0, -1, 0, 0, 0], [0, 0, 0, 0, 3, 0, 5, 1, 5, 0, 0, 0, 0, 0, -2, -3], [0, 0, 0, 0, 3, 0, 3, 0, 4, 0, 0, -2, 0, 3, 1, 4], [-4, 3, 6, 1, 0, 0, 0, 0, 0, -1, -3, 0, -1, 0, 0, 0], [10, 4, 2, -9, 0, -6, 0, 0, 0, -1, -6, 0, -2, 0, 0, 0], [17, -3, -1, -11, 0, 6, 0, 0, 0, -2, -1, 0, 0, 0, 0, 0], [0, 0, 0, 0, -3, 0, 15, 5, -4, 0, 0, -5, 0, 4, 4, 4], [8, 4, -11, -3, 0, 2, 0, 0, 0, -10, -2, 0, 0, 0, 0, 0], [-43, -2, 15, 7, 0, 2, 0, 0, 0, 4, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 9, 0, 16, -3, -6, 0, 0, 0, 0, 11, 3, -7], [0, 0, 0, 0, 10, 0, -1, 7, -6, 0, 0, -6, 0, -2, 0, 7], [0, 0, 0, 0, -19, 0, 2, -9, -10, 0, 0, 0, 0, 15, 3, -4], [-5, -1, -17, 8, 0, -4, 0, 0, 0, -1, -1, 0, 6, 0, 0, 0], [17, 2, -4, -10, 0, -1, 0, 0, 0, 1, -7, 0, 1, 0, 0, 0], [0, 0, 0, 0, 21, 0, 0, -3, 4, 0, 0, -4, 0, -1, -1, -10], [6, 5, -30, 2, 0, -6, 0, 0, 0, -13, -4, 0, -4, 0, 0, 0], [0, 0, 0, 0, 7, 0, 23, -5, 4, 0, 0, -3, 0, 12, 13, -17], [0, 0, 0, 0, -6, 0, 14, 2, -14, 0, 0, 10, 0, 14, -2, -14], [-21, 3, 13, 8, 0, -14, 0, 0, 0, 1, 5, 0, 8, 0, 0, 0], [0, 0, 0, 0, -10, 0, -14, 18, -6, 0, 0, -4, 0, 0, 4, 2], [0, 0, 0, 0, -3, 0, -23, -19, 22, 0, 0, 16, 0, -7, -15, 8], [-47, -1, 1, -4, 0, -2, 0, 0, 0, 5, 5, 0, -4, 0, 0, 0], [0, 0, 0, 0, 2, 0, 2, 13, 18, 0, 0, 13, 0, -11, 9, 6], [0, 0, 0, 0, -9, 0, -21, -5, 20, 0, 0, 5, 0, -14, 5, -1], [0, 0, 0, 0, 13, 0, -10, -3, 14, 0, 0, 14, 0, -7, -5, 5], [18, -4, -42, 14, 0, 0, 0, 0, 0, -14, 4, 0, 0, 0, 0, 0], [68, 3, -38, 22, 0, -5, 0, 0, 0, 6, 13, 0, 3, 0, 0, 0], [0, 0, 0, 0, 4, 0, 44, -4, -18, 0, 0, 11, 0, 5, 4, -5], [0, 0, 0, 0, -10, 0, -22, 4, -21, 0, 0, -2, 0, 5, -9, -7], [-24, -11, -27, -19, 0, 25, 0, 0, 0, -25, 3, 0, -9, 0, 0, 0], [-14, -9, -15, -9, 0, -11, 0, 0, 0, 8, 7, 0, -7, 0, 0, 0], [43, -7, -13, 12, 0, -24, 0, 0, 0, 9, -13, 0, 0, 0, 0, 0], [0, 0, 0, 0, -2, 0, -21, -32, 36, 0, 0, 8, 0, -7, -23, 4], [0, 0, 0, 0, -3, 0, 68, -3, -26, 0, 0, 3, 0, -2, 1, -1], [101, 3, -4, 24, 0, 4, 0, 0, 0, 13, 2, 0, 8, 0, 0, 0], [0, 0, 0, 0, 22, 0, 50, -5, 30, 0, 0, 7, 0, 5, -21, -12], [-35, -5, -30, -18, 0, 14, 0, 0, 0, -21, 16, 0, 16, 0, 0, 0], [0, 0, 0, 0, -19, 0, -20, 17, -12, 0, 0, -24, 0, 5, 3, 4], [-20, -10, 102, -16, 0, -6, 0, 0, 0, 2, -14, 0, -4, 0, 0, 0], [0, 0, 0, 0, 20, 0, 30, 10, -18, 0, 0, -37, 0, 15, 22, -7], [0, 0, 0, 0, -45, 0, -65, 9, 9, 0, 0, 13, 0, -31, -4, 4], [0, 0, 0, 0, -42, 0, 3, 27, 16, 0, 0, -5, 0, -12, 10, 22], [-15, -11, -2, 2, 0, -5, 0, 0, 0, -15, 15, 0, 16, 0, 0, 0], [-49, -2, -3, 19, 0, 8, 0, 0, 0, 24, 12, 0, -15, 0, 0, 0], [0, 0, 0, 0, -30, 0, 6, 38, -2, 0, 0, 1, 0, -1, 32, -3], [86, 12, -10, 28, 0, -30, 0, 0, 0, 26, -4, 0, -2, 0, 0, 0], [0, 0, 0, 0, -27, 0, 21, 47, -26, 0, 0, -41, 0, -2, 28, 6], [0, 0, 0, 0, -2, 0, 16, -27, -2, 0, 0, 5, 0, 53, 15, -40], [0, 0, 0, 0, 6, 0, 48, 8, 8, 0, 0, 0, 0, 44, 8, -44], [0, 0, 0, 0, -28, 0, -42, -2, 54, 0, 0, -6, 0, -2, -8, 2], [0, 0, 0, 0, -15, 0, 125, 29, -50, 0, 0, -19, 0, 26, 27, -21], [0, 0, 0, 0, 28, 0, 42, 7, -20, 0, 0, -23, 0, -11, 33, 18], [-141, -3, 1, 32, 0, -6, 0, 0, 0, -13, -1, 0, 22, 0, 0, 0], [7, 3, 84, -16, 0, -12, 0, 0, 0, -1, 16, 0, 22, 0, 0, 0], [-163, -5, 77, 14, 0, 8, 0, 0, 0, 7, 11, 0, -4, 0, 0, 0], [-146, -9, -119, -7, 0, 7, 0, 0, 0, 0, -13, 0, -11, 0, 0, 0], [0, 0, 0, 0, -34, 0, 102, 12, -16, 0, 0, -16, 0, 22, 50, 0], [0, 0, 0, 0, 38, 0, -78, -26, 25, 0, 0, -39, 0, -10, -19, 6], [0, 0, 0, 0, 23, 0, 47, 14, -18, 0, 0, 24, 0, -47, -15, 30], [74, -28, -78, -12, 0, 32, 0, 0, 0, -32, -24, 0, -6, 0, 0, 0], [0, 0, 0, 0, -22, 0, -26, -34, 32, 0, 0, -4, 0, -8, 0, -40], [77, 14, -6, -38, 0, 25, 0, 0, 0, 9, 35, 0, -7, 0, 0, 0], [0, 0, 0, 0, 5, 0, 103, -22, -54, 0, 0, 4, 0, 85, 19, -48], [22, -3, -3, -15, 0, 39, 0, 0, 0, -30, 1, 0, 1, 0, 0, 0], [89, -13, 95, 30, 0, -22, 0, 0, 0, 11, -19, 0, -2, 0, 0, 0], [222, -7, -20, 11, 0, 34, 0, 0, 0, -35, 17, 0, -9, 0, 0, 0], [124, -15, 147, -85, 0, 19, 0, 0, 0, -28, -35, 0, -7, 0, 0, 0], [134, 19, -28, -25, 0, 36, 0, 0, 0, -51, 41, 0, 3, 0, 0, 0], [0, 0, 0, 0, -21, 0, -102, -73, 34, 0, 0, 8, 0, -3, -17, -9], [102, -20, 113, 34, 0, 23, 0, 0, 0, 12, 22, 0, -8, 0, 0, 0], [-92, 8, 83, 57, 0, -50, 0, 0, 0, 6, 0, 0, -30, 0, 0, 0], [0, 0, 0, 0, 75, 0, 41, 25, -19, 0, 0, -41, 0, 21, 62, -24], [-108, -31, -8, 32, 0, -66, 0, 0, 0, 7, -14, 0, -12, 0, 0, 0], [0, 0, 0, 0, -61, 0, -114, -17, 0, 0, 0, 5, 0, -1, -3, 0], [-74, -19, -118, 42, 0, -64, 0, 0, 0, -4, -9, 0, 1, 0, 0, 0], [94, 0, -44, -30, 0, 16, 0, 0, 0, -84, -22, 0, -20, 0, 0, 0], [0, 0, 0, 0, 45, 0, -12, -6, -4, 0, 0, -41, 0, -4, -18, -67], [0, 0, 0, 0, -60, 0, -74, -88, 0, 0, 0, 37, 0, 31, -50, -5], [38, -10, -108, -18, 0, 31, 0, 0, 0, 5, 39, 0, 5, 0, 0, 0], [37, 32, -105, 30, 0, 16, 0, 0, 0, 17, 10, 0, 27, 0, 0, 0], [0, 0, 0, 0, -5, 0, 69, -25, -21, 0, 0, 35, 0, -11, -28, 36], [-2, -14, 89, 39, 0, -35, 0, 0, 0, 7, 19, 0, 9, 0, 0, 0], [0, 0, 0, 0, 9, 0, 75, -59, 27, 0, 0, -25, 0, 39, 24, -84], [52, 0, 107, 27, 0, 8, 0, 0, 0, 8, -12, 0, -24, 0, 0, 0], [0, 0, 0, 0, -14, 0, 88, -66, -4, 0, 0, -28, 0, 52, 16, -46], [-50, -4, 66, 63, 0, -26, 0, 0, 0, 15, -42, 0, -6, 0, 0, 0], [-76, 18, -122, 58, 0, -10, 0, 0, 0, -70, -16, 0, -22, 0, 0, 0], [0, 0, 0, 0, -140, 0, -128, -17, -34, 0, 0, 57, 0, 29, -15, 4], [0, 0, 0, 0, -41, 0, 15, 47, -70, 0, 0, -25, 0, 42, 28, -62], [0, 0, 0, 0, 60, 0, -66, -33, 36, 0, 0, 15, 0, 47, -45, 28], [0, 0, 0, 0, -62, 0, -82, 36, 69, 0, 0, 60, 0, 17, -41, 11], [0, 0, 0, 0, 27, 0, 1, -23, 99, 0, 0, 40, 0, -64, -52, 15], [0, 0, 0, 0, 10, 0, -36, -4, 52, 0, 0, 20, 0, -54, -56, -28], [0, 0, 0, 0, -23, 0, -35, -19, -22, 0, 0, 41, 0, 26, -44, 58], [52, -53, 176, 18, 0, 22, 0, 0, 0, 25, -48, 0, 14, 0, 0, 0], [-110, -19, 51, 39, 0, -27, 0, 0, 0, 97, -9, 0, 5, 0, 0, 0], [0, 0, 0, 0, -38, 0, -56, 62, 90, 0, 0, -67, 0, -63, 18, 35], [-222, -10, -8, 6, 0, -50, 0, 0, 0, 22, -30, 0, -18, 0, 0, 0], [0, 0, 0, 0, 19, 0, 56, 35, -8, 0, 0, 93, 0, -57, -15, 60], [0, 0, 0, 0, 12, 0, -20, 27, -72, 0, 0, -7, 0, 45, 53, -16], [0, 0, 0, 0, -14, 0, 72, -42, 12, 0, 0, -48, 0, 76, 52, -50], [-233, -17, -135, -46, 0, 32, 0, 0, 0, -5, -17, 0, -40, 0, 0, 0], [126, -53, 5, -37, 0, -31, 0, 0, 0, 74, -23, 0, -9, 0, 0, 0], [-127, 1, 197, 115, 0, -20, 0, 0, 0, -5, 6, 0, 26, 0, 0, 0], [183, 22, 79, -43, 0, 6, 0, 0, 0, -18, 36, 0, 23, 0, 0, 0], [-384, 21, -6, 60, 0, 19, 0, 0, 0, 0, -7, 0, -9, 0, 0, 0], [40, 45, 118, -75, 0, 4, 0, 0, 0, 33, -1, 0, -17, 0, 0, 0], [411, -5, 10, 62, 0, -33, 0, 0, 0, -27, 27, 0, 26, 0, 0, 0], [0, 0, 0, 0, -6, 0, -205, 22, -37, 0, 0, 46, 0, 41, -17, -53], [-64, -33, 8, 24, 0, 67, 0, 0, 0, 70, 41, 0, -19, 0, 0, 0], [0, 0, 0, 0, 134, 0, 29, -45, -92, 0, 0, 0, 0, -62, -72, 35], [0, 0, 0, 0, -100, 0, -220, 48, 77, 0, 0, -43, 0, -38, 31, 2], [11, 24, -147, -12, 0, 28, 0, 0, 0, -43, 6, 0, 1, 0, 0, 0], [-138, 46, 92, -12, 0, 4, 0, 0, 0, 62, -26, 0, -36, 0, 0, 0], [0, 0, 0, 0, 126, 0, 96, 76, -10, 0, 0, -101, 0, -27, 60, 21], [230, 47, -182, 114, 0, 23, 0, 0, 0, 34, 25, 0, -13, 0, 0, 0], [-197, 23, 41, -54, 0, -44, 0, 0, 0, 19, 55, 0, 20, 0, 0, 0], [-72, 9, -270, -26, 0, 81, 0, 0, 0, -90, 17, 0, 17, 0, 0, 0], [0, 0, 0, 0, -30, 0, -58, -64, 76, 0, 0, -12, 0, -50, -34, 30], [0, 0, 0, 0, -7, 0, -129, -46, 24, 0, 0, 18, 0, 39, -25, -18], [0, 0, 0, 0, -125, 0, -183, 9, -21, 0, 0, 36, 0, 0, 22, 69], [-100, 28, 51, -17, 0, 2, 0, 0, 0, -10, 68, 0, 10, 0, 0, 0], [-44, -23, 111, -3, 0, -49, 0, 0, 0, 106, 79, 0, 11, 0, 0, 0], [0, 0, 0, 0, 57, 0, 143, -35, -97, 0, 0, 26, 0, -18, -18, -59], [0, 0, 0, 0, -26, 0, -261, 32, 12, 0, 0, -7, 0, -33, 29, 21], [498, -7, 69, -97, 0, 21, 0, 0, 0, -33, -27, 0, 7, 0, 0, 0], [0, 0, 0, 0, -124, 0, -118, -60, 128, 0, 0, 98, 0, 60, -94, 4], [6, 5, -268, -24, 0, 62, 0, 0, 0, -68, -17, 0, 51, 0, 0, 0], [0, 0, 0, 0, -6, 0, 110, 40, -30, 0, 0, 11, 0, -65, 28, -21], [0, 0, 0, 0, -12, 0, 100, 125, -86, 0, 0, -123, 0, 31, 59, -94], [0, 0, 0, 0, 37, 0, -91, -19, -122, 0, 0, -11, 0, -82, 41, 45], [187, -21, -72, 56, 0, 40, 0, 0, 0, 1, -50, 0, -10, 0, 0, 0], [0, 0, 0, 0, 176, 0, 164, 156, -125, 0, 0, 7, 0, -44, 133, 18], [16, -97, -302, 12, 0, 95, 0, 0, 0, -4, 51, 0, -11, 0, 0, 0], [-59, 25, -27, 54, 0, -94, 0, 0, 0, 123, 31, 0, -2, 0, 0, 0], [0, 0, 0, 0, 39, 0, 215, 62, -132, 0, 0, -46, 0, 55, -17, -54], [0, 0, 0, 0, -7, 0, -7, -11, 67, 0, 0, 16, 0, -110, -64, 161], [-30, 27, 325, 97, 0, -85, 0, 0, 0, 68, -51, 0, -9, 0, 0, 0], [-370, 0, -36, 10, 0, -74, 0, 0, 0, -34, -12, 0, 46, 0, 0, 0], [0, 0, 0, 0, 49, 0, 75, 54, 74, 0, 0, -18, 0, -55, -81, 98], [-382, -57, 170, -39, 0, -28, 0, 0, 0, -3, -7, 0, 39, 0, 0, 0], [-166, 34, -36, 58, 0, -66, 0, 0, 0, -18, -62, 0, -36, 0, 0, 0], [0, 0, 0, 0, 81, 0, 103, 91, -115, 0, 0, -140, 0, 84, 84, 1], [26, 76, 51, 3, 0, -72, 0, 0, 0, -58, 18, 0, 38, 0, 0, 0], [311, 9, -201, -130, 0, 104, 0, 0, 0, -103, 3, 0, 38, 0, 0, 0], [0, 0, 0, 0, -16, 0, 217, 145, -138, 0, 0, 28, 0, -94, 64, 27], [555, -5, -13, -26, 0, 16, 0, 0, 0, -45, -29, 0, -42, 0, 0, 0], [0, 0, 0, 0, -165, 0, -32, -47, 198, 0, 0, 21, 0, -67, -17, 86], [0, 0, 0, 0, 117, 0, 147, -19, -85, 0, 0, 21, 0, -35, 36, -114], [209, 23, 217, -87, 0, -26, 0, 0, 0, 0, -59, 0, 10, 0, 0, 0], [0, 0, 0, 0, 18, 0, 122, -160, 92, 0, 0, 44, 0, 70, -62, 62], [0, 0, 0, 0, 238, 0, -21, -62, 180, 0, 0, -11, 0, 27, 13, -79], [-330, -26, 274, 134, 0, -58, 0, 0, 0, 140, -38, 0, 12, 0, 0, 0], [-239, 61, -85, 44, 0, 74, 0, 0, 0, -79, -27, 0, -36, 0, 0, 0], [124, -6, 32, 0, 0, -12, 0, 0, 0, -6, 2, 0, -28, 0, 0, 0], [481, 42, 198, 2, 0, -109, 0, 0, 0, -41, 49, 0, -27, 0, 0, 0], [0, 0, 0, 0, 163, 0, 77, -43, -104, 0, 0, 5, 0, -32, 52, 36], [0, 0, 0, 0, -170, 0, 113, -116, 268, 0, 0, 48, 0, -33, -77, -32], [-580, -73, -40, -168, 0, 94, 0, 0, 0, 4, 65, 0, 3, 0, 0, 0], [0, 0, 0, 0, 6, 0, -78, -52, -205, 0, 0, -10, 0, 131, -101, -43], [-222, 73, -214, -20, 0, 25, 0, 0, 0, -96, 73, 0, -3, 0, 0, 0], [0, 0, 0, 0, 16, 0, 92, -66, -84, 0, 0, 15, 0, 45, 46, 67], [0, 0, 0, 0, -97, 0, 130, 63, 8, 0, 0, -54, 0, 53, 131, -51], [201, 2, 103, -99, 0, 93, 0, 0, 0, 89, 51, 0, 17, 0, 0, 0], [-208, -22, -246, 40, 0, 24, 0, 0, 0, -94, 48, 0, 48, 0, 0, 0], [0, 0, 0, 0, 238, 0, 62, -4, 178, 0, 0, -86, 0, 18, 40, -64], [429, -8, 104, -169, 0, -35, 0, 0, 0, 10, 4, 0, -3, 0, 0, 0], [0, 0, 0, 0, 55, 0, 366, 169, -70, 0, 0, -162, 0, -37, 131, -47], [0, 0, 0, 0, 40, 0, -280, 90, 120, 0, 0, 32, 0, -116, 56, -36], [-760, 13, -313, 137, 0, 57, 0, 0, 0, 18, -43, 0, 9, 0, 0, 0], [0, 0, 0, 0, -1, 0, -5, -141, 158, 0, 0, -1, 0, 48, 23, -29], [-104, 37, 35, 9, 0, 37, 0, 0, 0, -96, 27, 0, 31, 0, 0, 0], [0, 0, 0, 0, -107, 0, -285, -11, 117, 0, 0, 123, 0, 125, -78, 2], [-181, 12, 219, -251, 0, 60, 0, 0, 0, -176, 32, 0, 9, 0, 0, 0], [-779, -22, -289, 1, 0, -54, 0, 0, 0, 18, 42, 0, -9, 0, 0, 0], [0, 0, 0, 0, -32, 0, -98, 42, 218, 0, 0, -34, 0, -34, 8, 30], [26, -45, 168, -114, 0, 163, 0, 0, 0, 26, -9, 0, -35, 0, 0, 0], [0, 0, 0, 0, -91, 0, -248, 24, -8, 0, 0, 94, 0, -44, -16, -26], [0, 0, 0, 0, 49, 0, -31, 135, 165, 0, 0, -109, 0, -123, 104, -16], [-78, -55, 279, -67, 0, 72, 0, 0, 0, -51, -64, 0, 48, 0, 0, 0], [0, 0, 0, 0, -243, 0, 51, 79, -27, 0, 0, 58, 0, 86, 64, 59], [-364, -9, -185, 43, 0, -87, 0, 0, 0, 100, 109, 0, -25, 0, 0, 0], [-908, 19, 274, -168, 0, 110, 0, 0, 0, -54, -11, 0, -5, 0, 0, 0], [0, 0, 0, 0, 4, 0, -63, 22, -233, 0, 0, 19, 0, 34, 51, -6], [252, -17, 186, 279, 0, 44, 0, 0, 0, -55, 35, 0, 3, 0, 0, 0], [0, 0, 0, 0, -31, 0, 230, 119, -62, 0, 0, -216, 0, -25, 59, -9], [328, -33, -190, -72, 0, -39, 0, 0, 0, -116, 21, 0, 13, 0, 0, 0], [0, 0, 0, 0, -284, 0, -200, 98, 32, 0, 0, 92, 0, -148, 50, 212], [0, 0, 0, 0, -272, 0, -64, 10, 0, 0, 0, 131, 0, -111, -126, 185], [0, 0, 0, 0, 236, 0, 253, 126, 59, 0, 0, -48, 0, -61, 121, 59], [0, 0, 0, 0, -147, 0, -152, -71, 204, 0, 0, 64, 0, 21, -115, 51], [606, 10, -34, 90, 0, -14, 0, 0, 0, 26, 34, 0, -72, 0, 0, 0], [0, 0, 0, 0, 95, 0, 334, -187, -60, 0, 0, 57, 0, 93, 5, -150], [377, -72, -77, -92, 0, 136, 0, 0, 0, 75, 118, 0, -21, 0, 0, 0], [-61, -55, -140, 156, 0, -35, 0, 0, 0, 117, 85, 0, -32, 0, 0, 0], [-95, -50, -268, 0, 0, -29, 0, 0, 0, 79, -23, 0, 9, 0, 0, 0], [0, 0, 0, 0, 217, 0, 180, -59, 268, 0, 0, -73, 0, -14, 5, -115], [0, 0, 0, 0, -99, 0, 169, 9, 171, 0, 0, -12, 0, 18, 150, -129], [-772, 12, 160, -8, 0, -292, 0, 0, 0, 46, -62, 0, 24, 0, 0, 0], [0, 0, 0, 0, -61, 0, 355, -163, 100, 0, 0, 5, 0, 4, 20, -2], [203, -8, 221, -242, 0, -72, 0, 0, 0, -21, 58, 0, -21, 0, 0, 0], [-335, 8, 185, -265, 0, 35, 0, 0, 0, -91, -75, 0, -13, 0, 0, 0], [-701, -26, -6, -65, 0, -177, 0, 0, 0, -26, -80, 0, -81, 0, 0, 0], [0, 0, 0, 0, 223, 0, 509, 33, 265, 0, 0, -96, 0, -104, 82, -87], [-366, -40, -320, 178, 0, -9, 0, 0, 0, 187, 57, 0, -25, 0, 0, 0], [0, 0, 0, 0, -155, 0, 284, -195, -16, 0, 0, 74, 0, 175, 13, -63], [0, 0, 0, 0, 70, 0, -408, -140, -74, 0, 0, 87, 0, 61, -236, 25], [-327, 71, 283, 20, 0, -164, 0, 0, 0, -63, -113, 0, 22, 0, 0, 0], [-676, -41, 642, 6, 0, 0, 0, 0, 0, -64, 33, 0, 71, 0, 0, 0], [0, 0, 0, 0, 120, 0, -98, 161, -116, 0, 0, 39, 0, -99, -7, -92], [0, 0, 0, 0, 120, 0, 177, 69, -428, 0, 0, -117, 0, 24, 92, -68], [-153, 39, 165, -182, 0, 216, 0, 0, 0, -171, 65, 0, 14, 0, 0, 0], [-406, 81, -287, -137, 0, 202, 0, 0, 0, -129, -40, 0, 4, 0, 0, 0], [0, 0, 0, 0, 224, 0, 116, -94, 97, 0, 0, -18, 0, 51, 7, 71], [0, 0, 0, 0, -177, 0, -197, -48, -6, 0, 0, 34, 0, -151, -189, 86], [973, -94, -67, 153, 0, 138, 0, 0, 0, 154, 54, 0, 5, 0, 0, 0], [153, -53, -481, 296, 0, -10, 0, 0, 0, 57, 55, 0, -56, 0, 0, 0], [0, 0, 0, 0, 101, 0, 144, 75, 184, 0, 0, 37, 0, -83, 31, 228], [0, 0, 0, 0, 268, 0, 164, 200, -111, 0, 0, -42, 0, -241, 9, 133], [548, -4, -378, -12, 0, -188, 0, 0, 0, -124, -6, 0, 2, 0, 0, 0], [0, 0, 0, 0, -70, 0, -704, -59, 146, 0, 0, -43, 0, 75, 49, -38], [0, 0, 0, 0, 97, 0, -299, 68, 88, 0, 0, -136, 0, 1, 19, 32], [0, 0, 0, 0, -112, 0, 24, -6, -10, 0, 0, -50, 0, -40, 96, 186], [-94, -4, -260, -112, 0, -242, 0, 0, 0, -44, -152, 0, -38, 0, 0, 0], [0, 0, 0, 0, -18, 0, -346, 134, -4, 0, 0, 106, 0, -12, -82, 96], [-101, -63, 383, -45, 0, -102, 0, 0, 0, 31, -12, 0, -8, 0, 0, 0], [0, 0, 0, 0, -38, 0, -201, -302, -69, 0, 0, 46, 0, 43, 47, -199], [113, -22, -328, 91, 0, 125, 0, 0, 0, -68, 160, 0, 25, 0, 0, 0], [-542, -5, 128, 183, 0, 146, 0, 0, 0, 147, 109, 0, 37, 0, 0, 0], [-1093, -40, -118, -147, 0, 71, 0, 0, 0, -22, -82, 0, -119, 0, 0, 0], [0, 0, 0, 0, -13, 0, 415, -97, -46, 0, 0, 87, 0, -10, 106, -26], [-488, 38, 181, 33, 0, -39, 0, 0, 0, -37, 13, 0, -83, 0, 0, 0], [-106, 22, -362, 46, 0, -108, 0, 0, 0, -182, -104, 0, -74, 0, 0, 0], [0, 0, 0, 0, -214, 0, 308, 208, -272, 0, 0, -61, 0, 41, 202, -103], [0, 0, 0, 0, -335, 0, -265, 121, 137, 0, 0, 51, 0, -139, -70, 210], [-240, -74, 633, -187, 0, -52, 0, 0, 0, -146, -106, 0, -36, 0, 0, 0], [110, 101, 30, 162, 0, -46, 0, 0, 0, -48, -57, 0, 33, 0, 0, 0], [0, 0, 0, 0, 287, 0, 401, -106, -88, 0, 0, -74, 0, 63, -47, 12], [0, 0, 0, 0, -32, 0, -240, -168, 112, 0, 0, -16, 0, 110, -222, 32], [0, 0, 0, 0, 224, 0, 280, -21, 140, 0, 0, -89, 0, -123, -41, -66], [0, 0, 0, 0, 178, 0, -294, 114, -234, 0, 0, -41, 0, 7, 112, 11], [-414, 56, -182, -308, 0, 10, 0, 0, 0, -42, 6, 0, -36, 0, 0, 0], [201, 42, 477, -85, 0, -109, 0, 0, 0, 81, -61, 0, 33, 0, 0, 0], [0, 0, 0, 0, 206, 0, -8, -42, 54, 0, 0, 149, 0, 139, 126, -127], [0, 0, 0, 0, 41, 0, -346, -71, 10, 0, 0, 230, 0, -107, -175, 124], [264, 17, -629, 323, 0, -217, 0, 0, 0, -34, 25, 0, -1, 0, 0, 0], [0, 0, 0, 0, 204, 0, 300, 170, -260, 0, 0, -98, 0, 260, 218, -156], [313, 36, 343, -222, 0, -70, 0, 0, 0, 17, -190, 0, 29, 0, 0, 0], [0, 0, 0, 0, 154, 0, -66, -165, 374, 0, 0, 91, 0, 63, -133, 18], [0, 0, 0, 0, -89, 0, 84, -88, 254, 0, 0, -32, 0, 54, 102, 132], [0, 0, 0, 0, 365, 0, 520, 225, -114, 0, 0, -24, 0, -5, 283, 28], [0, 0, 0, 0, 59, 0, 137, 89, -50, 0, 0, 145, 0, -40, 6, -22], [0, 0, 0, 0, -42, 0, -74, 227, 104, 0, 0, -333, 0, -119, 99, 18], [507, 66, -533, -145, 0, -46, 0, 0, 0, -54, 2, 0, -27, 0, 0, 0], [-422, -9, -183, -121, 0, 183, 0, 0, 0, 122, -35, 0, -23, 0, 0, 0], [-117, -102, -331, 152, 0, 16, 0, 0, 0, 265, 56, 0, -55, 0, 0, 0], [622, 18, -128, -10, 0, 78, 0, 0, 0, 66, 152, 0, 30, 0, 0, 0], [0, 0, 0, 0, 424, 0, 784, -92, -126, 0, 0, -8, 0, -8, -22, -30], [0, 0, 0, 0, -333, 0, -81, -103, 194, 0, 0, -128, 0, 57, -1, -108], [-736, 74, -124, 196, 0, -24, 0, 0, 0, 186, -2, 0, -16, 0, 0, 0], [-12, -8, 267, -67, 0, 38, 0, 0, 0, -212, 56, 0, 24, 0, 0, 0], [-240, -50, 23, -421, 0, 245, 0, 0, 0, -137, 99, 0, -17, 0, 0, 0], [0, 0, 0, 0, 319, 0, 154, -124, 146, 0, 0, 122, 0, 2, -68, 142], [0, 0, 0, 0, 168, 0, 523, -101, 160, 0, 0, -76, 0, 180, 154, -249], [-657, 70, 646, -116, 0, 141, 0, 0, 0, 97, 141, 0, -21, 0, 0, 0], [-612, 115, -615, 15, 0, 125, 0, 0, 0, -79, -175, 0, 57, 0, 0, 0], [0, 0, 0, 0, -25, 0, 183, 12, 364, 0, 0, -20, 0, -39, 89, 208], [0, 0, 0, 0, 181, 0, 282, 56, -174, 0, 0, 94, 0, 44, -50, 42], [0, 0, 0, 0, 147, 0, -329, 139, 256, 0, 0, 87, 0, -178, -99, 41], [0, 0, 0, 0, -47, 0, 209, 117, 225, 0, 0, -155, 0, 227, 120, -110], [432, 53, 182, 150, 0, -48, 0, 0, 0, -39, 118, 0, 100, 0, 0, 0], [0, 0, 0, 0, 213, 0, -359, 5, 255, 0, 0, -44, 0, -8, 28, -83], [0, 0, 0, 0, 90, 0, 554, 5, -88, 0, 0, -19, 0, 149, -5, -210], [0, 0, 0, 0, 28, 0, -346, -164, 282, 0, 0, -10, 0, -4, -44, -76], [1288, 105, -226, -1, 0, 174, 0, 0, 0, 5, -39, 0, -37, 0, 0, 0], [604, -22, 806, 54, 0, -17, 0, 0, 0, -83, -17, 0, 35, 0, 0, 0], [0, 0, 0, 0, 121, 0, 382, -5, -6, 0, 0, 193, 0, -80, 41, -39], [21, 70, 1013, -93, 0, -1, 0, 0, 0, -137, -143, 0, 37, 0, 0, 0], [0, 0, 0, 0, 179, 0, 355, -31, -75, 0, 0, 86, 0, 142, 4, -165], [193, 81, 379, -89, 0, 38, 0, 0, 0, 36, -25, 0, -22, 0, 0, 0], [-50, 87, 72, -294, 0, 92, 0, 0, 0, -170, 161, 0, -65, 0, 0, 0], [0, 0, 0, 0, 29, 0, 1035, 259, -203, 0, 0, -158, 0, 118, 186, -95], [0, 0, 0, 0, -9, 0, -299, -69, -347, 0, 0, -18, 0, 136, -158, 47], [0, 0, 0, 0, 100, 0, 190, 271, -342, 0, 0, -287, 0, 65, 149, -76], [0, 0, 0, 0, -65, 0, -209, -191, 436, 0, 0, -28, 0, -145, -105, 224], [-476, -115, 31, -69, 0, 247, 0, 0, 0, -20, -47, 0, 77, 0, 0, 0], [415, -136, 301, 42, 0, -32, 0, 0, 0, 211, 106, 0, 23, 0, 0, 0], [0, 0, 0, 0, 164, 0, -356, -18, -137, 0, 0, 110, 0, -79, 37, 77], [0, 0, 0, 0, -93, 0, 103, 35, 64, 0, 0, -71, 0, -28, -68, 72], [0, 0, 0, 0, 5, 0, -140, -3, -142, 0, 0, -47, 0, -207, -173, 78], [0, 0, 0, 0, -99, 0, -184, -45, -36, 0, 0, 186, 0, -295, -155, 410], [0, 0, 0, 0, -19, 0, -94, -210, 188, 0, 0, -135, 0, -66, 22, -151]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1089_c_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1089_3_c_m();".
// 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_1089_3_c_m(:prec:=16)
    chi := MakeCharacter_1089_c();
    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_1089_3_c_m();".
// 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_1089_3_c_m( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1089_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<2,R![3721, 0, 46518, 0, 94305, 0, 74898, 0, 29084, 0, 6102, 0, 705, 0, 42, 0, 1]>],Snew);
    return Vf;
end function;