
// Make newform 350.10.a.o in Magma, downloaded from the LMFDB on 29 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_350_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_350_10_a_o();".
// 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_350_10_a_o();".
// 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 := [15584709, -954173, -30664, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [-24541107, 879788, 2988, -29], [317892135, -2870324, -38844, 377], [-689084751, -29287144, -1164, 967]];
    Rf_basisdens := [1, 285564, 285564, 142782];
    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_350_a();"
function MakeCharacter_350_a()
    N := 350;
    order := 1;
    char_gens := [127, 101];
    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_350_a_Hecke(Kf)
    return MakeCharacter_350_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], [2, -1, 0, 0], [0, 0, 0, 0], [2401, 0, 0, 0], [-9083, 47, 1, -8], [-45744, 348, -2, -17], [-92248, 1434, -5, 24], [55446, 534, -89, 80], [47265, -6207, -414, 8], [64501, -3716, 1249, 844], [-3072748, 15951, -1419, -340], [-1080497, 49569, -1744, 421], [-4263570, -86518, 4483, -545], [-7014741, 92014, 4883, -5933], [-6518066, -412, 7056, -2212], [-22377918, 297101, -16331, 4151], [23898612, 450097, -8549, -10930], [-11015902, -182258, 32578, 22757], [-14825043, -640224, -5052, 16917], [-58315091, 1140930, 8799, 14315], [7271038, -400926, 57423, -907], [38579611, 1070652, -82209, 24501], [96263360, -1118601, -151992, 3026], [-247781096, 2358530, 55019, -84747], [-236255180, -5693124, 136902, -73569], [-219778714, 978080, 57518, 240165], [330509214, 1709482, -22524, 81672], [-672443156, -259289, -40060, -88509], [-258943179, 5651247, 269066, 228781], [796607889, -6451238, 322614, -35824], [-1032747547, -9014004, 147941, -288935], [-468151420, -1830644, 91096, -571728], [-2830144050, 6055491, 76450, 710315], [-478413194, -4736301, 228686, 542900], [-2620672537, -11918242, 716751, -659134], [1296060037, -30464290, 301313, 970699], [-3537109150, -10034784, -783138, 260741], [-5357419484, -27396846, 177811, -2081496], [-8461874096, 48920977, 1655831, 414536], [2597171186, -73540536, -1978492, 939830], [-3887778256, -38078500, -2682387, 249250], [2148020914, -38143932, 3590824, 3802171], [-1693382564, -20531942, -6589168, -3275512], [-11532492519, -86512921, 2956491, -349131], [-19354635747, 9077389, 756844, -1220965], [-5367970702, -38695191, 4188731, -2980672], [7502899772, 31645552, 1407703, -4312472], [-6638018526, -132943841, -7863599, 2162626], [-25194273346, -30486636, 1658314, 6051094], [-9350353098, 145625570, -6515990, 3508508], [-19843567061, -161427158, 10537389, 4107766], [-13189997384, 115061528, -6788828, -9480754], [32699042394, 53280836, -6719575, -5829750], [46620926572, -102792782, 5293991, 5265744], [-27102779900, -257352706, -6422456, -13143407], [-26739074317, 232777071, -22982576, -1618770], [-4428800912, 652248538, -78948, 13254609], [106931414512, 250223701, -14643611, -12242686], [-35420296426, -243922696, -5095456, 16977424], [77624636393, -89945387, -13674752, -1908221], [-58011340350, 444053822, 10093339, -356560], [31230689036, -223008152, 4887014, 13777381], [-53685873532, -609680418, 3211963, 12013108], [111858300644, 742800434, 5922748, 7272400], [-64924875562, 477836464, -9942292, 13800898], [-90435705919, -160804169, 38888532, 2653185], [143679262435, -509689242, 24234864, 18977725], [-206487469602, 799361269, -17355702, 11984987], [-231878481325, 220506508, 52947812, 11940935], [86941245042, -2624212348, 18758234, -21639166], [30626805684, 684298860, 26762278, 56710709], [63270142777, -1775183595, 2008844, 51990430], [-181309356230, 424663367, 52689755, -92948448], [-101923984343, -1143346296, -78661285, -31185900], [-128294955505, -868483597, 50879333, 13236320], [-63421913388, -66850857, -55210477, -116894848], [79670092949, 1334040901, 80268326, -35373679], [-194192918418, 1557940960, 49936816, -14599996], [-142474285071, -1668006935, -2922885, -75745257], [-51268858778, 2739428488, -48643151, -89891794], [249635204520, -2278761975, -125075014, -13159522], [-466966049905, 1064045181, 122811376, -34360223], [-138495575852, -6649418408, 56548000, 41344578], [193435873976, 2583461218, -1307925, 97929404], [310763557584, 2000763557, 117061395, -102031110], [173254948756, 823801236, 155056857, -114567254], [263286781343, 735858902, -249831604, -35274616], [26897295149, -2372425803, 218813941, 65345151], [-456007118888, 1167917432, -149111914, -44919623], [648017363144, 1312582705, 13679967, 108766021], [95939140970, -5690865546, -260547268, -149355118], [701626152688, -3714182501, 212034303, 109617344], [197833281243, -10194322405, -111859716, -54165388], [-456858447587, 9451191115, 20034384, 86113266], [630523984884, 8887949571, -206271011, 18638475], [1089462327726, 279816312, -102840980, -39974248], [1047742847576, 5974835898, -267008996, -191656153], [1352702733846, -6968658052, -4856763, 141074308], [-440651287076, -2063570842, -359158061, -306954852], [1165771262251, -9929965472, -367755661, -181028036], [-610229010591, 179477853, -563074891, -58508988], [1305589127945, 2153711197, 257691374, -150691271], [-747835123430, 6587317436, 413189894, 225989838], [244716507413, 17654107607, 469696425, -395170729], [-473062311797, -13821166433, 76477326, -84474364], [762697682470, 11517711098, -108729001, 216834666], [2807330253994, -7640764225, 743006974, -14422834], [435369411980, -21587034196, 56664619, 277452594], [2050140209171, 6207745214, -621562301, -54786561], [572852656432, -8497021304, 1146861417, 564170708], [-1343752872224, -1672310827, -124764677, -241269738], [666715651803, -27340549296, 74069459, -456407394], [1093535909679, 5650952008, 65974915, 429461460], [1902212457564, -22667299037, -466385183, -455069682], [969128990895, 4323503233, -1062723060, 151250778], [-1210929377223, -33604501135, 411223184, 34869617], [1319706335800, 16169000918, -1148069814, -764664692], [1515223570334, 16870503118, 343496812, -364275914], [937230084826, -6593636395, -149506387, 647216397], [-765880871668, -20806177041, 130759520, -759800989], [-114467563794, 6334643048, 736469600, -678828148], [3204084494858, 12068299383, 1309406245, 626577917], [-989838252418, -11672571472, -1567014758, 157307978], [-322643180245, -33390516174, -357622898, -611651443], [3048496053222, -25481103097, -1317513666, -885727052], [1321648107774, 14558673928, 238055898, -1226725132], [-1678757509386, 3178045529, -2017950939, 900521157], [-3671032723858, -10549689013, -1700377405, 793942742], [-2218200473192, -2179927808, 795126462, 116011580], [482312600276, 22242222396, 1346717624, -338576868], [-2766129765575, 19123540542, -214029127, -1587150757], [-265064761608, 63789805080, -146140096, 710344674], [2392510956556, 9311952323, 1017763207, 852311083], [-9609068052801, 48755753731, 1888543584, 111591693], [2487924348280, -19041010760, -322128105, 1194612352], [1221312196754, 25504362154, 2079779239, -695574129], [658288159412, 75893798318, 111711702, 1418089469], [-8395308406418, -16948409125, -2980911617, 375886780], [5181003864364, 9959689342, -1088851460, -687694692], [-4873125973717, 66696642992, -1138302501, -561651202], [-4684118223114, 41845551070, -831143240, -1776543614], [-1723679513950, -23122618417, -821045129, -2217461489], [-4079692288419, 18479663155, -1099574442, -787723558], [-12386880197333, -48512498581, -475603677, 1916623348], [-2351578054964, 17033296664, -690654160, 1582419902], [-1387091752234, -76980061943, -4593902869, 1571704056], [-4584181245708, 138376753904, 998321422, 1447622666], [-2842223077222, -22472615416, 2878801227, -1037587721], [1624103530378, -24961125020, 4729494965, -1286150038], [-3229676265709, -23812549130, 2098949919, -764639935], [-17609369545210, 56611399975, -1092934901, 485615265], [-6021654473708, -80247682578, 2890077564, -4246818729], [-10613144239715, -32849295947, -3549626203, 1175402666], [-5744987978162, -106778343415, 962435899, 2206175682], [9751156876388, -58794663236, -4109261740, -2518040032], [3318058713059, 181571415065, -2906455796, 2653897070], [-7512904188761, -147015874537, -2009856016, 2897714134], [-2409564917254, -37972437156, -235637372, 4341656931], [29815435815794, -23083244888, 1476787117, -570795661], [-8308211963004, -61775747890, -147772950, -968471309], [6097426046060, 40380663258, 4950928046, 2171892022], [-21061915057059, -31881891603, 740251429, -4413419081], [8203261582776, 44137502644, 1690904458, 1847401404], [3123825068118, -105139792374, 3273068531, -4343620046], [18587383412315, 138211464515, -1654891531, -2211586455], [-3584316519404, 14904953627, -6549636231, -771783646], [3399207843227, -190365153533, -1938265118, 1420201950], [29866247480714, -64482024356, -2919165196, 4290210434], [14017241330611, -24385808985, -3775198025, 4627708719], [-9332577010284, 140210369906, -8682183384, -4668433952], [-18408257321617, 99558412840, 1131932404, 6137879369], [-5276734491174, -170136001922, -11796908374, 5152154950], [-460939104197, -254046629087, 338342882, 1636097236], [-2463750684058, 81232254965, -3641150202, -1132693439], [-5441197105726, 188891654877, 11737860561, 2351747748], [4692539146852, 72113357912, 2762398461, -7372299040], [10823918881347, -115015724461, 13510356801, -2471380944], [-21434885381642, 173753991403, 5122153523, -729284091], [22775764926932, -74413135961, -9174654813, -3817129004], [29879252337352, 53650074630, -1265875496, 540152495], [-6871131222381, 49403000771, -2151521238, -14172847088], [-31109798881976, -331674182804, 9953552319, 7091881572], [-9351494310645, -141790865476, -2095241053, 1391859248], [2107145346750, -225404018828, -5107086883, -199543562], [2954490522225, 141713258748, 3113732889, 11004758967], [-8542231009194, 133807234860, -15729621426, 1348194486], [28762323195973, 315676336478, -2793862277, -230749880], [-6347754608030, -112739702826, 3421264525, -10618701758], [-32522860594255, 186978267199, 3260617313, -6704204593], [-42676766453222, -57563350511, -6042669509, 3848536080], [13350207493386, 280918207968, -10115727191, -1259814844], [-4944686947507, -161234152820, 16267434172, 4477770707], [-50570269761215, 89043269664, -8544724338, -2894702969], [8060232929702, -227256201872, -2689607502, -4713590180], [49912219348575, 75565986444, -1754410240, 236498411], [-23226458072374, -355114886470, -13719765378, 10084680789], [-47257299136635, 442763888246, 4686791896, 8423257742], [-27177252436713, 385640553322, 10887548289, 9279289738], [57642880688446, -167313312200, 20573265465, -4510022938], [57869936526524, 187190537415, 6562281511, 1091248658], [-49807058879054, -569227628263, 9014807487, 300260429], [-77624585712526, -265415912868, 6419183768, -14736461594], [-27708458804128, 110583699638, -18523550084, -18359348335], [47181816696698, 23298723548, 25927913059, 12843094805], [-17876664932766, 257639730723, 20519239483, -1440520944], [81708708242134, 238017540830, 4709222004, 6563506011], [34582316166862, 47489262458, -29620932798, -23412371510], [-54663260548384, 365500877468, -7718828652, -729400662], [-17923528546153, -121579906117, 15546266644, -464609669], [-36845661180390, -111400546787, 4301616733, 14502640542], [13946540454011, 133997240837, 2196011630, -4419841819], [32692700469028, -205402141460, -1333388680, 10648106394], [50264204491563, -504497475590, -9606231105, -10999880169], [-31915436598920, 570864019814, 19500510683, 6481025230], [-48663667237454, -101842581143, -10590019433, -10720766896], [70487814700920, -37864977338, 6477555233, -3705272750], [-11674008983805, 951030094621, 3408201364, 2765967672], [42133771741570, 547147674064, 6667005733, -14977928916], [67951364287213, -143662811733, 28213525788, 14581095788], [2352989717267, -93813598570, -26414559077, -5619223704], [27456975180517, 235879765619, 4605705548, -28922819733], [143017127448508, 67611656648, 25009438458, 32244670352], [-55553389747645, -164815303519, -19603178571, 24975863049], [-91741205379999, 1153305536442, 28901810037, 18944965093], [-97491833747996, 41780224595, -23818567902, -28290762522], [70976256417870, 95067552415, 8086071667, -18846729169], [-35444755553414, 151714756014, 13158658799, -34329487757], [-170505109914077, 155474834202, 1833515949, 10228314853], [-191088146909320, 689428648338, 6558795854, -790951494], [55449762369261, 86910824930, -22985412516, 30294898623], [-103797294914221, -596288840322, 16423539377, 19811827392], [13124971945528, 763806445915, 28902350586, -19515054700], [-47130093120140, 962021769129, 24727230069, -4649149683], [81981257728091, 706696676210, -14062712650, -30612985634], [-22442893032756, 332258581807, -49501528571, -13875717034], [35268317047944, 98644814949, -14477655989, -11395287710], [294684302609262, 269234825036, 5711169473, 775050349], [-153646081871363, 334200943439, -43528180706, -12920823703], [27352051952325, 1303672645286, -37047092924, 36059049035], [-3171966459008, 329214836630, -56456381330, -58704006230], [-54888087113211, 30984487325, 23492031993, 1618504654], [73871430349360, 42197361095, -6759541622, 3270558076], [-122334039637328, 518238277381, 18695148477, -19974099960], [-12218716922965, 673735443958, 69390500097, -9839735068], [-1219864281644, -69787592114, 87107383453, 63407404839], [241944924607816, 1072432494592, -10413247154, 14713411206], [-248472895543526, -111873588618, 46724208894, 28430332030], [-19043577808630, -1222650782200, 32037886338, -12986920694], [-163711873344440, 1425950773490, -4229169363, 24809028096], [188712999711816, 203362627462, -24613811968, 9202558278], [-182013952304834, 1829199714185, -21281984509, 19731277155], [135170569902570, 258939871188, -74306049917, -24109997833], [-34697482285096, -358366552006, -23560047920, 26546248102], [165912920082084, -1067540908518, -18374586965, -16361129820], [-77803574498638, 1052668491146, -4411714368, -19547856220], [-193626941852604, -359340249248, 24123556195, 4670245128], [80560112061349, 395858135165, 12650695570, 62874876853], [-171021613060052, 927181965608, -25715255293, -15304432038], [-204797989848166, -548099125540, 58401622382, 43137142360], [-186899193153826, -2017834843834, 13952633437, 63692577422], [-132967983611628, 593260846122, -45246696880, -63656004524], [-77444481081973, 444180629191, 84235435943, 42304649932], [-9888997632600, 27531920906, -68908347248, 31711122203], [-59110233337372, -575048756402, 19535501238, -19678475049], [24915191169278, 2567157504044, -35494052393, -30685583841], [407861331217688, 468546196662, -979701671, -28435851002], [265371351384219, -227236543242, 8311251929, -17870437796], [123072308050474, 773890019604, 61697944016, -70313568161], [135166012974675, 241026384880, 92698255268, -34237285127], [-99898174592905, -2301634628317, 38360079238, -60112480041], [103867713142964, -1603618421392, 51322531096, -14206175068], [-96345715976340, 1746312579618, 2765464451, -25421706038], [-260332709991612, 225386915138, -57598518163, 59564678748], [54585519657027, -2096647608009, -19076035876, -77410497428], [-120540218511988, 747812298442, 88679083768, 47604391544], [312752930169612, -612637724962, 48387702590, -7001419732], [234317552550163, 1120457093945, 21911656151, -85943586302], [-230424651194526, 2026353831535, 40362807829, -30181675497], [-69254262681537, -882765239823, 17351706294, -67126936225], [-58944964384960, -909436886502, 50547090169, 31428033150], [306239829056250, 1564379902991, -4511219211, 118007296278], [-316275863175672, 349174771897, -70737308537, 14021344617], [-254233320425968, 3063070966493, 28850886983, 54149321586], [138427409922484, -261655616408, 25395779306, 121568068590], [-489341413968074, 1138570132413, 39070402656, 33993489996], [-565721186458779, 961497851184, 32385291563, 57269256763], [-604374635700687, -77691835037, -31101850690, 49946031577], [287906960502569, 3189381468680, 20374731429, -83696730274], [-207663371700404, 334614286238, -91170130694, 48568186938], [-101107664520190, 1039611750950, 12911639230, -143152891840], [424565168140827, -1864788048186, 173986833825, -56765362052], [234861106054528, -2568300220693, 64205723165, -43684010516], [43313853838879, -1048212820479, 197431641193, 15883014781], [218237736596046, 670398616289, 6509099542, 29507679080], [-302228115171031, 1236869474912, -150202833323, -23231296350], [153918484351960, -632949723596, 142936867792, 18568193004], [-195030360350382, 1172020716611, -57207098243, 17551241332], [-37400202607104, 6157388891516, -3868640480, 80130737445], [595336443961942, 2931710078263, -55829821029, -118500261188], [-177661475512998, -2488245586006, -51789352025, 51802115004], [209097131567130, -3946003556298, -187938190379, 8871192061], [522140580227090, 4184286737985, -93558030393, 5508192349], [-76993823349761, -2601876165453, 73212677292, 125587841296], [586529253258755, 75135266300, 16864403572, -28635606575], [-942575131612941, 1109902234258, -39138889478, -23854929865], [579811415779298, -2726889490687, 93893583356, -55651591421], [479308164679261, -1451509134397, 220339193760, -88964684242], [382926805962440, 1965893975060, -9428863640, 7068392835], [-323024689462241, 4207316333038, -30268866173, 33369693903], [-955473270107562, 1371857459891, -184764407339, -26714789429], [818351182874454, 1371870016347, -3575794947, -15489643602], [-713427315777362, 4670685591907, 33258705827, -13490805983], [398096966442149, -1391398834326, 114414881198, 84144770960], [-519931030105972, -6647613634244, 18822993176, 52115672916], [8447405302593, -4628554514751, -234961499812, 27482183992], [-318016589567128, 1384405953294, 214535840472, -91889493588], [-8144012435722, -871985921578, -226402127361, 7740468198], [-132166846029560, -1972770826838, -316986136964, -61621824936], [-250535061706230, 3511252229856, 268102923669, 142446950513], [565057296131589, -552021234271, -85249770475, 269138382529], [-818023691870208, -3756412106428, 127261845964, 82051994526], [616804450003614, -3738709462526, 102781620135, -131449427478], [833797973942650, 2647941305892, -74221809598, -28400456478], [257475361625941, 989113185007, -15724323872, 45692970356], [-488663132001595, -1562988401197, 152180598286, 160362141223], [-256747780836456, -323056747826, 225721119548, -99158802745], [-840339089995393, 2911598998011, 130298476005, -66377097890], [183401942889482, -9730048774744, 183247821354, -124263950474], [-341132512747143, 1123324686011, -62897933292, -19659876518], [658613916533839, 444745976722, -123509023693, -63558311860], [-315277913548518, -4532204852027, -116259641873, 139563285607], [-177988145641445, 1533224245684, 315146369959, -255347263312], [-437055177276462, -496559997988, -12927993922, -85853761510], [69041343617116, -4988308424102, -92762524241, 3716435706], [-971453459293228, -2660341406730, -154036318205, -67704884310], [-491462252958222, -4101153634716, -173703107706, -186583236080], [292412888246733, -2171861189554, 380853172931, 221634467922], [301766427631780, 2428461739234, -359326777532, -187309236369], [12118317494744, -3182156780336, -461169357503, -15817469253], [-1487921806706582, -1544484550515, 18128107219, -1241259078], [-702865843834122, -9368111817527, 259970879725, 144014956697], [-891196700913597, 1563042335276, -37250019248, -96491019582], [-56246754445342, 3199577726, 163574177740, 58742873299], [-778002283767297, -7659501112532, 71464238417, 232162199341], [-1032918950869281, -895946122452, 125904482863, 44071089750], [-404135773105223, -298097898073, -84433903248, 74761512408], [-429707856846462, -8428393565328, 48850443874, 27265808925], [-594066271894441, -1520408215758, 332354072112, 118219244669], [246972922861786, 2478662969254, -149972221634, -56000649438], [-835950140566930, -7310888006266, -186692311750, 144261237421], [-1005359616795426, 3821635449151, -595648896332, -45307636906], [858815235637793, 787202276894, -212909724817, 356675292112], [1113593415463162, -7428296513885, 241209871561, -177743446917], [-1985268331372590, 1303672755050, -18665843758, 134933632110], [395943264537667, -1573816196459, -82861477820, 487385598975], [159199604186570, -8001805776418, 40986950943, -280386770638], [661677579626752, -7967917072865, -400523102753, -240845481876], [-400962971267838, -3798907616105, 4510010694, -106112051668], [6283124396674, -595059096593, 130224740749, 327784468335], [1234396377127716, 7196945451105, 11305870497, 88431595009], [192238108224325, -10420712938455, -141026577198, 100000629669], [1560667199056060, 8340893467218, -207648744981, 10041430915], [-730578156733376, 9698146152251, 200392683307, -3612246853], [-845130364381259, 4850402740916, 311573191539, -106716586117], [-601384059653774, -3115039442008, -220779573991, 24268705378], [-1515068059949338, 2517469808514, -126584642735, 62072870270], [366078235622770, 5367815354424, -88549423558, -99549388678], [-590532108507373, 15566810356203, -265764301674, 197761247506], [-92933668950741, -11049694233595, 89422612809, -415262800475], [645474673345569, 1768082540508, 299142024291, 272883685377], [991519441741148, 2334075275941, -324513175338, 473123660160], [102088254636973, 3725792087151, -103073376242, -255139439138], [-690288100596338, 6885847010545, -99476456537, -504646771773], [-305604011043784, -11303329922499, 354201044125, 92252763278], [-78491631240327, -593640635957, -80353737528, -353324717493], [1432612799437168, 3518373709800, 106138120843, 264903322756], [-26146543672523, 1650758978689, -263144225968, -319708173966], [-2240315345220800, -5832192489678, -136108764023, -95958573506], [800214512806034, 8387594470682, 282723912791, 70185210568], [773237372292538, 4123532692858, 290126176206, -169638174571], [1047381182810986, -15073481923264, -499262657158, -248300234891], [813055424911037, -5933478913706, 551043845524, 427639329302], [-491296649430875, 6739091320090, 337521214529, -104553301435], [995038929137213, -4329318232246, -515788279202, 301016662702], [2045686472153998, 10429094928421, 335853204069, -150653023174], [1051815709954004, 8839062170912, 360344076062, 566111790360], [-1410772379673187, 15087022531394, 499211128681, 105460771515], [623528318709480, 3319470239864, -367885390792, -331201869265], [-2580050210993121, -13806371530513, 85550925818, 209759989368], [2044045468215190, -3330949231917, -150940610111, 510894245856], [-45091467510567, -164942420459, -655226983783, -173038693295], [-187311642451028, 8757804257700, -134253807596, 8305877389], [896119127654149, -15936342555892, -372771946094, 43890396965], [-57708605166126, 2589734914662, -50002951209, 534108017186], [744434924227185, 8135735553634, -192397265597, -255708252291], [239574284576439, 16348642749988, 683334617184, -430810456862], [2134270405240236, -12736864293058, -473747038918, -12298433226], [1198257671908396, -4608443560174, -350113214519, -10119928711], [-49822121519324, -22300475337464, -334570307539, 286110463526], [1039973051247813, 20163677256987, -350530847736, 329320189785], [2706803356861272, -12127667089326, 427145979144, -85518316967], [139350264629953, -8180047305053, 263268457435, 479712006105], [-912952863820031, 10015951829927, -541291335274, -164904057734], [-5230688613192, 11968411803324, 216982128317, -304114571081], [2569145493581126, -12258072926034, -218528032724, -276806596806], [-1274252034216112, 12520753388005, 185575645673, -50631563342], [1250110014671313, -7302423901435, 177614354182, -627483073489], [2176817330147782, -10137995699447, 175115298351, 255199914949], [-844546610794038, -12803268278205, 20234377315, -153338251678], [314130908493052, -24412121117, 481797195494, -330583291414], [-3921421085822608, -442083231236, 333021891319, -28165262023], [41363549369327, -10896036399790, -43019720445, 124582604526], [2597849620173348, 2713257565956, -800392822215, -491649833472], [-2844235472598417, -4196500880701, -256204790438, 142143710648], [-1466551912948085, 1368836217681, -236061295023, -178855993819], [120652037421746, 27281767189908, -287080622296, -26593962306], [2330222591310928, -19938372761717, -615363364061, -396174763385], [866277175129486, -3834587401385, -173927146587, 420027605896], [2404077963123308, -9970265599666, -340863358609, 100669360226], [308320348200556, 14824768386173, 408239627313, -767809672042], [-537515392892882, 11764221262685, -453722445363, -363944189177], [1156735682970614, -17290293749066, 747525333922, -80524446897], [-607988635676792, 22211343182707, 492736909273, -162626405277], [-122903343461860, 25520946481150, -149807483129, 19432590428], [726397205514016, -835167619148, -842198524435, -111373641263], [-636390705897050, -8361723392820, -1384867254082, -425019425683], [806547826550295, -15520450853831, -635996183536, -25041161306], [348849918745590, -14546873034207, 511300378608, 688201544235], [-3175637217194892, -24729331335388, -18746653273, 806087537874], [2426616620089310, 15236224261678, 61512220764, -211460736342]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_350_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_350_10_a_o();".
// 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_350_10_a_o(:prec:=4)
    chi := MakeCharacter_350_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_350_10_a_o();".
// 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_350_10_a_o( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_350_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,10,sign)));
    Vf := Kernel([<3,R![100363104, -143388, -39210, -7, 1]>],Snew);
    return Vf;
end function;