
// Make newform 126.14.a.q in Magma, downloaded from the LMFDB on 08 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_126_a();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_126_14_a_q();".
// 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_126_14_a_q();".
// 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 := [26034700, -166540, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0], [-999850, 1821, 9], [-1999980, 4482, 18]];
    Rf_basisdens := [1, 5, 5];
    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_126_a();"
function MakeCharacter_126_a()
    N := 126;
    order := 1;
    char_gens := [29, 73];
    v := [1, 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;

function MakeCharacter_126_a_Hecke(Kf)
    return MakeCharacter_126_a();
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]];
    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 := 14;
    raw_aps := [[64, 0, 0], [0, 0, 0], [9542, 1, 0], [117649, 0, 0], [-2249726, -151, 163], [-6951382, 678, -327], [-33475174, -5873, -160], [4134644, -2670, -5989], [-345626938, 5809, 536], [-2145244792, -61862, 37707], [-2571374764, -101406, 149907], [-1541600518, -249474, -354819], [-15450172514, -83935, 903622], [17252707916, -305256, -88732], [-7012685676, 1429278, -1888488], [-42893508892, -2900888, -2233971], [-8119461540, 4268142, 9102514], [-181783883602, 8110890, -202753], [205288717916, 32865708, -12642046], [-201819367470, 56542899, -14129864], [-148503457666, 57137628, 9352522], [-1412300146504, -130588404, -32834542], [1576709404448, -31569152, 44504776], [2945999654134, -90915475, 44610474], [-6546279670786, -157590612, 50478338], [-4346581538486, 12537179, -249412038], [-7409260529212, -252407538, 242738133], [-7046918297990, 58166273, 433112125], [-4948115904574, 465432876, -437634494], [-21590225461280, 602239232, -421173256], [-12520246711288, -90085152, 1519876944], [-50189723823496, -241796828, 346413096], [-23906037729764, 1223386262, 1557301606], [83426160051776, -74951628, -903327282], [-26520468889060, 6198306808, -3489474013], [119981315082872, 806873100, 670044306], [53264646438494, 3198239478, -2114147535], [38934729747764, -8678974956, 2167488670], [-303911044208540, 1755721574, 3512312480], [-215347639515486, 9360416187, -5082120672], [-364620185768074, 6695925355, -7894099395], [154445691160154, -16279130142, 4261517843], [-720703023208422, -158560029, 2442597730], [102144315204470, 31346880798, 6277924589], [-663014467202700, -17312887320, 15357916081], [-206824140604720, 5107720656, 7657724600], [-310814629426156, -39572649972, -11706202990], [-45551084784616, -45261650412, 7547440030], [-636335966944484, 40321967126, -58207537690], [-236688515091502, 65605935918, -14856682363], [-728579730994604, -45802671586, -12531277304], [-674214496131410, 23175519461, -41392741948], [-1869321304590730, -121879997256, -37065695468], [1512965661914220, -100214879442, 91384228118], [4501951791595382, -66115844603, -10454928602], [-1626157526204306, -182101188367, -62528041086], [-19821637748242, 251919682657, -36412518534], [2550808181971052, -105404180694, 139118123391], [2537031326475614, 232605846066, 107584170635], [3223021641119108, 171324059590, 112465564632], [8314949591099972, 6401052294, -46764778871], [8096048172571474, 302289111971, 27795526512], [3121143311159276, -514059271266, 137226903341], [9494105771316036, -245231582082, -5470855180], [11009512360663874, 58448971440, 224337872648], [14272675470096204, 700927309764, -26563951139], [-5064348140894188, -409743379764, 34996503730], [6259520086073294, -283025700288, 359160798816], [11785784525539782, 143224879455, 635891399619], [15254000326093382, 164108965554, -704092113845], [13052634787493386, -1334899042597, 130738850026], [-8386969198933862, 282483718427, 427058868974], [7445518374022544, 58487148528, 427793649640], [20119222540437254, 2009457084480, -367534173856], [4292414307232100, 1562789029980, -3590808310], [34099628898466904, -1098679881188, 665644947564], [-51846182968739840, 2096387825738, -586529810655], [-23634774730973842, -1601362746738, -303728454251], [-23690199217385788, -2541976922222, -661409620650], [86063381444511470, -2567935295160, 453490345964], [61287212197551916, 1896446616326, -1183371677758], [-28346985649625698, 3124070666802, -3309194781813], [11582077052193770, 316245318907, -3450088712014], [135312194120518202, 1371329496960, -887470895552], [97548380860649120, -1572522553980, -509242458426], [-85591606986540978, 2268741391155, 2577105493287], [-151983570001136856, -1854093547128, -2075427967842], [106725505365834230, -9903867554424, 2613587823436], [-150445877295894118, 345733937539, 874186614162], [57019500675813056, -7811000411184, 3560360875448], [-172505788063756220, 2568337634930, -2671568163866], [-54556362284991188, -3589800490654, -2247779592040], [70495036256265128, -3707793588444, -7597105747402], [-96291221856425594, -2340085158469, 7952292131337], [309569424021720236, -1959425155104, -7380060482352], [-10391967162964416, 11233906309272, 618576827244], [-228194996744121370, 2598678777817, -139504972380], [29931478393923674, -3617015907737, -1015314474292], [-103767025831423888, -11364431460672, -742405431264], [254713590271300886, 7510539903474, 12822903238443], [-383037573781901332, 5564437137216, 19922803644384], [189780436034397524, -17824752126284, 3650893819607], [174860796246586260, -12480385145742, 5241916380282], [436623965377118052, -31888335944622, 9436959449566], [-948964916183392300, 18083204858952, -2573147292052], [446034653998362914, -12982666155816, -3600113698236], [284180871312494900, 11297939328154, 23536209807974], [503264651752430410, 32950355506271, -27588404331756], [1211814121894927794, 9279292567299, -20676378243272], [-739623448872879190, 501400389480, -6491169827300], [-177782465338254856, 46255130864556, -21602798388990], [-645612946887429082, 15589495630668, 42055679535474], [-471648149846230748, 16212935750054, 32786839294576], [797356138822476920, 9024676875108, 31132816464534], [-590909090899145272, -15076053650880, -33232863463584], [1149323807285890084, 69617972087474, 19027451547262], [-1968391396656996436, -27106065262974, -18206825516541], [297973548428256620, -20172259881686, -36118694949572], [-690817337087364280, -18983367827258, -33905028297223], [-210194493264356182, -26835853787183, -55004702567983], [999184131960803582, -46974378699378, -39329685642219], [-2775152991701454130, 2804942870082, 8981121896483], [689659912649619306, 132748302990639, 27055955176612], [-575252270547159490, 1785784126099, 32212895795923], [-1095656151638991832, 41101873057968, 7685429913352], [-897705516200469240, -105787248047934, -16803150865201], [1138426813191966074, 69001282458828, -62617612439630], [-2647077181877691920, -47655201648280, 9252682228448], [-1907890227353070556, 96000048882006, 25404197030721], [-251640821535561358, -131427763610586, 132023286681337], [266094262181405684, -13533532408332, -94280587614098], [-1346409219788745950, 86255732992655, 113563501326050], [209461665031091720, 189447036570240, 35818231588800], [773902808317864442, 193225256011116, -98987519526238], [-1012465230429376066, -4755357145019, -158639579020616], [-2656577792660481238, -102699653120136, 94260687275828], [-5505568333940990782, 84053357775871, 102913521642082], [-2423920008603142192, -47378749949172, -65972636591854], [1855943409292756618, 249447454877399, -32644747351888], [-5653189761191762368, -19281846401900, -55465662673198], [-2896536248411438896, 199507703731992, -99966817162332], [-4331359315213240500, 211102118983236, 38242011766813], [-5556326096572200112, 41001897026772, 192840940752574], [-7460453899283879814, 33212865913701, 24244435569607], [1299723725460412682, 283906157897586, 229491490729835], [4029289842347558876, -139426921456166, 55872677438608], [8866547134298483246, 39850240560282, -62808257096153], [-621208484118144962, 38697707662637, -107337682154692], [-683481283215119308, 591804981117618, -214181335841717], [-9397967645985554, -388520503575583, 33607557978810], [5913347749038399950, -513691301654364, 215628708197494], [9614341482159783930, -682275675315129, 157577251849700], [15631042660269661820, -9034064901792, -11388797209328], [-667120060105419244, -505933821214058, 387311629511172], [-2646584685148659436, -330212035398744, 273110281909116], [-7639446717959864038, -109385870453381, 436364670154366], [6166853087591878976, -223787125184292, 176242090159050], [3082855516498059966, 134858169457401, -480088244947062], [13390480883737755746, 58661044042404, 214163838810998], [17250199431874175310, -649470818032335, 189573191308954], [-648507780864176046, -187039649369727, -594359574415341], [-4392982762860132456, -1042811002916832, 513385879778262], [5978065285221661136, -52932404232384, -108200277459744], [-16221618975042272912, 966780819742976, 39127570678556], [9499727592319335828, -1489357663187166, 415539710993650], [25241795210305081864, 422483845076420, 393046464069084], [27875658527162783528, 356578418033052, 230866990078698], [-13516719955447875682, 72807469841622, -432333848238591], [16343807772813229322, 62648574792042, -865945916064289], [-38938827975655462, -67124034180269, -616626085909014], [43646595657478435882, 741485548092641, 100308081567385], [9887126911240705934, 726300358718094, 237067653224341], [-38045780560160425150, 153405295304419, -144357061742196], [17905659086475521930, 870257782921038, -104136589773003], [-45689688052718109352, -297059851148496, -161134212040504], [40649477869116548362, 424069085710799, 171796879981788], [-22207048631581178356, -1359375345027912, 491854604712724], [1576136871455074592, 179882976143674, 679345070451457], [8607437552987704676, -546785511903990, -1078050521777585], [8369522319459630566, 2105682768921534, -937091219166371], [-43233850618939146304, 607338581420124, -615065450268406], [42779626168002811112, -1083991643024780, -30947211478132], [14550387685955759654, -738575358572190, 1032882489376083], [-59086250502946421750, -396283738317145, -174605940714472], [33547154889403101630, -1429573338167595, -173227093097248], [26987642472942844978, -1062768142501513, 1090775890565514], [58877495000899861778, 1390862599160448, 207402591180480], [-61842090567393170728, -107529868598160, -505844674234200], [3637807293982687898, -2814727335827706, 1989840761413833], [-86681243287824060568, 191118531598948, 157775232136388], [46531592426602451726, 1495731429009120, -261009901034416], [-106481370007037004862, -872776502750543, 850501400478439], [-8472389605012391788, -502120546569204, -788821002766190], [-68434460999448971118, 212892794245791, -1365070819133018], [-57286467539666586622, -2565519980507759, 128286151477415], [1868072336191522722, -1568059852969365, 1387525608524056], [69247405426620093134, -3633368220764190, 585527984588179], [4359240872639161982, 4616354206929978, 118721488128151], [169685868716663889830, -793923853049375, 293382706142600], [-23606606189201391044, 2586094610875346, -1598851708099212], [74879014663732958580, 1059773776977540, -2006641354046169], [-14867684345743134448, -2723488177500060, 3052396756017942], [-62573336562842965918, -2536200162127758, -3090895636436245], [-8725538432416701562, -618565485908676, -4412015271021990], [142991856987169819512, 888979778624724, -624915984635296], [23948133437744503394, -2140335697159925, 457793002600472], [-195230615040325390528, 652383188589612, 187072721244098], [-95431344243033947494, -97154046306371, -2048897606589429], [51714115824612576200, -4909055574345764, -2759411678680600], [-19059802261582449100, 6498556872199794, -2494735791988245], [-74738895018851891038, -3251089993192680, -2921073295292508], [241959133510032386086, -1572465604674499, 1074102231099582], [-138112525299491526232, -1644869524649148, -1713592193229210], [113133345576882039408, 7335686040767280, 583967880759700], [25022004584586986004, -1751043990306042, 3819569427346140], [-90136808215595560534, 772080973123260, 7965192132614042], [-67213842423144448360, -4564108449960588, -2490793818426450], [137289312204258567562, -3399126157414477, -5210215995865402], [-208532126281821142730, 4755764073541589, -3464492291841698], [-125387520719898341888, 3976178599007378, 2776373151714165], [224793681036175511978, 4714893717201108, -2021931371629890], [73890683921118893084, 2212866242929014, 4285493768941425], [-135158201522259940720, -10431909172323212, -4169431625700138], [-256950579588954734440, 4355083410954960, 913046101148728], [307163798096288625496, -2853623124316252, 5447257399061792], [196015512166014008618, -15751741477453650, 6346864576902341], [272301450049344384702, -11016651480995139, 7331708930891652], [29614902868391128934, -7625564307059939, -6471456443179650], [-102416602007478201148, -7394048446291398, -7826115237470185], [26567877070298938350, 11736661608997515, 10064127453675851], [261281747311536545618, -6167002981245876, 1907031820605170], [-97514365235256181180, -10143623959076922, 371603336608873], [-293845026939039598744, 15046372687207884, -2864613010818766], [-136332419069620261104, -4257478019023512, -5968759944850264], [-112121810972844856636, 5130483900580182, 5197412556615873], [283077315916041458368, 1518937831653368, -3189656834140292], [228258287240192686862, 5263966177941444, -1033914699181018], [-401383788281742763628, 2596535565182228, -8486555215311529], [-397783549979088811466, 11122120790008223, 3098749628377535], [235178994383162209440, 23794389292320864, 6538820976077336], [202726442803122451006, -26997407668716661, 8223279172158495], [99109826478850509728, 1818000880970880, -5472242271389504], [366819845053262535824, -12256267357373076, 1175061537994146], [698805211893022226906, 9764519083018950, 1870733499387369], [30402056235211492486, -20000034115121227, -5416001123010270], [-485829594829116469884, -1593455777651802, 3346130298156296], [-664068278484477326116, -9870822046037166, -1906287131928901], [155322884968198689468, 6369729256254846, -8917512742850446], [-72594064664986166860, 15977671751692512, 6842460132411984], [-511925347900234723098, 15558074347671705, -9033798484718460], [-204580029535698241774, 18630704248574208, 12286060212381312], [-864333542002484976206, 1515088254288851, 7575945148781696], [-208755404909873519166, 5296364393152335, 24976630446323434], [13971128786320311230, 512449270772556, -7501709389542030], [67823776357073035426, 8147252928924815, -3994583277134974], [-1000896331936127771678, 13714621520722685, -2595166754885283], [250298567667953295206, -10893947379021678, 8691550698817563], [-129959253544218994876, 23635796926918026, 6002451703464847], [-429398710286667862638, -18658702347772605, -9493891387044720], [-523484251344880071526, -14664593760017100, 15477819561032782], [-682141846965769805056, 17912417305713612, -13426583147005390], [100859513994619477742, -19506602884640393, -4208943030118391], [645205095164316411578, -3616946071467810, -29867058710713075], [-312250261635178289938, 2706096170938602, 25721448059128991], [356296514592798855522, 11187542030272287, 11405524105785242], [-495095814381605081704, 4673397183438156, 19612420560732786], [-1385586378053420618364, -16841280335457828, -600566301373529], [719427861538292058410, -27630266519215901, 25671193718130790], [-443943146175581987860, -34417659176150544, -10810414677578264], [978603300648984468192, 28280334540598074, -18847694092684431], [-408986603952717112354, 6207771329104614, -16420723294026471], [-679626370164174031540, -17282500009529244, 13182936621241366], [579799661751089117582, -20366149264472076, 27688113047241070], [206302330407904693016, 50398690747964976, -14671395201946296], [-310494443705408343730, -43910491629523248, 32864630152412728], [-64658995181002015012, 19581212915814918, 984634981070409], [1370694533164493169050, -12769794104055575, -26751792025091991], [-85414253222559943606, -26177548441609410, -38474585895120995], [1797826511735926955246, 8111004103874286, -15850768378482523], [1430349837204910173948, -363057641176506, -33834901315847786], [-748278369830188943160, 14753698712574276, 11621901922317644], [455770205306456004152, -20656847649729864, 26934800599935252], [541237717646158634312, -34015646354850932, -42241760301536448], [1548506789939612064398, 46850333929948254, -7515941128636851], [-2318787899594652979072, -46036815569703768, -16741210627463172], [-1179237959445329430374, -20557378457095693, 40181497855640426], [397141314508990650974, -100537828747160880, 29823908587742520], [962063767552939515196, -32488989879175216, -26723556326267289], [-360003697389185312836, -58976695041375654, 33727169441437767], [357623000040717469086, 65605732274662545, -65119275079645794], [333704313170949193684, 8868036968853020, -25400156505343333], [-914283481137241032328, 24337867725967708, 7834384321698132], [111114024961478223284, 92449865685984574, -4906267971413584], [-521540063527278389708, 43022214095479490, 51535904895712682], [-324824638527463328674, 60999069227320392, -20805352547590548], [-85551670326860466246, -117953318510204961, 18897165286457584], [-2438437608285274917472, 40743239797019712, -1788234486791584], [-1020397197891681449410, 111358391830745953, -48348430223572018], [-560907735258592951172, 73619376337587494, -45877078489411162], [-2826510195392239229464, -31587918287122356, -30268754799321870], [-2360160267102053881606, 10831235487549756, 17062995018623834], [437397461743484961736, -5497274007370210, -59716995529718827], [1080780017828138955296, -44710015866870264, -7013265519547892], [-902830509075644650982, -108373053361674859, -37029429921793049], [-253726794703112283148, 12074889812194440, -29655790315723572], [-573024712078146811810, 77548214793132744, 530394041330988], [-2475777300665210778938, -76428590443386253, -53688751688017403], [-2325211109845848776974, 89634000509190342, 1895327862629353], [-660496199678009588038, -64678112559460109, -59192335660311310], [2111679012309192236834, 134514886403742870, 61696671915514529], [999758761881646257384, -165303953115359484, 17047225773865268], [-2896044845607226764136, 39010703729438482, 9076067252885371], [1276461338173169528124, 83348403752593470, 63077370330946674], [1795182048721387784948, -111641284364098536, 34077593827879972], [690818217194072932374, 150447227058666933, -12938686306730042], [-1184125024805143568722, -110704543765927884, -36657202238984242], [-2505493221578561999128, 108930201932824996, -19047705717778236], [-3986231382709759220754, 131179224709172781, -43031489468333720], [-166320636994852597402, -80083874487438660, 18495992643755162], [-2462740015342644018116, -128172469305879694, -71088450788564092], [1040004334283363013908, -153902748471056634, 31357685754526537], [1602587986114191538454, -36601010802410790, -158296270864160761], [-3952737800456921924286, -181325623148119149, -25070175349018684], [652651498708365191288, -218437156426387188, 46540944762529810], [-2495288433101147172128, 5272273624153724, 74233647562769118], [2085405669901959375110, 93774788092192560, 112580471544068040], [1940812964056941321332, 63686386681494228, 113516297285005758], [-2335955172252285573412, 250835351263816506, -140447029357095913], [5763722520447600487626, 6031194569536023, -79391043308818272], [3600760475841088352616, -34850069427066354, 36070250486775893], [2756292004227003494018, -22219145133407592, 138290203491247076], [-2973389430348065320824, 33788501446502142, 59221802678135221], [3672980663217783410852, -154811175487884054, -7713777862016481], [-1295700972200493639092, -102015170965847074, -18868570899992698], [8290924324356672074324, -10243112884377012, 16469224836254706], [-1372894296802858303140, 161893597824222438, 29145449418092990], [-2383586344842247696930, -278055214402592052, -30333475560130894], [6427951455051339713054, 44373788042819881, -91255792601214822], [-513897932644951750642, -172677683888750388, -102510595969355854], [-1428998048390220406108, 293423323322087010, -161575152820045485], [4123966793261234670566, 255536177464852056, 71079615018861444], [7989771517021425267596, -32100006129527810, -66917385654692826], [-9002508025993160318114, -42953834441015815, -36784060719130510], [6276808235346121869704, -63237159017633952, -93430328021406960], [2725533366189028495008, -67076078823880338, 130751742462259507], [4183166657796160618098, -175054732425487071, 24180291655089323], [-228424259419720175302, -217715332893430806, -132403806398429409], [4148934449732506243052, -122093946501056280, -84609237922404516], [-3937304712514462887880, -54690167527943804, 125365980054654728], [3058687575486644404114, 201773247575960783, -257864861171989730], [258479946635876467964, -519712326786111366, 113068530048126967], [-518756876504955992926, -155042860367721174, 237054764347432319], [3158333614859149442188, -323122821935220460, 89150067032583861], [6604250860341478061984, -27570526368336444, 28124758966297894], [-7744593488056722076090, 16672433454052632, 208842910093457316], [-6903612909083665209750, 149958476181427911, 105057652131800576], [-752796913706375936944, -335090639159778224, -56991962534324516], [-2346241784489752880032, -367788802547110208, 106539414069027704], [8548073082800589166040, -33840030446945000, 5574966634452914], [-4131015434986172929774, 156591052393024915, 169548886597631544], [-4034304384820645358314, 174513155212915776, 166517449148875616], [-58808584538401910682, 420750930169792257, 71742891942209288], [-317782846320514454230, 111361759943660923, -336423375386675390], [3433025693449356374130, 96448623187222005, -28957097184320627], [33863654654429185112, 3332013675566928, 300933327324247800], [4813311206785789773206, 299891348490678138, -263503507139011593], [-778778742558780994234, 100896860512994485, -348450976074572782], [2747890745153228751656, 262468832955678492, -344320322953948374], [-5920707987792975300514, -309018270777899850, 152828000531173201], [-12921313257117907520354, 254840509159292435, 1271889500906923], [-3157244275985166247204, -425699811780248226, 438053645846671821], [14797109537509208915522, 175006401264238231, -239373061136004258], [-7002612814200986207140, 133809753564278476, -266657343747740011], [15317404148864761217060, 254645693746917930, 91888857746304511], [-2943974728454352947770, 121505048968085178, 157333281698589015], [-1934327660125871761080, 117996899715733980, -181793946785291448], [5776340241381994295430, 502063427693703837, 172446497701321734], [3563525363576162824898, -122044739287260480, 303125968172699168], [-3331940859958410924158, 217378250939395967, 171999839883200274], [-18279271539279632895994, -11843320494528756, -161709273715770350], [-15182536033592499534494, 72939063100261907, -93729756740648180], [-11324812381821941666336, 106707825706697612, -24534535898232954], [-21059774359244068058008, -226740325552333848, -181978899728007972], [-14349974904873058750568, 330528279562668572, -113487289366696644], [6310990945811101868240, 299634507416725560, -822696339532459180], [-8654180174764921367848, 179112993382626892, -483007039806395068], [-3273753170613326570536, -132258367186492956, 557989652850565206], [1570463293041994109018, -155775437749601946, 323391894516642009], [5833501676127102521132, -358035062499886416, 100835161737845000], [-12863068821939939293876, -96918968124445486, 677459645983694456], [-23738019625892622039118, -154024596702682266, 57257413504567385], [-460825259624070688482, 336800604926978685, -183353746117110596], [-3233973708756069929662, -529005027762809099, 156228546663460865], [-7680923582126572559452, 61983032202452694, 55706449033448705], [-13778586167532397833774, 410553804268619691, -405905528068711164], [-150712805397450112042, 67451881917509640, 213627799004212748], [7534950380486695641320, -756648698408524608, 126714055897207072], [-15851756634387333101278, -258829339600964945, 247990556130098098], [-11383901006257055289412, 725484489119678688, -263226117906067376], [-13565895834816712631208, 811218470076054918, -471888256104791587], [-29561615578804868611642, 521173502533662342, -119540605874965367], [1863427448676488930728, 808483959523380416, -732855789864006870], [-6419290642214193569296, 321794447442410256, 476180289985737880], [8774615422790878594142, -181292984787667463, -804115561643293454], [9728230663848856624046, 369438826073220313, -126827667626963210], [-2099203645829429289328, 402525065475903024, -868423446784681144], [-14274462738399263387962, -965135283877984782, -370217966217216469], [-11426892595732125495328, -651316394645600468, 457816031329947798], [-7461420187349637774520, -905687238646530780, -596823291491268298], [-10928650596365920538292, 525209773196987334, 639940152635757226], [-18681496330634298970534, -367891660323749268, -410327448240775134], [3104967798287321106240, 571603940260258386, 665745424491119141], [20601524936719493315814, -171004098449416413, -551033632422004603], [33752468690095380911036, -26223086689470360, -172800882252425572], [-13742238146068156636726, -984136759616817474, 353005722953201757], [1285225066555558238206, -866971893460761007, 590026419853259862], [-31839010446114140585522, -643415152697060779, 185548393042377316], [10925839209042627923396, -38951700937801338, -162076417227018871], [32954786444944638520626, -424889304394280673, -34262438874360754], [4247173665495952345364, -31768653896717906, 445769483078332896], [-4015187594689077954824, 1027019995170640238, -554020003733109143], [-25928236327984762177258, 817219318600286370, -139389945810585805], [-14315048677071430962862, 1379125206845898763, -558822822428089516], [37825855704671003589784, 467378490681073940, 387261974496259016], [9169762781402313644954, -1092805816033130148, 223474760936373642], [33816780270388732038378, -134046384595469865, -956809515508620344], [-8829176499699719539266, -228675147358814925, 838700300087814083], [-6572268364012246927764, 451449534572503002, -406303808783361036], [43143656648306988570776, 691389648726521160, -141063690392387348], [2262725982282031768228, 484397059314870254, 38063126713018788]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_126_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_126_14_a_q();".
// 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_126_14_a_q(:prec:=3)
    chi := MakeCharacter_126_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 14));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(2999) - 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_126_14_a_q();".
// 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_126_14_a_q( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_126_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,14,sign)));
    Vf := Kernel([<5,R![13179876039000, -656288460, -28626, 1]>],Snew);
    return Vf;
end function;