
// Make newform 342.10.a.l in Magma, downloaded from the LMFDB on 26 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_342_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_342_10_a_l();".
// 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_342_10_a_l();".
// 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 := [-48270488, -2723303, -34433, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [-17640024, -758211, -2208, 27], [30780440, 698613, 244, -17], [30821704, 574821, 244, -17]];
    Rf_basisdens := [1, 20632, 20632, 20632];
    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_342_a();"
function MakeCharacter_342_a()
    N := 342;
    order := 1;
    char_gens := [191, 325];
    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_342_a_Hecke(Kf)
    return MakeCharacter_342_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 := 10;
    raw_aps := [[16, 0, 0, 0], [0, 0, 0, 0], [350, 3, 1, -4], [3075, 6, 2, 9], [26056, 1, -25, 0], [30071, 199, -33, 169], [103123, 14, 587, 234], [130321, 0, 0, 0], [-752981, 195, -1531, 93], [-1537183, 1639, 1027, -3481], [3192456, 2444, -2050, 2150], [5128462, -8564, -6770, -14570], [-2893200, 13410, 19020, -28480], [1937238, -11191, 24965, -25660], [7894898, -25983, 31111, 32602], [-18108791, -60111, 35357, -78901], [37327107, 11193, 66072, -8236], [32233368, 12223, -115309, -44408], [33192661, -284703, 156322, -19056], [11884254, 118800, -8844, -407378], [-9921749, -400244, -184019, 170182], [-76710310, -599398, 293190, 123590], [186639194, 292006, 92806, 104262], [-72054508, -282772, -201740, 1072810], [197503898, -2142810, -963354, 2541012], [-491365346, -1494188, -922096, 1059368], [301262866, 391416, -1594406, -273372], [-227298043, -1193097, 629356, 313752], [-551394775, -2216331, 515073, 1081671], [1694311634, 1232280, -1800740, 2531560], [-1415706382, -1345132, 3818232, 664634], [2051926390, -6325111, 2038265, 3277840], [-163598345, 2081490, 3495887, -2252186], [1311466170, 2723665, 3949613, -9599264], [1498856998, -10418655, 25001, -5558338], [-868922830, 3564080, -2343690, -10801840], [3713146638, -8585776, -2536030, -1975930], [2070893992, -6332236, -3440126, -3672322], [-2587248312, 17784906, -1999050, 11517000], [215897998, 11001052, -9714142, 8008606], [8387782292, -16156658, 825214, -9615452], [9146257862, 2489068, 3638250, -32493950], [7022312089, -3410366, 164894, 16196523], [16950065182, -20601322, -2995124, 11000162], [-42966280, 6095362, -15717440, 11675560], [-8436684505, -28404714, -30590562, 27553881], [-3439396375, 16710503, -28902720, -34648720], [19212545166, 69805796, 54602090, -39914860], [13809654279, 27511091, -8588502, 19466836], [10656110848, 18284293, 10613425, -5533700], [9849701816, 56773453, 43503055, -69107770], [18198952889, -50691770, -27464294, -9189493], [28702041624, -42426270, -49969108, 93061284], [-7558951636, 56299707, 65615755, 34163630], [-30355130572, 17575616, 59713960, 60467210], [681596746, -88562339, -92520985, 65967790], [-90548450530, -21046174, 45225448, -76864614], [-62786388691, 81135909, -6360189, 133459827], [5581653206, -22600909, -119713479, 56055272], [22513495936, 73238174, -72992788, 45271524], [47440123640, -52213441, -62450991, -142558792], [56560249207, 40509439, 154009607, 121217189], [159497240828, -1209872, -63714924, -109610588], [119646666781, 114695540, -82805920, -166455885], [-62619903547, 227748199, 133006314, -215854592], [-96817374689, -91396563, -126825691, 196037233], [-102796378201, -175603829, 80340450, 263594740], [32851432404, 103176952, 8667956, 83641402], [47457758112, 194766351, -205467165, 458509310], [181688146084, 383133445, 76868413, 154485316], [77546925735, -143733023, -287338050, -40212660], [-172545685933, 142080784, 117537616, 393884297], [25324387956, 244868380, -144876832, -491616944], [110396724797, -692677155, -9526347, 116316351], [142877099877, -850834061, -50903572, -579595964], [-185877070218, -214687774, -272052600, 369399400], [155725361600, -34818199, -152224409, -168953058], [-420099288294, -633025501, -11509723, 920897984], [510803504956, -803891644, -115486498, 76434544], [-140154169696, -1057927256, -68000856, 993489298], [-166085418736, 1255212772, -202127126, 618894998], [-221830534477, 125747351, 45326007, -292272211], [475085462326, 1124840046, 28320074, -184698382], [-606966846114, 151792388, 444935798, 310723586], [-99492637312, 1829119814, 617683122, -1248072376], [86592442352, 428447911, 1001816473, -1637320744], [-360467958902, 805909366, 82009760, -104663090], [113849039623, 770411042, 323574307, -1813808986], [-708322293870, 99323817, 452979081, -292250718], [-494233953910, -335830001, 941345193, -1265302694], [21738861288, -965926793, -371417433, 1656795874], [-333341740620, 2155461968, 197090172, 1679862624], [-14334933994, -1431567264, -930587742, 1056700416], [-807861920908, -345242736, 726638152, -2070255256], [1028293972550, -2308137705, -2990697, 848292036], [-1835397455525, 1258209991, 448985033, -1529513259], [923324337898, 1530893438, 280032536, 379432802], [438422801296, -2030179692, -594143530, 3464452620], [814975978935, -2858485779, -58207792, -264285204], [-1399498927976, -459492937, -1607358371, -1263526642], [-641230727868, 3700305952, 338794796, -885012668], [-278715181630, -4085302771, -1284252917, -2944353164], [-1317703512256, 402155698, -3115774826, 168955628], [-478250955028, -2674208352, 3209196706, 3012729512], [463174211044, 2806605320, -2017425644, 6129851372], [-3059248638775, -2672809612, -278242917, 4392525386], [809244624166, 2774703789, 845884163, -2339551374], [-201309798874, -4832857996, 1189107292, -5588364536], [-2761661431656, 3191175892, 972703800, 3261118180], [-1275096297072, 165325670, -1617551758, 5480550434], [2530538099430, 3122789686, 5448792074, 320286538], [1022342248892, -3650746647, -2175431445, 948303450], [-2833290594468, -820362645, 2100090597, -3146466666], [-2861248617018, -2147815158, 2536513964, -3087743112], [-2845386912854, -3195077887, -1819040981, 5811368438], [2537374193202, 2259013022, -1732263744, -9373467778], [1830670545044, 5774315387, -5573641593, 5884702874], [-2037049357543, 6760179962, 4195241098, -3309472369], [984262749650, -1962124775, -4500747797, 8484438296], [-1190811057847, 11495136711, -3032397284, -6126284228], [2975839878161, 6735422645, -2403402447, 3854264471], [-1971611268724, 8772837006, -5376660756, -2758018332], [-357192587609, 8524812653, 869032301, 4057514137], [179171644996, -3189561656, 1877211044, -10079278412], [-4985100817252, 325905305, -3699841719, -2097096598], [484140996796, 9663421826, -5487649624, 4761738612], [2347265680034, 4831779792, 3209298918, -2793953994], [3980142145461, 4574595346, -3520706130, -579723025], [-893794040005, -5946334812, -10214244156, -3497798007], [-2912709294172, 16254036098, -4547127978, 3932869634], [241410499498, -8607441191, 4832141803, 7201465306], [-720144918984, -13054346072, -10091577750, 9469690230], [-110656286264, 10788083800, 4943459512, -11815469096], [5686855391988, -19596791645, 1873695107, -6188832896], [2101320057651, -8282355366, 838759815, 16162017130], [1429855814675, 3418490122, -14164850625, -2857121810], [-3701666208493, 22527013101, 7796263261, -20857151443], [12483618184473, -18799293267, 2201380238, 2001127236], [-1833927400027, 13232875445, -6652463087, -10071236529], [6588462723257, -6339413278, -9718983983, 1424096594], [10416865445651, -17216386117, 5744039010, 1635904520], [-1739727982974, -2254098079, -4653146553, -3663390996], [-817155405823, -13543356892, -8402492328, 12048174119], [-4166587793297, -8267158861, -17320406458, 8034440104], [10859462920409, 28180982925, 23508255561, -2507601753], [-2527553667320, -11372340866, 6405037184, 28661594578], [9960305488282, 11680701480, 3328636036, -765319248], [376090838044, 4803817198, 3267094244, -33734829392], [4632914378812, 5533031215, -9564599759, -14705569388], [277507460018, -11277765648, 11111394520, -23155964130], [-1799716568111, 3987780311, 263324827, 4998466379], [1048076207752, -25674255557, 2911973, 843848386], [8186045754488, -13987961861, 7229501919, -23775900962], [2534693381194, 21470095792, 8210647064, -21123673682], [-15914123086549, -10832067229, -31689604554, 2807073092], [4147595286720, 25009232494, -4186916244, -28281177498], [17481067244975, -7766271685, -9894672471, 16943293613], [7829699400671, 17994335765, -31113456662, -21086269564], [-6327519136133, -10537889284, 29518985653, -25576252354], [-1109737666171, -31694521493, 27525362755, -22297825505], [4423144614164, -56025369200, -9275865038, -14291059106], [2300132318394, -46322955682, 8431028688, 35794053486], [21740159878288, -558345192, -11829844568, 24204645144], [2414728624948, 26528898192, 23644531520, 19829495920], [-7088313327796, -64651549880, -34169868536, 38935574618], [-11546508861238, -2933427106, -17478926606, -21384727282], [-26447099066628, -17907880710, -8706966016, 1025574618], [-4913287305394, -38365146177, 4806118941, -7187530368], [29928903873500, -4931469220, -26049515340, 37846476110], [-36535466295566, 41345485081, 2337760355, 36788265880], [15668830952157, 34620489511, 25197298032, -61074185556], [18420803917535, 63270485411, 14082481275, 35930940425], [-9964374909088, -63271423608, -48430643936, 63405991088], [14669310361375, -84090846395, -28200624518, 85638588064], [4150454734736, 42975518012, -8977270032, -94092345964], [17574753752676, 41150207385, 22169027247, 17661676494], [25331716671876, -27703413064, -11585220034, 47669739002], [6907920012136, -63620032697, -46911240523, 66400819874], [-2691133797676, 51058871212, 20780435286, -56222112518], [-11399803224962, -17829127835, 17637385945, 62713593190], [-31796128240879, 48635870234, 30803149326, 10605380747], [3552049263529, 31358090473, 2609853662, 62489829744], [6829255284254, -80213773912, 22286845962, 34492164734], [48270095272524, -77764419798, -8941679166, 12224451118], [14819894550897, 120389325174, 28393228026, 22280535427], [-14604293281124, -11439794437, -11269636075, 71935073050], [5805201738341, 30283293807, -30760551441, -47016133317], [-280562366276, 65247989638, 44711396062, -41836671236], [13876784013158, -47183500804, 43961420232, 16650343664], [-5557805066701, 52352326839, 64725651517, -15155793951], [299006745122, 139640950132, -7347938838, 75359961514], [-15472225028102, -27269633121, 17065838669, -96226527782], [-25238856036704, -13144311080, 115495605940, -90262761080], [39001201602907, -82224599111, 26993450681, -10634541803], [447040474800, 90210361384, -30408768894, -123396878598], [-4445700118988, 31652984476, -85730638912, 94961579566], [-39682796991589, -35275492552, -92432557755, -38023537990], [-24382925170276, -63486139438, -25136397060, -57106636180], [-61795732395907, -79491249821, -87058327418, 43555696404], [-10437005946729, -130662448914, -62709030402, 71965732641], [-42138112122670, -30022243390, 9064291780, -60193522870], [-7668049105288, 3445294094, -36306970452, -21142316914], [14248529463791, 110918369875, -76623724653, -28189062071], [-33274183004580, 55575924534, 107927262776, -56589898608], [68061519664594, -176705752818, 50000644466, 32863058962], [18419057609470, 148879085129, -68163193651, -130716346622], [28513472950559, 105040290852, 52160776524, 67673615733], [-17599363433, -188192466881, -26925880486, -28561652312], [-47449122904671, 34803657216, -49054493133, 139527889554], [-9265121236751, 189931390751, -32938146488, -122485716736], [-2633861018171, -76262412829, 46624558090, 196448342300], [-34479481407692, -24126410626, -50023914502, -38605261474], [19460846339110, 143969692593, -31737997409, 124658360982], [46474996489213, -245754274295, -51361570810, 104007506540], [-93875891224196, -11689965682, -54692204992, -7136313954], [-14669837068466, 108625282056, 78417166030, -41625095250], [-4482809850127, 71958424761, -18181263225, 2723498295], [-53112268704206, 71990035514, -57073119292, 65275824286], [156681579977330, 108058365790, 18998271406, 28365437242], [-103442000344640, -204558766215, -43827341929, 222793027622], [180717498199058, 32161435380, -17011162578, -18310172166], [-46550593782646, -93361295368, 41207274870, -88772470480], [-13105565766674, 50392781368, -193703378512, 137147443176], [35424205365283, -217821339160, -139548856532, 139810511501], [51137057654481, -41484663493, -58309730244, -326304456128], [275299768724, -292593829293, 35082811509, -7565078682], [-61116675312514, -236424051096, -127565816336, -52433069392], [58085557344082, 343161957730, 8243162360, -181937700340], [-3409857529186, 136364869204, -65401573932, -8144974214], [-12775688171924, 69506581685, 24366709109, -152820731102], [63574185563544, 281437621435, 229536742895, -284574178160], [44153392377877, -83742184175, -195144256394, -223149429428], [46659949405472, -111169812420, 76852860444, 7434265848], [-215133014078226, -158549833264, 21216706968, 189111574176], [-50028984596032, 172534937941, 47618132529, -258128068502], [143074678433519, 118887819016, -113773167920, 193090017085], [122922927425744, 210616079721, -88330670061, 160509053418], [155683763906650, -27794587385, -105610079221, -186820013222], [-177184475401878, -176355626118, -26034894030, -21333670210], [-27305961324972, 582934499832, 20964698052, 75216102824], [-38182368688272, 410811715718, -47071296378, -246890978056], [-99342881131984, -8711300635, -238274635071, -130786306102], [72539089848135, 179532881655, 139057284617, -215664589431], [47968147379227, 69418183293, -155186074115, -130859627655], [119753577237188, -357457809058, -19419639152, -226820450204], [-28912135630554, -164983685827, -311997875013, -32331737426], [-136655808715882, -207319692465, -108574448667, 117530654946], [-173769894032996, 521463223132, -30037126312, -256148655764], [-19534925446620, -144238412804, -302160326212, -260379536864], [162623403646881, -318093053360, 73747296888, -140501254029], [-83893913328322, 7570550756, 497117223252, -295246262536], [-118475654408033, -448116242676, -17864136079, -346416733358], [196120501451391, 33087156923, -147784904847, 262065782421], [28619306904902, -185540367310, -20311609920, 287043715010], [-58645728095834, -44978130937, 55326377303, -142581739414], [-169592723891446, -517449988026, -251417259182, 22080161306], [133111582883824, 348325494861, 11947495069, 296613316728], [98178072354376, 231161933834, 20108762878, 393884449076], [24471650146086, 577293446108, 213271772118, 77665253226], [-17045150480162, -250831131340, -155840517980, 221460399620], [211398906888092, -538970292130, -40568907360, 159812306390], [-184589714597616, -552238790874, -187067156262, 211944270756], [-3735260072066, -89029967319, -90363727451, -330474750402], [-153485991191337, 92065525005, 409701110585, -743537512575], [-205736745444072, -158625037279, 394775336763, -632842150594], [23395885702993, 46315060385, 420872674762, 45705394364], [-195271112765345, -580191641041, -169369785505, 352505479565], [24067690961231, -647371889688, 30238213, -138327541654], [89956943978463, -246300495607, -295698329608, -129925142416], [-41660484106056, -50977698387, 193147486275, -35015085930], [-80262487325457, 227082466459, -477730947949, -331482306023], [86428894654355, 689832206713, -61844554764, 742485145192], [82936337600075, -612457507708, -53817456795, -284858226010], [-17171986141891, -272835250816, -48113297712, 511987089551], [252263183242090, 716008882022, 231838903042, -255632866456], [-109428451430381, 325776626819, 136195731145, -906474184015], [62277457088332, 114832744781, 218618164871, 361560807312], [88799245936927, 580750036823, 234954059323, 198201042581], [-331343699112320, -502184554438, 426257157850, -347600006650], [229246075608314, -385784216265, -115125043697, 891835250656], [40193574180138, -137809834744, -455720213796, 904827905658], [-280976950403335, 686702669277, -564602358381, -45854716377], [196554684531085, -195226376736, -356408484136, -786302181377], [-433792869582833, -411285333759, -208673868335, -5562260475], [-74643375340414, 160311129941, 467312043465, 67695916040], [108388615367414, 525486121479, -796522143959, 301127223782], [-127266766646689, 200160386694, 101007737895, -62242191810], [-108382053992466, 275000363206, -280811983704, 110147421502], [-70669691515563, -577431850872, 136560142472, -56264482161], [-356647871575590, 40003481518, -29210093496, -49540623842], [-186971791930334, -468208552312, 811745767634, 15134198398], [361191116222818, -390455724493, 533127574733, 327486583286], [-348075548792514, -325132857182, -310738213476, 561706317178], [-279777484268624, 601977426990, -351085715878, -267373545836], [245781962667614, 794576565164, -268015553490, 978809887310], [-344971055614176, 1558945633274, 165140865534, -975397420182], [-286145151860098, -632584429354, 593575556382, -1255963667026], [-384928041269152, 1386010697745, 567151285633, -1520144489484], [-103700801039875, -184603623603, 7377429106, -507444315188], [576699129054320, -1599909423207, 35428700517, 873624516714], [-83366584542280, -839636610415, -573672708333, 985241880914], [-363674833111937, -468865803827, 244509993389, 636960672953], [-256249785861237, 556871209670, -1054470536254, -244446356983], [-256001933057957, 292618219763, -32322835666, 274317524748], [9289370764434, -880343776509, -142805256619, -17106755298], [-38972585812742, -932301195062, -127083311606, -1683135447812], [673624853208431, -61409833197, 126439360414, -997570386272], [-687500836815135, 140399639971, -250374904501, -469782199937], [-574670947948810, -581173927897, 461916137137, 1541652318614], [246262428712472, 462347367830, -416491730466, 25301852618], [-205856450053578, 440609198999, -94937601195, 942560218330], [-288616962514, -1432077066568, 79496740102, -914702591706], [-251332069441814, -1492865970282, 816040425302, -1063008631856], [60927599213264, 1218672444302, 609176314446, -2129007310048], [-61144834879016, 810512232552, -13757849680, -1417483938680], [435380756333108, -842936987632, -799971025542, -175626170164], [247858820508144, -68209851081, 564164262135, -661661419190], [137784048620506, -271303921918, 1319274229736, 508405119412], [511824016568409, 204956888808, -622711797613, -667780371666], [426972935989176, 1335103961523, 145746238653, 255045979906], [-494131237218705, -1338602123099, 3120545444, 391877422528], [-174614494354039, -532472145334, -551967581079, 962305032182], [923900116591257, 876825423355, 752782357311, -387903325713], [-65217128517678, -341956548262, 1167363269504, 968754812588], [-283030371283599, -1073308049681, -173406982206, -1340738802832], [61280538225918, 449044816422, -632840832718, -636565574316], [453015679161545, 2091833309861, 1195532931114, 370406009888], [-145156359680773, 270107319941, -538413723300, 1702586813300], [88814875702124, 2789290544834, 655430562766, 392524826252], [231468407795498, -844525286799, 798995385637, -22508512066], [233462588555730, 89663421633, 628139203655, 883808200560], [231701501139175, 2219411468977, 164903414657, -1403145341991], [615892032281393, 1573988100889, 480245045523, -132148955189], [642605315687976, 1051637610433, 16993242057, 1993317535854], [-16657321676656, -1277488113305, -1133038990035, -1856918421860], [-224739375539330, 441757132373, -1145604966691, -1532186022512], [474956328863149, -526589168211, 1074190320529, 56728071963], [-864544186738460, 535469530790, -50398969462, 1217581191066], [-95859708249963, -60089436448, 2348550733607, -443240012146], [634005273004115, -904243151845, -633916722579, -2496905722723], [85353555850541, 2163454584089, -969853493475, -2087632825525], [-181887349429233, 850776322450, 8055993795, 2790730589530], [114937405802785, -1851948317225, 1558045784615, -634026723365], [388166885168834, -2669975801606, 266303427978, 358597191106], [-1010530278094819, 1046220960443, -826631967017, 16785981411], [697019158404932, 1718185924948, -1296192440348, 121375991504], [-843921462187378, 2130763292468, -973141929090, -546002222050], [-151234231292857, 1153904447097, 498974850840, -2838834326520], [126888165984042, 685154443026, -446695196568, 329111637924], [297015047340702, -3577421690827, 652735115865, 1717641859970], [332840918378620, -157972398914, -1552803034970, -2375970210500], [-577621950705406, -18424594990, 180473907564, 3477120642938], [70337779382330, -1457907153241, -1738622538929, 1299992141582], [256872149777432, 348283648222, -1026783105252, -1364586718034], [1389796078614410, 786945511670, 653972483364, 115310512658], [293316380436684, -3460432820976, 54760888482, -1499609867016], [878604104929135, -1548782346745, -323706515143, 3245495549689], [844963325849620, -1004415699672, -448550805694, -1066145803298], [-483391285696913, -511003640826, -1391632332697, -1876901772774], [1510288610914946, 51284150356, -624106100666, -832869259972], [-1108790849070526, 38814205739, -377997753633, -2480704302346], [-356088915203814, 1143258969860, -2080016429688, 509000543904], [-446991789706294, 1430426449836, -785083049894, 2065614275072], [-1434617999082577, 431798216911, 850322552086, 1234284319452], [287632890921080, -2581146904227, 2177949620997, 2575919831934], [-795996076346524, -1508350650758, -992157577536, -2256233101532], [-800263098323666, 4141144640984, -1537714490206, -760002582302], [2563079991335354, 2405202649068, 1023525432360, 373028494770], [29583754724174, -374172194390, 413675456832, -2395752804686], [-241634122878094, 5515219016118, 434694469522, -1056149030126], [-59957800989249, 2667078674257, 1790003218064, 195548259328], [-655779483200135, 1260490273900, -1064566494748, -1873957301661], [-527147669798327, 1015094856699, -647762504857, 455328782271], [-362528794729018, 1966088669149, 1380206973867, -1908763046066], [1244034624846530, -631483785389, -1246811559333, -1044047643686], [608960309780429, 1607091136265, -1098266992742, 218083086016], [201878985407024, -4468582623512, -1866057509588, 1386152992684], [-1598815332192100, 938334993543, 207038976909, 1152053272878], [452195853461325, 3780293045874, 1099725612309, 100622242178], [1288206387900280, 520593167700, 853305446182, -1837560104376], [-64051016300798, 1559488244588, 96176798498, -873442487174], [955478524895512, -1765256943811, -317577416461, -3040362593022], [-1019136754225675, 1542911989750, 664233707490, -877384538705], [-2639479933318396, -47783819319, -721980407249, 1045122906582], [152710568796473, 4137936955371, -2988326681664, -1517295487188], [1301696218188570, -43071969814, -1557860691444, -2628403385808], [559569482270687, 3625412396823, 1870616960685, -3182347671195], [-991189828800568, -538633341434, -2456561518878, 2834645308774], [-252824486303392, -4099898665675, -1813162912401, 5067749466068], [-2045730488719460, -1222997935338, -1495360781362, 2867736404776], [1118853999265434, 7202405888360, 2363406111062, 1940322070754], [-728330361089041, -3951849121015, -699342807083, -4540054014931], [2676059524903350, 662895867966, -3369794613348, 5518488257484], [281621667116860, 4251338854193, 962192164585, 14000874290], [-848693921316072, -1100933515186, 1376475981378, -4420221026904], [-1675285664353462, 5252007007328, -608004602082, -2932702961974], [-1841230150811126, -3539599430506, 1295473298140, -3067875018580], [-483751832098084, 5996023326386, -2759547048182, 1084548056206], [-1752169941977576, 2829169685954, -217555707098, -1903232555596], [-535185891941640, -1017540583070, 3324545097756, 115950268332], [631999395851086, -1381467197530, -778764457916, 3096022523318], [-1932922770896592, -2944404251607, 630034132023, 612322219666], [-1959627775323610, -1375418351122, 770654703438, -818118676594], [-331802446934272, -1874918813534, 3204009708352, 1953136232604], [890776303734930, 33893406798, -3036014292768, -4026112252966], [1558005886218195, 4131797704180, -3426410887432, 4879993338541], [-1721153864261056, 1905809432125, 832653101007, -2604671729786], [218384233996764, -1310479680746, 1071916999716, 6555179779152], [-1736889694712677, 819916630881, 1813831971060, -4206291214920], [1951816740985358, -2842796762035, -308630789087, 3473009391436], [-1123299704254800, -2117622808844, -1156702077112, -262357723154], [-4878592530950592, -1385222482955, 851002978929, 127554257888], [1192209800629319, -5652883114219, -1689411729536, -115469894212], [4252967612694732, 1176586495765, 893661843365, -1570277591870], [-2510635012912243, -1604296177493, 235206435030, -995873041400], [894730142963472, 4276281027494, -519059611674, -4743869559178], [1354083108303058, -5408547054238, -3126070347232, 2946295772836], [-1276063763188072, -2105950148460, 4345970254242, 516631869954], [1471933985173997, 7373633528959, 1272089229886, -12036816534048], [-571039101259148, -5067477918934, -592891202770, 2943901680260], [-1321180848515658, 4468501986810, 764710242108, -7881873607434], [4145091509480349, -4770429170541, -913186113493, 3227055824859], [-1350006179969021, -446709954410, 4717545647498, -6721066334919], [2422813711733553, 6644266506599, 2792768252148, -8039307468844], [-1004551498009730, 674108866174, 3477980955826, 765395322292], [-2980109462964373, -1112465026769, -4003354645097, 2733259589081], [-108354567522433, 10468353877857, -675427439924, -3272210053468], [461857823409047, -347312025964, 1415127070705, 1374570734970], [1259379551852354, 4899093243209, -1228128344661, 6142797607178], [2171505673919389, -1568920459052, 3892055234336, 4236441936787]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_342_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_342_10_a_l();".
// 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_342_10_a_l(:prec:=4)
    chi := MakeCharacter_342_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 10));
    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_342_10_a_l();".
// 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_342_10_a_l( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_342_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,10,sign)));
    Vf := Kernel([<5,R![15389064288000, 6547343400, -7813530, -1395, 1]>],Snew);
    return Vf;
end function;