
// Make newform 384.8.a.n in Magma, downloaded from the LMFDB on 23 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_384_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_384_8_a_n();".
// 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_384_8_a_n();".
// 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 := [12138, -2448, -430, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [-116144, 36928, 1360, -96], [-173740, 52816, 2516, -200], [-13692, 1808, 132, -8]];
    Rf_basisdens := [1, 119, 119, 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_384_a();"
function MakeCharacter_384_a()
    N := 384;
    order := 1;
    char_gens := [127, 133, 257];
    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_384_a_Hecke(Kf)
    return MakeCharacter_384_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], [-27, 0, 0, 0], [-48, 0, -1, 0], [170, 0, 0, 1], [1124, -1, -2, -8], [3210, -6, -1, 1], [-3738, 13, 32, -30], [5376, -7, -56, -14], [13748, -8, -180, 110], [-60596, 70, -357, 90], [37858, -2, -276, -59], [-28322, -98, -317, 287], [-59794, 99, 1372, -278], [-373832, 191, -1148, 458], [193092, -124, -1272, -1146], [-597444, 138, 471, -206], [-35308, -784, 1292, -1876], [-307826, -454, -2337, -1833], [110348, 616, 1452, 1996], [376876, 1268, -68, -3570], [-379210, 2, 4382, -3554], [2385234, 2088, 12964, -67], [1146900, 751, 11242, 2508], [40594, -330, -5160, 8860], [681690, 2730, -17900, 7600], [1950124, -3372, -6721, -3946], [1192526, -602, 3064, 3555], [-675012, 2218, 23084, 2752], [-3750190, 2630, -2505, 8461], [5828978, 1570, -18932, -4856], [15399062, -1290, 1508, 3919], [23935620, 7128, 55752, -16056], [18247542, 4065, -48716, 28614], [8542612, 14252, -43572, 10124], [-27381056, 14856, -98065, 18168], [-7221422, 2478, -29112, -53075], [-8563714, -22002, 66727, -27637], [45661936, 1463, -55044, 43226], [50397296, -24264, -13972, -6668], [-45236320, -10434, 62731, 94228], [65268060, -20072, -10988, 28212], [-22738094, -12914, -73693, -32983], [50720472, 49312, 96984, -40464], [82507534, 12558, -7062, -1206], [10489956, -34986, 44143, 140358], [51437094, 27806, -175352, 86775], [12244380, 40808, -320348, -48884], [74755366, 32692, 277524, -161305], [69389636, -53195, 402926, 14404], [-10153334, 16990, 12355, -188579], [-16350694, 14714, 446004, 124728], [157999472, -104308, -204576, 74996], [178538270, 21724, -359298, -87070], [-7953548, 133495, -414306, 150456], [79749170, 121768, 369056, -45960], [132550232, 79260, 162100, -106276], [-137407636, -150936, -549565, -221050], [-133176890, 134764, 136652, -151337], [143699234, 25678, 215963, -84927], [-124594462, -13268, 1079876, -116964], [199897852, 172400, 1064464, -29112], [289594348, 17358, 527343, -111694], [-16409316, -20024, -1597508, 80732], [-66266304, 166780, 476268, 97240], [-81546842, -5906, -196814, -360878], [-299443916, 159560, -165341, 631170], [172236556, 298954, 247556, -645536], [279815758, 386386, 56014, 132174], [-1728900, -253409, 1928794, -264180], [2459102, -91530, 2100359, 50759], [-56119342, 568954, -1331476, 30928], [-75397732, -349176, 432972, -629322], [-655798558, -110262, 1063844, -1049827], [849338030, 308374, -40869, -362277], [203312744, -463647, -56176, 553538], [207583352, -393540, -926504, -1172864], [798578256, 608850, -1849889, -1421100], [490222406, -150238, 906543, -1462377], [507537534, -889345, 736496, -1514186], [-1217368846, 539574, -1063780, 1041696], [-427279996, -258447, 387030, 414932], [2382157250, 146186, -1246013, 464817], [442797372, -314688, -2728184, 2392722], [501515122, 457200, 2785868, 1511012], [-553637250, -780518, 1702480, -2607085], [-1765576788, -236449, 2267666, 1838788], [-677380330, 211569, 180432, 1380434], [-683792302, 26562, 6687604, -2947344], [-909704304, 594482, -2948157, 924964], [-785468450, -772186, -4348420, 1270931], [-617876588, -869175, -2045658, 2629764], [923094452, 1426584, 2076760, 620978], [-1271420934, -1119528, 2657728, 1722177], [-2148907548, -11962, 2574496, -1159892], [831898932, 1026800, 5857600, 1190088], [-33086004, -221416, 4085572, -1218410], [-1771228556, -591550, 894611, -4928706], [-748753418, -784789, -342552, -3921794], [2632995704, -288879, 3454248, 1090546], [882492394, 330714, -839529, -1821227], [3413813944, -1246927, 461900, 1150070], [-419370760, -155984, 2067523, -2481604], [77850348, 1163739, 3493590, -3519048], [-587045010, 1576571, 11209828, -6584302], [3636988292, 269902, 1958752, 2636340], [2668700662, 945630, -12785174, -1837222], [451228996, -2657926, -2481288, -264276], [1137281106, -398030, -1519796, -91240], [816708364, 272476, -3881652, -647006], [3024121150, 1513050, -1170382, 971626], [-2174926586, -344678, 487748, 4529423], [1201801534, 3474802, -8412125, -1921773], [1500574050, -414080, 902780, 8855812], [6416100076, 1150596, -3828576, 862472], [2043642506, -1404328, -6268904, 6187441], [3459786750, -3305479, 10914356, -4302874], [2194440152, -607883, -17885524, 9127222], [1918316580, 3682740, -1816332, -4603762], [-3550976744, 271566, 11074451, -4427696], [2460170204, 2274674, 12834960, 5211620], [-2922199978, -2086874, -12759309, -1639689], [3505579458, 2168132, 6185988, 2278804], [-2117702280, -4945020, -13112233, 5440028], [-1801604724, -210143, 8217862, -13924172], [4295507984, -2424033, 5120452, -10462990], [-2429086716, -384144, 12889211, -1592574], [-4068451014, 176346, 20191307, 1491293], [4440748876, -17672, -5137680, 9997366], [6299238450, -4535822, 9325384, -11144675], [5175540850, -3020862, 13421519, 1015425], [1389730252, 2970470, -11108576, -2677292], [1753602456, -2798568, 16071020, -947800], [-3127424974, -3872120, 45251668, -9828979], [-6926942726, 884726, 12004083, 5904381], [-1593758674, 8527005, -696448, -5390646], [-1804761474, -3192254, -22313574, 6177202], [-11407218924, 4989276, 4306911, 10495018], [-6374214472, 9613923, 12883296, -11951274], [-1737520728, 5355644, -17870893, 15232404], [2308812870, 2714529, -26810268, -16779506], [4728787360, 3947843, 40365256, 9646030], [448837748, -4953024, 10882799, 12434506], [-3381637870, 9706108, -8225960, 27961565], [-7774845556, -1954874, 8071860, 4327008], [5695886098, 1073382, -31210449, -4237963], [-10431522908, -9294420, -18240484, 16688698], [4628930950, 1588782, 32517499, -12268457], [9485566398, -11187021, 24703908, -2376582], [12962103440, -15234751, 9911908, -4006538], [14628161064, -324184, 20301720, -823360], [6658684478, 9929662, -14624921, 15791855], [-12134649486, 11233772, -19207616, 19351536], [6488913936, -11952341, -16555468, 21239266], [-12645802216, -56964, 27440428, -40460588], [-9701831904, 10538477, -38812580, 2323126], [-1904746192, -7251464, -21287824, -25813724], [-5691636158, 6337668, -62485384, -2689923], [-17293674834, -4755453, 18805296, -5705034], [-3467008054, -3578040, 40126208, 26495696], [11610305232, 5444926, -17269693, 45197156], [3316258140, 9231288, -9454748, 34418452], [1564564550, 5642507, 39627256, -38327698], [2754953846, -8940356, -36014520, -40193985], [-13156582724, -13486739, -7873354, 8164412], [-14085605442, -5380421, -26173280, 11519430], [-10319456792, -7564452, -10438580, 16136012], [11577710546, -10002724, 26595052, -4029475], [-15157260570, -4852662, 87938547, -38339277], [-17179853126, -17814210, -87644660, -14136512], [28580552840, -12654494, 61391079, -14218208], [-26535541324, 5630722, 22969016, 5282284], [17379167998, -10618678, -12266993, 46215107], [-44480437608, 5592644, -5358756, 25253664], [-16867682870, 8864240, 81554928, -30111520], [-14822116886, -14725956, -30746076, -13960159], [-7596861902, 8444084, 38975116, 64177588], [-13063498180, 19994432, -17587200, 40017864], [-4888006080, 14780736, 35511911, -988224], [2345327070, 17792546, 26950456, -28640389], [4000610566, -9748350, 81197215, 25450163], [28184182018, 6290488, -50295428, 18227125], [12072846852, 7436659, 73526386, -29681748], [-27706347198, 3657630, -44696277, 19768181], [-9549231854, -4679612, -61796732, -4124900], [-21488507128, 1318828, 81938336, -19071256], [15744070312, 11932718, -4260665, -16914704], [-27992811934, -9539946, -48272553, -24254727], [-42304252460, -5928252, 61438240, 25817152], [-36003883146, -11593492, 12896838, -59193126], [37141017984, 11124348, -112672496, -38760056], [-12325465902, -3343212, -167173592, 71854640], [-8187956364, 13773780, -30708084, -37178588], [-32662662764, 4029944, 63690464, 35616936], [-10631854152, 19961242, -78235101, 43398496], [55440181492, -20844544, -15429424, 31753936], [-11414246974, -5672088, 54550188, -56818700], [39329815974, 4106934, 57890954, -45594918], [-52056095502, 26891386, 58837223, -90072431], [35661853258, 20291768, 10784868, -81358908], [-16151905408, -42179448, -123208172, -6441856], [-12845759520, -25629572, -140126013, -19609328], [-54036911378, -1732586, -48868036, 37673483], [-11428200342, -7226574, 138272179, -73203639], [-4229321042, 16213282, 47313814, 3714390], [-7565048412, 26909109, -10457358, 9425696], [-30244115148, -24070174, -53452309, 24648542], [62599348494, 14862596, -115631388, 9981603], [73074183036, 23045071, 72518318, 16510472], [21889934394, 32085910, -142711212, 81826360], [5740782608, 43349285, -15271028, 33521246], [-14517058898, 3888434, -259644870, 44275618], [17484174504, 65675788, 97842671, -95381836], [75022262894, 35425054, 158052432, -142733], [-21443834620, 5799516, 118747676, -76106652], [-43201435692, -12476108, -42957044, 73892202], [2596269034, -50881608, 131523084, 42326420], [15562239146, -37522866, 5282212, 1795321], [59726051006, 14312321, -182938508, 115138318], [31877365536, -53555300, -107520956, 111868836], [-54691285248, 40688164, 29549851, 26335928], [13531481354, -30433054, 167986187, -51241415], [110983900182, -1403236, 76922864, -78827593], [7384907318, 74080679, 26549052, 9757978], [-30757536106, -13298404, -46412916, -31955425], [53484357940, 24803655, -108641718, -68405268], [9546498006, -51427038, 129621323, 74779335], [-42936669470, -14312694, 111448432, -109792828], [148264793556, 23186788, 70747320, 56025546], [5546704222, 20700192, 131612568, -37558869], [35264647860, -54052514, -104033224, 117981364], [-90889983086, 1424394, -19251737, 9027909], [-41703642664, 28789681, 138490612, -225605906], [98851748734, 20896518, -200584172, 154778963], [50046742354, -24470560, 145676060, -46227764], [-26328233968, -15535923, -77711412, 55033710], [-1585588764, 17911740, -326098928, 39442698], [-45332088966, 25340382, -62678044, 42276936], [-22453523888, 188924, 6552783, 41963664], [-63680048596, 5280581, -23184042, 69537788], [-117004746860, -7165028, 67442580, -225005890], [55282477548, -29411741, 46518406, 171322408], [42972484396, 9693570, 71021380, 125833672], [-74468786686, 33049026, -308459056, 74061949], [-62944284098, 49956414, 1796439, 109013299], [-16837867462, -5872124, 487074084, -129999772], [-5219030028, 77176696, 351874292, -157834654], [75305614746, 64516780, 36241740, -4831495], [21285855172, 27203954, -607871516, 9960808], [8255749436, -39336502, 84170068, 30554712], [-61764353176, -64452860, 101719592, -240871884], [43890030594, -87513674, -248205929, -45911043], [52019357250, -18335182, -39181812, -116450744], [-101648783820, -19590884, -158383852, 102119974], [35798808986, -8620932, -21797944, 41925184], [19015895356, 3730490, 64382123, 225956602], [-52704266796, 12782730, 489905588, -173985736], [87094699754, -27866978, -211167941, 114721449], [-64267812652, -43397298, 203703088, -94793284], [22540944260, 83799890, 252107703, -155130858], [11945985434, -18517168, 329658852, 29663436], [32073818646, -93311298, -26334028, -190879545], [56038373996, -82771728, 258340260, -242192252], [111716117018, -89333334, -82942797, -57769535], [104107336510, -23011186, -316954785, -304558421], [-148792152314, -41730037, -17199596, -224459806], [-113989901564, 89362078, 19137300, -155370480], [-4526965208, 87593416, 36421147, -117480796], [119022913978, -19463882, 482258700, -110728768], [-24619667152, 147929919, 254880320, 225608206], [139256136768, -4299504, 47445287, 161286240], [175310024654, 86776546, -167994689, -86803665], [-113257478884, 115211282, -305604880, 37079236], [31718091866, -45938568, 586445528, -337440344], [44821837690, 1003114, 306590684, 27892337], [10064050786, -36191552, -11408160, 393662336], [-21676804634, 53040540, 179381488, -231904753], [-44319235068, 61035401, 351232930, 212441320], [29779868758, 67752778, -684141273, 326163319], [189695514718, 40189258, -248969718, -174670718], [-131804413836, 88717306, 252703876, -48892184], [-2809498668, 206904964, 409695480, -214119158], [-105875734018, -91677826, -334799608, -165077101], [152726035996, -176120080, -216667700, 155099362], [82298202158, 8595354, -903115597, 159012667], [-131460674480, 85209323, -19144864, 181580726], [-143767936344, -51550488, -111991880, 330252308], [-159147014802, -19700160, 577866814, -199867430], [-215582687416, 138467596, 39140471, 202215724], [32901315610, 13873148, -624264088, 241608713], [-161289487470, -127222630, 23546508, 127336912], [52720018984, -99219578, -683205341, -280232624], [-227405752932, -17661380, -109193348, -171451884], [49220747954, -12825662, -692680072, 123478172], [189833983428, -86879292, -62146044, -292331220], [360197063094, -12943686, -115541897, -8106901], [-64726468272, 87459386, -261779269, -303740772], [40117218494, 130912820, -858073244, 333060435], [-332771771668, -23129264, -259776537, -269999578], [46951585204, -12686243, 670753506, -328609504], [160937472088, 30615039, 729606288, -259024002], [198723694566, 20280706, -596485662, -121096710], [-162030507080, 85373938, 445601739, 111889464], [-198500522198, 134468360, 441885796, -382607503], [-22946062700, -99556036, -780944576, -387995480], [162124252456, -5368801, -27712252, -10927110], [5234987230, -108680780, 364861158, 314660106], [-245847015852, 253750015, -574254106, 292867792], [43814191922, 233815462, 206841351, -440757063], [243996288564, 81043056, -780699948, -433280470], [-86622394290, -73664398, 345434523, 83380619], [-30648148136, -70330260, 104218512, -547753952], [-439518877572, 10324740, -375564153, 142482750], [-141471902786, 55782973, 436946412, -90396234], [282680433552, 171064609, 553103984, -144697150], [26631726000, 213919428, 481504532, -32735776], [34415089802, 43740300, -478319912, -87599648], [77941883196, 9042502, -1402412232, 405393124], [268097674956, -165569468, 650824184, -245385954], [142423420094, 75833090, 175090206, -258148530], [-71968957382, 33295442, 261721104, 72660860], [307575522436, 89516244, 257368000, 312985952], [360836033622, -24911630, 392828802, 330783898], [-32676459556, 62613682, -953464357, 293542114], [158276983922, -218095662, 25929612, -146030691], [32191794238, -83829749, 90903756, 468749426], [349063914602, 77299538, -933871396, 384268360], [363788353344, -5876399, 674585992, 220780490], [-51384177192, 154128859, 887577348, -793849342], [166285422288, 196641516, -881511424, 597694824], [-16980139296, 78367410, 648933655, -670749964], [-12764654782, -6382138, -1621948721, 666407949], [243131037504, -52432628, -426815093, -370135248], [-7277242058, 112736932, -1642313644, 379699223], [-432982159980, 156675046, 814108084, -616112176], [219714643524, 28734912, -1665591764, 206222276], [-50822481740, 229285317, -1804610878, 597282944], [98411774014, -170186258, -126793201, -265954597], [-49310182086, 181526170, -653021616, 673135956], [102699397814, 333941862, 1256434342, -76533202], [268697758974, -69517092, -355449076, 458047891], [282663380502, -62233382, -1046683837, 742260919], [205228250918, -79052777, 1468288024, -323632994], [35153042300, -146503570, 883992951, -191991342], [-167006139314, -86950276, -819160, -726545901], [273775761236, -88434234, 407353939, -153786946], [-81947624244, -282335273, -563697354, 18243680], [-224502683742, 186051278, 773391259, 122269917], [68334292108, -270238302, 636812588, 232328000], [20072933004, -210858376, -1033246672, -109860858], [-83343437868, -188448806, 852231407, 318925046], [188960474648, -214450433, 502798608, -57531250], [292883978610, -15551214, -793542436, 1114552072], [-416047428412, 190929430, -395042269, 465109558], [175214724654, -229182160, -1200634420, 824456131], [-15915554138, 217998490, 65088275, 1113280807], [-215299206390, -42647124, 1883633408, -241619152], [-120807212768, -291170396, 905236344, -591034684], [-109742802284, 78393410, -368470784, 173897364], [200672856174, 33556269, -291437364, 694012742], [55587826944, 142125880, 307152940, 107762952], [-21795692386, -150732142, -113654909, -694591281], [176068913106, -85588370, 738084112, -258325308], [147065344152, -71724036, -935541552, 711543776], [202950977652, 218112477, -425495326, 289667808], [-45248735652, 4201038, -1996386464, 63488828], [-272991384818, -450244758, -2041326974, -645774710], [-376151688228, 40049864, -32113829, 404632238], [-136955515230, -269034364, 149528400, 920709373], [-287248831734, -251898092, 1042471836, -561920436], [-83164962068, -146035235, 1321312666, 259488024], [-68008167176, -174019687, -226059136, 1186530034], [-785428927824, 51930348, 1487320488, 392958504], [495362329276, 269634278, 74166871, 1149483522], [135344285970, 105716698, -2689864552, 436122221], [-481006303134, 333071818, 823021487, -45237807], [-983653961252, -109016013, 363865822, -347258864], [-460297856584, -297316944, -2732902904, 407046544], [-269726000094, -610536880, 808904928, 1114257552], [317664638438, -422364993, -1275934268, -1044366262], [-515595656986, 450674960, -530760002, 893684394], [86103876272, 98696610, 716219411, -94747012], [-182694006354, 366038429, 61876664, 1254248994], [-63709841614, -605262498, -418693944, 14719197], [69132222290, 433075488, 2246072344, -38903256], [-224471647640, 56498209, -2716853108, 492043982], [486596160000, -197267016, -325612404, -464257604], [74949513234, 654586696, 1378417364, -999278643], [451084612706, -108986670, -1294160485, 77664105], [-442771259724, 117412676, -1445903036, -427834972], [-968372682884, -18621464, 1706621392, -1481276566], [49681947442, 264579204, -700414056, 337291776], [756520937784, 263524678, 148046719, 816719720], [234040041548, 324605992, -1179121176, -369701672], [58541761408, -243360307, 889415312, 397403570], [-3789665544, 623044840, 1378632228, 2025511776], [-610318799198, -355580918, -60486668, -361498304], [-453592597546, -38946134, -1650121020, 386303911], [-325067962026, 225057663, 1174596232, -1691358546], [-640529003192, 289459025, 1487958496, -912376102], [842297112320, 302931218, -2740143873, -595682500], [-676595588074, -125183254, -2475651105, 794591143], [-152636972026, -230099365, 1658678340, 845745410], [930041900366, 28883496, 1313427340, -867059469], [773383894638, -742984353, 1050066156, -322978206], [208023057772, 592155692, -457691561, -801749522], [440699643338, -72656114, 622205984, 1680568809], [-357735223422, 411472298, 716202319, -519492291], [274754236094, 620345391, -619405808, -995718794], [-418213994864, -304753575, -276309968, -113372566], [-421381498340, -24697937, 60808046, -471231672], [-694339391306, -96697178, -1395196446, 779775218], [572122875480, -216862920, 1875860439, -1116428780], [-364586815612, 10513747, -332935794, 1347338912], [574935239248, -874254301, -339030324, -1295928742], [45798644006, -325897650, -509422818, 1450765174], [-875925346948, -531680952, 227811051, -838565706], [-501119782152, -298012520, 4166248232, -626003088], [-8312290638, 244593372, -268367920, -735896715], [-250711179810, 244698707, -383343472, 1670005254], [-833942738124, -173603932, 2600776532, -693729150], [672079049744, 462142732, 182772003, -53503584], [-356183120570, -78239750, 4320978027, -1329969849], [698493053528, 586300, 2519465848, -831505332], [1046005870092, 322766417, 76027118, -821463108], [-720216462506, 594644154, 346868378, -472610382], [-549926705524, -405067040, 1566310475, 236187334], [-704897550188, -370939471, 915992726, 794503604], [534742701378, -165676950, 4266652872, -131834268], [-816251183424, -97057283, 2092667788, 615210350], [353428804308, -323680644, 3765173484, -401535226]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_384_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_384_8_a_n();".
// 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_384_8_a_n(:prec:=4)
    chi := MakeCharacter_384_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_384_8_a_n();".
// 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_384_8_a_n( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_384_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<5,R![2983276800, -22830080, -233184, 192, 1]>,<7,R![-37318092656, 407076832, -627336, -680, 1]>],Snew);
    return Vf;
end function;