
// Make newform 273.2.j.c in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_273_j();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_273_j_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_273_2_j_c();".
// 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_273_2_j_c();".
// 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 := [1369, 2997, 16588, -16327, 68867, -25533, 74141, -18801, 54235, -8506, 23428, -2645, 7324, -526, 1458, -59, 211, -4, 18, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-541048332998388422025224026482, -4053938625265300732448395495, -3734581071136679412423316370, -235294624201578712546452422958, 106832788127261578410932469239, -268061444077698210708445476719, 148022831628311368404020457341, -208089548964465772315175897620, 71968215133683284893975622780, -91498734861179839043604586484, 25779796624540228220353572936, -29186840814893966044352762673, 5431359145409041149804181685, -5804068931644273128789469255, 775116859497906120872527767, -847126094504028583409134957, 64392367693258135889221094, -71989800983906175327149653, 2948586670918701808551791, -4085487136543173326688997], [31118642540475146064694445912463539, -75811065291850596623486187751281406, 116276216222505912564463304237197753, -108703474688815797770677787428453507, 133061047576959130423042494261455679, -86473198222264444011573080268539148, 93226723298245350986656262736003598, -44573378608605928791145945360996892, 39739199709410044884437241045620313, -15926811006029639049421851830493578, 11943361514385690862839544910032821, -3970015679584422038303839535352523, 2319813098230545135177055987966447, -672485662073818096289969998302433, 320844822250980836735900849124641, -81977332045861207285091886808268, 26547883599804116440388906209725, -6153372527727959839784962018196, 1371391336152384902356738569499, -300133994374942407958277244158], [32545207099711078731794325733, 22914281211171705348517758920, 80080429879831559595060696900, 547857964635386867862326181979, 25329526173786282227531350337, 556805708900178597111330431473, 29356035922071687508468245166, 443622023675648303292386247910, 10635628540313710360776263960, 196940736515037912243001933776, 4041894163272650459344425843, 64194950599949943857606426611, 803599389582718498273633651, 13085500236178418311241708565, 286236925337428349187776971, 1941499406783905413614279500, 33963416633628193346040637, 168170142905332217106438781, 4085487136543173326688997, 9506596087569495495277254], [76498439551155901605372825973303, 1040616193353465426806646546015, -23286403199775164886189082413337, 425011978776888589922216066006378, -286082773563193033532835097647413, 462931980944888790145921131781233, -343249866809578308629773307357472, 355004914948736606316975639667295, -190199029453549464511799689740259, 155223655426875839155891688089833, -68255083814261259751423798054546, 49188995418896324074745959195092, -14718547408603054413942371662676, 9692490867745127666643417399500, -2124310771437863705198405800610, 1413985969910790012325989263903, -180911357890774773273854317013, 119717171362891862549077508377, -8704509733109891846887882359, 6905285611257289835653862890], [697109471565452723846450865976802, -460703310925526697682439300187295, 2485045796758903408408523246806288, -1300802053762476375461092954576432, 2685397279235594541360400347441666, -1762655089830846690969078378496851, 1635437266101970074637306641856777, -1289676220270047542003975257645181, 659851727456421235501118013184470, -572969530730428504376747894693240, 185429221828389633696249134384313, -174627552403471720341439771630759, 34661762238567164155615375239799, -34404684966066569774905181195101, 4267936839669219355854820123001, -4850842095428855703737495302835, 322382846246591900724621455712, -409002972042913302267281368259, 11384290415918989293568645273, -22059565808638195111123708928], [3336748112877763038183708627341, -11627832077419404565334221113592, 34631977024400740663717040523566, -59638233946051065909540254368734, 43060642928682904667684212962898, -64128264497361160758239731798327, 32951378083611635633614645716079, -47311598150841645554998987858595, 14768686483222414528467896811466, -20457723211419213352692836332261, 4701755679731548010450248367412, -6412458627944464838041217221629, 946833209669629245432803090839, -1271866313529508469754542168795, 123731889372165409632805779831, -184338994072097313938320894530, 9740696055033624868807891733, -15681640429861400348325962873, 351744055240071333325258398, -879600191884083208967414209], [399903162476216056702950743151422, 3072478929710746354692840844883131, -2276905601557612803506801898935177, 7671470824449844209712451840114816, -2792272658701624453569179841756060, 7212248291147255902630496617640679, -2416871137970853714564377948372994, 4748028320841348040725199420195220, -1143796078428707053884894387348873, 1958689413598781412311416498295752, -395422648016227477077032809945425, 593041204676302258474852776666840, -82566308075111392091968624505486, 115483059750272710211614687247338, -11391515290637933883849482903572, 16470861038462149920915230808112, -925188925555534473871396350365, 1387051403995825637601406358919, -38185185301840964082466607032, 76928540504194365699792961129], [4182204103110874071297385847626848, -27302764799446949145615669852967362, 44122561469480118425811710714121747, -70989919562992066718448032595181971, 52044721190489281147690452269887453, -66160950939776705056606355614636631, 38237790580296755340119187293923767, -41482740246878481269743699563265421, 16723467622644562549839486026744829, -16399385849756527608088938758473141, 5213186203916746026577518419615797, -4713762858399919160082457680351292, 1034388272145588058265759106144284, -886787509369351797071740745434444, 140502377566984528040814712521412, -122348425158084174468378036586158, 11414554751613308422288814197776, -10083199051821045769543385227201, 519035587247795853558443240459, -547032892879214620350249147761], [4904613101529405434832308787078, 32463056619900070843169307975053, -65427083417999056397580191370166, 169762115362412024437743322934801, -127071818495169742977683956650873, 181459129725459673940572068041447, -97038888715487812292067041678316, 135367928967498852239233487044924, -44957598056872240854663862971214, 58786074808962877919634751957201, -13585884359044387449861562464470, 18512554076498152147852594534837, -2681156313251144971337417132923, 3692246215347241728671550066957, -326748068612455370728726305585, 537962157850176888307584496807, -24634582481399738567098646190, 46025780075609179116409549487, -660823901855692754332108674, 2592049278636087802657452227], [-954636370439460057642453047153636, -1485009820604195292527129026572033, -1985436304259972786884689054741820, -7070661971480829655082981461295971, -2264254782915633046246063874308508, -7701363420589751993110442011126113, -1917349306696282402134285987322912, -5562982321692739636853342377781223, -870430745096515881789068262931750, -2381566229158775041086438489527451, -278133207208836159741267032708863, -743794169437154400721899818070155, -56357334455999473786148494284293, -149023170146987408049036059706653, -9781372300994797067491508537861, -21598404211828921261432769216251, -938583595257175127278138560594, -1852595082836908045721076066747, -73101611845366533817908434270, -101821382051282373258671320462], [33167858081967647089695029280927, -22651855290345595347313524174590961, 11368317417355663790559997120818214, -62991863936276004364949006290251674, 12201844829134768961909988890829499, -69002254441313896963403206636275922, 8048557738538132872158760349398162, -48204591625362680749063509544147081, 3410838479643168671219531666900686, -20677975530269450195061250508661791, 1100503461168874083136273858269168, -6314531343789698308882705308303288, 213053415623996835572168454063792, -1246607413112704486289128458061110, 18644798449409268253868538198082, -177133376756155825899168281364319, 728933639287800660202845293091, -14996805006720435737873426277344, -119965180563481247720775643043, -811347505638254673016242624978], [-492993699877845225448670891064974, 1476380044502233373600269716680920, -2047690647161828431914062644517347, 4770707009381107269392946697269550, -2580714750078383904713071941742710, 5375837228591700429922273111733424, -1490027827156975678844184270869149, 4078497411264945318359090066278175, -608292732892936936449960787987095, 1803754651441828823097315894995258, -164653778286039728687437829100396, 572122942140396394028725245012775, -30397496001346965294340493986699, 115131180607893452464444544052139, -2607018145755562210278700490285, 16767119761634346661079598505079, -121160742218425489032481707987, 1438850555740982062458979078160, 13138839787370564488601661635, 79974693311878674703640697149], [530495014785748571929566404024965, 557810311606027021326458426778760, -2270782672098573370476154723632826, 5920068097547458588645664266359253, -3912434351393369072068114251110661, 6157622112715051110144040655149386, -3229188369133569554909210689419637, 4732236146131896612002957056412861, -1502579578852427417313528005999226, 2069094372205210597488842165859680, -487402577433659750652445331140959, 665964050906290548992564847538168, -99815416730223525730094168189362, 133669765967236327140238343479876, -13090056078075075826777266841520, 19725786405028462002656362856711, -1038900563964696036247502732412, 1692468395960390495557615498748, -36533770266434602873655340226, 96819344902331263752639532847], [173879805204720109882108632675844, -1885362099641700168688105299274280, 4838595711329907781960136594515673, -7312369541394705678448896887870996, 6657664373970494879849002313292186, -7917006262000091551828222614465675, 4909883649604400844120896212641956, -5929408513623506200477998442515586, 2179950719114701902556730628406521, -2593718939981868180567860500979818, 678308458310155344073325206091640, -821140788900012057666136351712498, 135432290766910247670721912739306, -163810622541150952673167990402340, 17556183053897235165030578758450, -23882867519601343002311216009290, 1380653697218536641062518377714, -2039053873531239807910274694313, 49930169430911949141898714106, -115048696625446065214454465266], [3576666740526488558760366608666, 23255664154838809130668442227184, -66701413307230977668652135081295, 119276467892102131819080508737468, -86121285857365809335368425925796, 128256528994722321516479463596654, -65902756167223271267229291432158, 94623196301683291109997975717190, -29537372966444829056935793622932, 40915446422838426705385672664522, -9403511359463096020900496734824, 12824917255888929676082434443258, -1893666419339258490865606181678, 2543732627059016939509084337590, -247463778744330819265611559662, 368677988144194627876641789060, -19481392110067249737615783466, 31363280859722800696651925746, -703488110480142666650516796, 1759200383768166417934828418], [5383522455165565036271733610858799, 30122856852506216649132371205625705, -34486284259171854565973654535156721, 127145978581831908427754519993007532, -51273350773318583073480584300169314, 138221106727360520241360746084271352, -37738780061852986639038213859764727, 98683681794708528028308383984701413, -16934804998751859991868454159659457, 42105228864217754332077886907028721, -5252737286386413425111213884950263, 12910547648560679288653495760188011, -1036161739181998753486000177393007, 2542333408179121209705748046590437, -120725570991746153888218773946909, 363122793789656617209181994299800, -8481915521695374654811004848836, 30747373632935788536610003440016, -103190391697568836589356040596, 1686658510188675797689348187322], [-4311806491182162040374557605989326, -16445804578374024653829603156301341, 10149084621939645881515370251707393, -94661561842689218647202901056098078, 18326133580024093197043474646299372, -109119549393686683662607279405126348, 10213197170234755874175292102644985, -84419605494219927958411562011813869, 4176061120900396325278360352335609, -37473063640521001529457375779529102, 1093882144731424140859966833361143, -12020282287313518222143761042060889, 198169718585141852182648539900149, -2433349996389391293580607412013645, -3186979705758439077407323004119, -357003786002852251562654871409361, -2153803386285737978957438111916, -30754824652996742687170144972568, -513618288757343180281210438627, -1719118167780304038462420340704], [-5568334016711834991228921863806, 3696028165143525643865708873305820, -5726660849761505580395631915937244, 11747992316164129740457928900888084, -7286142243257359708692038277015453, 12155833781258047530985537654144269, -5272367002415732960272623326427365, 8500691893352716489040694290590264, -2305940925222579256293389596864134, 3603791201747180826034705420524430, -710449888262703659894656395765423, 1104254923813722910620595015217507, -140139535317884650512095653688609, 217087838816891391822336106423763, -17646610739331526917293322185605, 31068256910262393098872149362431, -1345705424515536726892269781377, 2630251435731729180571983055783, -42081747011923910253210122375, 145325051963474911389414146224]];
    Rf_basisdens := [1, 1, 138515715760567765339564646802, 6657480846600168505515495619244526, 138515715760567765339564646802, 59977304924325842392031492065266, 179931914772977527176094476195798, 5125081483141007317563891931674, 317022897457150881215023600916406, 2219160282200056168505165206414842, 8568186417760834627433070295038, 317022897457150881215023600916406, 2219160282200056168505165206414842, 179931914772977527176094476195798, 179931914772977527176094476195798, 179931914772977527176094476195798, 2562540741570503658781945965837, 2219160282200056168505165206414842, 2219160282200056168505165206414842, 179931914772977527176094476195798];
    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_273_j();"
