
// Make newform 76.8.a.b in Magma, downloaded from the LMFDB on 11 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_76_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_76_8_a_b();".
// 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_76_8_a_b();".
// 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 := [-6276171312, -280013424, 16275767, 135458, -8376, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [-394340616, -655626372, -3798869, 331031, 1337, -23], [11111121348, 548036696, -9662021, -357983, 2117, 51], [-33289998684, -2202338405, 41365824, 1628074, -12312, -269], [-76626597048, -4929275990, 101646951, 3641083, -30195, -617]];
    Rf_basisdens := [1, 1, 12622824, 2103804, 2103804, 4207608];
    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_76_a();"
function MakeCharacter_76_a()
    N := 76;
    order := 1;
    char_gens := [39, 21];
    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_76_a_Hecke(Kf)
    return MakeCharacter_76_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 := 8;
    raw_aps := [[0, 0, 0, 0, 0, 0], [7, -1, 0, 0, 0, 0], [47, -1, -1, 0, 0, 0], [-262, 5, -1, 0, -1, 0], [1346, -52, 1, 3, 2, 2], [221, -52, 12, 2, -1, 6], [3647, -46, 16, 12, -7, -19], [6859, 0, 0, 0, 0, 0], [16649, 494, -38, 12, -1, 26], [-10315, 1379, 143, -165, -90, 171], [66842, 1281, -133, -65, 15, 99], [135038, -1059, 385, 95, -15, 105], [93658, -2693, 609, -327, -193, 53], [203132, 96, 95, -59, 36, 528], [320025, -333, -985, -114, -124, -982], [84255, 2955, 127, 1089, -464, 337], [213157, 11722, -141, 651, 209, -697], [92723, 4843, -3229, 1058, 532, 492], [-13057, 20179, 142, 1758, 340, -2616], [-242236, 9992, 3444, 246, 1684, 838], [-1864249, 15252, 382, -16, -1089, 987], [-1068724, 15445, -5115, 25, -695, -1395], [-517244, -45434, 9308, -42, 2686, 5164], [-2421858, 17253, 2831, 9039, -1759, -1783], [-3557830, -25110, 168, -9084, 2514, 4998], [-391920, -9204, 5722, -2676, 7846, -4886], [3508052, 23008, -7814, 12984, 1240, -6648], [3452275, -56366, 22301, -2571, 1315, -8783], [-1697731, 159159, 7503, 9669, 7026, 13101], [-83964, 154575, 35399, -33, 8561, -3949], [5443562, -19769, -8721, -22991, -12887, 5757], [15144364, -158774, 35827, 3825, 630, 24114], [257407, 367168, -55118, -234, -8697, 17463], [10623662, 83446, 64787, 5375, -9020, -2016], [-1848009, -330273, -14621, -28488, -7772, -8102], [8422400, 352018, 115836, -21326, 14806, 402], [26168, -263214, -64234, 30532, 9288, -43734], [-9243418, 578168, 4648, -42242, -18274, 24084], [9269616, 481587, 55599, 35013, -14013, 26889], [-31771448, -82748, -33296, -618, -50214, 77796], [8663010, 115743, -63919, -34671, -7459, 5207], [-17123752, -409480, 23640, -50350, 76190, -66480], [36099056, 1326293, -44399, 51336, 69629, -43258], [-31305436, -972037, 26707, -33641, 71321, -32223], [-41943996, -599028, 216758, -33882, -40834, 9014], [-9904096, -583251, -82407, -81240, 67725, 42486], [-31643719, -2490758, -99861, -91613, -86267, -5637], [-8726878, -312309, -312727, 109867, -21375, -56409], [39038249, -318718, -34407, -128247, 34861, 87259], [-33206761, 3664053, -49709, -93238, 13938, 10122], [13892792, 378284, 179615, -106605, -145350, 154020], [151154180, 2270501, -44563, 181176, 221049, -194226], [20357930, -2405353, 169109, 43173, -50773, 268533], [40733612, 2596490, 306365, -170271, -80874, 20040], [217654556, 3094898, -36616, 145476, 83700, 87318], [66191833, -3363995, 709117, -30024, -22602, 308988], [159565900, 1877287, -145621, 24219, 121081, -265007], [102931823, -3677178, -123996, 188808, 93957, -408252], [2786723, 1396261, 80787, -131216, 200146, -77658], [284385008, -3322636, -245762, 78258, -98578, -77434], [-4968484, -7847708, 154995, -134165, -31940, 232260], [199695339, -2906142, 235702, 121764, -19349, 533152], [-199659214, -3691939, -1000959, 123509, 276395, -320703], [129190256, -6587863, -613541, -433506, -84919, -173362], [-222992383, -1208272, 1149693, -412837, -441859, -65901], [170017453, -4273082, 145882, 126390, -91983, -164610], [-124089103, -7096753, 761004, -55156, 491966, -532062], [-109435324, -513740, 703850, 91154, 549334, -598608], [-75541388, 3276430, 151197, -677643, 196034, 130616], [47789795, 4025595, -1001855, -49780, 375900, -102780], [344437209, -5715504, -942303, -225477, 195525, -838101], [247913324, 2694509, -626977, 194508, -148023, -990384], [-310886368, 2026588, -258496, 500180, -345716, 717240], [-641270773, -2323530, -128730, 683568, -481137, 60504], [-135559951, 804076, 173477, -187723, 780103, -72771], [-374011492, -4452265, 535101, 293889, -614585, 305317], [153754807, 7582555, -1391095, -133344, -146876, -206450], [33879551, -4576467, -709333, -835208, 562374, 455346], [975910666, -3638489, 2559127, -837789, 426339, 199869], [787356134, 4820651, 1892097, 554753, -458473, -535341], [1467873398, 5151356, 1025012, -267942, -62718, 279504], [-963795721, 10633495, 4215, 192973, 342412, 1450845], [1172156838, 7730130, -585350, 429174, 326776, 504850], [238741736, 26399109, -723733, -693665, -636273, 795855], [781262216, 6494107, -3880941, -508655, -107045, -1686867], [1133073752, 9309254, 1772699, -683997, -989358, 441834], [273816526, 13345318, -190694, -1708350, 1508670, -473388], [1241801435, -12004318, -2247422, -792728, -911575, -630399], [292246101, 17612571, -4598763, 48120, -28530, -765696], [622641737, 5580899, 1688823, -4894, -1004956, 1031478], [-591260278, -21198172, -893367, -1619817, -437354, 1825804], [483826032, -25430004, -2084268, 1253328, -1605828, 1446624], [-1576219420, -918036, 3606270, 2794272, 683652, -256344], [-72555622, 5247368, 3325106, 1095300, 2034990, -3170358], [81137534, 7837992, -3999141, -1188945, -1717290, 2259918], [-973399891, 3138548, -279560, -2469990, -1241695, 4431380], [-1581471498, 10419618, 7550926, -82410, -406250, 34492], [-299428834, 16512701, -3689783, 1211553, -1751923, 1312739], [1458544235, -17932672, 2721047, 611583, -358015, 63819], [-1431224095, 2748725, -1984835, 2237422, 2101568, -1899870], [-405299536, 58825984, -3128056, 1140716, 977020, -1217952], [-430202043, -11488209, 308855, 2941926, 1897766, 337178], [-2635802518, 3280745, 8159903, -433761, 1397367, 1680117], [456920648, -81474748, 2471324, 1885212, 378318, 1876038], [2382472250, 2199350, 13920940, -1549502, -2426068, 3796740], [1818000551, -17748842, -831702, -4029686, 334357, -2324403], [910222856, -15796690, 2374645, -5366661, 980954, -47668], [-750929652, -34370064, -4836982, -1654224, -4776166, -1448122], [3563638814, -17615191, 5923593, 1946925, -2187065, 3304741], [-890012968, -23705196, -4786432, 617128, 873762, -3837024], [-2728908382, -2367692, 4587164, -4969396, -3938882, 525012], [1597975367, -41052711, 1605225, -4920720, 599250, -2515140], [-1979456922, -4178832, 5780583, -67863, -269820, 1868226], [811152764, -129452800, 6050720, 2550402, -496972, -1617540], [3013814381, -20220151, 571123, 2740294, 4048526, -4495944], [-2220117398, 74802946, -17029458, 1983954, 1718366, -2543056], [-1221529612, 44189788, 3732465, 2446681, 711016, -9414162], [4006669790, -34396345, 2308865, 42990, -432555, -197850], [881744969, 98898557, 8398073, 1639008, -757464, 4302624], [4262963511, -35072694, -5058163, 48981, 1422719, -1757011], [532783187, -59606348, 6465684, -6384146, -1029299, -4558302], [3833129384, 181972260, -1357614, -2578902, -2850306, 3529074], [-9896414321, -39056639, -10273835, 3173589, 2813334, -4204983], [2115457000, -49077722, 1119250, 6754674, 11340114, -3558558], [1871936276, 22502704, 4458303, 5387047, -5155052, 13260726], [-1322586526, 96991268, -9470564, -3071766, -504604, -8879848], [6873680312, -104607102, 125046, -497208, -2200752, 7055982], [-6209344430, -51283607, -6775869, 618996, 3253859, 696932], [13701662, -5142423, 1595913, 7055430, 8452623, -2766180], [-3990728806, 118321720, -11499930, -91784, 2866996, -1423902], [2356554260, -57294072, 1441681, 1832351, -3830736, 5868162], [-3310083426, 135902613, 6346803, 1238451, -4140441, -4412097], [5033547320, -29054658, -16282226, -493342, -2287458, 9268038], [-9244059295, -167278541, -16451395, -2085238, -568358, -646914], [3902738561, 117274430, 4762530, -10271796, -4760009, -27485], [6264481283, -66741094, 20069982, -1177576, 5715161, -4454031], [7068281, -156041026, -841138, 8083410, 1265997, 4595790], [-4259800075, -95771680, 1270487, -1056201, 372791, -10146663], [-11279324981, 68982127, 4518287, -6243519, 8749888, 3119833], [-2471826217, 205406768, -8338144, 14339406, -1338021, -16402893], [-212876389, -13511684, 41385777, -6618563, -9483587, 2203179], [-3362975577, 94030257, -8984181, 11484012, -6775062, -2154822], [9700576778, 282315799, 1345071, 7721086, 8578297, -1541472], [5627592343, 60888937, -19872164, -3279780, 9385626, -3244530], [-4388343481, -116121450, -34409370, -2761584, -5868501, 5360700], [-6693142118, -32494772, 6564106, -5212740, 6404490, 5649972], [10990813928, -69122276, -29523638, -10267452, -5890490, -914346], [-7217327396, -178072766, 6329140, -5801652, -18910872, 11628024], [7573815056, 244206420, -24188945, 2213567, 11217408, -16035900], [7537980718, -74639171, -7328827, -1720005, -11528597, -16736165], [-8845848427, 29661770, -10556918, 3123046, 5543213, 2569698], [3520798024, 117909178, 28075411, -13911597, -5005608, 13243842], [-6657730468, 51046886, 13868283, -17044573, -12505630, 34412436], [-7112693996, 26375230, -222890, 2402496, -16100934, 17482908], [-16138109119, -121561601, 17250324, 7369744, -3249122, -2054058], [880348002, 255410586, 6984912, -890970, -9251760, -1388286], [19520999423, -71735936, -44388072, -3369626, -8352089, -18093804], [11130078221, -160547668, 1600049, 14787135, 13769325, 9478743], [-5949509083, -15995110, 68189446, -8627930, -20560309, -6353085], [9431509875, 94390368, -17294344, 11460540, 28312865, -19117468], [-6268962672, 115732956, -27973726, -5725422, 7417412, -20718346], [-6029774628, 96282477, -54054063, 26595393, 9753555, -23548221], [-2751233554, -139611830, -36090668, 1115418, 2426920, -4313916], [1605837004, 193697008, -60932144, -8337480, -13473720, 23233872], [-16479281302, 246780479, -25995367, 9332385, 5086743, 11620575], [-7347344950, -340450108, -50842348, -17100, -19882458, -2817120], [-17940562372, -186995155, 78037895, 8684901, -10706251, 15604005], [-11585039281, -174504903, -53414241, 24188640, 12675954, -22469610], [1443975074, 54362425, 27446835, 23139871, -19702871, -9945915], [6118138675, -481661177, 462709, 16710222, 11199156, -21140844], [12243997857, 24315165, 53734860, -7228428, 25761708, -213480], [-921913813, 7469623, 8141451, 2637577, 23358208, -24893583], [2528175080, -157484764, 51042512, -14335848, -23043252, 45534264], [-12136059205, 125717562, 4096585, 24519311, -13259379, 15310023], [-6693494248, 138730552, 46283124, -9425300, -16096880, 35268648], [-6182475516, -239893974, -56672283, -264795, -36412740, 31513554], [1660315982, 77060784, 38209028, -29106506, 3074166, -2632704], [-18375934311, -244687593, 66987349, 25612674, -24414134, 29732428], [12171958736, -327645412, -59238990, 37397978, 1455128, -1333746], [-3264198559, 255641817, -56210831, -12568252, -24514368, -1468422], [-4237421806, 219782899, -29648439, 42199960, 3917461, 25747380], [26284721363, -117523354, -47047673, 14969115, -6628465, -34762951], [123127916, -395459210, 54897246, -27285104, -8213048, 66102738], [-13634410756, -364998634, -37849374, -13504674, 19598632, -17179682], [22927475456, -370745461, -14054469, 1314318, -28931621, -10283276], [14101048867, 343122019, 43337563, 396858, 34203792, 2513706], [-4908106399, 32896902, -78628014, -9036498, 7245333, 22585566], [-15762588640, 642376752, 6160990, -48348574, 12058236, -3552672], [10955930792, 680005717, 48475509, 19606405, -5937125, 2615373], [11980312903, 38242846, 301352, -18135468, -42333947, 13457044], [6906581384, 317219345, 29446215, -5800249, 20748251, -54323577], [17353952872, 191830150, 73763371, 5618925, -43408974, 16286280], [21706709042, 411999075, -80025845, 33479, -25307199, -42322905], [21526684771, -17289851, 54721573, 14853429, 720126, -3584799], [-8699174154, 330940530, 72036138, -12939060, -27776712, 29672490], [-20526108032, 64538446, -70816100, -26194740, -44933220, 21521190], [6823060043, -966612218, 40054584, 13257274, -217979, 15238233], [22206165974, -102903176, 134831196, -8392130, -37376444, 16998300], [-26281305209, -802410068, 3075935, -40767375, -15035045, 18561025], [19480567422, -54659163, -52245561, 13624422, 19703091, 1513386], [9814674002, 483485648, -16978264, -18608520, 8261040, 38675802], [-12692756176, 254289001, -26330733, -46308071, -1890779, 34400889], [3743865443, -437708227, 54203913, 10457147, 39569870, 6436431], [-4126538110, 709414949, 140760863, -11324769, 29270249, -15173769], [49912200832, -330914576, 29505898, 39896076, 58063044, -94244694], [9641284747, -1037252165, 145628047, -7759368, 17504964, -74534994], [-35854722256, 698107329, 51240723, -6189966, -9928599, -50298294], [13219965073, -66938906, -52989323, 19823373, 6489825, 70649019], [13979149965, -198170328, 82524864, -92894640, 35017065, 31753173], [-26401277935, 163728650, -114021305, -30138737, -43966243, 27267015], [-7597606675, 945602, 27353851, -62471927, 15686339, -3862731], [26290927914, 494633700, -90863990, 7077948, -31645448, -26592410], [-25394109805, -603328331, 135514405, 21986622, 2127352, -53455674], [-9494951073, 1090232310, 101274007, -2915133, 25305979, -39678059], [3035206976, 54066593, -165145649, 57321849, 50083541, -36083083], [-84846680212, 137492881, 29733247, -42096585, -29626505, -31969761], [-24118084033, 1193097786, 29728548, 46488732, -26411895, -73136124], [1669902574, 16523908, -18807584, -30253284, 52365324, -14592738], [50592699444, -590754411, -64653727, -17976831, 16019297, -18452203], [-7755141363, 136461663, -5753117, -120057732, -76419794, -6809096], [54249126884, 1070856132, 170429604, 25320990, 73806270, -28041792], [35594047754, 674022565, 67460355, 84455509, -106320869, -21860415], [66229230236, 1368100457, 64201789, 20746197, -35971357, 2844773], [35842962218, -678638629, -130201769, 12915292, -7696987, -27712194], [2905626059, -634323520, -182386749, 3225123, 5433649, -45430601], [73845031019, -485651379, 47917227, 60599214, -4007934, 42369504], [-55339242658, 359483726, 227590382, -4325010, -52298958, -24918450], [72431823516, -334437621, -148363667, -58719843, -3766397, 92086561], [-1485143032, 2078988326, -59542062, -5487064, -34674226, -68641452], [38891481526, -493830668, 211581559, -14211771, -40882374, -18262692], [81662144951, -634186223, -168283339, -48688708, -1604162, 24704826], [6238203587, -297273741, 1956118, 7469786, 102635424, 6279336], [30646500110, -1433192595, 138991245, 36296097, 35903523, -9159255], [-20745928806, 992882286, -278434458, -34832622, 8616342, -185896746], [-42911933254, 985249880, -204306195, -34046221, 79542794, 19472532], [-5582781948, 1837191033, -125572933, 92804556, 4591733, -26797192], [-71485864312, -564922626, -40925097, -33212385, -41719980, 74793786], [65961698659, 2034870853, 59512459, -73783572, -32430978, 71833584], [27238554256, -1390003106, -4101732, -77401350, -18389590, -8278264], [30559530070, -773334053, 19266099, 70507263, 31364177, -70779337], [20208098980, 1217870002, -46083492, -77630628, -73223470, 34549406], [66872886716, -209616512, 92331591, -69154901, 72005116, 22677822], [-33604444393, 190326014, -454514710, 33312780, 9912965, -166333110], [35447630567, -972886430, 148304710, 84536994, 27754351, -194259870], [62628621570, -921684609, -261460867, -83991591, -55763173, -72332743], [-116593080307, -119936491, -53783667, -50894376, 55832626, -88602104], [41240729393, -915089523, 72150873, -12304596, -71021778, 117537372], [-62185747778, -866757569, -121838873, -9574725, 18047625, 75040059], [-46058989108, -55403456, -207048652, 114147716, -44627576, -51738144], [-52448596668, -242700711, 54094227, -87843906, -56562459, 72887982], [-34917156484, -190169762, -76474404, 19339810, -4126724, -107160480], [-75914707811, -1377457724, 126707122, -11872080, 144223425, 103788189], [37351301631, -37113426, -107652204, 120183708, 45192069, -57625776], [-102391558180, -2431634987, 96588801, -108451727, -148980293, 108311427], [-145375419651, -362357883, 200714605, 68977272, 53904952, -57446114], [15542388584, -1413526348, -199589746, 15193560, 70350360, -27704922], [-48124631311, -89617025, -21685985, -20682792, 105642502, -265163610], [77372151554, -605201023, 252685507, -103918109, -22538257, 78578973], [47005549590, 1761602709, 29612805, -77902113, 17365977, 43855041], [41391668744, 1698133544, -478831562, -32968316, 5701142, 77533182], [-65325563128, 701095621, 200240739, 36951709, 45999313, 107390517], [45690755928, 2885959518, 52487376, 140341548, -40794486, 44693994], [14058224495, -1301017919, -49905233, -83099796, 3661966, -152270556], [17401137839, 580975574, 110506802, -79672998, -24292501, 57715266], [-158075164532, 386041408, -67658733, 156440235, 57113162, -92166940], [-156161280913, 1313607725, -427360880, 37291264, -55352074, -7091490], [-104217993783, 60730707, 122358259, -148334547, 136196842, 11105893], [58057952465, 1593415388, -266566354, 84752088, 163264077, -165650763], [-42896950381, 225071028, 564776999, -83323337, -39571443, 32072199], [-2536145793, 1629662427, -230334807, -164635800, 214711188, -185225430], [-51146616193, 75339943, 183371051, -206639251, -54014804, 3370497], [154785407873, 3480451889, 127580604, 115690172, 107578976, -85716504], [-17623220737, 1139954680, 129069894, 14410720, 73676419, -40666365], [106113593480, 1162574167, -313925691, -117780422, -148488113, -544722], [15315448652, -236852317, 414913753, 29285053, 76595381, -128255841], [75193149527, -3129787870, 43155754, -46683944, 2448425, -7686822], [86153835980, 710307404, -310060913, -36317589, 15638708, -8793352], [23017416455, -1348084279, 338345497, 50244031, 84187214, 78746979], [115516262264, 1146589598, -180485774, 43439182, -105110212, -227328618], [-71003319930, 885419988, -213160159, 26502909, -111248614, -148980838], [-11781660528, 1654786158, 93474522, -44840904, -149063442, 427526928], [-20934666859, -1592805828, -133215816, -210824250, -36980775, 249114828], [-37742106020, -1363392365, 460524721, -54379428, 21583983, 456426096], [-25155378553, 1764199468, -397145024, -84474516, 51780481, -363323628], [60310216064, 1795493302, -150657555, 86824807, 42257302, 194473686], [156749443379, -1392959983, 120453929, 44049990, 8745660, 362979558], [109477828577, 1695494232, 570633102, -78050262, -1820955, 213815049], [7183048358, 3554404418, 35499918, 357842802, 112601470, -124114784], [-127812593140, -2560996483, 460776779, 71854104, 23262161, -9077052], [-14580332986, -652020148, 125543664, -12157932, -35914508, 137956858], [-36677040548, 139996180, -531476060, 32223258, 262976982, -190991640], [-29580492906, 2973606768, 40675951, -244732713, -52875902, -54778304], [24773212682, 806198624, 317453304, 8609268, -5530388, 382248274], [87555456352, 5173692220, -322358270, -157398222, -295397208, -65200020], [27688077224, -1068688748, -194149296, 202509010, -68843846, -164189520], [-94225677828, -1028862600, -117148860, 243553536, 53809134, -325050840], [-55703754598, 1627647184, -350620692, 93101548, 91908922, -325696524], [15490160341, -1700409179, -331941937, 125195808, 30364936, -86844296], [-102432170919, 5463149337, -223686646, 232998906, 123154544, 190261028], [-39516643624, 732367116, 252028335, 13992567, 292472772, -173718774], [66948979238, -3187103438, -562981155, 239754223, -2216402, -136332456], [61196647053, 3137816610, 129256414, -422418270, -54959171, 105514930], [-249221493772, -3946717413, -6245101, -168765050, -298150785, 172234188], [-115526590393, 848355305, -535739936, -2664804, 263040170, -343453402], [94678533110, 46191704, 839002733, 49171593, -31923118, 165825156], [219298563812, -1869332259, -403368773, -105472885, -25514553, -190382715], [-57874121139, 5597316420, 496860047, -12589737, 77202515, 266025929], [-72886057093, 470050993, 319204661, -185816671, 368042386, 120598737], [97960144877, -3002493241, 299143793, 181526136, 29747124, -344378394], [11020791140, 569593324, 390678336, -368204636, -270850670, 86284452], [-114454475455, -3355509115, 128531499, -175876062, 459055702, 117564664], [-232758151934, 3104522728, -157983814, 229023054, -90777704, 112708282], [41916067114, -3912454466, -181403492, -254056716, -186139314, -38593254], [-73347815230, -2552934149, 501188337, 34744117, 231121609, 483480351], [-19008067136, 953020882, 17052058, -32498802, -102973614, -45020646], [-117410733106, 125429623, -36069669, 268490011, 28410679, -157955883], [-40983936850, -841782502, 67177611, -107311503, 437079208, -69559058], [7466709220, 1603873381, 358896427, 59852799, 202850181, -273357081], [143288683157, -2811345028, 184857590, -206530716, -185416351, 88524237], [286666877666, -1857006232, 416443971, 94573485, 162512560, 127054642], [-380690626831, 1996675351, -296376358, 324682202, -75558842, -130011066], [365079822503, -894260324, 395540466, 74615062, 38215483, 33147891], [79871084307, 661728108, 223736736, -194372640, 325592325, 42839832], [130730323916, 4249119147, -415546843, -9495911, -211520949, -153325863], [114488479723, 245624122, -587032791, -389211129, -128029195, 286056203], [29671368740, -7430093995, -171241645, 173767119, -123081049, 286369725], [10990067837, 6107887438, -233818479, -18098123, -274595027, -155215653], [-96316600975, -2647007333, 266443614, 15311794, -98838782, 79426062], [315867316304, -3445671913, -13450309, 146395149, 314993535, -134631183], [271917999827, -1416162295, 23290301, 290644470, -138354054, -367648920], [-57020854969, -1748677819, 471101057, 424515582, -131558482, 239660334], [188669408369, -3369620998, 105453094, 260734590, 84716489, -159659410], [-271265527513, 2178765962, 685366044, 228429452, -90484207, 104691468], [-121745906784, -6638935758, 479823855, -135955845, -365272830, 475603140], [-154160059732, -6146264596, -324641637, -519747109, -282225196, -131874804], [570149860624, 1917583750, 512020051, -246627867, -216515706, 354502734], [-13951966927, -409647713, 245360479, -186236979, -584495546, -198270327], [-248856166030, -6081270169, 921868003, 131609499, 39268127, -102370693], [467084530349, -4199599920, -397500310, 374280604, -40845579, 121218285], [521973697139, 5032138024, 413064732, 240551242, 30520219, -190290684], [-85280555311, 5080383745, -654719775, -241240229, 181075456, -482698977], [436959556445, -1999920436, -1007713320, -198932778, -90642863, 90361501], [-284895991823, -1890847067, 656585761, -570180051, -573020724, 124775637], [-129485226316, -714082597, 1360244511, 83599775, 298222895, 379596807], [112929482047, 1416527182, -245546638, -470916762, -88455725, 279706894], [-98383745776, 5758304282, -1178532466, 89880534, 408965886, 356756778], [-19853569924, -2960008736, 973654308, -63381134, -235730726, 959113116], [464115979721, -3125758545, 1039289718, -128846610, -243667842, 240415230], [212957525214, 1090385904, -912089022, 122968410, 367223490, -439017114], [384972344179, -3375100025, -65417121, -103901976, -116061952, 231279842], [-274219579858, 8697385293, -217422749, -164545069, -447206361, -531315123], [225547831478, 7551528904, -455800584, -380957864, -139223648, 505806198], [-42298449199, -486167659, 630207617, 149346276, -11282676, -532176666], [-222276817594, -2194779538, 1440017304, 174021698, 423432272, 36572574], [-160276918228, -10047119537, 493227351, -107097257, 412484977, 162070557], [151437047136, -3921919842, -528467814, 285129510, 346118496, -949534140], [-95367559799, 1937889310, -374131850, -169967388, 57299223, 436356030], [403191554362, -2047169306, -985336022, 117597828, -145764168, 312823086], [418727827601, 3110025134, -794685566, -327182496, -108510457, 302867867], [164289041198, 2598099761, 1334415119, -457254207, -4362693, 441068349], [-92259606139, -4259586863, 1144817343, -18021494, 9320404, -518550222], [81457483932, -15371347266, 203958528, 206706150, -382671960, 114876096], [298470202346, 665785763, -1090739047, -51710421, -8983983, -646113], [-41541034301, 2078552107, -1296672646, 42333090, -560107400, -346498712], [-313446388342, -8181523710, 1353851895, 189850737, -225834828, 227470326], [-522931969162, 4089030257, -788562165, 477967223, -24444127, 150465159], [159372006952, -2138905658, 149059090, 722254524, 12749004, 481068282], [-646348161076, 3596681478, -1644096546, 166035348, -420187998, -6897036], [200606699276, -12970177327, -224791899, -599911531, -23620249, 861784407], [-159483059022, -2625011340, -1293783760, 49868904, 489032186, -366017920], [676256814869, -1098797771, -632086732, 635846756, 171404704, -985367604], [-54551991778, -2895883051, -350215991, -400279182, -437797093, 376874864], [-452572769371, 3910552469, 28420813, -50862651, -134209864, 7299581], [-63575371501, 659160437, -50486751, 932253770, -171396520, -406273482], [16961221907, 9542497823, 36718215, 267684272, -57544048, -113228334], [-563749053489, 2542834176, 743748977, 107743329, 57897941, -81578641], [850676270076, 6179518542, -839444746, -124691994, -420392806, 398948318], [-76182290134, 4235755392, -333099723, -219204741, -867593304, 216723522], [242220363217, 6688216840, 1727257230, -502564194, 118677749, 285210365], [-591996359248, 2277310246, -1843924322, 91186302, -263757320, -36511464], [-228357879596, 6396115750, -1883409470, -57735924, 334206744, -36725430], [327297663998, 5081898140, 821067469, 436343355, 583308584, 7702850], [738892907426, 1849437863, -2035337127, -626383036, -125267983, -451164468], [38810494828, 4758582850, 266490917, 173578221, 706920388, -262368062], [292796760467, 4996525779, 623133468, -637802868, 143768568, 106725336], [-363297350634, 3165824712, -468895326, 928272738, 304983882, -501817866], [-84154986493, 600825840, 1182139200, -634384206, 152508051, 163334280], [54367122326, 8503840514, 127539684, -524344606, 108099698, 223582152], [-132257715808, 7318163302, 1147807695, -1292992481, 113213914, 397856322], [-43731918908, -706045673, 817551475, -272627631, -165206541, -460630563], [-392480632270, 2457480762, -2600428576, 8843440, 177333150, 248636028], [23486791325, -5144986276, 153035672, -920099304, -376294257, 792005448], [740311956252, 10599710838, -590174574, 338286732, 78356778, 494457642], [-709577436328, 2182988756, 990455455, 508664251, 205520156, 372329838], [-237048956442, -8548444116, 513601908, 305631942, -305895102, 483425106], [-24984532054, 4526234518, -1957014264, 561552640, 50435746, 67327980], [388051504568, -11974885675, 1989629755, -694394993, -192353407, 248235915], [-768277102386, -8758797825, -391021645, -293744937, -532695013, -125628625], [214008393206, -3743561965, -3344357675, 3750805, 281040965, -375425385], [496681082490, -8308650168, -708936936, -313441878, -331285992, -101844312], [398211169244, -6271510207, -2250086699, -308955971, -457526869, 443957247], [211182299252, 944756534, 183491793, -243788499, -8076656, 384712378], [266374590326, -129425204, 1236775200, 173956732, -844576598, 830111376], [-581410954808, 11469111784, 571953806, -82968558, 65268298, 1053462466], [77336138308, -11342331833, -958471581, 580782303, -384549823, -432027247], [642737810420, -10568017967, 744605591, -425499082, 523127077, -116187198], [158466242939, 10792558511, 801233607, 928935458, 364829660, -1403796846], [-145216965942, -1216573497, 561227361, 560830341, 96087459, -1176935643], [208975357673, 6745011675, 99839742, -1553597094, -831134742, 885051618], [114076465218, 31660956, 462146807, -1055205117, 235430702, 750252074], [276723331994, -12077477459, 87207803, 418890515, 424749133, -660354135], [-9304246745, 12600397459, -1344259845, -7798818, 617576072, -172321624], [-320991342355, 2496787808, -837005143, 671772633, 582192495, 489398709], [107830976882, 1729762006, -708959593, -363362251, 699987736, -635458806], [-902129954857, 5205284780, 965230563, -626252437, -135466009, -119199051], [-63316025738, 6831785416, 2263019142, 559568832, 750632888, -490047706], [634889907646, -11968942310, 1658447200, 121775700, 480393900, 243674940], [-600944748982, 17457683625, -1853944281, 916880835, 280390839, -305822265], [177416784553, 5829089908, -736370215, -581197359, -664837739, -505995257], [-417078400038, 13232638950, -1539335006, 868837536, 486887680, -782388992], [97261014000, 1368471765, -120849195, 556790157, -852940797, -275836605], [214416762347, 1411206977, -2675495935, -57909591, -101160766, 541940817], [-524143830316, 6487074995, 1185517147, -184947780, -665889793, 51547490], [-690466469783, 4580142103, -965302134, -536165742, -550110418, -529640878], [346284808958, 2706823428, 3070250038, -249157858, 129344880, 1517972856], [-376262861389, -3642433534, -1872619774, 108725604, 1468447395, -78577728], [-430930043785, 556803491, -47947576, -1671069084, 268719060, -706383312], [126064401625, 2230057678, -96160564, 776627250, -772144865, -362005433], [1087533196586, 13359447364, 1440315843, 542837179, -401686094, -122345604], [-609876219224, -7124183309, 1480688977, -194698224, -19088901, 519239844]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_76_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_76_8_a_b();".
// 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_76_8_a_b(:prec:=6)
    chi := MakeCharacter_76_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_76_8_a_b();".
// 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_76_8_a_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_76_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<3,R![-7412317344, 43655400, 16686996, 93190, -7711, -40, 1]>],Snew);
    return Vf;
end function;