
// Make newform 1470.3.f.d in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1470_f();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1470_f_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_1470_3_f_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_1470_3_f_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 := [101626561, 294123256, 1087013404, -630430976, 595763862, -91953512, 64376800, -6808704, 4836403, -298200, 197216, -7728, 5846, -112, 92, 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], [-1202728311133779179554909109, 9955887688266404429946106, 35874681437029057265441973, -4685579583089306764764583, 10591214719874231223793348, 3497231496721962844392765, 1467974756910134628134465, 306572240997688184788012, 76261143494901216401580, 16545566601055515429559, 2793391292439344623383, 455975368108340251668, 54078590776251682475, 8239103585403158159, 676562680999836294, 57754008957283349], [206657596524136518657064, -103279705437214175760, -459537667512276799289, 1279768421429813362272, -1018214320678792586196, 595135449699402838792, -152233236071607452553, 46638150914308904520, -7103633821675122284, 2160971883833844512, -237157576567025547, 55447463307528888, -3468795000369922, 824042900206056, -35399436274870, 6718070224756], [-148193606010062737313275, 957085277114840834430, 3491995997388483650717, -940733060256762782559, 1467948791527369196388, 23538017273856016799, 233091302320357629453, 4802805224198506740, 10456974871241558252, 356604274247547817, 371621017202953791, 14035722749452236, 5895790087314937, 341679513333957, 79093222616710, 3871767397361], [-49793140462485741740564019667302022211751, -450294361739753268802611711172967452983904, 235625405974736320182385020984337601858401, -199611409492269652994318983181462690900774, 16480923200844042141095313649474586060138, -21102866749248222462536154496131177234044, 1562153171319216137200389970915623241819, -1438089633101304793073636413061634509524, 65194802114865894964792930629943731574, -56379450841845268013992185571629193172, 2238397531499978911345875836894047377, -1572246595585425326053498700187612372, 33346620725345705792292386908536195, -23706868915498534505262085799802764, 213469975304718887115010020250304, -241863822777540874882466993018758], [-23442301013525123996598271073372839033, -229621811151920173894439902818460534, -714070897931272908462439708632495915, -8608546324615197810872297777006685983, 933885797263311750157099981268214596, -899631755687316031497385829078742651, 115859697731261714424380120491192081, -71687408890868806747434561888203188, 6428727908938342577118706461520812, -2919190798664141627791804403165965, 205591363940722638333739187297079, -88569529078180963996479471688716, 3487555436126339212562826767107, -1369703339442836424119507090009, 21207121467610615912805559174, -15676746441665707101942164015], [3521207262416884848433762658587277531, 36052656915764843531341394646112567344, -27545780009134355888225371127509524184, 20757636283402814726509997166646534848, -3771284369594629070382322847180181060, 2236415316817892637807058734013008848, -283581678836521920106992554468810640, 168345816581855321121206226303993216, -12335700651762730044495715881145318, 6850224385630247456211484006725040, -329641444475618185980178937295216, 203150684489855051057790801147168, -4883872557229584935529507311852, 3184797771932765844822003594240, -10894314337506543053670349736, 34800704278153535382807509504], [-55329661987849902130608, -567954327233848070808304, 436496862559525516173889, -328552596355156909606256, 60517159199633559261440, -35333929028214918917480, 4517022991968883377451, -2639716566132467353984, 195705915902593012444, -106964341125832723328, 5211291917675260305, -3154550976828630456, 76985389887345138, -49316294058364856, 184355843936000, -536662839109972], [203021156853115775993, 2091806790152256573456, -1620423665127954679375, 1220130262910161491531, -228882972939831674094, 131897626701278295101, -17105922536607134721, 10036111646725656126, -746713194852137098, 410965646117486839, -19810557668746935, 12285060311199138, -293621077625441, 193661918213181, -540413699312, 2130173036201], [31351166733895176216491140415459948534796, 298517316090639541206036201872067943971200, -184555318397999592675046544109329481337922, 153102783374700304960302234551110364381923, -25462330763896727659919529802689863003296, 16400400933464541644568104022630034167277, -1931951755527215176068822620639346594878, 1282216420561340630964640398485100256046, -85155157364026490810922764150475232928, 52509790850976840228722541081735640975, -2345134475522779658037774090424825002, 1582514521052192986730127030508629594, -35765374599523411150807746572903628, 24724502366652215915576790007891357, -90824115373216270012966076556376, 273267982442506027837028536846301], [-437660350242222703221165, -4518691295624378534050984, 3517427264905839032095693, -2644373246682812474960417, 500982390617084205830630, -284874104240500582055717, 37198980049890495166591, -21496564169263011322522, 1616020902079177673194, -874597310627211904019, 43002282249586977093, -25956155317369110414, 638852366768395737, -406573176070056149, 1527746136142088, -4448842632361015], [-91876261549562488474322233688611891103, -6470850633222513601969200095438569758, -22597125487299789997563421409019516695, -58619731313164471563160626236307114531, 597458333330310777396600761626775892, -7473449288344881015343436020856745167, -17681141653075112811106269800634411, -609568656712704554220138175959467556, 2424669373205808452677178694538204, -25937879554799122322336137198622449, -100975119829351085447600383013997, -791993126949886351938458511046812, -2722805495207821537930036165291, -12845894306918859627747662840373, -205984038615707634647717699362, -139899057247192626960828150203], [54539131317226042274521458166636701909, 2499667994650377956679074524685699432, 8755731051360650982019965319468659565, 22564363014998968270435084775820227404, 45053311281652415642974882019971172, 2695217965796171147046350321069201188, 33350653108110624529048868648542321, 220345273133399733933805748083108424, 980369731111473431671427903471644, 9383188325428496653322675718828448, 102227182237608941304707315817543, 287669320037743266070478689305528, 2344084363837616559345483004641, 4686121529079582552930273937852, 88189787602355302125069537998, 50541445469745635702521407476], [40128729606389940427563972548234469854, 1699987857187158300731555890791555114, 5946720044570265499150836888229441082, 16011464587952105898188873235352187640, -51743176237912170133092018183094008, 1890245428081527900140741520716056325, 13527137712560061152587689973211136, 154371956973564180787294432103580228, 94213946227552098355377432246440, 6545045094796181211847908243536239, 50642128087521428839734928726662, 201097599940690016735522351078652, 1195103257893557548048710310882, 3269452438379247383903820031191, 57402549257930764143801253636, 35618621022542461412963550752], [241226071476552345162168621818414428421697, 2150637685521930692819305889555961803356510, -1025012991098740975794373087499920956372100, 971695144433049417614826274880961599060141, -144115666979851304912358383250150995962136, 103489208761170799566591481949888616327575, -10627157121886052664993396991945530374686, 7604888710910270137183375270238308341856, -461578234521407040548049640832600487082, 307821302729523772843844588129480487590, -11987810186592915492952403117919938364, 9030723326987672595044485228224009498, -172571033238879105571543248620219622, 141488245005809006513245332039530819, -45409554837746644596280025048156, 1524687532650925566384058512983608], [148851527006263660404650371701627502341, 1331955896632363538983196299482134343112, -644931194393471260333156135024330484311, 607562677390245683660668103797050433139, -92294600198557773363013468818806213150, 64784183508077896482320219799719599595, -6777773520474492153092935877383356565, 4779142678687522109036057214533659918, -294775183761668393523411707373797314, 193818155261377055998617002044149413, -7597080890305333130374154566891551, 5700740767634372766157484444374170, -109190857744315535774155928018049, 89527070939922271046261982843611, -1952043673575989613570267656, 967177237679128037761186849117]];
    Rf_basisdens := [1, 852577600778545978990177524, 53375543816937984206838, 27111518972679309429492, 95852909214978668011338765982386839392644, 3169424634294834110747570214012724908, 6206482078151946905681090778450326301, 75811879080713475788634, 255239865906581664108, 31950969738326222670446255327462279797548, 427449074136574093101036, 9508273902884502332242710642038174724, 3169424634294834110747570214012724908, 1584712317147417055373785107006362454, 23963227303744667002834691495596709848161, 10365838565478389532966234019940179452];
    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_1470_f();"