function MakeCharacter_273_j()
    N := 273;
    order := 3;
    char_gens := [92, 157, 106];
    v := [3, 1, 2];
    // 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_273_j_Hecke();"
function MakeCharacter_273_j_Hecke(Kf)
    N := 273;
    order := 3;
    char_gens := [92, 157, 106];
    char_values := [[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, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1, 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, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 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, -1, 0, 0, 0, 0, 0, 0, 0], [1, 0, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0], [-1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, -1, 0, -1, 1, -1, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1, -2, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0], [-1, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0], [-3, 0, 0, 0, 0, 0, -1, 3, 0, 0, 0, 0, 0, -1, 0, 0, 1, -2, 0, 0], [0, 0, -1, -1, 0, 0, 0, -2, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 1, 0, 2, 0, 0], [0, 0, 1, 1, 0, 0, 0, -1, 2, 1, 0, 1, 2, 0, 0, 0, -2, 2, -1, 2], [0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, -1, 0, -1, -1, 1, 0, 0, 0], [1, 0, -1, -1, 0, 0, 0, 0, -3, -1, 2, -1, -2, 0, 0, 0, 2, -2, 2, -2], [0, -2, 0, 1, 0, 1, -1, 2, 0, -1, -1, 1, 0, 1, 1, 0, 0, 0, -1, -1], [0, 0, -1, -1, 0, 0, 0, 1, -1, -1, 0, 0, -1, 0, 1, -1, 2, -2, 0, -2], [0, -2, 1, 0, 0, 0, -2, -2, 0, 1, 0, -2, 0, 2, 2, 0, 1, 0, 2, 0], [-1, 0, -1, 0, -4, 0, 1, 0, 0, -1, 0, 0, 0, -1, 0, -1, 0, -1, 0, 0], [2, 0, -2, 0, 2, 1, 0, 0, -1, -2, 0, 1, -2, 0, 0, 0, 0, -2, 1, 0], [2, 0, -1, -1, 0, 0, 0, -1, -1, -1, 0, 0, -1, 0, 0, 0, -2, 0, 0, -2], [-3, 0, 1, 1, 0, 0, 0, 2, 1, 1, 1, -1, 0, 0, 0, 0, 1, -3, 0, 2], [0, -4, 0, 0, 0, 1, -1, -3, 1, 0, -1, 1, -1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 3, 2, -2, -1, 0, 1, 2, -1, 0, -1, 4, 1, 1, 1, -1, 0, -3, 1], [-1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, -1, 0, 0, -1, 0], [0, -2, 0, 0, -2, 0, -2, 0, 1, 0, 1, 1, 1, -2, 0, 0, 0, 0, -1, 0], [1, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, -1, -1, -1, 0, 3, 0, 0], [0, 0, -1, 1, 0, 2, 1, -7, 0, 1, -2, 0, 0, 0, -1, -1, -1, 0, 0, -1], [-6, 0, 1, 1, 0, 0, 2, 5, 1, 1, -2, -1, 0, 2, 1, -1, -1, -1, 0, 2], [-1, -2, 1, 1, -2, 0, 0, 0, 1, 1, -1, 0, 1, 0, 0, 0, -2, 0, 0, 2], [-1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, -2, 2, -1, 1, -1, 0], [0, 2, -2, -1, 0, -1, 2, -4, -1, 2, 1, -1, 1, -1, -2, -1, -2, 0, 0, 1], [0, 2, 0, -2, 0, -1, 1, 0, -2, 2, 1, -2, 2, -1, -1, 0, 0, 0, 0, 2], [0, 0, -3, 2, 0, 1, 1, -3, 2, -1, -1, 3, -2, -1, -1, 0, -3, 0, -1, -2], [-9, 0, 1, 1, 0, 0, 0, 8, 4, 1, 1, 2, 3, 0, 0, 0, -3, 3, -3, 2], [3, 0, 1, -2, -2, -1, 0, -1, 0, 5, 0, 0, -1, 1, 1, 1, 1, 4, 2, -1], [4, -2, -1, -1, -2, 0, 1, -3, -2, -1, 0, 0, -1, 1, 1, -1, -2, 3, 1, -2], [8, 4, -2, -2, 4, 0, 2, -6, -3, -2, 0, -2, -4, 2, 0, 0, 2, -2, 1, -4], [-5, 0, 2, 4, 0, 1, -1, 2, 4, 0, 0, 4, 2, 1, 0, 1, -2, 2, 0, 2], [0, 0, -1, -1, 0, 0, -1, 1, 1, 4, 0, -2, -1, 1, 1, 0, -1, 0, 3, 1], [2, 0, -1, -2, 2, 3, 0, -1, -2, 2, 0, 0, -3, 2, 2, 2, 1, 1, 2, -1], [2, 0, 6, 2, 0, -1, 0, 1, 3, 1, 0, 1, 3, 0, 0, 0, -1, 2, -1, 1], [-3, 0, 0, 0, 2, -3, 0, 0, 0, 1, 0, 1, -1, -1, -1, -1, 0, 1, 1, 0], [5, 0, -5, 0, 4, 0, -1, 0, -1, -2, 0, -1, 0, 0, -1, 0, 0, -2, -1, 0], [-3, 0, 0, 0, 0, 1, 1, 0, 2, 3, 0, 1, 1, -2, -1, -2, 0, 3, 1, 0], [0, -2, -3, -1, 0, 0, 0, -9, 2, -1, 0, 1, -2, -1, 0, 1, -3, 0, 1, 1], [0, -4, 0, 1, 0, -1, -2, 2, -2, -1, 1, 2, 2, 0, 2, 2, 0, 0, -4, -1], [0, 2, 2, -1, 0, 1, 2, 1, 0, 4, -1, -2, 0, -1, -2, -1, 2, 0, 2, 1], [0, 0, 2, -1, 0, 0, -4, -1, 1, 0, 0, 1, -1, 1, 4, 3, 2, 0, 0, 1], [0, 0, 4, 0, 0, 1, -3, 3, -2, 5, -1, -4, 2, 2, 3, 1, 4, 0, 2, 0], [0, 2, -4, 1, 0, -2, 1, -1, -1, -6, 2, 2, 1, -2, -1, 1, -4, 0, -3, -1], [0, 2, -1, -2, 0, 1, 0, 1, 1, 4, -1, 0, -1, -1, 0, 1, -1, 0, 1, 2], [0, 0, -1, -2, 2, 0, -1, -1, -3, -1, 0, -4, 0, 2, 1, 2, 1, -2, -2, -1], [0, 0, 3, 0, 0, 1, 2, 0, 3, 1, -1, 2, -3, -2, -2, 0, 3, 0, 1, 0], [2, -2, -1, -1, -2, 0, -3, -1, -2, -1, -3, 1, 0, -3, 0, 0, -2, 1, 1, -2], [-2, 4, 1, 1, 4, 0, 0, 1, 3, 1, 1, 2, 3, 0, -3, 3, -3, 3, -2, 2], [3, 0, 3, -2, 0, -4, 1, -1, -1, 2, 0, -4, 2, -1, 0, -1, 1, 1, -2, -1], [0, 0, 1, 1, 0, 1, 2, 6, -2, -3, -1, 2, 2, -1, -2, -1, 1, 0, -4, -1], [5, 0, -1, -1, 0, 0, -1, -4, 0, -1, -1, 1, 0, -1, -2, 2, -3, 2, -1, -2], [0, 2, 0, 1, 0, 2, -4, 1, -2, -1, -2, 1, 2, 2, 4, 2, 0, 0, -3, -1], [-1, 0, -3, 0, 0, 0, -1, 0, -3, 0, 0, 1, -4, 0, -1, 0, 0, 0, 1, 0], [-5, 0, 0, 2, 2, -1, 0, 1, 4, -2, 0, 1, 4, -1, -1, -1, -1, -1, -1, 1], [-7, -2, 1, 1, -2, 0, -1, 6, 5, 1, 2, 6, 7, -1, -1, 1, -2, 5, -4, 2], [3, 0, 1, 0, 2, -1, -1, 0, -2, -4, 0, -2, 0, 0, -1, 0, 0, -4, -2, 0], [3, -2, 1, 1, -2, 0, -1, -4, 5, 1, 2, 2, 3, -1, 0, 0, -2, 3, -4, 2], [0, 0, -1, -2, 0, 1, 3, -1, 1, 2, -1, -1, -1, 0, -3, -3, -1, 0, 2, 2], [0, 2, 1, 0, 0, 3, 0, 7, -2, -1, -3, 1, 2, 0, 0, 0, 1, 0, -3, 0], [-3, 0, -1, 0, -2, -1, 3, 0, -1, -5, 0, -1, 0, -3, 0, -3, 0, -5, -1, 0], [11, 0, 4, 2, 4, 2, -2, 1, -1, 2, 0, 2, -2, 1, -1, 1, -1, 3, 0, 1], [0, -4, 2, 3, 0, 2, -1, -2, 1, 1, -2, 1, -1, 3, 1, -2, 2, 0, 0, -3], [0, 6, 4, 0, 0, 0, 3, 6, -1, 0, 0, -3, 1, -3, -3, 0, 4, 0, 2, 0], [6, 0, -2, -6, -4, -2, 1, -3, -4, -1, 0, -2, -5, -1, 0, -1, 3, -4, 4, -3], [0, -4, 2, 1, 0, 0, 0, -8, -2, 4, 0, -2, 2, 1, 0, -1, 2, 0, 0, -1], [-3, 0, -3, 2, 6, 2, 0, 1, 2, -5, 0, 1, 2, -1, -1, -1, -1, -4, -1, 1], [11, 0, -4, 2, 4, -1, -1, 1, -1, -1, 0, 2, -2, 3, 2, 3, -1, 0, 0, 1], [0, -4, -1, 3, 0, -2, -2, 8, -2, -6, 2, 5, 2, 2, 2, 0, -1, 0, -7, -3], [-14, 0, -1, 0, 2, -2, 2, 0, -3, -5, 0, -3, 0, 2, 4, 2, 0, -5, -3, 0], [1, -2, 0, 0, -2, 0, 0, -1, -5, 0, -1, -6, -6, 0, 1, -1, 6, -2, 5, 0], [6, 0, -1, -6, 2, 0, 0, -3, 0, -1, 0, -2, -1, 3, 3, 3, 3, -4, 4, -3], [15, 6, -2, -2, 6, 0, 2, -13, -3, -2, 0, -2, -4, 2, -1, 1, 3, 3, 1, -4], [0, 0, -4, -2, 0, 3, 2, 1, 2, 3, -3, 3, -2, -1, -2, -1, -4, 0, -1, 2], [0, -6, 2, -1, 0, -3, 1, 3, -2, 2, 3, -5, 2, -2, -1, 1, 2, 0, 3, 1], [-22, 0, 1, 4, 2, 0, 0, 2, 5, -1, 0, 3, 4, 0, 0, 0, -2, 1, -1, 2], [4, 0, -5, -2, 2, 3, 2, -1, -2, -3, 0, 3, -6, -1, 1, -1, 1, -4, 5, -1], [10, 0, -1, -1, 0, 0, 3, -9, -2, -1, -1, -5, -6, 3, -1, 1, 0, -3, 1, -2], [-6, 6, -1, -1, 6, 0, -1, 7, -5, -1, -2, -1, -2, -1, -1, 1, 6, 1, 4, -2], [0, -2, 5, 2, 0, -4, 0, -7, -2, -2, 4, -2, 2, -1, 0, 1, 5, 0, 0, -2], [-11, 6, 3, 3, 6, 0, 1, 8, 1, 3, 0, 0, 3, 1, 2, -2, 4, 1, 2, 6], [-7, 0, 1, 1, 0, 0, -1, 6, 1, 1, 1, -3, -2, -1, 1, -1, -4, -1, 0, 2], [1, -4, 1, 1, -4, 0, 0, -2, 2, 1, 3, 0, 1, 0, 0, 0, 1, 1, -1, 2], [16, 0, 2, 0, -4, 2, 0, 0, 3, 10, 0, 4, -1, 0, 0, 0, 0, 10, 4, 0], [0, -4, -3, -3, 0, 1, 0, 1, 4, -2, -1, 4, -4, -4, 0, 4, -3, 0, 0, 3], [-14, 0, 3, 6, -6, -1, -1, 3, 6, 0, 0, 4, 5, -3, -4, -3, -3, 3, -2, 3], [0, 6, 2, -1, 0, -1, -3, -2, 0, 1, 1, -4, 0, 1, 3, 2, 2, 0, 4, 1], [0, 4, 6, 1, 0, -2, 5, -8, 1, -3, 2, -3, -1, -1, -5, -4, 6, 0, 4, -1], [0, 2, -2, -1, 0, 0, 1, -10, 2, 0, 0, -1, -2, 0, -1, -1, -2, 0, 3, 1], [-2, 4, -1, -1, 4, 0, -3, 3, 2, -1, 1, 4, 3, -3, -3, 3, -7, 6, -3, -2], [-8, -8, -1, -1, -8, 0, -3, 9, 0, -1, 2, 0, -1, -3, 1, -1, 6, -5, -1, -2], [2, 2, 0, 0, 2, 0, 1, -2, 3, 0, -5, 1, 1, 1, 1, -1, 1, 0, -3, 0], [5, -4, -1, -1, -4, 0, 3, -4, -2, -1, 3, -2, -3, 3, 1, -1, -4, 5, 1, -2], [0, 2, 7, 0, 0, -3, 0, -3, 1, 4, 3, 3, -1, 1, 0, -1, 7, 0, -2, 0], [-9, 0, -6, 0, -8, 2, 2, 0, -5, -10, 0, -1, -4, -4, -2, -4, 0, -10, -1, 0], [0, 0, -1, 0, -2, -2, 3, 0, -3, -5, 0, -3, 0, -3, 0, -3, 0, -5, -3, 0], [0, -4, 4, -1, 0, 4, -3, 4, 0, 4, -4, -6, 0, 4, 3, -1, 4, 0, 6, 1], [-3, -2, 0, 0, -2, 0, 1, 3, 2, 0, 0, 3, 3, 1, -1, 1, 2, 5, -2, 0], [-7, 4, 2, 2, 4, 0, 0, 5, 0, 2, 2, 1, 3, 0, 1, -1, 1, -1, 2, 4], [10, -2, -3, -3, -2, 0, 0, -7, -4, -3, 3, 2, -1, 0, 0, 0, 0, -4, 1, -6], [0, 0, 4, -1, 0, 4, 1, -20, -4, -4, -4, 0, 4, 0, -1, -1, 4, 0, -4, 1], [0, 2, 3, 1, 0, 2, -2, 9, -2, -7, -2, 1, 2, 3, 2, -1, 3, 0, -3, -1], [6, 2, 1, 1, 2, 0, 2, -7, 3, 1, 3, 1, 2, 2, -2, 2, -6, 2, -2, 2], [0, 4, 1, -1, 0, -1, -1, -5, -4, 0, 1, -3, 4, 3, 1, -2, 1, 0, -1, 1], [-3, 0, 0, 0, -2, 6, -1, 0, 1, -2, 0, -1, 2, -1, -2, -1, 0, -2, -1, 0], [-6, 0, 5, 8, 12, 1, -4, 4, 5, 1, 0, 0, 9, 0, -4, 0, -4, 5, -8, 4], [10, 0, -2, -2, 0, 0, -1, -8, -1, -2, -3, -2, -4, -1, -1, 1, -2, -3, -1, -4], [-3, -8, 2, 2, -8, 0, -2, 1, 2, 2, -4, 1, 3, -2, 3, -3, -1, 3, 0, 4], [10, 10, -3, -3, 10, 0, 3, -7, 3, -3, -1, 3, 0, 3, -1, 1, -3, 2, -6, -6], [0, 6, 2, 1, 0, 2, 4, -5, -1, 0, -2, -3, 1, -1, -4, -3, 2, 0, 2, -1], [-7, -4, 1, 1, -4, 0, 1, 6, 4, 1, -1, 1, 2, 1, -2, 2, -1, 6, -3, 2], [0, 0, -8, 2, 6, 5, 0, 1, -1, -3, 0, 3, -3, 4, 4, 4, -1, -2, 1, 1], [-26, 4, 3, 3, 4, 0, -4, 23, 3, 3, -3, -1, 2, -4, -3, 3, -2, 0, 0, 6], [-11, -4, 2, 2, -4, 0, -4, 9, -1, 2, -4, 1, 3, -4, 2, -2, 2, -4, 3, 4], [10, 0, 3, -2, -6, -6, 4, -1, -5, 1, 0, -4, -2, -1, 3, -1, 1, 0, -2, -1], [0, 8, -4, -3, 0, -1, 1, -7, 2, 2, 1, 6, -2, -2, -1, 1, -4, 0, -4, 3], [0, 0, -2, -2, 0, -1, 0, 0, 2, 6, 1, -2, -2, -2, 0, 2, -2, 0, 4, 2], [0, -2, 0, 1, 0, 5, -3, 10, 3, 2, -5, 4, -3, 4, 3, -1, 0, 0, -1, -1], [-3, 0, 1, 1, 0, 0, 0, 2, -3, 1, 1, -2, -1, 0, -1, 1, 6, -8, 4, 2], [6, 0, -7, 0, 0, 5, -2, 0, -4, -7, 0, -4, 0, 2, 0, 2, 0, -7, -4, 0], [-5, 0, 7, 2, 2, -4, 0, 1, 4, 3, 0, 3, 2, 1, 1, 1, -1, 4, 1, 1], [-7, 0, -2, 0, 2, -5, 5, 0, 1, 1, 0, -3, 4, -4, 1, -4, 0, 1, -3, 0], [3, 0, 6, 8, 0, 2, -6, 4, 10, 8, 0, 5, 9, 6, 0, 6, -4, 12, -3, 4], [0, 8, 2, -1, 0, 2, 1, -2, -1, 3, -2, -1, 1, 1, -1, -2, 2, 0, 0, 1], [-4, 0, 6, 0, -6, 2, -1, 0, 3, 1, 0, -3, 6, -2, -3, -2, 0, 1, -3, 0], [0, 6, 0, 3, 0, -4, 2, 1, -1, 0, 4, 5, 1, -1, -2, -1, 0, 0, -6, -3], [8, 0, -2, -2, 0, 0, 3, -6, 2, -2, -4, 1, -1, 3, -1, 1, -3, -4, -4, -4], [0, -2, -1, 0, 0, 0, -6, -7, 1, 11, 0, -5, -1, 2, 6, 4, -1, 0, 6, 0], [18, 0, -1, 2, 0, 2, -2, 1, 3, 3, 0, 2, 2, 3, 1, 3, -1, 4, 0, 1], [0, -4, 3, 5, 0, 2, -2, -7, 1, 0, -2, -1, -1, 2, 2, 0, 3, 0, 2, -5], [0, -4, -2, -3, 0, 0, 0, 12, 2, -2, 0, 6, -2, -3, 0, 3, -2, 0, -4, 3], [0, 6, 2, 1, 0, 0, -5, 1, -1, -4, 0, 0, 1, 6, 5, -1, 2, 0, -1, -1], [-7, 2, 4, 4, 2, 0, 1, 3, 6, 4, -1, 0, 4, 1, 1, -1, -8, 9, -2, 8], [-9, 0, 2, 4, 4, 4, 0, 2, 0, 3, 0, 2, 0, 1, 1, 1, -2, 5, -2, 2], [-17, 0, -9, -4, 6, 4, -2, -2, 2, -2, 0, 5, -5, 1, -1, 1, 2, -4, 9, -2], [-13, 4, 0, 0, 4, 0, -1, 13, 4, 0, 5, 1, 1, -1, -5, 5, -3, -2, -4, 0], [0, 8, -3, 2, 0, 3, 1, -4, 2, -6, -3, 3, -2, 0, -1, -1, -3, 0, -1, -2], [-1, 0, -7, -2, 6, -5, 3, -1, -10, -6, 0, -5, -6, -5, -2, -5, 1, -7, -3, -1], [26, 0, 1, -4, -2, -4, 2, -2, -2, -3, 0, 1, -5, 0, 2, 0, 2, -5, 5, -2], [4, 0, -2, -2, 0, 0, 6, -2, 0, -2, -6, 0, -2, 6, 3, -3, -1, -3, -2, -4], [1, 0, -8, -6, 8, 1, 1, -3, -3, 4, 0, -1, -5, 2, 3, 2, 3, 1, 5, -3], [-9, -2, 1, 1, -2, 0, 3, 8, 11, 1, -1, 8, 9, 3, -1, 1, -9, 8, -10, 2], [0, 2, -1, 3, 0, 2, -2, 11, -2, -3, -2, 6, 2, 3, 2, -1, -1, 0, -8, -3], [0, 4, -1, 1, 0, -4, 2, 2, 1, -3, 4, -2, -1, -3, -2, 1, -1, 0, 3, -1], [-4, 0, 5, 0, 6, 0, -4, 0, 9, 6, 0, 6, 3, 1, -3, 1, 0, 6, 6, 0], [0, 0, -7, -1, 0, 3, 0, 0, 0, -7, -3, 0, 0, -1, 0, 1, -7, 0, 0, 1], [-5, 0, -4, -4, -8, -6, 2, -2, -1, -3, 0, 0, -3, -1, 1, -1, 2, -5, 4, -2], [17, 4, -3, -3, 4, 0, 1, -14, -1, -3, 0, 1, -2, 1, -2, 2, 1, 2, -2, -6], [-8, 0, -2, 4, 0, 1, 7, 2, -4, -8, 0, 1, -3, -5, 2, -5, -2, -6, -3, 2], [-3, 0, -4, 2, -4, -7, 3, 1, -3, 0, 0, 1, -3, -4, -1, -4, -1, 1, -1, 1], [4, 0, -4, -2, -2, -8, 7, -1, -1, 2, 0, -1, -1, -6, 1, -6, 1, 1, 1, -1], [-12, 0, -3, 2, 6, 1, 1, 1, 0, -1, 0, 3, -2, -6, -5, -6, -1, 0, 1, 1], [11, 0, -6, -2, 4, 1, 1, -1, -2, -4, 0, -5, 2, -2, -1, -2, 1, -5, -3, -1], [13, 0, 0, 0, 0, 0, -1, -13, -4, 0, -2, -1, -1, -1, 0, 0, 0, -5, 4, 0], [2, 2, 0, 0, 2, 0, 1, -2, -1, 0, 5, -3, -3, 1, 1, -1, 1, -2, 1, 0], [-5, 6, 2, 2, 6, 0, 2, 3, 3, 2, -7, 1, 3, 2, -2, 2, -5, 5, -1, 4], [-11, 0, -4, 2, 6, 2, 1, 1, -1, -11, 0, 3, -3, -1, 0, -1, -1, -10, 1, 1], [-8, 0, -2, -2, -10, 3, 1, -1, -1, -7, 0, -1, -1, -1, 0, -1, 1, -8, 1, -1], [0, 0, -16, -6, 2, -1, 4, -3, -7, 2, 0, -4, -6, -3, 1, -3, 3, -1, 2, -3], [-10, 4, 3, 3, 4, 0, -3, 7, 6, 3, -5, 3, 6, -3, -5, 5, -6, 3, -3, 6], [-9, 0, -4, -2, 4, -5, -1, -1, 2, 1, 0, -4, 5, 3, 2, 3, 1, 0, -2, -1], [0, 4, -3, -2, 0, 5, 1, 5, 1, 4, -5, -3, -1, -2, -1, 1, -3, 0, 4, 2]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_273_j_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_273_2_j_c();".
// 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_273_2_j_c(:prec:=20)
    chi := MakeCharacter_273_j();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_273_2_j_c();".
// 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_273_2_j_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_273_j();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![1369, -2997, 16588, 16327, 68867, 25533, 74141, 18801, 54235, 8506, 23428, 2645, 7324, 526, 1458, 59, 211, 4, 18, 0, 1]>],Snew);
    return Vf;
end function;