
// Make newform 276.8.a.a in Magma, downloaded from the LMFDB on 17 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_276_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_276_8_a_a();".
// 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_276_8_a_a();".
// 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 := [-21076942492, 425424304, 7346801, -82397, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [0, 2, 0, 0, 0], [-14102318872, -79028394, 1769105, -192, -19], [-1413769426, 31717395, 501020, -1971, -10], [-99352314166, 1010516613, 43521530, -129651, -802]];
    Rf_basisdens := [1, 1, 25580880, 2558088, 12790440];
    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_276_a();"
function MakeCharacter_276_a()
    N := 276;
    order := 1;
    char_gens := [139, 185, 97];
    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_276_a_Hecke(Kf)
    return MakeCharacter_276_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 := 8;
    raw_aps := [[0, 0, 0, 0, 0], [-27, 0, 0, 0, 0], [50, 0, 0, 1, 0], [81, 2, 1, 2, 0], [-205, -8, 3, -1, 0], [-3126, 3, -6, 2, 0], [1590, -5, -38, -62, 1], [1971, -5, -11, -95, -3], [-12167, 0, 0, 0, 0], [-17277, 121, 239, -60, -33], [45429, -365, -293, -52, -13], [164613, -608, 779, -615, -16], [-11809, 939, -445, 14, -125], [21713, 1211, -1169, -73, -17], [4391, 264, -121, 818, -143], [181104, -546, 990, -527, 134], [-76034, 2291, -3120, 1184, 554], [-566643, -3808, -2357, 3963, -562], [-280925, -3275, -3695, 949, -853], [374915, -6821, 9513, -5786, -587], [-185425, -3195, 2407, -3016, 1469], [-242351, 4092, -5695, -1670, 2240], [-904895, -6190, 3557, -3663, 744], [-4344646, 9265, 5982, -11240, -2657], [-6055942, 12512, 5344, -246, 36], [-3253141, 4515, 4363, -24444, 6041], [-4045669, -7328, 36459, 840, -4328], [-4657687, -8992, -14287, -5591, 2548], [-6439683, 17778, -8345, 327, 3492], [-5238422, -67, -4402, -36500, 1343], [-3919134, 17356, -28862, 42568, 5796], [-512124, 1978, 24972, -18874, 6446], [-7294496, -28197, -88708, 4366, -2607], [-9431426, 62842, 41798, 68632, 1734], [-21982098, 88814, -46516, 106325, 5522], [-12670009, -8463, -39207, 119404, 6359], [-9623093, -69290, 115285, -63555, 5502], [-2946646, 94388, -4082, -42622, -15626], [9846923, -120193, 125257, 82502, 18137], [-18042407, 124007, 11513, 119228, -647], [18233818, 101935, 11812, -79946, 25680], [-34776233, 18370, -167447, -220557, -4974], [-30997104, 118014, -130660, 54130, -24044], [-23418040, -174287, -120816, -283360, -4012], [-17263843, -165921, 313165, 94274, -16137], [5133015, -184458, 178759, -138470, -16408], [-33272640, 204274, -71480, 102250, -2928], [54820819, -206161, 325353, -82692, 16947], [38106023, -386926, -161069, -228693, 26326], [-65577085, -139296, 319593, -849, -2262], [13255430, -142834, -550376, 195168, -9500], [40683798, -283390, -177478, -128648, -11070], [-70502994, -504194, 33624, 336070, 30164], [156233621, 2816, 193765, -729815, -32646], [-10123625, 313531, 604939, 566702, 51323], [64257830, -184430, 399106, -617932, 13648], [85546283, 135681, -508473, 778342, -83871], [-95717450, 388956, -742914, 720620, -72580], [-6866422, 801138, -407352, 542770, -31462], [48252994, 631003, 177598, 15828, 42157], [175082697, -914083, 288727, 119343, 136595], [293384908, 1191208, -500566, 267965, -19992], [-117594202, 837770, 845950, -846470, -84982], [309855614, 1379423, -453988, -357680, 63454], [35055944, -132214, 1202098, 86342, -170792], [215520549, -800615, 435113, -608688, 109185], [150652944, -102212, 345644, -1411338, -47944], [-182820288, -319452, -1519874, -34312, -96548], [316795134, -133385, -1147184, -1558806, -128404], [-43325048, 888791, -1140440, 324288, 180676], [-35959910, -1180418, -2974980, -747716, -56170], [337212618, 1832404, 893442, -238126, 95582], [-115988855, -642616, 235361, 3268670, -11244], [-638266081, 2204246, 1331673, 1121473, -108566], [-344790395, 673049, -1904753, 12877, -83619], [723312420, 116366, 487016, 2893696, -10830], [208186384, -925514, 1561890, 578271, -362178], [-868169508, -1778226, 332082, -400736, 238414], [-305268922, 1652991, -1699310, 2493086, 173361], [-837591404, -1302669, 1200728, -4002408, -76320], [81436773, 1724430, 2466521, 2133117, -204292], [-1419730997, -151276, -2417511, 2649241, -190288], [281493802, -93922, 2616950, 3693002, 272620], [-1438230584, 212592, 1107990, -1736070, -112808], [-1261768478, -403150, -608258, 2679120, 145390], [170075802, -957042, -4231926, -4250984, 91586], [-439486769, -515387, -376945, -304970, -590213], [-1445046392, -3276040, -986914, -1517286, 322502], [-477803305, 1669355, -2289177, 6265530, -438627], [-940398334, -2443308, 4901386, 3401764, -247218], [-563018095, -3835652, -2702399, 1514649, -186858], [46355270, 2844372, -2317642, -3223976, 1057730], [-731084236, 352926, 4387328, -936944, -317012], [497964894, -2745451, 8582780, -4293698, -404520], [-1025649516, 673702, -821780, -1103390, -284208], [913487560, 842860, -4891424, -2089722, -795674], [1091129123, -6094285, 3149619, 2299872, 697863], [-265760268, -3521147, 3965088, 12961698, -13769], [-1166049243, 2484911, -9850441, 4612409, 115261], [-951671118, 6018383, 6942306, 7334188, -110406], [629161314, -240124, 2838038, -2074958, 1329782], [-1367580372, -2310690, -2224786, 6966395, -559206], [2912304007, -6111162, 4325435, -5107869, -26318], [-3266851852, -6987853, -1234460, 9299110, -1189371], [-844214903, -1719541, 2161191, -10567191, -1660173], [-2970666035, -9544960, 8154051, 3251000, 121633], [1710649422, 2763648, 7058474, -11969150, 1023772], [-1702426457, -1383155, -3939025, -14140074, 1328411], [639766514, 2690190, -3634714, 23214196, 718394], [-1073232279, 1286832, -6850329, 20573984, -242067], [-435290967, 349339, -16067537, -13046148, 1337713], [-999017421, -439704, -3298943, 3327655, -426196], [-3110909168, 15384411, 2430696, 99712, -1797359], [51111607, -7257753, 11212629, -480909, -3001373], [1686452731, 4312064, 3683007, -6784872, 1938342], [-127706388, 7082749, 8336052, -3491922, 2847475], [2700643981, 4662391, -8057317, 7015511, 1250123], [2644427978, 6540773, -14163420, 5898376, -945274], [-2230540475, 9298439, -3500779, -10570084, -1793813], [4100548581, 5679320, -9194395, 27218125, -271422], [1526899463, -12049148, 15946965, -15094349, 1896780], [-332162871, -9080958, -3170205, 25154732, 635877], [-1091041838, -4108962, -9159152, 1806241, -1097734], [1647558342, 3978684, 12649690, 10045434, -257504], [6341622028, 6265558, 8317132, 22944730, -804376], [2140303846, 12444790, 204696, 10317531, -2586126], [3130555007, -15012402, -936119, -12384639, 3813040], [3234842348, -4395309, 20716474, 6282644, -625404], [7417616915, 2047892, -7299301, 14923890, -4124636], [4629554705, 1665382, 3651987, 5209617, -2183270], [5367552042, -11520802, 9292522, -955296, 61814], [6600519970, 10694396, -20490286, 35776784, 2273308], [8601412017, -1995484, -15754979, 3718696, -1139378], [7419383053, 8028052, -14062261, -17059905, 3667228], [-4400111912, 5037024, -2988978, 3013732, 1489552], [2676373096, -15686442, 25723570, 1554858, -1321108], [1848329238, -9279660, -7712616, -2500769, -610768], [2278114343, 19893985, -2584239, -6293477, -2414439], [12498223536, -9256320, 42016490, 12719407, 1065088], [-13069507076, -6607406, -21569362, -1710516, -867592], [3440872390, 37802948, -36109886, 6723042, 4201342], [1419975519, 5236419, -21154009, -10890312, 5272745], [5524933267, 24063939, 34456673, 13683856, 767033], [4777587833, 6448572, -12531743, -8396767, 6439722], [7927625892, 3282057, -14183784, -21113856, -4278640], [-3550168350, 12134962, -30387314, 12791144, 2782260], [164513554, -12307158, 18252720, 28512240, -4887224], [-579599804, -2623600, 19834178, -20063740, 1727950], [3359575558, 10872280, -12123718, -15853372, 6890738], [-9377114446, 8306295, 1874536, -9539168, -3093122], [2287410632, 38298902, -22476114, 61390134, 3110612], [-2372320676, 41682349, -19948812, 34217412, -2760417], [-1708682674, -14100314, 48487854, 38147842, -5069310], [-9906532881, 20252198, 33391283, -30841730, -1436079], [-7457520467, -45042327, -15559085, 41812287, -4326685], [-1082085746, -68737242, 28360178, -28077334, 3522800], [-13674063897, -32799862, 59495119, 22047794, -8597748], [-11133992969, 31970411, -1142389, -7577302, 7835203], [-11159796226, 4048244, -50143996, 28704536, -6852364], [6958747570, -73069128, 61032608, -30603827, 2524548], [-16960512262, -21411645, -57217236, -34938622, -267700], [-10191839106, 3500101, 30655586, 43048114, 2781671], [8762477639, 36890025, -19097991, -58451640, 4810473], [-15264526409, -22871274, -30879813, 2368707, -9017218], [2544129656, 12455601, 51188324, 14943302, 1491571], [-26377576820, 23929140, 12075028, -4291874, 6777242], [-11834180567, -13924755, 462131, -93935316, -873669], [7575341410, 66720413, 20102246, -19180232, -2677538], [-69097368, -32253394, -29701830, 98473662, -10028858], [10805480501, -14887221, -85139923, -857208, 9365943], [-11984771095, 20367184, 73110121, 53330745, -8189562], [21645941276, -10440282, 43813650, 90219658, -5441956], [-1473801210, 11593892, 27776134, -58317592, -4515416], [33825008420, -9892174, 9462422, 64612868, -6268408], [-23867577944, -42799246, 715668, -46596192, 2262414], [-2606860288, -59182529, -43796684, -59624672, 3127085], [5214523328, -17509746, -22598520, -22248840, 16419360], [511978733, 31454441, 73245225, 21635514, -2445375], [-10583303091, 31286478, 28352733, 65266660, 6946732], [12045704045, -23076382, -65718681, -60444443, -10149560], [-18969942545, 95961777, 97709369, -14105188, -5467295], [226969697, 40539174, 101172965, -65378427, -658614], [25916381710, 41389212, 5133496, -33926142, -7186174], [36435718310, -73933084, -36119756, -90204168, -14795210], [-12146598230, -128647478, -36028930, -54131378, 3594484], [-9384250696, -4269236, 6858450, 7548967, 10738588], [12760826572, -101652074, 18730642, -27418064, 17059622], [-17915913135, 62550783, -95263569, -6484581, -17642857], [3080233289, 9807825, -37416431, -77110356, 20530615], [7896141293, -65277772, -22105419, 39727490, -9727133], [39225591041, 79051309, 54006553, -79078216, 1822191], [15743634776, 29700238, 110975584, 120905030, -9083450], [35569687407, -41990607, -35708823, 60566671, 9442945], [15468056317, -47895517, -84305075, 220893814, 3334861], [12313474873, 117195242, -31196987, 150686833, -4557884], [10844369888, 109827833, 7236604, -49351440, -14383409], [-7487132238, -9764866, -112889332, 155805092, -21555380], [-1164978771, 118014190, 117203223, -50936991, 15748254], [22222505696, 10020111, -169363268, 30633252, 2961557], [-5050835804, -131353724, 53428, -28056868, 5021348], [-14541782804, 15170146, -111249714, 144638211, -6537474], [14392062086, -78266502, -181635374, 5998976, 17565452], [36555516462, 17239622, 9363332, 56289614, 4451314], [-21556191108, 64474220, 19513450, 7625960, -24079464], [-25181166853, 57915712, -40278197, -31230185, -19474108], [62013196259, 33856895, 146688475, 22295756, -127969], [-25356602439, 99598514, 127717173, 192282314, 13597418], [29208730818, -106041017, -41177164, -164377472, -4656562], [8525026227, -2311251, 185805099, -168148326, -14839005], [-30230401990, -137263480, 14726262, -179433686, -1282250], [31792145531, 64792961, 13430595, 257077188, -2430871], [-28679428459, 3276857, -41050223, 223450790, -6030727], [23481629233, -53698536, 199539233, -193381488, 26146632], [25918263103, -447254, -49332013, 250549339, 5039164], [5792161945, -142200075, 162542451, -36297222, -23945641], [26259022976, -78085070, 51116666, -155996558, -2175220], [-21839956939, -32337637, -49887981, -31339816, -22676835], [5816452960, 16839450, 100975162, -175766468, 27922196], [-16956374394, 46583338, -104646942, -62516332, -7486054], [33411689939, 101228399, -95627821, 240692418, 23318963], [-24431579726, -47378225, 27638274, -413317650, -7874356], [-79369579723, -77468132, 65456781, 64781196, 17697640], [-16478831420, -290234838, 180788334, -263079560, -10866104], [-53458764389, -193562024, -242081033, 291451884, -30505110], [51186858402, 137220434, -42992622, 10475932, 31959394], [-63499950262, -153705827, -314795594, 92259526, -3847328], [36953933368, -79908389, 135761168, -162900236, -13254923], [7271906005, 318192590, -73351615, 213062186, 10397323], [-31859656365, 124432726, 17216651, 206019384, -13814728], [22285811632, -204948176, 140394180, -157209596, 38856572], [-34792850342, 186310015, 123327754, 176430664, -26504362], [-72974945027, 115531745, 68464443, -142216281, 37857807], [-59581036253, 191852502, 160824627, 286692972, 19344088], [-14987745815, 59477413, -382814119, 109725982, 33483271], [-83984554647, 34300933, 76709899, -152583725, -29613027], [-17152890056, 186669692, 40494896, -32160202, -22472438], [-37576207266, -88937212, 203772836, 11889234, 66980328], [-36685435120, -322785528, 120519482, -157090661, -30267112], [-33694246294, -242146900, -159887522, 201589178, -37997392], [19253924845, 15047402, 46172265, 24210558, -15344321], [-698936641, 211420906, -201414317, 171084735, -50471310], [-70400660338, -82581616, 200381018, 38965966, -25159506], [-113766871967, -16390851, -148363189, -225177924, 19381239], [-72379330650, -453414339, -7525334, 144512534, -24233540], [50201904470, 316617682, -125828120, -100459316, 52948976], [-3056796094, -275315642, -146657258, -1163960, 29238422], [-131775127046, 130881034, -66095394, 187663528, 42292], [12513400789, 62272478, -191342319, -474751559, -43512816], [-95017510277, 127473827, -320440227, -266389757, -23337871], [-27208867870, -55278990, 77694766, 600269144, 20613234], [-63559287169, 247994688, -271783763, 126668231, 2297822], [32315268510, -26812271, -196208770, -149055596, -50428921], [-40935274072, -288757838, 433354324, 201319828, 32099042], [-58296945108, -197760618, 346671342, 148628864, -8973648], [-90387633143, -37911827, -158543891, -212964282, 44493673], [3241198610, -447639374, 339274738, -453311052, 21947814], [-45297513969, 61191178, -237672375, -520701753, 52001670], [-112164440249, -84068571, 64432401, -791065011, 11673469], [13048937169, -148342687, -79107827, -42223822, 21188959], [-251227576, 110031521, -133308872, -817413080, -29633668], [-55889959895, -393136770, 81177889, -608986264, 27727980], [-12288571887, 199285400, -506854447, 305315221, 24546888], [-73146269172, -187940458, -394991062, -663966046, 24320872], [-60727974985, 348232708, -36361171, 188837435, 37687984], [12892567276, -9982140, -50542838, -50897636, -31852198], [-29183596923, 289366177, -171281481, -201593449, -8988515], [81327655792, -252359036, -181267478, -72798461, 87172836], [-8075014482, 632361653, 542783726, -92569840, 1709279], [-56284671127, 318700821, -84687561, 602105395, 14929895], [-11229771075, -151187987, 48443841, -5821170, 62380171], [91548696744, 267631470, 427029454, -434149210, -3376244], [120051661731, -33394175, 72577357, 862838907, 14391661], [138404391860, 63231088, 476749322, 133099924, -3054316], [-179601323375, 116125528, 419530521, -214174716, -77826508], [206177585702, -238366570, -313869656, 93679248, 30061956], [35592083202, -179567578, -137054170, 571195156, 43182266], [156010746068, -114853623, -606862030, -67732264, 54484132], [-59650353404, 227848200, -226414554, 452982704, -25917622], [112012715710, 849957144, -431241588, 297068392, 10732764], [135804948155, -105786788, 349360467, 136773391, 68904676], [129923900014, 77172819, 82025820, -284447216, -40841210], [879608749, -745408694, -1593119, -247720208, -60120130], [59147450850, -719575960, -167988614, -183200642, -85739422], [-9472165443, -211288062, 394592415, 377630699, 81234390], [244733758392, -33591780, -323135116, -704923590, -25149380], [-39613874536, 719732575, -464160994, 298760464, -63482832], [133806471048, 165557640, 829339118, -64437278, 18540798], [-37806481256, -173722706, 393621426, -724642325, 83760854], [27779282340, -59649998, 138489784, -1114444548, -31853384], [-204331366591, 362318927, -366519283, -154690626, -68258017], [-52807229494, 221686034, -185001448, 1064862097, 43930030], [56719981409, -87159612, -99088175, -757371463, -95660808], [-227308524579, 366137519, 84944793, 124273810, -85857221], [142376985947, -397587594, -111983657, -414535993, -2496822], [-87669031394, -547052643, 503001162, -236039584, 5281970], [-257293039534, -307462984, 77109888, 418644705, 7339752], [-86177674001, 32068892, -460704325, -733494410, 47551474], [-4137321879, 194694245, 213950133, -745249592, -25321001], [71052275576, 436734204, 147891940, 1356486500, -11246688], [216988421638, 893660584, -564031550, -511210308, 8950590], [159415329888, 293111314, -668715310, 178910210, -35927604], [-42469426020, -1077328734, 428736294, -774018105, 92560686], [-67470523445, -250595052, 340650923, 724537674, -56372124], [39607255078, 118760045, -78593932, -301116024, -163734954], [-43586746695, 146744201, -884934889, 975396209, -72985913], [137168698412, 742660425, -773918412, -184909388, -17469916], [27067472268, -734601908, -422929048, -339431176, 54368764], [348273932173, -616871350, -680794625, -315888657, 27246808], [-148344871476, 1209287820, 428846004, 688525800, 18185946], [164905015640, -78355877, 1254487568, 591937122, -113251566], [75825117116, -1022690091, -199862914, 99350824, -15786496], [-185838775428, -131534124, -527122726, -541006387, 111737964], [-138530434830, -725225313, -199128694, 419426910, -83233759], [104548051620, 586807962, 1228348404, -691095284, 120106960], [139020942112, 48947790, 730626436, 696955718, -36596438], [-302802585970, 557961312, 796389660, -445389984, -91483614], [472604461008, -432591736, -11465204, 261251784, 29561136], [-133899153187, 701796612, -444852475, 518142754, -41706913], [79993461460, 429089946, -273769898, 995803152, 112556576], [-204789091125, -408310149, 237251959, 860665634, -23825509], [144554007681, -757835493, 593355479, 228909239, -174205981], [-135248688912, 923128752, -1343901202, 594554594, -29660440], [5894339043, -49103867, -44779097, 1075538266, -36326849], [-50320431625, 468571301, -655530023, -293949472, -16888421], [-402107542704, -430704341, -18392576, -881697730, -50312259], [-5531321974, -875281132, -583185904, -275541018, -83373464], [135644232483, 490290273, -974466915, -184953805, 199435713], [116998698554, -80654790, -721651350, 224077660, -40359970], [-46279324550, -811515388, 626293962, -579632492, -62989722], [107141632604, -128036980, -1326354674, -1295804549, -57860040], [49272495142, 544468812, -754388792, -572840938, -90077490], [63110153519, 1094205495, -893353153, 1576269116, 63707281], [-86457873088, 226089230, 251511612, -1647975704, -15445784], [181694869296, 537025454, -655010240, 287008618, 179021906], [88360156189, -80288535, -1528526749, -636195913, 46135675], [210864218380, 547772309, -729813798, -150544806, -140571638], [117406767913, 1334679188, -558547033, 439941729, 120208772], [-570830058930, 633296215, -1161811750, 747652860, 47552721], [253249022180, -1600524799, 1105300564, -1876856144, -93886672], [60320623241, 95337182, 1200431853, -463733456, 185088226], [-25308825828, 505329863, -403024244, -911333118, -127801690], [-157831265000, 276304161, 778997056, 449953782, -34335489], [-156334818021, 367657131, 1107756563, 113930986, -26260769], [-217238251373, 165533572, -196555145, -1528695478, 294130894], [-374262464350, 1372896360, -212437676, 2009822215, 114758644], [467784525698, 149965610, -588692782, 364029208, -100048958], [296475772842, -940730377, -72563478, -252357802, 69799316], [88185752442, -683226498, 2048422954, -49608666, -108707178], [293342991606, 774776758, 1403246754, -1968710818, 91904144], [263129264024, -527389964, 1949021054, 581321261, -2235568], [-124366696432, 665790740, -1055951364, -131056980, -98799184], [-264500766365, 239484516, 1003729497, -2099269476, -40429037], [32233468049, -1897550063, 912547021, -1170504974, -75803629], [-664799711643, 709657276, -1430692523, 302214862, 27730188], [-114713829119, 504699746, 972754747, 2008930167, 108727498], [-421604022658, -1083459076, -413528172, 1216741200, -69877542], [-335451502044, 1132216634, 264139024, 1652837508, 210000930], [-323602887835, -922202614, -1146463743, -1131413655, 173640342], [-55357898320, -636764020, -222411194, 1226189432, 124673768], [-354607548045, -431185688, -1064106261, -1140349202, 32618205], [-14894309857, -438804550, 354032625, 486299243, 335925420], [-350858180119, 905094491, 508889013, 1081571042, 101719975], [-109520430375, 904531597, 286852491, -751464510, 34605211], [-457402184525, -476236548, 1241013403, 217915099, -177655294], [573671868296, 1798228968, -542321724, 246077068, -113407792], [178963716963, 455277855, -1348004025, 1531452756, 107644925], [498158290041, 2173738425, -616371555, -502882478, -43501387], [-755467655737, -731368078, 253471531, -243466710, 60757230], [-311383261518, 296750064, 143499768, -3498045614, -14356790], [-527267796754, -1304008599, 394906284, 1369517710, -266635920], [85064567524, 1660754410, 1019167084, 984210570, -11269140], [-533719146665, -1005665393, 679897149, -2853348554, -691471], [-244975062754, -1488975414, 682825128, -2971203229, -107383042], [-671248659803, -873618754, 944005077, 795325888, 227937980], [198372949676, 391340560, -306860674, -1544300360, 44452802], [-643862050236, -196665826, 141837620, -795736242, -55734830], [243560339128, -575308594, -2468339948, -2458579630, -55060422], [-207090036406, -1006899042, 1454815148, -1419239760, 164234420], [235324310754, 2109101127, 106963546, 1504412994, -64843835], [432411920348, 3241064957, -813828876, 1009030692, -96359740], [-191004903360, 214920552, 1099145026, 1152665907, -40033964], [-374149623344, 521216415, -2662372380, -97448330, 112169053], [-150130024274, 271904428, 726557030, -2847350836, -322913704], [671768089215, -1253119339, -1492948937, -546500054, -240689065], [46140413819, -197211157, 2447170985, 388303081, -135141201], [200724219750, -355998642, 2042226714, 2208912112, 11250734], [-990024180630, 1665819830, -337930762, 1554766224, 161550240], [300983701290, 1255612710, -2010765424, 2304631954, 237848682], [98549714663, 2650237101, 622591745, -796565067, 168295553], [-29680990080, -1124774586, 1734218444, -1836759938, 373558702], [-383633333010, -823069344, 1619886460, -559366460, -129278314], [529118239611, -69130767, 2910165231, 1067772658, -216098983], [-71901664942, 2459954605, 1880771160, 293118844, 50599882], [1010128616174, -763490320, 40096706, 786641474, -244153678], [-48512821032, -2932854982, -2231408380, -1963610198, 46527138], [-747518023330, 768469886, -214784848, -1011788542, -32689588], [320489582139, -303103042, -219358405, 3583785824, -193538972], [790317134212, -538200295, -637690456, 714874010, -474039473], [-441619216971, -938028973, 51549495, -222285349, -80753911], [39050262045, 941931981, -2686112583, -1664436646, -396952355], [955161083812, -657920752, 2366328230, -100657100, 261939694], [679181245329, 2378883455, -401799603, 2049012666, -223694113], [392100660119, 802558, -306684005, -1605393302, 156687286], [-533880280674, -1946096043, 1227147746, -738227126, -355012181], [1177859201555, -906466327, -1261367057, 1602117986, -225778909], [-169471971335, -412652597, 2890333111, 146512368, 236078913], [-316441733071, -820580316, -1523887633, 1314389247, 700640], [1053348945381, 24524825, 411698021, 574280898, -263796737], [79646847343, 50564931, 1428058793, -2612100733, -220970375], [295075271048, -1645597045, -2585981446, 754616958, 48139430], [-91585132069, -1504885764, 1111588873, -699895688, -235518069], [292774350315, 551414299, -508853789, 2963316974, 133440759], [-79319556279, 2097946766, -2235169579, 3261903109, 222592920], [-141147788019, -1677228533, 2112228495, 611028981, -63624963], [792227466292, 2198773730, -1160525642, 2353087124, 191825480], [605850148671, -1474503951, -1875501525, 2027910396, 88363203], [366091845813, -1189169970, 3050881409, 1916445114, -287189905], [265574553689, 3505869753, -1460057749, 1223748852, 4044263], [593216534610, 586491923, 2248883074, -1526528486, 141534053], [349528231108, -332195812, -1600494412, 4508370306, -183837444], [-110958160308, -3342406032, -134367154, -723664177, 296526852], [-627325166807, 2035688982, 436165051, 632494429, 269267104], [1179750113540, 798493604, 2468887612, -1974436656, 211060504], [238494229490, -555207959, 101221168, -3284539040, -57488218], [41057889986, -2775842584, 2921829880, -3527471980, 40084684], [-396647295525, -1495330695, -1609379017, 2579323852, -561484475], [-967027735861, 437059060, 1725556499, 1076169727, -302409306], [-56910670126, -418194212, -5024725000, 175306064, 120297764], [-296116105326, 1064089698, 2805667498, 1796250342, 178739370], [-1230607674327, 2061978992, -919267231, 1839841694, 442323143]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_276_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_276_8_a_a();".
// 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_276_8_a_a(:prec:=5)
    chi := MakeCharacter_276_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 8));
    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_276_8_a_a();".
// 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_276_8_a_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_276_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<5,R![-954494730000, 3570710000, 45210400, -170050, -252, 1]>],Snew);
    return Vf;
end function;