
// Make newform 10.16.b.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_10_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_10_b_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_10_16_b_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_10_16_b_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 := [59143904715457383364, -41384481648202964, 14478882731282, 1095295465934, 23752924445, 6172534, 8, -4, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [1649429145461498232805098793733374695936, -125266809290974978921494641595461945088, -6050803925287062975900266285093564736, -2695340257204035207363257830796352, -446222755875853786209452541216, 3352317624629619746282965728, -190210628213944223576783584, -64631454965757861480288], [297838293235491922687608089510161970469846, -22759233124909892127626956035916547576168, -6782502632577644273726423038346708946, -465882990321225458024151453955165497, -90420906995745184998648633140676, -5317755617417827568909290542, 354073482124671874636786426, -14849096797892152834494293], [-136439319949381249750328781743597133595299295799616, -635920359442498099345410614196408743527079352472, 3389304839722019432663863577307267831110211166, 3292653572766033699957736997017248396862987, -8818841841975084646175858020529421283704, -53529602259395671192261513750731300118, 238182762673673343382098694213871254, -1769903380506502482086107286897], [28579328697541907910618001537611874964055827921292, 25269916056081197447145737826710696919810807464, 608397161877261829514559146784331473259764358, -2197919560728568685327124438654241273240769, 1144296532317881669184519650031886419048, -3419834934250262012610859159784264134, 49967997736650698682803306710426102, -137441371795353580927749672367061], [-1836803156436590728497470781251584, -150858299102349160942460343707648, 64667263621522485826250561664, 3110334880139552113052771328, 603421399371408949197504, 24592864898365207488, -1743882156830683584, 99067145033162432], [1977616627995112051007771137562731804544875769942, -26354886517579894646357039566052932902119504736, -98958636908456696248421627537584892343207292, -645368816970190513111189234733849658402194, -64378050826990905672452383605591787852, -1433026832913019747466545016771064684, -3074285292066163118245427802710248, -32142075671203191908712778485386], [-42433743872592732005318000988208635990432, 184039733026365880005498727523289565696, -85994218297372530146701426096952128, -3267226742586191239272606543014656, -6376996500022107985945798677408, 13400377645397961613889038624, 3186918370360379295519968, -188766630054076381120864]];
    Rf_basisdens := [1, 2273980688281133592111523655492226082475, 2273980688281133592111523655492226082475, 228951197638209373454564536205923798661830425, 228951197638209373454564536205923798661830425, 118274675913440646124350953095, 4319833917702063650086123324640071672864725, 11908249194992944573738027010463885];
    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_10_b();"
