
// Make newform 144.12.a.t in Magma, downloaded from the LMFDB on 23 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_144_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_144_12_a_t();".
// 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_144_12_a_t();".
// 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 := [-6375, -829, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0], [-53056, 768, 96], [477504, 17280, -864]];
    Rf_basisdens := [1, 7, 7];
    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_144_a();"
function MakeCharacter_144_a()
    N := 144;
    order := 1;
    char_gens := [127, 37, 65];
    v := [1, 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_144_a_Hecke(Kf)
    return MakeCharacter_144_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+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 := 12;
    raw_aps := [[0, 0, 0], [0, 0, 0], [528, 1, 0], [5932, 1, 1], [-79424, 12, -16], [-16486, -236, 20], [-255456, 290, -64], [1530312, 1190, 166], [4396160, 2920, 288], [2668400, 13847, 1408], [-3395188, -17495, 937], [-24405170, -19604, -3476], [-344172320, 39694, -13504], [-9486072, 118870, -17322], [946868864, -38200, 5280], [-2251942928, -297505, 71808], [5309533312, -660504, 8736], [1712187990, 414620, 159388], [2039966576, 544948, 43188], [19566603776, 960096, -90240], [853901926, -961176, -362648], [5947381324, 2063705, -344743], [44772148032, 9220, 151888], [-50800814016, 3587460, 582784], [35559244494, 5225968, -1136144], [-71236661328, -1231461, -2737152], [70086786724, 8801339, 439355], [8276231552, -24652360, -1599904], [119779582554, 1992980, 3697172], [34709254208, -15862780, 3733888], [269102925508, -57336493, -293549], [-363648725504, -56381344, 6555520], [481380261152, 14103890, -9413184], [502008330224, 18248660, -11379756], [894618622800, 64249109, 11096576], [953240083820, 52926865, 8642961], [922784878486, -178558356, -13596308], [1426592795976, -47308218, 23289414], [-407281229184, 48244680, 29776032], [178777548176, -176159815, 16249984], [460737834112, -51680792, 24156704], [1812837038114, 348983060, -42684396], [1398655618432, -508926152, -63763616], [1688128044162, 171998488, -70534376], [-3181756604048, 96313015, -54199424], [1420471881524, 479655, -51029593], [1502862875760, 246958900, -35245260], [378039054292, -69853057, 217731199], [7071825675456, 689670780, 177601712], [-564489291630, 838485140, 51971476], [-3716251179072, 945217660, 94623104], [867840467584, -367447096, -274344800], [-3914423330642, 1385966440, -72315544], [-2395124790592, 2043974748, -301941200], [4954845783680, 208284520, -349286912], [-8270328833024, -3872473920, 393524992], [14886510960944, -698863949, 333056768], [-17323600861932, 2790600815, 51568751], [-18369043672094, -540200172, 3232788], [16017278305664, -4674256040, -172827136], [-17468998773216, -1342944616, -257029480], [34068948901616, 1609496975, 532100480], [-12237828908432, -4072487564, 1168031092], [-25934407253760, 6716964432, -280037312], [-20191811525670, 4555202808, 766867192], [-121594268432, -3157047185, -1211245824], [-7538907752416, 3303977560, -1766464936], [-11962078817218, -5811876952, 1234550184], [27072461967680, -8885718940, 1078813904], [-20017196428266, -1659157860, -3073073764], [-67034578483648, -2530675100, 2163538560], [76205936007168, 5248219008, -698508800], [-20356652568884, -11549488807, 1369612633], [57302882226590, 214458780, 2678037660], [96053123157640, -24137838090, -1906909706], [65062244946816, -2740187880, 2195283168], [-136031016624816, 7599372469, -967347840], [122379090268358, 20683758732, 2464392076], [-481230431904, 18996084246, -2032406720], [116908910733430, -7554198800, -2718712080], [-118679874954560, 20864475484, -1768043984], [160458814573586, -10017549420, 1123800212], [-82592763422592, -16023529304, 1024535072], [148779007603810, 8077659024, -4410785904], [-92370598164108, -22680796905, -9122932457], [-6889016445632, 41655995300, 6054850000], [182699101221536, 25105170858, -5653685312], [177102307237990, 14025075824, -669403024], [57681801909200, -31878341859, -7781083776], [-130023734715260, -44536504029, 8222599459], [-298370575005760, 1594702700, -6564719760], [-54288644986368, -43444081376, 9310174848], [-400138365630308, 37129945877, 2750325525], [-609078437438464, -19476416320, -1154664704], [501192652581664, 49268860120, -10508417832], [-89394319633664, -100907121680, 2072815808], [410667021771312, -92066340285, -11059531648], [-338992435797920, -117715537530, -5182357440], [480395883989512, -15580624810, 9209455702], [-595099904805174, -91500193020, -1107392508], [436474377892248, -51368839198, -4090266654], [-861813438605296, -125840411295, 24008282112], [-91697637579328, -103486336820, 10925906672], [-1635192142245280, -51918773082, 9175748672], [670018976471792, -46976466220, 10317314772], [-919434661664046, 1037683576, 1329611128], [1686626559516160, -145694958240, -14211386496], [-1277621905689664, 4356080700, -48412812160], [-657847010188928, 42059938168, 40610833504], [-646586501818294, -173331240680, 44136212248], [-2623009359546044, 11437877619, -16344284813], [-603373380688178, 112794989084, 52901612828], [1478431215714176, -271589891080, -10528337152], [1370718216127520, -128458887720, 5891128792], [-3005151678416932, -193822903035, 31266288901], [-621683074827232, 30848163138, 45924739520], [2346514147956888, 222952027746, -43208643998], [-653298975721088, -84036937480, 29407488608], [3749934483528912, -106868553555, -2427125632], [306612520127232, -116946465936, 19194326208], [732781525860958, -141095191300, 40659267580], [565451968405490, -513325285040, 32452076880], [-643044281645360, 95236514765, -65686870784], [-1266559906818112, 493161137260, -14577211536], [4695358093436104, 68159286630, -21110716058], [1198759998359984, 121327766075, -12440819456], [1545438105438546, -580160859500, -69925891180], [-1592106663732480, -406676340112, -124623152448], [-831260923921572, 371026491333, 4358303685], [3929233631755306, 633531151652, 26413337124], [5040608027116912, -557090234700, -92996282700], [-4381034991902080, -520684022840, -106466988896], [278551293028444, 839642843365, -48683439899], [1675467839970978, -633124630508, -6603427564], [1808043836429728, -139273294374, -95583975488], [4028901689108738, -821328549960, 55052266936], [-5068505594789200, -513771076405, 98056949248], [8174772275008632, -594591597878, 53943111370], [938660411942992, 227408621285, -26785257216], [-4431618273160672, 1198073232802, 19303389376], [3496029222989624, 1628069408730, -37044403238], [-10371635319935632, -759619097353, 98210749696], [-617213737533188, -646465920099, 43523322781], [6175238645316480, 1001315460760, 17846654944], [-2166233638862070, 193620224660, 146972265364], [5842276848034816, 167491858240, -210540144384], [-1685513202881026, 352742284764, -129779619620], [-5524493236020000, 161871639630, 76353911872], [1015708043035832, -1286809344070, -42507875398], [4181072765466240, -374051301880, 459470800288], [-2417931165376250, -1902393172196, 109409212956], [2117379380683392, -2346864687832, 158239258624], [-9271603671181624, 1588782104230, 28531550886], [-11708928469148928, 1431279287920, -56014318912], [-9769086229956136, -650370220974, -125640658862], [-6194183868745088, 333317515080, -494117160288], [-12291830669302660, 2568206824125, -185227124035], [8035123403237728, -938565200874, -373389514688], [-18623139040731030, 266833826016, -468677089056], [13435349554806736, 273620904157, -111496187776], [-7833513648900736, -722745442120, -224631217568], [5510297916557280, -145588300290, 44766659904], [5565320802776868, 148811743739, -448313191941], [-2684764323576896, 1763944351276, -40262992272], [6457153039196128, -935681167490, 163994369344], [8585774227395840, 1599196317840, 639694806336], [-4777965505208324, -1580337969955, 264248169693], [-2564539568257586, -459757092852, -212832450804], [-18077835067114146, 2380408962160, 79975073904], [-14821032975286448, -756516433195, 582464350592], [557226015177472, 4467025205872, -273506629440], [2709300529900758, -3938881125780, -710647258772], [22529410386904960, 1187211144536, -410386363936], [8574158977612726, 1689153535008, -25159752672], [42063836218133212, 1346409892485, 267719031429], [-20833532930556160, -1396041609488, -637510836992], [-18859895110575168, 1756827887120, -1131500251632], [-29590368598259632, -1968964020763, -638884652544], [9382105014363572, -8012829710265, -698065403833], [11558270699873638, 3963977714300, -485629608580], [54230973509080588, -2937086552151, 173129004969], [18086594653951808, -94331898300, 973822709328], [41049289767962194, -1648838705276, -385373115260], [-10045318606327424, -894617068520, 1512754173952], [44616695708831616, 2757681141720, -1054157849632], [20443522094841680, -1532619402283, 263187069568], [-8370717795116214, 3494747006468, -51029355772], [-15629064488137440, 1856114463960, -1264996412200], [63074061812053334, 2323350305320, 484472327208], [-11134253428457728, -7475065783888, 103611920320], [-24734528532654786, -7130381669056, -571958215360], [-32735110371327616, 2728539714680, -626214015648], [-61637219147306560, -8440923951600, 752266427920], [61068338385024912, 3058318177753, 712087347584], [-32101125524146432, 15146515910960, 556033261504], [-40937747899121920, -396495560720, -986822466048], [44039938463574882, -1607646002440, -113301284616], [4224840175592426, 2757833933092, -646668216796], [92622925485260160, 4984302654680, 875786632192], [-20476196496586240, 774614769440, 20848854656], [45008991762109584, 1821579415337, 2309607917312], [57680112100042484, -12016485631625, -1232406937225], [70389108829587074, 3499349840388, 879138234116], [-21824340154868530, -2163663962840, -1235998945496], [-90566263705568960, -2721180658460, 564769096400], [-5511086331349392, -11222229267705, -1490651043712], [-46648792053955756, 9646869750175, -1160372080225], [112937717605286848, -12126545903060, -1198475966864], [107728037031910848, -14502688014628, -1172074647424], [-8349311419242952, 16682828919450, 1434955327130], [-136237196770114958, -2031725218760, 985177791032], [-118197578409983536, 202573734269, 1460466935040], [20566979103504852, -12461277641825, 2781937224607], [-15163344404549760, -8550151916840, 2523639588064], [61372277273134848, 13252556962864, -1391003791936], [-15025872013711558, -19060018400880, 366834951568], [40596180511258060, -16136360058279, -1225041999271], [-42859239579314016, -9084538477046, 3456258712000], [89848491397363072, 10443137800120, -182381880992], [-258498447752839792, -1485248267335, -633897146624], [51265674210983538, 19265787547300, -4863865412700], [29852991550245972, 24432406409055, -3495816364193], [-25500209074775840, 38031569200654, -1907850459584], [-205041967982973564, -11658798497725, 414098550851], [120891140840515136, 32750435060, -2244223547376], [28947222271246206, -16412504340260, -74800032804], [-70851536302393920, -13833780879780, 727779120768], [-180578541810118400, -2520080627888, -2606998148032], [-7770709232253500, 13276867252147, 3756784578483], [-11947591718691840, 2902140870848, 1262731276032], [-733051320579878, -36461937731564, 617793198356], [-76035654359969416, -10425651694710, 5628414756746], [83758623434437348, 9360555747435, 291626504299], [-44209572074242432, 27565272395496, -2391878381568], [141773954830760920, 22124102085394, 3140164275986], [-103869870325314560, -28571437710400, 4171811823360], [45862485767577662, -3599392020240, -5429788732176], [-20908937566672944, 6019846586845, 3748639693568], [-258996677351233856, -4821044674276, 2423600603440], [-72867137883630464, -32121441148056, 4416348156192], [16434630055543232, 52234850607500, 2526548148720], [60199101811110848, 47858761261840, -7349334027504], [95614422315509564, 4213736977965, 98001227309], [-191556082569890394, -5747784266260, -3714586669844], [-123431718813080832, -32708199963600, -5895630760960], [-402997648823329280, 24252750576992, -344033137792], [-182704787049771780, -10257514435043, 6542441700893], [19937344579421056, 1141383251224, -3373230644768], [512443951114372128, 6936890068120, 1273246657688], [137031168056612864, -7695107433600, 3248431951360], [231152120324938986, 14727652003476, 6538492571540], [-77707595695735488, 49689340767444, -1162019851392], [2108623901008768, 41114665535000, 3354727044320], [334624227970704694, 18927970684320, -6998387944032], [-337990126991584848, 5626326593595, 2755178160768], [-239693970900224128, 42724869464, 8376169230048], [146511619451011682, -27183702994140, 1690207930404], [451537987965220688, -35605262895972, -1423112057700], [-189683378094447568, -46488804219805, -5035708321152], [141250844422961706, 66625484923664, -4262488148208], [-156508537762372556, 7944857586407, 5992343057127], [285029166279143552, -41407226067160, 372898769696], [480780719583717298, -9216237469020, -2900793665628], [-505104065317381194, -11104933772436, -10583758511508], [-159256529487575584, 12472880495070, 9859230676288], [371742001546415552, -33762438352880, -8933048188912], [190519090819083728, -34024027704515, -4998491840512], [-677117572471085248, -25869110533772, -11431441371776], [361523609322965336, -69784502503886, -6521600828878], [-322559497997662000, -2418880243475, 12128649320960], [-160457255503635386, 13358561902620, -5843717244132], [166974118315631056, 89286738828924, 7172101355132], [98576859136751302, -1623603260256, -10176906355552], [-303060193531221732, -25028870961515, 3496797888149], [-277204750870659154, 83292764004640, 423929694496], [-870556903256461196, -31862408092041, 6085945489015], [-124486219086446016, 35942744098740, 8982500673296], [-470307002086162698, 120405983991820, 509663526668], [62624608150375770, 47476194364760, 11327995026264], [525232032123483264, 107164303617128, -5425758217184], [79150603207671040, -67653437406960, 1011288813376], [-417026581494024812, -108077117984785, 8072854837231], [-65393795725524352, -74886834722360, -19680796232544], [149231802834323182, -70153836036580, -14375278667492], [135274323343915064, 50828166693274, 3149132518810], [88334628589727232, -48047180982688, 8802595498880], [-1195087580239044466, 26951618155368, -10959030078104], [860764019213691024, -92816986821015, -14568621959936], [-563012873191254932, 48493256539185, 4402956364849], [1367341144486857920, 51385811356876, 1309200947584], [-151348028327372720, 31064398693733, 14016351192192], [60366290251818112, -37877213211800, 10969508743200], [182838987656064576, -23151229722140, 8832427476864], [-574552701373233536, 30439975732744, 13636009825440], [-1012272965177367386, 44079858303100, -1565851372676], [1566671432345729232, -37527981748883, -1013079478400], [-153123800492102300, 11998925566635, -6996240153941], [-1213209438453113296, -82907485280125, 17517166529280], [-934970325758252992, -25237168506988, -1955984897904], [93167212847407768, -139957634770014, 4905217908642], [461436594933253194, -83903601862184, -21937049516072], [-630945914681160048, 169692182924105, -22207254492288], [340547929983944156, -50997176828795, 24719675505797], [226794802307837184, 125529843848720, -46815265861312], [313876671519998248, 145239164763310, 17765130885294], [-676153887759003618, -57401856416792, -26894539479576], [1119931227643112896, 77862649814860, 25557009511664], [-428065013852930214, -106627550039420, 41159303724932], [-1301337090644818176, -59376520171472, -29823473103424], [1317773461038555278, 22192396231452, 13956508302876], [2384852199440675200, -76638596226440, -2652756006816], [802801060727415344, 80952545438147, 7845097894912], [-1803177489038878560, 186139624418570, 14761451619520], [-742363278523041304, 84997290060606, -55544281921730], [897979523926382336, 72396331078960, 29180721002944], [1962335987347535574, 177930522015040, -20355738286784], [-665151689632869888, -222603109790304, -2403982344064], [604261197482291712, -209955208418400, 35067001636992], [-711275527178252114, -103085095039960, 39956052368936], [1837044783947302720, -168408127319948, 16488221944448], [-40235665309507808, -205454455357480, -46816511270952], [1726518072907032442, -275994190969512, 4371510530904], [-644369175747732752, -171241333382577, 52426072755840], [1403914572580469100, 217973986358737, -39496913359407], [-1669658698952947744, -95151983688450, -35678142956480], [518099907322874974, 189849920928880, 45283503605872], [480854234543028968, 304504454084990, 26295485379966], [-990743335897946744, -49036285385162, 43908992807478], [90202592466516992, -45663467735360, 14203636656896], [-224301161029568752, 186143045654225, -21700317558400], [-1323862574979758854, -95620090043660, -76622268449804], [1410129397884391952, -12876247594495, 33407753558272], [1527789468895430452, 65449176931975, 2361469529735], [1502150744375778176, 90527738692760, 22823817557984], [122559766434003952, 51188795337940, -1793298737964], [-1578703473078521280, -5142428305740, -23742119827696], [-519212532970162378, 176297039771500, 65331247027820], [-450235860298240064, 467121389487100, 46764849646720], [1816074856249892486, 224477992531080, 16449865760392], [2231147071181900292, -245364633182685, -28449167036893], [711719095024277950, 98365498674396, -3673205073956], [2390161415512583776, -44628478652570, 66924294725952], [2857176112990564528, 157246326783787, -17119640096384], [1454994690030259780, 370603137969235, -18956047729581], [-1367875395649721808, 15035587244995, -108246026407552], [-3276259405229935424, 37782435586428, 41980091231408], [3155532770696718322, -115408441744220, -23979090822748], [-2756953401589780544, 14125784074640, -70760467359344], [-1221504227440568576, 182984483150128, -51225436879424], [67416244421931824, -341584663376045, 20065629986432], [-3108936961704467976, 337929294036330, 45430000906602], [2713283955184717158, 204847396798960, -79878437065232], [-1656112437034878096, -404541583347113, -38356881328768], [-1027520074556361708, 338241741013743, -24460699491601], [190422085382856414, -416652035151620, 74194154167292], [-1818307195846721280, -433153483271920, -53297795525888], [438390317736617344, -391285659868488, 82901307371872], [2644382607305604096, -90803642247488, -37427493232896], [-3856978383360555488, -292518821570590, -35168685883456], [137768383637938432, -638509172469680, 70537216876608], [1877497791382643310, -13865149592180, 74083792614540], [-1125852706628945216, -107747988678740, 72737324441984], [-209821314437231232, -548388198861000, -109665930875040], [-424348317748705728, 519929248294132, 3916481936400], [421759295912136912, 123921128520892, 127242563720380], [-259774525148023494, -168915294741192, 6635886199608], [1303304201041480432, 29341163761615, 136599179499776], [333210291235720780, -564333730779367, -6929219223783], [6314548405374654026, -70100650627760, 75740831027536], [-1420611060390147520, 30703825260084, -36022417672944], [240360257742000904, 405840961042390, -189424245087274], [6358204828676462080, 16829961125600, -60026700979840], [3572784785666891888, 649414109807271, -120408279979648], [252581041803561980, 254987514683325, -118649574033475], [-288518800097790326, 673333861577732, 29780036739332], [4214629924689917632, 351898369700380, -112761636124368], [-1559527733813637248, 190644259165144, 73170409108448], [-2501953135687502942, 420722302975584, 9435090155104], [2292610244435009376, -289498259825802, 178396780570688], [5199422152984971878, -157188516327768, -56080412393304], [-735086149696087536, 358554563553537, -84527541575808], [666272173263134240, 4815805640290, 192981096131776], [3934038869953114764, -305679626825367, -85237374412439], [5524570829350029440, -486636250405240, -79470586127616], [-128085679191487752, -900542160563990, 49896740951274], [2233558416556071040, 28619684135080, -16692926999008], [2585105586279724860, -680831179065075, 132894007433485], [4931508083319641282, 380434411791636, -83771339323884], [3400464219580697936, 310556634087708, -46517632771812], [-454840093917947520, -184672824600840, 186408698490464], [-2014443070299444930, 960245335465280, -26131579654848], [2972896094746815056, -1070043955137915, -108582596931456], [-6995411243719232768, 183315304487920, -46382982463808], [5412520554294213416, 456802778508398, -48443217119122], [-3000495447522123392, 186179784173944, -78897960087456], [2609006275960077942, 1057390092329840, 29945657061232], [4571862066570984660, 8336141865375, 107261602867615], [7193803549365279072, 618407994696726, -38123101793984], [3344066941741359464, -468185508264290, -17546493136226], [2156545895842441872, -270791025036023, -29296790433920], [-4881387985718072490, 522404076690700, -172203912297460], [1533108329024865376, 55079269411270, 77250308268608], [-1327799883601832028, -1219544484054629, -84048171222629], [-1084805706057847712, 601821480258630, 29981965838912], [-3266117550436019600, 260110956778055, 46500494328320], [4673855887251819148, -170532018964375, -13588673003415], [-438449376717172358, -254689529411052, 227856881453844], [6494756034832801120, -233761238304170, -30507130400960], [-2817678219974569624, -49387464944354, -181547104689890], [838729345020908224, -565350429052196, 6651972001840], [-8935320914785735294, -185266070734824, -51003732068840], [-2872019820361820144, -807802510038175, 52796880058880], [-2676244533926890048, 996513817579980, 80623398835952], [10018443078970650792, -35803030416050, 98835819852110], [4550113869227508550, -200701880138936, -133834122232504], [-2822302168857324560, 980620435249247, -50347325802752], [8661852917609098624, 160003124291896, -21319025088672], [-3986534968716276692, 792963022903041, 112851967608577], [-2107948096775315104, 441502540325270, -327809898420672], [4787088604880033792, -984274160023680, -22058303391232], [-595009702468214832, -217373292202147, 102507170228480], [9373734480360050158, -380237153405860, 61102017994588], [-193380583859438592, -590640063314240, -74740300958976], [2425867541900049088, 1192522790096732, -238381099796944], [2614311891082372554, 469290612209336, 291194260061368], [-12173351488745986832, -120725779842705, 70969091116288], [4019083075808885184, -493556448869620, -133863931963408], [-272308243563664064, 522996547494100, 257613217128576], [11144347263080775352, -448516504851590, 90342054166394], [18213454430348659072, -262520049127944, 117741869360736]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_144_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_144_12_a_t();".
// 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_144_12_a_t(:prec:=3)
    chi := MakeCharacter_144_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 12));
    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_144_12_a_t();".
// 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_144_12_a_t( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_144_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,12,sign)));
    Vf := Kernel([<5,R![-146016358400, -81004800, -1584, 1]>],Snew);
    return Vf;
end function;