
// Make newform 400.10.a.be in Magma, downloaded from the LMFDB on 31 October 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_400_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_400_10_a_be();".
// 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_400_10_a_be();".
// 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 := [-635000, 111148, 4237, -764, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [-212885, 15848, 2304, -38, -4], [1707050, -1154384, -87432, 4304, 232], [8293595, 295336, -103872, 434, 172], [-6517800, 493304, 54392, -1574, -92]];
    Rf_basisdens := [1, 945, 945, 135, 105];
    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_400_a();"
function MakeCharacter_400_a()
    N := 400;
    order := 1;
    char_gens := [351, 101, 177];
    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_400_a_Hecke(Kf)
    return MakeCharacter_400_a();
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..prec]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 10;
    raw_aps := [[0, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 0], [322, 10, -1, 0, 0], [-9711, 11, 2, -1, -1], [-15406, -117, 5, 3, -4], [10338, -467, 38, -2, 5], [-68798, 127, -32, -6, -10], [49324, 2394, -34, 28, -8], [-866120, 4863, 447, -47, -106], [1419018, 8114, 128, 2, 254], [-2370696, -13959, -1333, 25, -452], [446815, -110188, 1778, 134, 50], [-2951541, 147796, 2330, -131, -163], [-3086308, 50672, 1133, 254, -862], [-3091312, -325712, 2110, -890, -554], [-4665147, -446192, -708, 1199, 983], [-1485114, -607307, -1915, -561, -1194], [58843877, 22791, -16072, -1925, 6223], [-3169772, -595024, 4797, -2914, 5706], [69899332, 247883, 3000, 3192, 3401], [-109671764, 23162, -20245, -6818, 5286], [-152515885, 31299, -5362, 6657, -7747], [336477656, -1994489, -73170, 1094, -1573], [-307466630, -747278, -46914, 16250, -3712], [359765356, -2893549, 53729, 16739, 17060], [-335375832, -1510280, -63557, -16002, 46106], [289210071, -6296415, 24620, -8343, -43939], [982465852, -6182957, 35625, -917, -37140], [611834919, 9774504, 85614, -10314, -4770], [2103876390, -2012274, -402858, 226, 73142], [-2007900789, -7432608, 288960, -36059, -39247], [-1733906765, -4188446, -453378, 27462, 144220], [-3076974469, -16988993, 398416, 9933, 154049], [6661632868, 18954409, 345245, -84269, 26918], [-3165291980, 23792094, -585681, 45790, -19018], [-4366865356, -13319262, 122848, 32132, 159482], [-7711971889, 31491131, -705412, -8323, -6091], [4339599786, 12772200, 815097, 24056, 3700], [3539168410, -14972784, -1818306, -74870, 161642], [-5831407988, 23382867, -1439932, -260576, 381004], [-1051102352, 32832832, 1437494, -3730, -245522], [-6548557300, 38023022, 1268028, -58552, 545772], [-3840178006, -45444351, 3045982, -45398, -221235], [-12533350680, 29010422, 2979148, 129664, -267406], [-4780147800, 62078596, -493308, 483848, -362992], [-12117753955, 70231553, -2392990, -439505, 110259], [-20217278026, -203130588, -1085948, 509554, -67206], [-8940644095, -58477292, 2691420, 167611, 175467], [16245711768, 81606958, -1730494, 669030, 115200], [-24649254866, 25963748, -1710620, -178248, 1000644], [33378205670, 13867468, 4171175, -833440, 1065340], [-28658688496, -21438033, 1894628, 821140, -937295], [-5345732376, 4037985, 3073260, 991708, 1289456], [-6659397802, 131489398, 1255950, 330838, -1721880], [-30813476650, 243691546, -861628, -1195426, -141830], [-21151805150, 407776186, 8133520, -975904, 41070], [-25294560272, 92304170, 507320, -334996, -895648], [24078417762, -421532441, 3119053, 1025771, 1192536], [-62147437634, -721667022, 390610, -1469522, 2823252], [-9295693170, 522098759, -4507542, 1422018, 2484758], [-150813938166, 245238221, -2469615, -1126957, -383550], [-102853512710, -491911839, 4727578, -1535782, 3225482], [-24823934852, -73448286, -6524491, -1900710, 1343666], [-179979358018, -82593814, -16403250, 1986694, -80204], [-13501239102, -459479388, -2240322, -3014782, -5056130], [-19224523811, -424718209, -3379574, 1756283, 2786995], [30655993643, 929875740, -5348182, 6002194, -1377098], [-100954084791, -1293632515, 11883306, 1099279, 5751703], [-19115263450, 1030120675, 13039919, -2699939, -2063938], [-146255670374, 645505398, -16754958, -455486, 12094964], [160208422086, 64404354, 25572337, 3247072, -5383752], [-5021542798, -982638684, -34027070, 2111778, 10450786], [-154287076770, 2450495822, 10972962, -2239422, 9369164], [103639614456, 674062505, -22585286, -7118108, 6668132], [-95417946848, -1562292154, -24171969, 6987906, 12454682], [202922935958, 2693609692, 20281904, 6138884, 1910728], [-172409258512, 804996948, -35903456, -8324784, -4534484], [-29976779228, -1279747123, 84273282, 2730110, 7330629], [348837098915, -912972022, -13677988, -5878836, 7023562], [-176927783410, -1029825545, 30891876, 3225594, 10664962], [-11308506492, 1940741994, -22943134, -404234, -15278012], [-111070723610, 3980802690, 58963925, 5787912, 19896752], [117018531500, -3906760729, -47673602, -14364906, 854859], [-365308740126, -1427277820, -54502493, 6973900, -2125288], [-360267429202, 1310307919, -77070360, 10660834, -4468230], [317148654658, 218691491, 18777318, 8662218, -40009165], [-307533970139, 5046700570, -28018376, -12557076, 5582234], [280615584582, -1079201532, 128485866, -3824018, 16797866], [20371773248, 268865140, 31619906, 1948468, 42838316], [327263090745, -945863884, 419354, 4184455, -3591321], [-809040108864, -1994394226, 42902242, -5583288, -15593652], [419469440966, -2498132554, -20380734, 1803282, -34919170], [-67212142923, 1387889772, 133129828, 10769239, -25555977], [-1009533783561, 38528152, -56166168, 6747193, -2648475], [-45989846006, -203723092, -80901268, -12820962, -17453210], [222344103318, 5042209060, -17031100, -696072, -4667052], [127679129161, -709570116, -36637816, -24810512, -48899612], [364618352819, -3956629771, -29178482, 31822529, -22968131], [746309988662, -980414260, 130807822, -27361182, 9147702], [-107377503402, -9604156819, -44481614, -49996342, 30356062], [-47934509474, 971165697, -107563305, -19493671, -77928476], [998896690825, -3842495520, 310816596, -26701421, 13001939], [-1051640965667, -7120949300, 192375728, -8352048, 66170484], [1042932126153, -6115373212, -160287130, 12249663, -2968289], [639774902439, 1099572592, -16673622, 27900570, -114201734], [-934962259482, -10162942401, 32530642, 48708926, -84428002], [591165048721, 6832564598, -67470606, 15308922, -73612756], [1139572830498, 2216451714, -541048785, -1854568, 12821728], [1097816758510, -8982258819, 76545194, 48318618, 1247729], [117976844230, -2424633904, -379254406, -11399106, -18695282], [-7965254838, -2550126324, 221856264, -2758252, -37289336], [1965669570410, -8719306904, 102379368, 64505888, 33187256], [-333427161175, 5069462108, -543367436, -30017045, -72383725], [332460047680, 7672411906, 125706478, 47646984, -67169260], [-309927621082, 1918993786, -459530026, -82592878, -15906512], [3374420306933, 18197330044, -214963374, 46426051, -56942901], [1151846952446, -5525263028, 363252212, -64511614, 137074450], [852287476038, -12526008239, -156695119, -46189173, 57852102], [1289142276585, 3523457205, 264879350, -91246437, 168014735], [745231566694, -12839821333, 270769325, -73577797, -18612748], [-714220250334, -3712896300, -93635952, 98970920, -103430972], [2411218170820, 9673555942, -404699358, -4713906, 72130480], [2128449313833, 5801269353, -51862054, -139435361, 65285719], [352585122344, 10662826715, 325005876, -117425060, -158934944], [839226665288, 20015962803, -415405905, 91381489, 168971762], [-418150818536, -20053699694, -401793314, 3770098, 249181336], [1369787310366, 34369820582, 341090583, -22818428, -187493180], [790758522684, -5344442860, 412990917, 114831422, -133577550], [-966888039586, 607986415, -38359219, -117104645, 54445280], [-1056112727437, 10301267692, 476904794, 73781853, 282040245], [1618490093880, -18983889270, -306571634, 81926000, 72188540], [-3212825891838, -9658752828, 830792983, 75484940, 299123024], [2312121331906, 24853735116, -429567486, 1827070, 175609010], [-432850686181, 34024666240, 95660078, 158829294, 14994846], [1409081350546, 11670950271, 1493351014, -174490470, -190144361], [1533351628980, -18561608739, 1425673265, 192268199, 12417846], [-2734789209107, -5127958856, -845004844, 57257371, 358989935], [-4190778829542, 6665787108, -715539492, 55611832, 65287604], [5371980891858, 32657093562, -682738650, -87810642, -111077748], [-5059621757015, 35237656620, 155112734, -177597577, 55822767], [-1857957925658, 34163125914, -648972470, -190228214, 92717016], [579030771104, 36976920932, 685997002, 43467060, 485021628], [-3426362381338, 9655461763, 1087577394, -91346910, 64845742], [12980141447548, -10051480005, -350747429, 206807941, 142570110], [4025144642518, -11155990248, -1452142488, -150863238, 550580562], [-6928370088398, -17455177686, -1893878534, -164056214, -415448760], [-8272497704045, -98454953836, -214007312, -149120220, 325883328], [-9609176234545, 70364500007, -2136604256, 213677105, 155859325], [-11902602888018, 69608500092, 1215959375, -158372304, -129392284], [-3106348833362, -81914158088, 1086571166, 207376802, -97551398], [-7803286126590, -40761179502, -981132342, -1705718, -586746736], [-8489843016826, 117522192129, 377665630, 35259294, 605036134], [16401373787976, -18223773236, -554195232, -82828648, 385377848], [-16313898984741, 24625983468, -562871422, -94574259, -23409283], [-7271947190018, 39459377860, 1150764414, -84662210, 674689134], [2975031683474, 74086977950, -974889094, -261436090, -92921998], [6334426601838, 84821406028, 533931228, 421618532, -585006328], [-1823991676016, -106177110155, -1823939494, 273198858, -672560919], [-10822462812326, -22108352829, 2174641573, 91630139, -92909092], [-12945908733083, -36023893128, -722371744, 465574687, 76628911], [-8832481605885, 79641947700, 343396348, 273993392, -523809460], [-714814215282, -31712235000, 674166626, -128268034, -964925514], [11314369271331, -90452483453, 176231168, -15340607, -223257271], [-3406425544148, -17019401229, -3120154478, -41340578, 627352311], [-10468855514896, -11849634434, 1016811759, 973404490, -1073761782], [-34164132749550, 11510075026, -1348865217, 64009600, -304738128], [4784295788258, -28205500022, 1348546916, -262671916, -896695598], [3669860836440, -138830755687, 1234445838, -467032906, 273317985], [-11076837476012, 79094681847, -247855229, 219536877, 57321850], [7014759939798, 211550760457, 1021341084, 86399154, 331849258], [4364799136254, 254834371765, 2082542013, -126172857, -501637106], [-4795558571732, 30214589634, -1776888973, -262920626, -219325610], [-29760187322830, 25619430959, 1816254194, 294172706, -247501009], [29085826798656, 19024092412, -146027027, 592545018, -283054930], [-18412002128682, 11347913613, -3710806190, 375952670, -306018619], [811627894308, 73773530513, 447344744, -150086848, 889323116], [-21477405525418, 16694922375, -1937131709, 499293025, -477624690], [28038778876260, 48832656976, 520134314, -498075504, -862259352], [1732260348048, 95926921558, -4211967468, 481042920, 1110855226], [6884987656096, 192378244060, -3394133126, 332992228, 173753500], [35837323311584, -44574678797, 3873989078, 285334336, -1411536268], [-30466351504140, -35377682381, -1821972923, -1226291305, 615623928], [-7404123277668, -26273683897, 7227135684, 305844064, -1213408475], [16638258651942, 22118629712, -96119641, 58075520, -353614180], [-28767173996862, 21602375318, 6884823752, 470540448, 746538658], [39947799302078, -66241267495, 2244707981, -823753257, 1226927722], [20988604058156, 187148534145, -448424478, 436489620, -1114594944], [-16608133823425, 167489655030, 264719612, -1579731616, -105467262], [13315784343278, 254802068340, 2885032543, -1208319104, 1361248068], [-17611891085619, -211300663232, 51663472, 1152451988, 154590708], [-6024237460464, -49275154737, 5199369018, 380488152, 50481564], [839851889919, -281393619275, -6266270308, -444782459, 49522757], [-8421227540084, -207226757564, 1987792602, -1141963302, 910763686], [-45159314972484, -242639588795, 1323475832, -668169812, -746690908], [30253915222494, -16715241644, -12716774092, -331717372, -323115200], [54578650142351, -88997091392, 2405290712, 1252821124, -1204504924], [-1355441601362, 140307213854, 6433607674, 11931794, 847888780], [-35302851530527, 87351974642, 9392424718, -284071654, -2041050752], [20867341832678, 76660441734, 5547932547, -1281241028, 164382404], [-21150852338140, 402603492934, 5517435648, -256118260, 1171722254], [-70584814976714, 341561183212, -2695948722, 58042502, 952801526], [39363858434906, -71564562244, -7087111302, 435810310, -545310326], [22506733492289, -397923716264, 8228511274, 1451213806, -428818202], [-59155985040399, 505916403816, 325674628, 70056319, 3401973243], [-7996142992014, -24764627042, 861798470, 91479126, 4091111088], [-33507802529778, -76444254478, -9753406980, 1140753318, -462999118], [-33544566870671, 248622059472, -6039527596, -1066549409, 1095911899], [-5220245204758, -39150078776, 2974712828, -2363928940, 1655417452], [-42627444227375, 16455635976, 3446973980, 945383115, -4158762085], [52960128935558, -121821049332, 6441871904, 2167149764, 1343236008], [2920980206930, 123752208495, 4691699251, 239622761, -2013339730], [79873208184318, 132804820148, 8902801449, -402829044, -812806384], [-7210593432453, -179891705763, -8543351624, 845663133, 1745946385], [-18930604702314, -158378856742, 9592566904, 1626934814, 941222482], [120294530180209, 121269706406, -2575557070, -1029522094, 1768894676], [56582743954560, -191581154762, 10932681120, -1780693484, -1737283200], [7813195623552, -784207734577, -839977012, -1140080624, -1345005075], [139176556942564, -108025426762, 2924353577, 463056482, -999136990], [117025477478964, 99422220311, -1932030243, 854095927, 3162122020], [127287379625948, -312241564380, -10563678870, -1058372646, 477234054], [-27507485796190, -366319552896, -3949196215, 1062999416, 2709107292], [-17745756523824, -290287973381, -22588924180, 502731408, -2813061519], [100659011274380, -91636343354, 2880711107, 982884486, -1283140842], [-83252051360246, -193014489463, 15940869420, -630585050, -2065164218], [73193790358158, 756798836215, 1544154739, -1492929279, 1394979326], [71550132026132, -391664129743, 1807512578, 2227756270, -1444480863], [-6257532349510, -744173094508, -5309445769, 1995358180, -4350524232], [43663237838718, -528799936312, -7274918923, -507025820, -3220063944], [136869819726440, 619044168677, 7962607568, -1131249572, 1678343400], [-68479056565790, -52335902357, -5803733445, -2954007535, -4973275798], [-82651182582473, -50146591219, -16583257290, 2436890533, 2724436825], [-183221581892800, 530697648086, 5032836061, 1341537214, -1737218770], [-34846994484414, -317316654041, -12671390688, 1055635264, -969415611], [35606312479099, -419931365128, 15392644056, -1834579471, 1889401281], [68250025085358, 388582396350, -25897227255, -1146204648, -5497747680], [14234723049686, 905331298591, 19040312942, -726828074, -3119297197], [-303298201024, -899208075371, 8502953437, -1662073077, -1383041566], [-61428788434210, 63898368081, 19346293416, -1056526626, -3119032902], [-15699663005080, 171730576756, -2239702006, 966863268, -8696015244], [-105666921890748, -288404721935, 10951322482, 573234400, -4069942088], [-75439627934314, 1550991891321, 17447885306, -378063226, 1613076990], [100807837497114, -812860345298, 11681173634, -128727666, -1554904710], [39930928812688, -939926726922, -3392356006, -1827301530, 5498532248], [-89235502852877, 519800122524, 2335445150, 899310786, -3979136602], [154323074521032, -33796782752, 19572378882, 2051992244, -777143356], [1626087233568, 929234134798, 18626212769, 3066784454, 2396912614], [166219514328935, -939282631972, -26400387478, -1771136927, 839141265], [49990501795924, -386293620599, 21266111046, 955777632, 2032991872], [-58819180154026, -1110266850348, -1333603345, -2091607232, 361510012], [156882822782030, 148838213806, 11435112520, 2347179208, -1761038414], [-101231766889605, 1030577101192, -29759697924, -2627019472, 1467674120], [-68054414273836, -861606812546, 13872499317, -2115397086, -450557030], [61689485142006, -342177820315, -22974678894, -6229863814, 9664526409], [-193412441222730, -167370328595, 19128601807, 2069014769, -6569710752], [119762147062213, 839434888889, -42396204890, 2645097427, -1875715117], [34196257942650, 198642833867, 7128094809, -2482007457, 4967142104], [-262994375848136, 290578426943, -10311122066, 822712500, 1716533820], [-76042017427096, 21873460975, -15722924847, -11316749, 3887111688], [185110233292573, 179905799078, 19763580484, -4798733484, 4698948390], [152298888959168, -982897507882, -34891860035, -785452514, 701942318], [-186376846265717, 511522761583, -30644380236, -2613826331, -138375735], [32367611265644, -1376693241905, -6964352261, 3078603869, -3995329998], [-193801495214844, -1510955513381, 5311106299, 52157037, 3798241286], [-115426468921074, -611332272017, -17044667588, -795205080, -860707003], [108472083511778, -1571686947501, -5041244118, 515615646, -1982172270], [-94252148416812, -2303185178666, -507948556, 4437012592, 573900386], [-146829820583518, 608669300782, -37935813030, 5684984262, -8327297696], [-15312542569907, 627191744009, -27458680154, -5871182301, -3446299701], [-108003662797732, -844349730915, 13504877067, -2270740031, 8131276880], [-10480790878528, -2354612394621, 5733758263, 4303894673, -7149721918], [-157589487193919, -1325940080433, 1912422896, -6092274901, 2761045731], [-343893881950092, 659326423119, 26528817136, 391521936, -10690062035], [93835422241538, 107719055900, 39103602519, 6395632924, -4319789360], [76959293113574, -1618164062188, -6944713976, -362941540, -16903141448], [-14977743696498, 2315039733764, -12029901796, 5412746858, 8505086162], [-39845937138601, 1716558871793, 60832487582, 3660840889, 9200709177], [114329919935066, -879656358612, -24812724446, -2899346306, -12237175470], [-46862646352194, 234011029112, 65159161252, -4096894032, -5758380360], [127050002834186, -898784899385, -45697082470, -6652598014, 14031218266], [-180602014640668, -1448682159956, 49530393746, 4832030000, 13324047544], [-232898935717138, -1991345476826, -1013430040, 8321008950, 3305423706], [-50072113654370, 280054268224, -85199974654, 6712902270, 2354649318], [132943054033040, 272436264452, -33007366048, 5601537480, 6836342068], [192804585477120, 2073356214631, -5052300262, 2696524544, -9367980788], [87689500967442, -860924231584, 14453770120, 5427358302, -3329787450], [-32797712606910, 105080406100, 9629780484, 53485004, -10694505592], [-321735216037562, 958194345113, -68856523189, 2833582445, -10997627200], [-172889568126042, -1057145572128, 17901949496, 543262754, 4143374274], [102367976853530, -903248826380, -22328835048, 2355043660, 1218095880], [171992662752112, 312678483759, -34625941323, 3277741647, -4857725532], [-58895540013639, -603295801812, -65510203276, 4912937803, -14767704701], [74839328785778, -897104632601, -61485550474, 10290717794, 16408356439], [110106581274642, 599692243797, -55079780854, -354279550, 16503333426], [236662303929858, 768216803432, 27366576138, -798935650, -12536532666], [-59660522074158, -572526224274, -21009063082, -4678878706, -18670884072], [-154690794695150, 2007774242190, 4222752293, -10090324116, -508049740], [-155662829389570, -479818183961, 50596831505, -6293086225, -28871766404], [-216337513675323, 1636762534820, -70218900546, 3693778747, 15547500931], [500999101027893, -100216385697, 72280582026, -2278751813, -3429816229], [259582015320175, -2257442325802, 27511110002, -10992643286, -3524533764], [-401699424163590, -3632686789749, -29401198961, -13517037203, -4119547674], [-205995065007266, 376508536824, 7365675690, -1260251458, 24654360406], [86141768357048, 1056774852381, 39494693288, 8406020640, 11134481720], [-218223794184806, -254337195571, -36455428722, 2672426210, -1666218270], [-24086187679768, 2494480318515, -38174431174, -5096654230, 4873166115], [-60760524823945, 3411749366716, -19689811990, -4373894247, -135396255], [229585383976270, -978019335333, -51937507329, -1601270099, 18438726710], [-569883873345048, 2668588018842, 10536454106, 954413984, 7993081332], [322598262609904, -456048975705, -50584194315, 9398361759, 13070395932], [105879875921480, -1503402136498, -75010799405, -12232012710, -2897224854], [-95350786091726, 1334768747264, 28179807396, 2186460392, 21001434840], [560134591048826, 3412441685743, -16076251494, 19879259846, 6542799539], [313130277026637, 1561594836724, 64352110124, -3570531349, 20928545503], [-497918669319482, -238274327348, 81056598466, -6040290498, -2247657634], [104812436640354, -492116683082, 6971123914, -11377830378, 28315004744], [-273140064585784, -1204243811217, 101964754534, 5699589392, -15679740052], [412962700010078, 1245960101800, 58033111906, -4207048650, -24586211578], [132304643625921, -6213105448390, 14710577282, -1158854698, -16577385100], [-646509250682349, -2157044789738, -18350884846, -3009441342, -220960428], [125823618432363, 299582091868, -104893039832, 6287771241, 10461488081], [147612899012833, -5062973239662, -27509964608, -7516836996, 5234104978], [369514836152906, -882759764681, 92476345945, -12117269769, -17314450540], [179506996569878, -2419791682882, 124513667200, 5787626102, 20138743426], [-273248324271654, -1880084702854, 69420964562, 3033868050, -3045356528], [-294363080651558, -101490553246, -132027281158, 2186336934, -36769349924], [576657747509637, 1792244937473, 2081217960, 17248309451, -9928694097], [730009096968047, 2406982970244, -7805256472, 12479843485, -31411444355], [-1066935211557686, 6815764168954, -81683671243, -6130081676, 42032467292], [-680954282513016, 1699647422601, -18475415939, -16189757045, -6199690338], [-593098088360012, -239606112311, 2326375873, -18855938801, -41918271038], [66594184796106, -3186079222321, -23879017073, -6627761323, 37872884986], [335654267595246, 3966011533490, -3780417879, 14657566640, 27294576288], [331580857503482, -2859396336391, -45999438086, -14701191282, -26120486310], [406292548606219, 1448485093951, -117705353434, -10356380035, 34621620421], [-163154760592925, 3776493323576, 67479995772, -13702920879, -30524061103], [-716266398394348, 4128039595623, -167665273037, -1981129859, 5995342938], [-101202781155746, 2110832964956, -67137307904, 1034451484, 8555148944], [-414729875983768, 3400992468827, 16076042466, -1667658718, 30804149331], [-112224317168030, -7745356728574, -14025924629, -17854848896, -442621624], [236064568528418, 3210597746330, 16721243984, 580149032, -34689717610], [-173302692697903, -627520133438, -86778051348, -16084895648, -5865426906], [-833246184175616, 2247568122420, 58793272598, 6738586942, -12302037446], [963839090160836, -7665887649088, -22324136493, -16136516830, -6278508354], [352742650294500, 5802112851776, 80594654762, 16584311514, 20637950074], [506894357730711, 5195643767876, 16585337290, 15860985865, 34281151553], [-620769570926098, -4330473298597, 84313944873, -11867687585, 57768980584], [1218033706212886, 1472277708411, -117986956114, -21509969666, 1875522166], [1015636970690640, -2699830985004, 38261572319, 19350075350, 16475926890], [-395009696471560, 1673424505387, 107959328697, -3147906941, -49113578964], [-203503743548043, 3598829204225, 160460790796, -11493982969, -40375485017], [723637646753134, 8041086046226, 90597994270, 8101531478, 12559056892], [342019772251044, 2817007276483, 90441164801, 5253269115, -82924420980], [-809893013401492, 260585422776, -31797050985, 29958604914, -34577993778], [-131768877848596, -6691859315148, 34434214454, 25023512518, -839214494], [-610719307210490, -6503316651149, 60564371390, -4953733822, -17047178597], [-988093610796366, -4380459398688, 28390416441, 3658802904, -13382029524], [-327378135455037, -716996305441, 35852096050, 22360824989, -14202251], [-764233847104030, 2515504056204, -114718731336, 7262654508, 24109890960], [-263239209391704, 2322388217036, -65697226458, 17842764108, -6033879460], [-458210024612934, -9514600681847, 129784140105, -13283134109, 40401011430], [377083885974086, -2949730284361, -13124998816, 14562329104, -39915928251], [-1858020739274454, -7729658499538, -15885950391, 13321723612, 18415743892], [-319255681138899, -421516194336, -112243954624, 4394702859, -50721135337], [2508447087669207, -1250848053825, 65015910054, -17251447519, 16775511529], [170858659057022, -9547917589179, 4221198000, 7733967376, -8226719473], [94713236190530, -3677431938191, 45228968055, -13042372631, 30345731940], [-927373052162990, 5096009175376, -96593069114, -20343637038, 17333868506], [-1508459218079855, -4265790296330, 171640438962, 5723521750, 14085079656], [-1205929226911077, 5942130501852, 124760431408, 13300216145, -32378492623], [778754810232625, -1258722764637, 135450157590, -19295233833, -596947689], [-1849283606885248, -1345660836180, 213486634384, 16087741152, 20767735360], [569117296177954, 8448050683976, -164595622614, -22056669386, -44290013378], [607140627199824, 15565931724552, 108926428614, -579416308, -17288739308], [-492769632136294, -6143227700311, -101397458755, -24792463705, -37947150454], [-1077017270909524, 2895630330859, -87612680992, -6479745220, -48743869724], [235810270697732, 7091695789382, -57322251385, -56782218770, 61029784758], [1810466430994699, -5411590113270, 41162629724, -20846731756, 5183292690], [760823787086972, 15233584994059, 168655894268, -16797404764, 45641348437], [-2012224650198886, 3685198388336, 201150855856, 5160351748, -576178828], [1763029513242776, -8458527323886, -293303544488, -6821910932, 21852383442], [-614289669408703, 5715179400726, 10951820552, 46670588188, -29520659330], [396555225374208, -7493984681148, 44975780501, 28607985010, -52417772738], [-1119224783809377, 8645676017232, 203472734566, 26854020278, -43192331626], [579132503551259, 1485878097052, 204182658700, 45972517637, -98595028791], [-914370409537296, -10163503040702, 22912993333, -62803684666, 787029774], [810615734876986, 8327248718224, -244507259814, 7407762554, 30543565034], [-473612071924568, 12929576174996, 109447057100, -53428375692, -15654878192], [-2527783295809689, 6181925603976, -219260602368, 11595260189, -1191021611], [-1257818314454960, -8248606196106, -149412291970, 16715405664, 81797196836], [289299619612181, 2900115600194, -18719569580, -35358866632, -67218670466], [-483133017010228, 1821608505514, -150866047222, -2472245802, 80718803748], [-1132605650000406, -1070639643699, -120116356994, 14855056530, -102521712206], [1877216949810791, -5450990001901, -170141434322, 18643110445, -36914677255], [-76947114485520, -5574581561102, -153431787110, -2523092968, -11388565428], [-615573778127907, 6299817570904, -197437675090, -19351339734, 105224299842], [-152885464691786, 1249586083452, -418519579570, -23604801978, -71770053706], [488847909312193, 1626485985926, 68824515558, 58639142874, -113053020100], [-94227615236473, -13902143433169, 28325141844, 22317867401, 3424081917], [1065415355872612, -6229334893762, -431655539440, 5636833076, 18971827358], [7116978786734, -8553287306819, 220510657855, -9746820535, -74828558424], [-1777327219545212, 9880937742743, 282615993510, -32482924402, -40479829293], [1788066989917978, 8313720317472, 129773585015, 2680334900, -30068380296], [-329404576017865, 10437157724944, -293694195396, 19109394888, 11573820664], [1184379619688566, -3121836264976, -311350528286, -18495798434, 127024471166], [911677792771824, 5768347402404, -197468567781, 62029535398, -46965062446], [375036245454598, 2135633281468, -331815716632, 23957914724, 38042784520], [1726018207326158, 6034395466618, 93116725118, -66912233350, 42587853016], [-493282273138107, -2542226996132, 556350246396, 21329248255, 10056378327], [502713133297163, -5569186143251, -158988177320, -5091956511, 101208728465], [2407543155716181, 13204983477566, -30096568522, 37390235246, -65297170024], [-2119811458584184, -20301962480276, -87403169652, 16821844924, 69586434336], [-1833849817784144, 8454473264155, 14225387844, -47079165076, -18765446728], [826631092513323, -5218060793848, 436757982832, -35317709531, 33068746289], [727449289724546, -6522117698679, -329267987724, 6572539708, 37973522279], [1236581499865062, -16911010087077, 74363632247, 15594983541, -46140071170], [-1183311921165028, 3842470731870, 208540391228, 30361233432, -91983067492], [2079896618643554, -9646899013138, -38896542532, -46827906934, 103856858030], [-387200991006566, -24223820441665, -88483062040, -56257498440, -42066446459], [594083102736616, 8400632672222, 73634450553, -4596088066, -3353680626], [-2208487320682440, 2878068843963, -553321870493, 70435877349, -103519418498], [-2075860898879372, 8713998181885, 361039119159, -40482509555, -21260943684], [-4541344597690752, 309393945742, -188356465894, 7145725128, 91864739292], [-457078179044360, 6219769010569, 174215330540, -23421756408, -39363287856], [-1042054595618891, 5325704110040, -416044648786, 36224953306, 95984303922], [763746149355646, -168255008743, 38448809347, -43996810523, -36282612808], [1616199267272709, 1320927089760, 220908678948, 3689880335, -156364993337], [-1149133044759488, 11766410529869, 470329332228, 23838473684, 142799062635], [798949997384989, 189855491955, 486157592200, 33403047379, -112484497257], [-1220524886021572, 7054868379494, 221445955828, -16470303472, -182070303764]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_400_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_400_10_a_be();".
// 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_400_10_a_be(:prec:=5)
    chi := MakeCharacter_400_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_400_10_a_be();".
// 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_400_10_a_be( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_400_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,10,sign)));
    Vf := Kernel([<3,R![20255684175, 573973425, 277362, -63858, -1, 1]>],Snew);
    return Vf;
end function;