function MakeCharacter_10_b()
    N := 10;
    order := 2;
    char_gens := [7];
    v := [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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_10_b_Hecke();"
function MakeCharacter_10_b_Hecke(Kf)
    N := 10;
    order := 2;
    char_gens := [7];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
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 := 16;
    raw_aps := [[0, -1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [31425, 34, 0, 0, -1, 0, 0, 0], [0, -3769, 92, -2, -7, 0, -1, 0], [11929452, -76, 0, -38, 190, 41, 0, 11], [0, 511638, 14712, 7, 287, 0, -84, 0], [0, 2355332, -255852, 574, 4814, 0, -648, 0], [809902020, -3964, 0, -1982, 9910, 3823, 0, -611], [0, 92781241, -343494, -4322, -4357, 0, -5751, 0], [-30568704570, 11976, 0, 5988, -29940, 225210, 0, 7194], [65288963152, -35336, 0, -17668, 88340, -114652, 0, 47156], [0, 386029922, -52867912, -282321, -1570101, 0, 52832, 0], [837389689902, -836742, 0, -418371, 2091855, -680291, 0, -328703], [0, -135935726, -166087517, -79132, 1284718, 0, -560126, 0], [0, -3850649393, 601564752, -1743094, -3287579, 0, -1809297, 0], [0, 24568639362, -1278008928, -267071, -7345231, 0, 2003292, 0], [473976063660, 23596012, 0, 11798006, -58990030, -16849755, 0, 2819583], [7225078662602, 45174458, 0, 22587229, -112936145, -9520874, 0, -1537538], [0, -188899662722, 4265536171, 24753196, 150042386, 0, -8758802, 0], [-30678279427848, -54005536, 0, -27002768, 135013840, -20555318, 0, -363194], [0, 82485330952, -12059633588, -13479536, 52357424, 0, -39918368, 0], [78011825676480, 152331912, 0, 76165956, -380829780, 88523424, 0, -14662152], [0, 1224405036094, -11264982525, 70686924, -56161806, 0, 136532142, 0], [-79406224204710, -478721320, 0, -239360660, 1196803300, -328821930, 0, 81695790], [0, -6849420087596, 10014499660, 169150506, 879905106, 0, -11384192, 0], [610756185449502, -599108136, 0, -299554068, 1497770340, 604457750, 0, 46665926], [0, 4836933328121, 53297973170, 1076897350, 5799560435, 0, -138357895, 0], [0, -10581447782364, -13776647319, 741879240, 4229702940, 0, -173435580, 0], [-338774924179990, -30359358, 0, -15179679, 75898395, 333219168, 0, -431973792], [0, -4314811230984, 222811865856, -1612421932, -7859132732, 0, -67658976, 0], [0, -15888135902239, 342315813806, -117548270, 3388980095, 0, -1325573815, 0], [-1109361103227948, 9582187076, 0, 4791093538, -23955467690, 672391387, 0, 1251874129], [0, 49610687136588, 1441469333592, -5236725306, -29685779466, 0, 1167384312, 0], [4496868378592940, -6291714028, 0, -3145857014, 15729285070, -14605532975, 0, -3241993517], [9711280425509250, -12931484734, 0, -6465742367, 32328711835, -23414545414, 0, 3357503474], [-10082780261499848, 8623670440, 0, 4311835220, -21559176100, 10837329410, 0, -1913978890], [0, 172989221712646, 1738998675472, -12585871767, -64902944187, 0, 657861784, 0], [0, -100503207363292, -1380993892675, 12967671776, 66709066276, 0, -623569132, 0], [0, 220605520527069, -675691716834, 18774726974, 19818880159, 0, 24684918237, 0], [0, -54516934106314, -4872453360120, 6650687245, -66769193455, 0, 33340876560, 0], [34934829141055380, 85919788988, 0, 42959894494, -214799472470, 59468394239, 0, 2332753997], [29893929928219502, 18980554792, 0, 9490277396, -47451386980, -34651885174, 0, -25433460982], [-10414014042351648, 23326049744, 0, 11663024872, -58315124360, 94653989512, 0, 13255599016], [0, 320588407525468, 7296004570900, 43025524686, 219749836326, 0, -1540737632, 0], [0, -349627821213422, 1370947217976, -21492593679, -376333766079, 0, 89623599228, 0], [139784972170899000, 858089408, 0, 429044704, -2145223520, -214403373398, 0, 18192063142], [-205929912414019548, 52174690196, 0, 26087345098, -130436725490, 153926676151, 0, -18452998331], [0, 2789898259816357, -1621689432086, 148078694890, 729884532395, 0, 3502980685, 0], [0, -2057979646387780, -78859570559067, -179943253552, -527797352372, 0, -123972971796, 0], [335296439134744030, 197391400184, 0, 98695700092, -493478500460, 466437258262, 0, -23673164954], [0, 1553272934128184, -2741415597972, -131020414152, 433497206328, 0, -362866425696, 0], [-122619931327193760, -366035954136, 0, -183017977068, 915089885340, 384488597456, 0, -116938495624], [232309270843190902, 623951376162, 0, 311975688081, -1559878440405, 566923182897, 0, 98516508213], [516088164114283452, -346707707692, 0, -173353853846, 866769269230, 850035796573, 0, 51997007527], [0, 5651649102551784, 242907606374328, 1090087444840, 4565645968160, 0, 294930418680, 0], [0, -4015110462283853, 154404580990464, -668447510450, -2334252069835, 0, -335995160805, 0], [-419435440575577830, -1019409176694, 0, -509704588347, 2548522941735, -1905871827498, 0, 64363682334], [369439137147374752, -1729485757096, 0, -864742878548, 4323714392740, 3119332159000, 0, 248672656336], [0, 9342298330662074, 126348387576152, 56365069907, 1066072355167, 0, -261415668544, 0], [784357840980544302, -1905807984750, 0, -952903992375, 4764519961875, 2281111159095, 0, -469169685405], [0, 1431727199639300, 457430576538449, 188482084944, 1040846594964, 0, -32812056748, 0], [0, 4293018269771898, -20387448446400, 26197405251, 2382454059231, 0, -750489010992, 0], [0, 13229207566268802, 38899740942015, 1356036278020, 3420704599550, 0, 1119825596850, 0], [-2824275505618558248, 623886416200, 0, 311943208100, -1559716040500, 830073244514, 0, -1053186107290], [0, -19814406280137020, -144212451291272, 2314377227586, 5670146879346, 0, 1967246419528, 0], [0, -143457658992706, 925842683310696, -2437684592761, -8349056043881, 0, -1279788973308, 0], [4486484503195957852, 13555861490124, 0, 6777930745062, -33889653725310, 4696466786001, 0, -608484954429], [0, -9675931581339640, -1241557712044000, 5379266164144, 24164340887624, 0, 910663311032, 0], [0, -69580362917747118, 175817332369899, -789954848548, -2209748206058, 0, -580008678894, 0], [-1247528907142111450, -10266018405416, 0, -5133009202708, 25665046013540, -6859768547578, 0, 812913424886], [0, 53525501918254568, -1391716524561048, -5725029475868, -38010568089868, 0, 3128473570176, 0], [-9348481517634765240, 6668591325016, 0, 3334295662508, -16671478312540, -3539788144330, 0, 3075612563234], [0, -60438993141587335, 3300502598802398, 4998725152858, 26457766575983, 0, -488046937231, 0], [0, -7701653694420822, -1075203670984680, -1080122395469, -13639970193649, 0, 2746452738768, 0], [6870324825676669180, -4818905989580, 0, -2409452994790, 12047264973950, 26201865706469, 0, 119965863695], [0, -11448734870774743, 2029590143824518, 11233749936922, 28501787621087, 0, 9222320687841, 0], [-14500859493377941710, 14212205101906, 0, 7106102550953, -35530512754765, 9288927163954, 0, -2573841741206], [0, 119992805348389478, -6953078122874776, 2709123363235, 51760983754115, 0, -12738455645980, 0], [-1927663816319743998, 12270511838312, 0, 6135255919156, -30676279595780, -16653704383974, 0, 890392759458], [39826988138610914110, 4485039542522, 0, 2242519771261, -11212598856305, -7574428622759, 0, 1984801051213], [-9161412892048957980, -23712099773092, 0, -11856049886546, 59280249432730, -22229082047469, 0, 6821629263177], [-7169738986908523598, 36219242013410, 0, 18109621006705, -90548105033525, 12651381029710, 0, 1797911720950], [-3025003222397293248, 43607410001144, 0, 21803705000572, -109018525002860, -17203986597976, 0, 5409168510896], [0, -18995917395676580, 13085955075203308, -14541025792134, -37759266524934, 0, -11648620811912, 0], [32647092806644847640, 36744062769192, 0, 18372031384596, -91860156922980, -54458481475614, 0, -5841991313562], [0, -29759852777267640, -3549585062789523, -13667310512912, -145547462830312, 0, 25736970088584, 0], [-39566789003150081850, -27730645148494, 0, -13865322574247, 69326612871235, 84210514393153, 0, 6277164690949], [0, 135361217483286884, -11819569501815040, 50523215104466, 229088511462706, 0, 7842521353208, 0], [65341446929149270902, -4348880941576, 0, -2174440470788, 10872202353940, -82947579582626, 0, -14543916201554], [0, -189642050833644321, -201743665790928, -21520606760670, -47415742620675, 0, -20062430394225, 0], [0, 540342010055293464, 10804706950990401, -38281343641536, -105817081379496, 0, -28529878942728, 0], [-8272897103026458720, -72689346511680, 0, -36344673255840, 181723366279200, 180886403410400, 0, 4718141153360], [0, -1111429058789766957, -947549004796752, 38615381388142, 99117858213557, 0, 31319682909051, 0], [-73709937780465885348, -193763994794980, 0, -96881997397490, 484409986987450, -133561150847471, 0, 3380276864755], [19530919229723963700, -76120393987028, 0, -38060196993514, 190300984967570, 36506264498351, 0, 9488315309693], [0, 257067086457963393, 13897749336204258, 871016540390, 201031314677275, 0, -65558743991775, 0], [-36314776796622532890, 219362808251848, 0, 109681404125924, -548407020629620, -316963076107270, 0, -24435333983878], [-28256283405131875398, -6088419420672, 0, -3044209710336, 15221048551680, 87343370831288, 0, -55208202587848], [0, 641155181987565512, 10850702813840933, -91905403522328, -495231269327488, 0, 11901417238616, 0], [13459123359928712902, -406261775550776, 0, -203130887775388, 1015654438876940, -321630103185118, 0, -46079120260414], [0, -331040997894307096, -29886973422462487, -280873569989240, -1272620778474880, 0, -43915690490440, 0], [0, -101432688135419202, 22082913738052704, 4513479194405, -19711910470175, 0, 14093102147400, 0], [0, -1706943448398772540, -3438423638912907, -77543212177904, -597097665586924, 0, 69793868232468, 0], [-274949395574413498530, 147221959112410, 0, 73610979556205, -368054897781025, 389247440953393, 0, -28423622779835], [-182709199025723376548, -309606284458556, 0, -154803142229278, 774015711146390, 168200400203069, 0, -22439870692729], [0, 1139662877762184488, -1219349614877992, -142244984243388, -1349058106475148, 0, 212611061752736, 0], [0, 78941513826316530, -73165327648235469, -248843095758788, -1200395751967978, 0, -14606575608654, 0], [0, 94297947528730512, -12021473918581128, -188451560011956, -898256447395356, 0, -14667117554808, 0], [136419196738200693000, 1041448398957872, 0, 520724199478936, -2603620997394680, 299205938725678, 0, 54545287549378], [310497313335184063502, -390493404634270, 0, -195246702317135, 976233511585675, -141179041852733, 0, -130263962881985], [0, 2821213003244344327, -69951797737989632, 324044004105674, 2479627484391709, 0, -286469154621113, 0], [0, -494785562489072054, -159032509203150224, 45497415122593, 651302724768233, 0, -141271883051756, 0], [0, 4033176469902861080, -6260896275589620, 234185102997204, 414874771959084, 0, 252016914342312, 0], [131929774030398437020, -330974835346820, 0, -165487417673410, 827437088367050, -746502581326375, 0, -102464911147045], [-342551607162570724648, 952286931579240, 0, 476143465789620, -2380717328948100, 957128245310394, 0, 119904425469630], [24550784886484176102, 960894051945954, 0, 480447025972977, -2402235129864885, -843999359117171, 0, 108207815710561], [0, 6809071763527879458, 159055154096637783, -348237225758500, -1504385950538330, 0, -78933392751390, 0], [0, -114894421093132641, -84659468824698588, -185810668846618, -1946167745543543, 0, 339038133770151, 0], [0, -3929323063849326290, 163709033767244352, -492457649062677, -2559384814823517, 0, 32365523170044, 0], [880011322946203752660, -490602722327348, 0, -245301361163674, 1226506805818370, -620310575929857, 0, 381231367335453], [679857852621896060402, 703624369939226, 0, 351812184969613, -1759060924848065, 1212650094354700, 0, 27463366191004], [0, 8916117770450530308, 384585543888457980, 562500787629826, 1582976117033546, 0, 409842607038528, 0], [0, -1949837658079369486, -63183881961536184, 1255214019066029, 4722847528482229, 0, 517740855615972, 0], [0, 345989971308243334, -42781172264770401, -1679792470704524, -8789019608860174, 0, 130019085112518, 0], [-503513358261308705948, -3906649339278428, 0, -1953324669639214, 9766623348196070, -1429301176420393, 0, -90355855981387], [787319343559755950202, 138218005138674, 0, 69109002569337, -345545012846685, -468628476287744, 0, 90639061600096], [-70570878728602989090, 445145590623144, 0, 222572795311572, -1112863976557860, -4401897035890134, 0, -49625692291254], [3141899933634047742720, -1974314334871576, 0, -987157167435788, 4935785837178940, 227739742647984, 0, 126919889051976], [0, -10843846829048187261, 47857799892301992, 1413922839366222, 6381562460852997, 0, 229350578659371, 0], [0, 17652772432233961838, -488711954104024024, 674352295115029, 3138351193329329, 0, 77803427415272, 0], [-356790870253492494460, -776614251927092, 0, -388307125963546, 1941535629817730, -4443636891533821, 0, 352445355032057], [0, -9218522333225098953, -283253671381510980, 2457924865921238, 6068109552513073, 0, 2073838259031039, 0], [-3426979187289073571248, 2827384462054496, 0, 1413692231027248, -7068461155136240, -3512744459424188, 0, 245861213118124], [0, -15595956473344346182, -193862013309301432, 2660700044966967, 5234858993430507, 0, 2689547077134776, 0], [1101065335902369919002, -5331453030779192, 0, -2665726515389596, 13328632576947980, 2788022365600850, 0, -299612554454038], [1266386857707112327170, -806103971642624, 0, -403051985821312, 2015259929106560, 7784624894272328, 0, 496485558263384], [0, -11822687641664521830, -1109339973013939920, -2121567843237723, -7555633645412763, 0, -1017401856925284, 0], [0, -14712926073321401194, 782424262602539627, 197165277910188, -864237835939542, 0, 616688075163494, 0], [0, 55914857509412294774, -370398828468172032, 575592906166235, 7229293841121835, 0, -1450443103430220, 0], [-2888048487994774505190, -13655802892206528, 0, -6827901446103264, 34139507230516320, -3282493444485816, 0, 704916668844168], [-32265903392487121748, 8385550980158692, 0, 4192775490079346, -20963877450396730, 233730117440609, 0, -1120646351252077], [4183921838616047710002, -7111104836283318, 0, -3555552418141659, 17777762090708295, 8624033313138296, 0, 390984574205048], [0, 27053242267109363709, -728447680758010026, 2811606700107166, 1430061646527071, 0, 4209323951336253, 0], [0, 29896268224914479630, 260786727542887119, -3291114329198924, -21403637595995974, 0, 1649355316667118, 0], [-4209648828072888498870, 4700399893529210, 0, 2350199946764605, -11750999733823025, -3831870316412642, 0, 764117806197670], [-1554308549838117927960, 8585095684202776, 0, 4292547842101388, -21462739210506940, -17756271058485882, 0, -1053859943388126], [0, 77531291440950490106, -430678481445944104, 2504146168410073, 20795087906579153, 0, -2758119021509596, 0], [0, 3369040567599826572, 457839660347518176, 2764420058518878, 4567007358338478, 0, 3085030978085304, 0], [597564922736130034060, 6758859774743916, 0, 3379429887371958, -16897149436859790, -12644739065933115, 0, -765826917175761], [0, 1270775964915739515, 1788963531900293628, 1577441712020666, 17527841970472321, 0, -3213544470122997, 0], [0, -78860525382916009874, 1076115014646936400, 1440994483909217, 18596094915916357, 0, -3797040832123424, 0], [2705482361394166502502, -5298210305447622, 0, -2649105152723811, 13245525763619055, -8074677705314817, 0, -3751765749297093], [0, 79908581285890722936, 1717370367413359185, -265815994363280, 27060216574280, 0, -452046729463560, 0], [0, -12149491213622874993, -1297870403691331620, -1624717408430010, 321220365019545, 0, -2814935802389865, 0], [0, -45650875300792313820, 3279453386772441, 2371967305604832, 7543855609184292, 0, 1438660306279956, 0], [-3120962432518967720448, 11694576532883528, 0, 5847288266441764, -29236441332208820, 1086920077002328, 0, 4275739477411312], [1058353611781682139720, -28103412601889168, 0, -14051706300944584, 70258531504722920, 14460542921021006, 0, -2805860626961662], [1805689262313703369830, 16454480549993842, 0, 8227240274996921, -41136201374984605, 2609585247091697, 0, 1359824173800053], [0, -7155658709589691232, 1002496320544402180, 403030777095568, 15474704393146088, 0, -4486516835889416, 0], [5711966869968261046902, 4658110152346024, 0, 2329055076173012, -11645275380865060, -2851343521897542, 0, 5761389689965146], [0, -127649218387332975978, -492143092373561445, -2792491399520620, -7372247738429150, 0, -2196736419724650, 0], [0, -103869970985504242180, 2075263578545881248, -3593085422592994, -48870253027502594, 0, 10301608638179208, 0], [0, 2890264514009208109, -1572770970111259010, -20908053032506074, -129172823610577689, 0, 8210852816015773, 0], [-14644967580960535238148, 11390624948123484, 0, 5695312474061742, -28476562370308710, 5741527621067049, 0, -8541961487022309], [0, 71200002461491597260, -493324845337441908, 26609918370872530, 98413950504066770, 0, 11545213783431960, 0], [0, -17133078154892096509, 192248578473268968, -1659811937795946, -28442941591208931, 0, 6714627300743067, 0], [6795917769972930177952, -32566996347847872, 0, -16283498173923936, 81417490869619680, -29704182870051912, 0, -690467663971128], [0, -101957789244936145974, 3283256720773371504, 946194442367629, 14470298545179629, 0, -3246442111113828, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_10_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_10_16_b_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_10_16_b_a(:prec:=8)
    chi := MakeCharacter_10_b();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 16));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 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_10_16_b_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_10_16_b_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_10_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,16,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;