
// Make newform 630.3.o.f in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_630_o();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_630_o_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_630_3_o_f();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_630_3_o_f();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [2560000, -7168000, 10035200, 70149120, 178889856, 86081152, 18837632, -4595248, 1093889, 231896, 50336, -12664, 1954, 152, 32, -8, 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], [534324510814884608000, -5587401352259187200, 9196525750040289280, 42570659834773128768, 95046452581399705312, 2818992904749593592, -1824569731375289568, 409758392839305393, 244453432126191576, 7134008349081616, -4928139696036504, 884237923385410, 151584816096312, 4536459111192, -3107145446008, 498284030129], [53477185232134471394118710208000, 1590560516521259391081802999148800, 1696749097671225799725375195551680, 353821788205151003380064012198848, -66084760112201739257152625941032, -47559316792232250224591704366012, 15565333085757911374763920921143, 77180454102197290632334158579, -173521337611490097457645568136, -135022761934534323422171192576, 32136734753681945313258983974, -1794093536667855446399605602, -112235197009448860752592032, -86826702835655389258321412, 17970079645683158103311503, -1507199328622388427929525], [232431648484874621115141632000, -2225350312372339004103034892800, -11620918919670154992391536887680, -12993474700473951273694265843648, -5305696558618628641218886482240, -719449018130531781232088723240, 180976850729426810190271470950, -65924256015119669450932994891, -14274226782583577122771384520, -1912893592429770663178189120, 546511703953657264363821140, -105717930910748956540229574, -9304805374903308743399240, -1220781585234851432658840, 355849584339626868196590, -50521933035234406935387], [338043110964360494658210332032000, -532880132548126797451977997516800, -2782839408275349352230347459422080, -3111633157131511050847624678326208, -1270855705906394283493640257820560, -172352038909657772404504958906560, 43372335081959687277592960733330, -15752394612797340867688025357631, -3418446210754313761500284959880, -458255913561199101206385102480, 130955780952902562464699541580, -25263266575828111291938782414, -2226878906398720288454917560, -292450754027165513539470160, 85224520217749198675066170, -12085404159758350350699247], [113359430152712771622478808256000, 266461998719592764984523512185600, 1391388873664253031217367420877760, 1555603783724061364253191658007936, 634888487783576647750492215095160, 85927199122479636045696950022860, -21731443531600977047188683957145, 7897245961507910001212281287842, 1708385418054973711004999115680, 228974356306765774837195962480, -65598741434497573017700291490, 12669223252126716516697758108, 1114365932830071889909269160, 146396752377212370392985060, -42688660290736661449235625, 6056238176411623354901114], [101744118017880288715678636288000, -1750255215698528982004688900723200, -866292116559071007080999323409920, -1442268565245647741634224725650112, -614728432832429659646949837550432, -195902824516510917785544306872712, 42150479723803937902196888918568, -9288302061651309344113847415891, -1663833911130719816240276739336, -515313230685024011226516720176, 117319933591638618645769694424, -16954729091769539577109963782, -1102626571635748756666051432, -325081325120604388154675112, 74241770522206402655967728, -8777584802917452100592915], [-11051711894885376000, 105301060960663846400, 548941248000905818880, 611701073097399244224, 245029826542538987136, 30190303107868824376, -7728422423215531764, 3029964043268094319, 659096250117860328, 80163851117945648, -23664986684234512, 4778238010708190, 429277520452136, 51193155741176, -15491795991004, 2256059372367], [750749150510170223960423077248000, 2360523507935563196223389644800, -5452919232974584984693876198069120, -10338182569908802403245236397660352, -4930577980578256305585405063338128, -930645725391078941535034491879648, 232001360301403406124337624556642, -60660729641285327316685378685187, -13290507949248193011690515661544, -2489257670269199927462816733904, 650291046644204334171770899276, -105961003111341288722252426070, -8697885978704018417996591128, -1584755917723635844287496048, 413468129475094484678871402, -53453000446683789795632691], [-103889220948746126317350906752000, 164319503969898351179625507276800, 850374348624210207641634207838080, 942331764442715348852192670029888, 364761822101351710054709910455632, 46354481699860174480729913468512, -11715006307895645409371321205698, 4630744326327588694200050265753, 981603878157766671660618418936, 123140326784007072026295781776, -35921176398745244766382383644, 7257109192570910665843547330, 639713175327196616809510632, 78640463768519071837864112, -23503972919102308071304538, 3412338678579729269398729], [-34792390529748269256595542464000, -81255165686903865978536717318400, -426677131187122355771571423727040, -478048602216806780235957352319744, -197734548487628531179290039085656, -23583926179124347694854481579396, 6165681703593142903658606767609, -2384748557168006514317267187104, -531653053519601170802975090288, -62579192398151045598224168608, 18792643926343523344187154802, -3780790853566572992793977560, -346072354706028195294085656, -39985022273591084051503196, 12276743089921280580133529, -1791907420770118236739192], [-154424235478291493398759673088000, -488077145624801586094222748684800, 1652595275103126127268440486789120, 5101702365002084263095418587284032, 2564623033441214030440116202017504, 545738373979820199663499762745464, -135945802433372310116560565795936, 31739225467634626177448390357793, 6910952861315796051643861922392, 1462824424856672409223525337872, -372339390852850080288812888088, 57152262588460708403280624418, 4528659966012185459267448504, 931403725433463611273107864, -234752825343122954764952696, 29369391430993776549242657], [-13556691495783048346065701888000, 827381353100050330290685450867200, 1748046373385579006534464146392320, 5581662438726636442298377681906752, 2749003015767474911914702680761728, 673359068251502610668644337808648, -160707111571222275251171900418092, 35698063581887795467163947659737, 7407789726927897658768044912344, 1795939749414398495782778605904, -439191029038663453727895892976, 65148253732557025727405518770, 4864429024102505288540376728, 1139686289961773367211583048, -276588239709545424544104452, 33748983840104420496354041], [-3658088019850964697623236416000, 126466386156125953953863727878400, 243994044675541917193691356527040, 818028966462865206534708372063744, 401805382218616894700708223300664, 99602828269490304490450790739524, -23719114928058737333969647109161, 5233599884399459371581852989872, 1081697621767113158489583473072, 265533250379439632170611253152, -64720079266248378638438018898, 9557535311357750667568232824, 709834574265647494182988664, 168403974109603378470151324, -40730009400841889037483081, 4955856064949048488893960], [-302620871803708696152200273088000, 4735112833339007106336508947200, -359154337198876821720458290470080, 5984389005390320008999784103464512, 3313466430217182716408137894865544, 909864607443146925496142029564204, -220006139215002140207901233137771, 42513426596138906143189654014693, 8940333135123891365164420498312, 2435027751677853805931316147392, -586013418928779212849080250318, 81220154548791279920124616178, 5884114166706164314372148544, 1546473273046397165975051604, -365620184134954700262732931, 43136369546463387987857517], [-230645924071229951444989696512000, -73703741187705017000901847283200, 1596955145704081586052408181518080, 10193963705550330718278853441434688, 5282853462056585681244785460447936, 1308784224636813158773593035161576, -318401580604409937167107256737924, 67340663352449631842871029974137, 14235180667441472243487072048728, 3502549277391697915664705524048, -859603350184844994130705189792, 124777143491149335127304736562, 9347599508626451088434718936, 2225981274042425398223395176, -538987862975039906091868764, 65196613732168144527114713]];
    Rf_basisdens := [1, 108723461658787840000, 75471572196185951487162204160000, 1179243315565405491986909440000, 150943144392371902974324408320000, 75471572196185951487162204160000, 75471572196185951487162204160000, 11373131612962816000, 150943144392371902974324408320000, 9433946524523243935895275520000, 4716973262261621967947637760000, 75471572196185951487162204160000, 75471572196185951487162204160000, 9433946524523243935895275520000, 75471572196185951487162204160000, 75471572196185951487162204160000];
    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_630_o();"