function MakeCharacter_1470_f()
    N := 1470;
    order := 2;
    char_gens := [491, 1177, 1081];
    v := [2, 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_1470_f_Hecke();"
function MakeCharacter_1470_f_Hecke(Kf)
    N := 1470;
    order := 2;
    char_gens := [491, 1177, 1081];
    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], [-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, 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, 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], [1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 2, 0, 0, -1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -3, -5, -2, 0, 0, 0, 0, 0, 1, 0], [1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 1, 1, -1, 0, 0], [4, 5, -6, 0, 0, 1, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0], [0, 0, 0, 0, -1, 0, -6, -1, 0, 1, 7, 0, 0, 0, 0, 0], [-6, 6, -2, -5, 0, -1, 0, 0, 0, 0, 0, -1, 1, 1, 0, 0], [0, 0, 0, 0, -2, 0, -4, -2, -4, 1, 3, 0, 0, 0, -1, 1], [-3, 5, 0, -2, 0, -1, 0, 0, 0, 0, 0, 1, -1, -2, 0, 0], [0, 0, 0, 0, 0, 0, -2, -6, 0, 2, 12, 0, 0, 0, 0, 0], [-4, -14, 0, 2, 0, 0, 0, 0, 0, 0, 0, -2, 0, 2, 0, 0], [0, 0, 0, 0, 0, 0, -5, 17, -6, -1, 14, 0, 0, 0, -3, 2], [0, 0, 0, 0, 3, 0, 7, -4, -4, -3, 9, 0, 0, 0, -1, 0], [20, 29, 1, -1, 0, 2, 0, 0, 0, 0, 0, 1, 1, -1, 0, 0], [-9, -3, -9, 2, 0, -2, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0], [0, 0, 0, 0, -1, 0, 13, 2, 12, 2, 7, 0, 0, 0, 3, 0], [-34, 1, -4, -10, 0, 0, 0, 0, 0, 0, 0, -1, -2, 2, 0, 0], [0, 0, 0, 0, 3, 0, 13, 4, -4, -4, -4, 0, 0, 0, 2, -1], [0, 0, 0, 0, -2, 0, -12, 0, 12, -3, 25, 0, 0, 0, 3, -1], [0, 0, 0, 0, -1, 0, -13, 0, 28, 3, -17, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, -20, 18, -6, -1, 9, 0, 0, 0, 3, -3], [0, 0, 0, 0, -2, 0, 7, -18, 6, 7, 13, 0, 0, 0, -3, -1], [23, -23, -1, -1, 0, 4, 0, 0, 0, 0, 0, 3, -1, -1, 0, 0], [-42, 0, 19, 1, 0, -1, 0, 0, 0, 0, 0, 2, -2, 1, 0, 0], [-26, -4, -6, 2, 0, 2, 0, 0, 0, 0, 0, 2, -4, 2, 0, 0], [30, 9, -1, -9, 0, 0, 0, 0, 0, 0, 0, -5, 1, 3, 0, 0], [0, 0, 0, 0, 0, 0, 16, -6, -26, 2, 26, 0, 0, 0, -2, 2], [38, 15, 12, -3, 0, -5, 0, 0, 0, 0, 0, -2, 1, 3, 0, 0], [0, 0, 0, 0, -2, 0, -9, 25, -6, -4, -34, 0, 0, 0, -3, 0], [-94, 46, 12, 0, 0, -4, 0, 0, 0, 0, 0, -2, 2, 0, 0, 0], [53, -4, 23, -3, 0, -1, 0, 0, 0, 0, 0, -2, -6, 3, 0, 0], [0, 0, 0, 0, 2, 0, -20, -4, -8, 2, 12, 0, 0, 0, -8, 2], [76, 54, -18, -8, 0, 0, 0, 0, 0, 0, 0, 4, 6, 4, 0, 0], [0, 0, 0, 0, 3, 0, 37, 34, 34, 2, 24, 0, 0, 0, -2, 3], [0, 0, 0, 0, 0, 0, 64, -6, 4, -4, 26, 0, 0, 0, -2, 2], [-70, 8, -4, -22, 0, 2, 0, 0, 0, 0, 0, 0, 6, -10, 0, 0], [0, 0, 0, 0, 5, 0, 28, 30, -44, -7, -17, 0, 0, 0, -5, 0], [90, -18, 20, 0, 0, 4, 0, 0, 0, 0, 0, -4, -4, 0, 0, 0], [52, -68, 40, -9, 0, 3, 0, 0, 0, 0, 0, -5, -1, -3, 0, 0], [-102, 39, 16, 11, 0, -3, 0, 0, 0, 0, 0, -2, -1, -7, 0, 0], [0, 0, 0, 0, -3, 0, -19, -4, -18, 3, 5, 0, 0, 0, 9, -4], [29, 0, 19, -13, 0, -1, 0, 0, 0, 0, 0, 0, 10, -7, 0, 0], [0, 0, 0, 0, -4, 0, -2, 64, -16, 2, -8, 0, 0, 0, 8, 0], [0, 0, 0, 0, -11, 0, -55, 20, -36, -2, 18, 0, 0, 0, 6, -5], [0, 0, 0, 0, 8, 0, -43, 24, -32, 8, 4, 0, 0, 0, -8, 0], [28, 50, 34, 8, 0, -2, 0, 0, 0, 0, 0, -6, -6, 8, 0, 0], [72, 54, 2, 34, 0, 0, 0, 0, 0, 0, 0, 2, -8, -2, 0, 0], [0, 0, 0, 0, -1, 0, 49, -6, -68, -9, 1, 0, 0, 0, 1, 0], [0, 0, 0, 0, 4, 0, 97, 49, -32, 5, 40, 0, 0, 0, 1, -4], [0, 0, 0, 0, -1, 0, 22, 19, 38, -4, -11, 0, 0, 0, -4, -6], [126, -122, 4, -14, 0, -4, 0, 0, 0, 0, 0, 4, 10, -2, 0, 0], [0, 0, 0, 0, -2, 0, -4, 26, -18, 4, 18, 0, 0, 0, 6, 4], [0, 0, 0, 0, -3, 0, 99, 14, -14, -13, -29, 0, 0, 0, 1, -2], [38, 110, 30, 1, 0, 1, 0, 0, 0, 0, 0, 9, 7, -5, 0, 0], [118, 2, 22, 34, 0, 2, 0, 0, 0, 0, 0, 0, -2, -2, 0, 0], [0, 0, 0, 0, 6, 0, 17, -4, 110, -3, 15, 0, 0, 0, -7, 9], [0, 0, 0, 0, -6, 0, -28, 48, 50, 4, 52, 0, 0, 0, -10, -2], [0, 0, 0, 0, -3, 0, -26, 44, 68, 6, 6, 0, 0, 0, -4, -9], [0, 0, 0, 0, 0, 0, 53, 17, -40, 13, 12, 0, 0, 0, -13, 0], [0, 0, 0, 0, -1, 0, 107, 66, 68, 4, -3, 0, 0, 0, 5, 2], [32, -69, 24, 31, 0, -3, 0, 0, 0, 0, 0, 4, 9, 1, 0, 0], [25, -51, -33, 19, 0, -7, 0, 0, 0, 0, 0, -3, 14, 1, 0, 0], [-59, 62, 47, 12, 0, 6, 0, 0, 0, 0, 0, -1, 19, 0, 0, 0], [-56, 66, 16, -8, 0, 12, 0, 0, 0, 0, 0, 0, -28, 4, 0, 0], [0, 0, 0, 0, 6, 0, -40, -18, 52, -10, -4, 0, 0, 0, -2, 14], [0, 0, 0, 0, 9, 0, -62, -7, 98, 2, 9, 0, 0, 0, -10, 0], [-191, -21, 7, 60, 0, -2, 0, 0, 0, 0, 0, 6, -3, 0, 0, 0], [0, 0, 0, 0, 17, 0, -60, 4, -48, 0, -54, 0, 0, 0, 0, -1], [151, 132, 11, 6, 0, -4, 0, 0, 0, 0, 0, -9, -15, -6, 0, 0], [-73, 35, -3, -11, 0, -3, 0, 0, 0, 0, 0, -1, -24, -5, 0, 0], [0, 0, 0, 0, -8, 0, 80, -84, 42, -2, -26, 0, 0, 0, 18, -10], [-62, 15, 84, -12, 0, 5, 0, 0, 0, 0, 0, -7, -13, 0, 0, 0], [0, 0, 0, 0, -23, 0, -113, 20, -4, -2, -53, 0, 0, 0, -7, 2], [70, -102, 32, 56, 0, -2, 0, 0, 0, 0, 0, 4, 2, -4, 0, 0], [0, 0, 0, 0, -16, 0, 55, 48, -12, -8, -58, 0, 0, 0, 6, -14], [0, 0, 0, 0, -4, 0, -160, 16, 8, -20, 58, 0, 0, 0, 2, -6], [52, 150, 1, -5, 0, -7, 0, 0, 0, 0, 0, -4, -2, 19, 0, 0], [-72, 202, -16, -14, 0, -14, 0, 0, 0, 0, 0, -10, 8, -2, 0, 0], [0, 0, 0, 0, 24, 0, 26, -118, -4, 9, -30, 0, 0, 0, -4, -6], [0, 0, 0, 0, -15, 0, -39, -20, -78, -3, -41, 0, 0, 0, -9, -14], [8, 104, 2, 52, 0, 6, 0, 0, 0, 0, 0, 12, -2, -8, 0, 0], [236, 16, 44, 48, 0, 0, 0, 0, 0, 0, 0, 6, 4, 12, 0, 0], [121, 92, 33, 60, 0, 8, 0, 0, 0, 0, 0, 15, -37, 12, 0, 0], [0, 0, 0, 0, 2, 0, 48, -68, 4, 3, 71, 0, 0, 0, 1, 13], [12, -175, -89, -7, 0, 10, 0, 0, 0, 0, 0, 9, -9, -7, 0, 0], [0, 0, 0, 0, 14, 0, 18, -82, -58, 0, -34, 0, 0, 0, -4, 16], [0, 0, 0, 0, 30, 0, 162, -40, 20, -12, -78, 0, 0, 0, -4, 0], [38, 157, -35, 5, 0, -6, 0, 0, 0, 0, 0, 15, 17, -7, 0, 0], [12, 270, -58, 32, 0, 2, 0, 0, 0, 0, 0, -4, 6, -4, 0, 0], [-249, -249, -39, 21, 0, 1, 0, 0, 0, 0, 0, 7, -20, 3, 0, 0], [0, 0, 0, 0, 4, 0, -144, -122, 32, 12, 90, 0, 0, 0, 8, 10], [0, 0, 0, 0, 2, 0, -94, 8, 90, 10, -20, 0, 0, 0, -12, 18], [0, 0, 0, 0, -14, 0, 30, -24, -144, 0, -32, 0, 0, 0, 0, 2], [0, 0, 0, 0, 7, 0, 50, -12, 120, -4, -104, 0, 0, 0, -6, -1], [257, 20, -18, 0, 0, 14, 0, 0, 0, 0, 0, -6, -16, 24, 0, 0], [40, 126, -60, -34, 0, -4, 0, 0, 0, 0, 0, 4, 8, -10, 0, 0], [92, -4, -34, -22, 0, -10, 0, 0, 0, 0, 0, -24, 18, -10, 0, 0], [0, 0, 0, 0, -34, 0, -6, -98, 142, 6, -16, 0, 0, 0, 10, -2], [-66, -15, 4, 44, 0, -15, 0, 0, 0, 0, 0, -23, 5, 8, 0, 0], [-54, 301, -84, -12, 0, 24, 0, 0, 0, 0, 0, 5, -6, 12, 0, 0], [0, 0, 0, 0, -28, 0, 72, 114, 20, 17, -42, 0, 0, 0, -4, 2], [0, 0, 0, 0, -17, 0, 67, -2, -172, 32, 78, 0, 0, 0, -16, 1], [0, 0, 0, 0, 23, 0, -4, 45, -28, -8, -81, 0, 0, 0, -16, 8], [-130, 68, -24, -12, 0, -6, 0, 0, 0, 0, 0, 4, 36, 0, 0, 0], [0, 0, 0, 0, 3, 0, 106, -46, 0, -27, -13, 0, 0, 0, 3, -22], [0, 0, 0, 0, 13, 0, -42, 50, -100, -12, -44, 0, 0, 0, -4, -7], [-213, -264, -105, 3, 0, -7, 0, 0, 0, 0, 0, -16, 2, -3, 0, 0], [-422, 106, -10, -2, 0, 6, 0, 0, 0, 0, 0, -14, 4, -14, 0, 0], [0, 0, 0, 0, 7, 0, -124, 15, -56, 23, 33, 0, 0, 0, -26, 34], [70, 336, -64, -6, 0, 20, 0, 0, 0, 0, 0, 6, -24, 6, 0, 0], [-204, 325, 58, -10, 0, -5, 0, 0, 0, 0, 0, 7, -15, 2, 0, 0], [0, 0, 0, 0, -19, 0, 22, 258, 40, -26, 4, 0, 0, 0, 4, 9], [0, 0, 0, 0, 1, 0, -157, -206, -108, -2, -4, 0, 0, 0, 18, -15], [168, -85, -4, 45, 0, 27, 0, 0, 0, 0, 0, 14, 7, -21, 0, 0], [158, -226, -16, -16, 0, 14, 0, 0, 0, 0, 0, 0, -18, -4, 0, 0], [0, 0, 0, 0, 37, 0, -20, 114, -136, -7, 59, 0, 0, 0, -13, 0], [-339, -214, 43, -24, 0, -22, 0, 0, 0, 0, 0, -13, -5, 24, 0, 0], [0, 0, 0, 0, -15, 0, 92, -23, -122, 10, 51, 0, 0, 0, 10, -18], [319, -381, -21, 1, 0, -2, 0, 0, 0, 0, 0, -1, -35, 13, 0, 0], [0, 0, 0, 0, -1, 0, 174, 93, 56, 11, -9, 0, 0, 0, 2, -4], [332, 317, 54, -24, 0, -9, 0, 0, 0, 0, 0, 1, 9, -12, 0, 0], [-171, -310, 7, 29, 0, -21, 0, 0, 0, 0, 0, -16, 2, -7, 0, 0], [0, 0, 0, 0, -28, 0, -82, -120, 194, 16, 114, 0, 0, 0, -4, -10], [0, 0, 0, 0, -22, 0, -335, 114, -102, -5, -7, 0, 0, 0, -15, 19], [0, 0, 0, 0, 4, 0, 68, 294, 152, -3, 8, 0, 0, 0, 14, 0], [222, 51, -100, -28, 0, -2, 0, 0, 0, 0, 0, 31, -16, -16, 0, 0], [263, -205, -23, -5, 0, -14, 0, 0, 0, 0, 0, 17, 3, 7, 0, 0], [393, -81, -59, -21, 0, -9, 0, 0, 0, 0, 0, 17, 14, -15, 0, 0], [-8, 170, 8, -44, 0, 8, 0, 0, 0, 0, 0, 2, -48, 4, 0, 0], [0, 0, 0, 0, 14, 0, -82, 174, -28, -17, 99, 0, 0, 0, -31, 17], [0, 0, 0, 0, -11, 0, 154, -84, 72, 29, -29, 0, 0, 0, -3, -16], [0, 0, 0, 0, -41, 0, -260, 3, 126, 44, 49, 0, 0, 0, 6, -10], [0, 0, 0, 0, 0, 0, -98, 22, 60, -38, 148, 0, 0, 0, 6, 4], [0, 0, 0, 0, 31, 0, -12, -27, -82, 0, -19, 0, 0, 0, 26, -18], [544, 168, -22, 64, 0, 20, 0, 0, 0, 0, 0, 16, -36, 4, 0, 0], [0, 0, 0, 0, -1, 0, 225, 260, 10, -33, -69, 0, 0, 0, 7, -16], [58, -157, 114, -96, 0, 13, 0, 0, 0, 0, 0, -13, 19, -24, 0, 0], [-221, -316, -23, -9, 0, 11, 0, 0, 0, 0, 0, 2, 22, -9, 0, 0], [-566, -234, 138, 22, 0, -32, 0, 0, 0, 0, 0, -4, -8, -2, 0, 0], [0, 0, 0, 0, 21, 0, -82, 42, -260, -11, 5, 0, 0, 0, -11, -10], [0, 0, 0, 0, 20, 0, -187, 49, -164, -5, -112, 0, 0, 0, -5, 4], [0, 0, 0, 0, -39, 0, 221, -170, 12, 16, -71, 0, 0, 0, -15, 4], [0, 0, 0, 0, 11, 0, -100, -219, -88, 46, 51, 0, 0, 0, -16, 20], [0, 0, 0, 0, 19, 0, 95, 72, -290, -33, 129, 0, 0, 0, 25, -14], [-228, -32, 52, -74, 0, 2, 0, 0, 0, 0, 0, -26, 4, 10, 0, 0], [160, -206, 28, -92, 0, 0, 0, 0, 0, 0, 0, 2, 32, -8, 0, 0], [0, 0, 0, 0, -18, 0, -24, -130, -8, 0, -80, 0, 0, 0, -8, -2], [163, -149, 64, -28, 0, 7, 0, 0, 0, 0, 0, 1, 39, -16, 0, 0], [0, 0, 0, 0, 3, 0, 165, -118, 32, -6, 36, 0, 0, 0, 14, 15], [137, 43, -158, 80, 0, 21, 0, 0, 0, 0, 0, -21, -1, -4, 0, 0], [331, 255, 5, -26, 0, 14, 0, 0, 0, 0, 0, 16, -27, -14, 0, 0], [267, -313, -81, -79, 0, 1, 0, 0, 0, 0, 0, 1, -38, 11, 0, 0], [0, 0, 0, 0, -8, 0, 186, 264, -30, -27, 91, 0, 0, 0, -15, -13], [0, 0, 0, 0, 15, 0, -305, 30, -128, -14, -37, 0, 0, 0, -17, 8], [0, 0, 0, 0, -10, 0, 140, 88, -244, 1, 43, 0, 0, 0, -1, -27], [-641, -213, -143, -39, 0, -14, 0, 0, 0, 0, 0, -33, 15, -27, 0, 0], [216, -354, 28, -44, 0, 4, 0, 0, 0, 0, 0, -8, -12, -8, 0, 0], [-141, 61, 14, 108, 0, -29, 0, 0, 0, 0, 0, 13, -7, 24, 0, 0], [0, 0, 0, 0, 2, 0, 68, -142, -32, 16, 132, 0, 0, 0, -8, 14], [-66, 75, -6, -3, 0, -27, 0, 0, 0, 0, 0, 12, 87, -21, 0, 0], [0, 0, 0, 0, 41, 0, 147, -252, 70, -48, 52, 0, 0, 0, -20, -3], [244, 79, -34, -66, 0, -22, 0, 0, 0, 0, 0, 11, -42, -6, 0, 0], [0, 0, 0, 0, -1, 0, -65, -10, -28, -8, -61, 0, 0, 0, 59, 4], [3, -362, 76, 28, 0, -38, 0, 0, 0, 0, 0, -18, 6, 4, 0, 0], [0, 0, 0, 0, -15, 0, -210, 137, -24, 54, 143, 0, 0, 0, 36, -34], [90, -78, -126, -14, 0, -28, 0, 0, 0, 0, 0, -42, 2, 22, 0, 0], [0, 0, 0, 0, -7, 0, 33, -342, -36, 57, 89, 0, 0, 0, 9, 22], [-57, -81, -125, -60, 0, -4, 0, 0, 0, 0, 0, 22, -47, 12, 0, 0], [-551, -38, -105, 10, 0, 16, 0, 0, 0, 0, 0, 49, -23, 10, 0, 0], [0, 0, 0, 0, -9, 0, -246, -193, -356, 19, 163, 0, 0, 0, 4, 4], [0, 0, 0, 0, -22, 0, -224, 104, -74, -16, -156, 0, 0, 0, -2, 38], [291, 299, -49, -63, 0, -13, 0, 0, 0, 0, 0, -11, 36, 39, 0, 0], [-336, -44, -28, -34, 0, 24, 0, 0, 0, 0, 0, 20, -56, 14, 0, 0], [0, 0, 0, 0, 26, 0, -222, -160, -192, 26, -86, 0, 0, 0, 18, -36], [0, 0, 0, 0, -36, 0, 185, 82, -288, 20, 232, 0, 0, 0, -18, 16], [-437, -221, -108, 84, 0, 29, 0, 0, 0, 0, 0, -11, 5, 12, 0, 0], [0, 0, 0, 0, 2, 0, 379, -119, -64, -7, -170, 0, 0, 0, -31, 0], [-343, 158, -37, 48, 0, 24, 0, 0, 0, 0, 0, -25, -11, 12, 0, 0], [0, 0, 0, 0, -30, 0, 20, 98, -114, 22, 32, 0, 0, 0, 42, -22], [180, -30, -38, 12, 0, -16, 0, 0, 0, 0, 0, -32, -62, 12, 0, 0], [0, 0, 0, 0, 30, 0, 8, 106, 176, 10, 8, 0, 0, 0, 50, -10], [-230, -70, -68, -164, 0, 6, 0, 0, 0, 0, 0, -26, -22, 16, 0, 0], [0, 0, 0, 0, -20, 0, 87, -46, 150, 33, 51, 0, 0, 0, -33, -5], [108, -418, 41, 9, 0, -7, 0, 0, 0, 0, 0, 22, 42, -3, 0, 0], [0, 0, 0, 0, 10, 0, 373, -239, -74, -43, 40, 0, 0, 0, -47, 2], [0, 0, 0, 0, -26, 0, -136, 58, 256, 1, -20, 0, 0, 0, -2, -10], [615, 21, 3, -151, 0, 10, 0, 0, 0, 0, 0, -51, 19, -7, 0, 0], [-72, 200, -258, -86, 0, 2, 0, 0, 0, 0, 0, -20, -40, -14, 0, 0], [0, 0, 0, 0, -26, 0, 26, 126, -30, 22, -146, 0, 0, 0, 36, -4], [-347, 185, -49, -41, 0, -2, 0, 0, 0, 0, 0, 31, -61, -5, 0, 0], [0, 0, 0, 0, 59, 0, -368, 335, -38, -46, -3, 0, 0, 0, 22, 2], [-39, 60, -120, 10, 0, -12, 0, 0, 0, 0, 0, 10, 24, -74, 0, 0], [-173, 608, 95, 103, 0, -15, 0, 0, 0, 0, 0, -48, 22, -11, 0, 0], [0, 0, 0, 0, 8, 0, -28, 66, 86, -2, -138, 0, 0, 0, 26, 26], [0, 0, 0, 0, -11, 0, -227, -440, -212, -4, -44, 0, 0, 0, -26, 41], [764, 22, -40, -76, 0, 4, 0, 0, 0, 0, 0, -42, 2, -40, 0, 0], [0, 0, 0, 0, 19, 0, 384, 17, -48, 41, 45, 0, 0, 0, -12, 10], [0, 0, 0, 0, 34, 0, 2, -22, 160, -70, -118, 0, 0, 0, 28, -60], [0, 0, 0, 0, 3, 0, 325, -28, -292, -47, -33, 0, 0, 0, -19, -6], [0, 0, 0, 0, -8, 0, -207, -363, 36, 9, -56, 0, 0, 0, -9, 20], [0, 0, 0, 0, -4, 0, 80, 340, 272, 10, 100, 0, 0, 0, -52, 36], [0, 0, 0, 0, 30, 0, 264, -184, -284, -2, -140, 0, 0, 0, -44, 10], [4, -454, 4, -32, 0, -4, 0, 0, 0, 0, 0, -78, -14, 40, 0, 0], [410, 36, -32, -54, 0, -30, 0, 0, 0, 0, 0, 2, -52, -30, 0, 0], [0, 0, 0, 0, 21, 0, -59, -172, 198, -51, -85, 0, 0, 0, 15, -22], [-609, -186, 77, -10, 0, -2, 0, 0, 0, 0, 0, -41, -31, -22, 0, 0], [0, 0, 0, 0, -10, 0, 410, -28, 186, 43, -77, 0, 0, 0, 3, -15], [976, 102, -144, -8, 0, 8, 0, 0, 0, 0, 0, 18, -4, 4, 0, 0], [0, 0, 0, 0, 26, 0, 314, -42, 68, -62, 0, 0, 0, 0, -28, 2], [0, 0, 0, 0, -58, 0, -305, 5, 108, 71, -98, 0, 0, 0, 27, 36], [0, 0, 0, 0, 53, 0, -8, 302, -68, -29, 141, 0, 0, 0, 37, 2], [480, 86, 46, 28, 0, -44, 0, 0, 0, 0, 0, -16, 66, 4, 0, 0], [0, 0, 0, 0, -14, 0, 174, 92, 20, -60, -260, 0, 0, 0, 68, -34], [-604, 120, 198, -166, 0, 26, 0, 0, 0, 0, 0, 10, -46, 2, 0, 0], [-324, 24, -172, -102, 0, 4, 0, 0, 0, 0, 0, 56, 8, -30, 0, 0], [614, 444, 201, -15, 0, -13, 0, 0, 0, 0, 0, -4, 44, -27, 0, 0], [0, 0, 0, 0, 52, 0, 217, 131, 210, 36, 78, 0, 0, 0, 15, -14], [394, 593, 104, -72, 0, 23, 0, 0, 0, 0, 0, -5, -51, 0, 0, 0], [256, 154, -166, 108, 0, -52, 0, 0, 0, 0, 0, 32, -18, -24, 0, 0], [0, 0, 0, 0, -46, 0, 452, 242, 226, -2, -204, 0, 0, 0, -20, -10], [-57, 182, 137, -45, 0, 37, 0, 0, 0, 0, 0, -12, -94, -21, 0, 0], [0, 0, 0, 0, -28, 0, 70, 262, 56, 2, -188, 0, 0, 0, -10, 24], [-196, 242, 102, 132, 0, 36, 0, 0, 0, 0, 0, 64, 24, 0, 0, 0], [0, 0, 0, 0, -42, 0, -83, -312, 42, 35, 261, 0, 0, 0, 39, 15], [471, -289, -119, -42, 0, 4, 0, 0, 0, 0, 0, -20, 3, 54, 0, 0], [-914, 444, -20, 37, 0, -11, 0, 0, 0, 0, 0, 25, 33, -17, 0, 0], [0, 0, 0, 0, 26, 0, -288, 40, -244, -54, -152, 0, 0, 0, 20, -54], [636, -269, 40, -28, 0, -46, 0, 0, 0, 0, 0, -25, -56, -4, 0, 0], [-890, -407, -14, 144, 0, 41, 0, 0, 0, 0, 0, 15, 37, 24, 0, 0], [0, 0, 0, 0, 28, 0, -67, 292, -210, 53, 341, 0, 0, 0, -69, 45], [0, 0, 0, 0, -67, 0, -183, 104, -202, 0, -136, 0, 0, 0, 68, 13], [0, 0, 0, 0, -12, 0, 15, 142, -288, 18, -134, 0, 0, 0, 0, -2], [-198, -265, -6, 35, 0, -27, 0, 0, 0, 0, 0, 42, 15, 77, 0, 0], [-72, 248, -214, -76, 0, -20, 0, 0, 0, 0, 0, -34, -4, -16, 0, 0], [0, 0, 0, 0, 36, 0, 879, -151, -334, -99, -114, 0, 0, 0, 17, 6], [1359, -193, -19, 95, 0, 16, 0, 0, 0, 0, 0, -13, 101, -25, 0, 0], [0, 0, 0, 0, -6, 0, 347, -85, -126, 46, -304, 0, 0, 0, -3, 2], [0, 0, 0, 0, -9, 0, 428, 6, 44, 4, -98, 0, 0, 0, 50, 1], [-483, -744, 175, -51, 0, -3, 0, 0, 0, 0, 0, -34, -52, -15, 0, 0], [0, 0, 0, 0, 52, 0, -378, 500, -174, 18, -78, 0, 0, 0, 0, -14], [0, 0, 0, 0, 48, 0, -12, -216, 140, -24, -26, 0, 0, 0, 44, -2], [0, 0, 0, 0, -44, 0, -15, 352, -66, -29, 167, 0, 0, 0, 69, -9], [0, 0, 0, 0, 46, 0, 273, 181, -58, 75, -96, 0, 0, 0, 11, 10], [-59, -176, 101, 61, 0, -13, 0, 0, 0, 0, 0, -24, -60, -29, 0, 0], [954, 156, 212, 84, 0, 34, 0, 0, 0, 0, 0, 68, -76, 48, 0, 0], [3, 132, 87, 60, 0, 10, 0, 0, 0, 0, 0, 1, -5, 48, 0, 0], [0, 0, 0, 0, 42, 0, -442, 272, -80, 10, 28, 0, 0, 0, 10, -2], [498, -260, -156, 16, 0, 48, 0, 0, 0, 0, 0, -24, -12, 28, 0, 0], [0, 0, 0, 0, 1, 0, 182, 20, 376, -57, -1, 0, 0, 0, -47, -12], [0, 0, 0, 0, -16, 0, -450, 270, -572, 12, -290, 0, 0, 0, -20, -6], [153, 677, -5, 2, 0, 8, 0, 0, 0, 0, 0, -38, 43, -10, 0, 0], [4, 60, 77, -37, 0, 3, 0, 0, 0, 0, 0, -30, -32, 83, 0, 0], [0, 0, 0, 0, 23, 0, 530, -82, 16, -82, -24, 0, 0, 0, -56, -1], [0, 0, 0, 0, 43, 0, -290, -31, 64, -34, -163, 0, 0, 0, -56, -42], [0, 0, 0, 0, 52, 0, 100, 158, 196, -34, -262, 0, 0, 0, -20, 30], [561, 411, 290, 116, 0, -5, 0, 0, 0, 0, 0, -29, -67, -52, 0, 0], [244, 366, 220, -102, 0, -2, 0, 0, 0, 0, 0, 12, -78, 54, 0, 0], [0, 0, 0, 0, 2, 0, 85, 64, -252, 66, 78, 0, 0, 0, -42, 32], [0, 0, 0, 0, -12, 0, 54, -384, -124, -59, 82, 0, 0, 0, 2, 46], [0, 0, 0, 0, 6, 0, 264, 354, 64, -42, -130, 0, 0, 0, 4, -28], [0, 0, 0, 0, -55, 0, -56, 91, -180, -3, 255, 0, 0, 0, 24, -10], [486, -73, 54, -2, 0, -5, 0, 0, 0, 0, 0, -21, 79, -14, 0, 0], [0, 0, 0, 0, 2, 0, 32, 496, -72, 76, -126, 0, 0, 0, -72, 20], [75, 812, -3, 151, 0, -45, 0, 0, 0, 0, 0, -70, -102, 43, 0, 0], [-630, 633, 172, 201, 0, -49, 0, 0, 0, 0, 0, -32, -83, 3, 0, 0], [0, 0, 0, 0, -71, 0, -166, -102, -48, 19, -131, 0, 0, 0, -3, 14], [-615, -120, 275, -159, 0, 5, 0, 0, 0, 0, 0, 18, 42, -27, 0, 0], [0, 0, 0, 0, 15, 0, -415, -112, 368, 6, 63, 0, 0, 0, -19, -36], [319, -713, -55, -65, 0, 49, 0, 0, 0, 0, 0, -7, -4, 25, 0, 0], [0, 0, 0, 0, 44, 0, -154, 194, 28, 28, -54, 0, 0, 0, 4, -46], [0, 0, 0, 0, 50, 0, -166, -178, 224, 56, -268, 0, 0, 0, -22, -2], [-19, -89, -227, 25, 0, -18, 0, 0, 0, 0, 0, -19, 65, -47, 0, 0], [449, 198, -222, 224, 0, -42, 0, 0, 0, 0, 0, 32, 72, 8, 0, 0], [578, 172, 277, 17, 0, 3, 0, 0, 0, 0, 0, 84, -4, 17, 0, 0], [0, 0, 0, 0, -54, 0, -272, 162, 216, 56, -180, 0, 0, 0, -36, -30], [0, 0, 0, 0, -10, 0, 242, 312, -480, 40, 44, 0, 0, 0, 60, -2], [60, -223, 404, 54, 0, 2, 0, 0, 0, 0, 0, -5, -72, 18, 0, 0], [0, 0, 0, 0, 24, 0, -362, 74, 346, 44, 214, 0, 0, 0, -86, 34], [0, 0, 0, 0, 53, 0, -108, -254, -16, 19, 343, 0, 0, 0, -37, -48], [0, 0, 0, 0, -16, 0, 6, -142, 412, -14, -240, 0, 0, 0, -50, 8], [85, -361, 449, 68, 0, -12, 0, 0, 0, 0, 0, 4, 7, -4, 0, 0], [-494, 488, 148, -163, 0, 29, 0, 0, 0, 0, 0, -107, 61, 47, 0, 0], [114, 33, -342, 169, 0, -19, 0, 0, 0, 0, 0, 24, -37, 7, 0, 0], [0, 0, 0, 0, 12, 0, -173, -5, -610, 34, -202, 0, 0, 0, 59, 14], [0, 0, 0, 0, 54, 0, 384, 450, 252, -3, 21, 0, 0, 0, 39, 3], [-170, -496, 198, -184, 0, -46, 0, 0, 0, 0, 0, -10, -52, -40, 0, 0], [0, 0, 0, 0, 106, 0, 220, -16, 278, -94, -410, 0, 0, 0, 56, -40], [180, -951, 6, 123, 0, 27, 0, 0, 0, 0, 0, -78, 75, 33, 0, 0], [0, 0, 0, 0, -50, 0, 267, 427, 66, -21, -142, 0, 0, 0, 117, -36], [-338, 540, -166, -139, 0, -21, 0, 0, 0, 0, 0, 51, 1, -37, 0, 0], [0, 0, 0, 0, -6, 0, 446, 370, 228, -8, -194, 0, 0, 0, -48, -8], [0, 0, 0, 0, 52, 0, 389, -331, 250, -10, 194, 0, 0, 0, -23, -30], [0, 0, 0, 0, -55, 0, 90, 207, 264, -42, 77, 0, 0, 0, 138, -8], [0, 0, 0, 0, -56, 0, -41, 235, 288, -31, -4, 0, 0, 0, 27, 12], [0, 0, 0, 0, 52, 0, -341, 544, -358, 69, 3, 0, 0, 0, -7, 7], [0, 0, 0, 0, 94, 0, 88, -274, 308, -116, -110, 0, 0, 0, -40, 20], [-900, 250, -52, 114, 0, 8, 0, 0, 0, 0, 0, -16, -12, 54, 0, 0], [-775, -204, 261, -275, 0, 35, 0, 0, 0, 0, 0, 36, -76, -5, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1470_f_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1470_3_f_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_1470_3_f_d(:prec:=16)
    chi := MakeCharacter_1470_f();
    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_1470_3_f_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_1470_3_f_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1470_f();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![3111696, 3259872, -5129712, -127344, 99088, 1352, -588, -4, 1]>],Snew);
    return Vf;
end function;