function MakeCharacter_630_o()
    N := 630;
    order := 4;
    char_gens := [281, 127, 451];
    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_630_o_Hecke();"
function MakeCharacter_630_o_Hecke(Kf)
    N := 630;
    order := 4;
    char_gens := [281, 127, 451];
    char_values := [[1, 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], [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 := [[1, 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, 0, 0, 0, 0, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1], [-2, 0, 0, -2, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1], [-3, 0, 2, 2, -1, -2, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1], [1, 0, -1, 1, 2, -1, 0, -1, -2, 0, 0, -1, 0, -1, -2, 0], [-1, 0, -1, -1, 0, 0, -1, 0, 0, 2, 0, -1, 0, -1, -1, 0], [-1, 0, 0, 4, -3, 5, -1, 0, -1, 0, 0, -3, 3, 1, 1, 2], [-10, -3, -1, -1, -1, 2, 1, 0, 1, 1, 1, -2, 3, 0, 1, -2], [-9, 1, 1, 7, 2, 2, 1, 1, -2, 0, 0, -4, 0, 2, -1, 1], [-1, -2, 0, -1, 2, 3, -1, 0, 2, -1, -1, -3, 2, -1, -1, -1], [2, 3, 0, 2, -8, -2, -2, -3, 0, -2, 0, 0, -2, -2, -2, -2], [-6, 2, 2, 2, 0, -2, 0, 2, 0, 0, 2, -4, 2, 2, 0, 0], [-4, 0, 0, -2, -2, 0, 0, 0, -2, 2, 0, 1, 4, -1, 0, 1], [2, 0, 4, -6, 0, -6, 6, -4, 0, 0, 0, 2, -4, -2, -2, -2], [11, 4, 2, 0, 1, -5, -1, 0, -1, 1, 1, 1, -5, 1, -3, 4], [-6, 0, 0, 6, -4, -4, -4, 0, 4, 0, -4, 2, 0, -2, 4, -2], [-41, 0, -4, 0, -5, 2, 5, 0, -1, -2, -2, 1, 7, 1, 4, -3], [-2, -8, -4, -2, 0, 4, 0, 8, 0, -3, 0, -3, 4, 1, 0, 5], [-2, 0, -2, -38, -4, 6, -4, 8, 4, 0, 0, 2, 0, 2, 4, 0], [12, -4, 2, 10, -10, 4, 6, 4, 2, 2, 0, -6, 0, 0, 6, -4], [0, 0, -2, -55, -5, 8, -2, 8, -3, 2, -2, -2, 3, 0, -2, 1], [43, -6, -2, -40, 3, -27, 5, -6, -3, 0, 3, 4, 1, 0, -5, 1], [64, 6, 5, 1, 1, -2, -9, 0, 3, -1, -1, -2, -7, -4, -1, -2], [3, 0, 3, 2, -17, -1, 2, 0, 1, -2, 0, 7, -3, 7, 2, 3], [10, -2, -3, 1, 3, -1, 4, -2, -3, 0, -2, 8, -7, -4, -4, 4], [3, 0, 2, -6, 13, -13, 5, -14, -5, -4, 4, -7, -1, -3, -3, 2], [8, -4, -10, 8, -4, 2, -8, 4, 0, 2, 0, -5, 2, -3, -8, 7], [18, 11, -2, 0, 6, -24, 2, 11, -6, 0, 2, 4, -20, -6, -2, 10], [-40, 0, 6, -2, -6, -22, 2, 0, -6, 0, 0, 4, -18, 8, -4, 10], [5, -6, 0, -12, -3, -21, -7, -6, 3, 0, -6, -6, 3, 2, 7, -5], [1, 0, -4, 81, 10, -15, -3, 9, 6, 1, -1, 17, -8, -1, -3, -9], [6, 0, -14, 66, 2, 6, -8, -16, 6, 2, -2, 6, -18, -6, 0, -6], [-2, -16, 2, 6, 20, 4, 0, 0, -8, 2, 2, 14, -12, 2, -6, 14], [-35, -4, -4, 34, 7, -17, 5, -4, -7, 0, 9, -2, 3, 4, -5, -1], [14, 13, -4, 8, -14, 0, -4, -13, 6, -2, 0, -8, -12, -2, -4, -4], [28, 15, -10, -16, 4, -44, -2, 15, -4, 0, 0, 8, -8, -4, 2, -2], [48, 0, 5, 50, -6, -9, -4, 0, -2, 0, 0, 18, -5, 7, -4, 4], [-5, 0, 7, 50, -7, 4, 2, 26, 5, -2, 2, -3, 5, 5, 9, 4], [16, 12, 2, -10, 28, 22, 4, 0, 4, -2, -2, -14, 0, 6, -8, 4], [74, 2, -12, 8, 0, 17, 6, 0, -2, 4, 4, 10, 22, -6, 7, -5], [-21, 11, 3, -17, -32, -6, -3, -11, -4, 6, 0, 14, 2, 4, -3, 5], [-3, -22, -8, 12, 5, -31, 3, -22, -5, 0, -6, 8, -3, -2, -3, -1], [-1, 0, -13, -75, 20, -3, -14, -3, -4, 6, -6, -7, 6, 1, 0, 4], [-46, 0, -2, 12, 14, 20, -8, 0, -2, -6, -6, 14, 2, -10, 6, -4], [-5, 1, -3, -6, -89, 1, -2, -1, 1, -4, 0, 1, -1, 3, -2, 5], [-18, -4, 2, 24, 2, -60, 2, -4, -2, 0, -2, 0, -8, -2, -2, 6], [-11, 0, 10, -16, 11, -17, -1, 4, 5, 1, -1, 3, 17, 11, 9, 4], [-30, -26, -14, -34, 0, 12, -2, 26, 4, -6, 0, -29, 4, -13, -2, -3], [14, 0, -19, -64, 20, -5, -5, 16, -6, -8, 8, -6, -22, -14, -10, -4], [63, 8, -2, 6, 23, 19, -5, 0, 1, -9, -9, 5, 5, -7, -7, 6], [2, -14, 0, 2, 32, 26, -2, 0, 0, 6, 6, 2, 0, -2, -6, 6], [14, 12, -1, -12, 12, -77, 6, 12, -12, 0, -12, -10, -7, 5, -6, 6], [-71, -14, 10, -71, -36, -4, 6, 14, 0, 2, 0, 13, -4, 9, 6, -1], [-7, 0, 4, 27, -6, 13, -3, 22, -6, -1, 1, -15, 20, 7, 5, 11], [14, 3, 11, -17, 31, 22, 5, 0, 1, -3, -3, -18, -21, 16, 1, -2], [-21, 23, 1, 19, 14, -30, 9, 23, -14, 0, 6, -14, -4, 8, -9, 7], [-141, 16, -6, 14, 27, 31, -9, 0, 1, 4, 4, 13, 13, -15, -3, 2], [17, -27, 19, 18, -87, -1, 18, 27, -1, -4, 0, 15, 1, 13, 18, -5], [35, 14, 2, 26, -97, 0, 2, -14, 9, -8, 0, -13, -18, -4, 2, -15], [12, -34, -16, -4, 8, -12, 4, -34, -8, 0, 4, 12, 4, 0, -4, -8], [118, -22, 4, -2, 40, 32, 2, 0, -4, 4, 4, 2, -12, 6, 0, 4], [-14, 22, 4, -10, -20, -10, -6, -22, -4, 5, 0, 9, -2, -5, -6, -5], [-171, 16, -4, 174, -21, -53, -3, 16, 21, 0, 2, 34, 19, -12, 3, -13], [-16, 2, -10, 20, 40, 70, -14, 0, 4, -6, -6, 16, 24, -24, 16, -20], [-25, 38, -4, 9, -20, -4, -16, 38, 20, 0, -2, 10, 24, -2, 16, -22], [106, -18, 22, -125, -11, 11, -5, -18, 11, 0, 6, -20, 3, 4, 5, 7], [-5, 0, 0, 190, -49, 57, -5, 40, -15, 3, -3, -11, 25, 5, -7, 8], [-181, -2, 2, -170, -53, 18, 20, 2, -11, -4, 0, 3, 40, 10, 20, 19], [6, 0, -9, 188, -4, 17, -3, -30, -10, -8, 8, -14, -2, -6, -6, 4], [-7, 33, 3, 0, -21, -49, -10, 33, 21, 0, -8, 15, 15, -7, 10, -11], [17, 24, 4, 27, -102, 6, 10, -24, -10, 0, 0, -16, 26, -20, 10, -14], [12, 0, -10, 26, 30, -26, 2, -20, -10, 2, -2, 0, -14, -12, -16, -6], [64, -43, -4, 74, -86, -6, -10, 43, -10, 8, 0, 12, 14, -4, -10, 10], [-6, 0, 22, 44, -8, -14, 16, 28, -8, -4, 4, 6, 20, 6, -8, 0], [13, -20, 22, -24, 9, -43, 5, -20, -9, 0, 1, -36, -15, 10, -5, 21], [96, -12, -24, 6, 32, 62, 10, 0, 8, 0, 0, -2, 56, -14, -2, -6], [0, 0, 36, -124, 2, -48, 36, -36, 6, -6, 6, 20, -6, 0, -4, -10], [8, 0, 4, 136, 68, -64, 12, -14, 12, -2, 2, -24, -28, -8, 20, 8], [-187, -64, -16, -6, 25, 65, 3, 0, 19, 2, 2, -25, 51, -13, 5, -24], [-101, 50, 8, 12, -13, 14, -43, 0, 23, -10, -10, -11, 7, -35, 12, -35], [-4, -2, -30, -10, 50, 8, -22, 2, 6, 11, 0, -27, -4, -13, -22, 11], [-21, 0, 51, -191, -44, -3, 30, -17, 12, 10, -10, 13, 30, 21, 16, 4], [-57, -12, -26, -49, -116, 8, -18, 12, -8, 2, 0, -21, 24, -21, -18, 13], [14, 0, 10, -98, -6, -10, 24, -12, -18, -6, 6, -2, -10, -14, -24, -6], [-47, -34, 32, 41, -10, -14, 6, -34, 10, 0, 16, -14, -10, -2, -6, 24], [12, -20, -10, 11, 39, 72, -10, 0, 9, 4, 4, 2, 29, -20, 14, -23], [100, -37, 12, 108, -72, -2, 10, 37, -8, 2, 0, 42, 14, 32, 10, 28], [0, 8, 14, -48, -8, 46, -12, 8, 8, 0, 18, -38, 30, 20, 12, -14], [-10, 0, -4, 70, 32, -40, -14, 12, -4, -8, 8, 34, 24, 10, -16, -12], [-8, 15, 32, -26, 6, -12, 12, 15, -6, 0, 6, -46, 8, 20, -12, 18], [-123, 58, 0, -8, 33, 44, -9, 0, 17, -2, -2, -25, 17, -9, -6, -11], [0, 0, 12, -6, -62, 54, 12, 38, 18, 4, -4, -8, -18, 0, 22, 4], [54, -29, -24, 58, 28, 8, -16, 29, -4, 4, 0, -54, 16, -50, -16, -22], [-8, 0, 19, -141, 45, -36, 11, 42, -25, 3, -3, -48, 41, 8, 3, 28], [76, -6, 3, -45, 11, 38, 33, 0, 9, -3, -3, -54, 3, 36, 21, -30], [51, 44, -1, 54, 3, -13, -14, -44, -3, -6, 0, 15, -7, -1, -14, 3], [-11, 46, 18, -6, -21, -59, -25, 0, 13, -4, -4, -19, -23, -7, -33, 20], [6, 40, -10, -22, -12, 16, -6, 40, 12, 0, -20, 14, 32, 2, 6, -24], [-55, -36, 18, 78, 43, -21, 47, -36, -43, 0, -2, -24, -37, 10, -47, 51], [-164, 21, 6, -162, -86, -22, -16, -21, -2, 4, 0, 48, -18, 24, -16, 20], [28, 0, -26, 0, 2, 28, 2, 24, -2, 20, -20, -36, -54, -28, 2, 4], [-68, -42, 0, 12, -48, -40, -4, 0, -8, 12, 12, 20, -8, -4, 16, -8], [39, 42, 32, -30, 13, 97, 23, 42, -13, 0, -23, -24, -31, 2, -23, 43], [-46, 25, -36, 78, -12, -80, -12, 25, 12, 0, 20, 58, 4, -22, 12, -26], [32, -30, 7, 30, 46, 13, 20, 30, 2, -44, 0, -12, 9, 3, 20, -6], [-10, 0, -11, 100, 88, -61, -21, 8, -26, 8, -8, -22, 46, 10, -10, 16], [-41, 20, 12, -36, 25, 63, -7, 0, 31, 13, 13, -67, 7, 5, 19, -50], [65, -19, -25, -20, 15, 51, 14, -19, -15, 0, 8, 39, -21, -15, -14, 5], [-231, -38, -4, -239, 88, 8, 4, 38, 8, 18, 0, -18, -8, -2, 4, -6], [291, -62, -4, -278, -7, -97, 9, -62, 7, 0, 18, 30, 7, -10, -9, -1], [-5, 0, 8, -173, -10, -9, 3, 3, 18, -29, 29, 27, -8, 5, 7, -11], [-310, -64, 10, -14, 16, -42, 12, 0, -8, 14, 14, -6, -28, 22, -40, 48], [139, 24, 12, 18, 15, -49, 5, 0, -35, 6, 6, 53, -59, 17, -17, 52], [224, 22, 8, 216, 0, 20, 28, -22, 8, 4, 0, -48, 4, -20, 28, -36], [-2, -65, 2, 0, -38, -34, 0, -65, 38, 0, 0, 54, 38, -18, 0, -18], [-138, -14, -2, -150, -112, 36, 34, 14, 12, 2, 0, -39, 12, 9, 34, -1], [-21, 0, 3, -102, -71, 56, -18, 26, 61, 26, -26, 45, -19, 21, 49, -12], [621, -24, -6, 32, -73, -55, -35, 0, 9, -7, -7, 23, 21, -41, 3, -12], [291, -49, 13, 265, -70, 4, 17, 49, 26, -8, 0, -20, -48, 10, 17, -29], [479, 14, -2, -466, -3, -8, -14, 14, 3, 0, 16, -1, -22, -8, 14, 3], [-55, -24, 6, -63, 4, 20, 26, 24, 8, 26, 0, 29, 4, 57, 26, 43], [-328, 53, -5, 11, 61, 64, 39, 0, -45, -1, -1, 56, -35, 34, 43, 2], [-147, 108, 12, -10, 73, 45, -5, 0, 3, -22, -22, -13, -21, 7, -19, 16], [-8, 0, 8, -44, -52, 40, 0, 44, -4, -26, 26, 16, 20, 8, -8, -4], [12, 0, -16, -182, -38, 32, -4, -46, 14, 22, -22, 32, -38, -12, -8, -22], [184, -41, -20, -152, -32, -20, -24, -41, 32, 0, -32, 60, -4, -32, 24, -20], [266, 4, 4, 294, -4, 20, 24, -4, -28, -11, 0, 9, 76, 1, 24, 25], [14, 0, -4, 320, 114, -122, 10, -24, -26, -12, 12, 10, -2, -14, -38, -12], [133, 40, 2, 121, -144, -12, -10, -40, 12, 6, 0, 1, -36, 1, -10, -13], [368, -42, -28, 20, -4, 18, 40, 0, -32, 28, 28, 52, 24, 12, 26, 6], [45, 64, -28, -61, 4, -24, -4, 64, -4, 0, 18, 10, 36, 10, 4, -34], [-274, -108, 6, 27, -95, -138, -24, 0, -9, 0, 0, 36, -21, -18, -28, 37], [21, 0, -20, -66, -91, 83, 1, 48, 35, -27, 27, 35, -77, -21, 7, -28], [-245, 6, -34, -274, 99, 4, -30, -6, 29, 14, 0, -57, -54, -24, -30, -19], [-215, 82, -17, 160, -37, -35, -44, 82, 37, 0, -34, 1, 65, 9, 44, -63], [-39, 42, -10, 46, -1, 80, 26, 42, 1, 0, 6, 41, 30, -4, -26, -7], [21, 0, -38, -70, -95, 135, -17, 16, -21, 10, -10, -25, -21, -21, -19, 2], [-252, 13, 21, 5, -41, -84, -27, 0, 1, 25, 25, 4, -41, -6, -23, 22], [99, -44, 2, -8, -55, -45, 11, 0, -5, -14, -14, -3, -9, 13, 17, -12], [66, 15, 48, 68, 106, -72, -24, -15, -2, -26, 0, 116, -68, 42, -24, -4], [154, -40, 35, -193, 17, 97, -4, -40, -17, 0, 54, -84, -17, 28, 4, 24], [24, 0, -58, -96, -90, 128, -34, -128, -6, 16, -16, 16, -42, -24, -26, -20], [12, 0, -42, -140, 12, 10, -30, 6, 0, -36, 36, 28, -24, -12, -20, -20], [268, 72, 22, 240, 68, 6, 28, -72, 28, -13, 0, 15, -50, 49, 28, -1], [-178, -28, -27, 224, 4, -179, -18, -28, -4, 0, -2, 26, -41, -21, 18, -2], [-7, 0, -73, -251, 70, 27, -80, 33, -6, 16, -16, -41, 20, 7, 18, 24], [-467, 0, 45, -447, 148, -24, 21, 0, -20, 2, 0, 37, 16, -7, 21, -32], [-185, -94, 24, 143, -42, -142, -26, -94, 42, 0, -30, -8, 34, 0, 26, -18], [77, -16, 9, -39, -34, -65, 60, 0, -30, -10, -10, -9, -48, 69, 8, 22], [386, -32, -26, 372, 234, -26, -52, 32, 14, -8, 0, -30, -54, -42, -52, -30], [302, 38, 0, -226, 24, 2, 38, 38, -24, 0, 10, 40, -62, -26, -38, 50], [60, 0, 2, 28, 32, -8, 6, 0, -32, 0, -36, 0, -116, -28, -6, 62], [-230, 64, 4, -24, 84, 67, 54, 0, -34, 16, 16, 10, -42, 58, 21, 13], [-30, 0, 28, 24, -2, 16, -2, 124, 6, 6, -6, -54, 54, 30, 48, 42], [29, 0, -25, 87, -154, 169, 4, -76, -14, -24, 24, -9, -44, -29, -24, -10], [233, 22, -2, -156, 93, 69, 53, 22, -93, 0, 15, -46, -115, 8, -53, 83], [384, 116, -22, 39, -109, -16, -30, 0, 13, -16, -16, 26, 57, -52, 58, -71], [238, 54, 2, -197, 49, -161, 43, 54, -49, 0, 22, -12, -49, 4, -43, 47], [86, -30, -46, 88, 310, -32, -78, 30, -2, 30, 0, -3, -28, -37, -78, 11], [266, 36, 102, -294, -8, 52, 54, 36, 8, 0, 12, -50, -12, 10, -54, 84], [250, -2, -14, 28, -70, -36, -48, 0, 34, -16, -16, -6, 62, -62, -14, -20], [-507, -70, 12, 446, -25, 221, -13, -70, 25, 0, 10, -18, 61, 18, 13, -31], [-244, 92, 32, -252, 104, -54, -22, -92, 8, -18, 0, -6, -70, -52, -22, -92], [188, 148, 46, -28, -96, -154, -46, 0, 28, -14, -14, -56, -64, 0, -40, 12], [-115, 30, -30, 144, -3, -83, 41, 30, 3, 0, 67, 90, 45, -16, -41, -17]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_630_o_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_630_3_o_f();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_630_3_o_f(:prec:=16)
    chi := MakeCharacter_630_o();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 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_630_3_o_f();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_630_3_o_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_630_o();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![-50723840, 31392768, -4963840, -257024, 94224, -368, -540, 4, 1]>],Snew);
    return Vf;
end function;