
// Make newform 210.12.a.p in Magma, downloaded from the LMFDB on 20 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_210_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_210_12_a_p();".
// 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_210_12_a_p();".
// 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 := [-478525314115194389, -66934369575900, -2535805712, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [473352991492445, 37791862847, 299755, -17], [-11282962781136437, -1033756312751, -11729323, 521], [1328248640114887, 131984499037, 1605173, -67]];
    Rf_basisdens := [1, 54032670, 594359370, 9005445];
    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_210_a();"
function MakeCharacter_210_a()
    N := 210;
    order := 1;
    char_gens := [71, 127, 31];
    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_210_a_Hecke(Kf)
    return MakeCharacter_210_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 := 12;
    raw_aps := [[32, 0, 0, 0], [243, 0, 0, 0], [3125, 0, 0, 0], [16807, 0, 0, 0], [114565, -1, 0, 0], [393579, 0, -1, 0], [2169518, -1, -1, -1], [3110501, -3, 0, -1], [128272, -3, -1, 8], [14619174, 117, 57, 13], [36297393, -124, 57, -19], [85228188, 593, 177, 10], [228786842, 1548, 418, -65], [115561006, 1431, -605, 144], [225427510, -2769, -427, -149], [-39486447, -1933, 1672, 427], [676747282, 3340, -968, 277], [2185211730, 3823, 229, -1510], [1470783592, 1897, -969, -12], [86003843, -14426, 11625, 1011], [2637426561, 24328, -13031, 1102], [-107544494, -18510, 16786, 2531], [7126235358, 21328, -18982, -2318], [6690946670, -58004, -11958, -4611], [15597497619, 60808, -17369, -4762], [12856633218, 93306, 62850, 468], [9291893336, 46024, 31172, 4710], [1047537526, -151389, 8681, 7605], [-3904839474, -206688, 66692, 11262], [39293819245, 220245, -127108, -10826], [-13046415446, -357670, -79840, 42986], [-8567327580, -578252, 95594, 20715], [79999277647, 1173053, 307506, 25454], [126622350305, 680797, -143200, -40303], [75669312312, -1122919, 2035, -59675], [217505177792, 66612, 162558, -158491], [102466207409, -892944, -1054119, -12284], [188437992082, -140031, 587197, -104188], [141788505440, 913417, 662529, 68471], [109488722768, 1572790, 29700, 122362], [435767965381, -910953, -1666744, -200972], [305124941696, 3913785, 571605, 257658], [-246825984991, -5012814, -456449, 499179], [183580606662, 1951306, -611750, 422376], [1210173950115, -450157, -2748218, -851081], [773598382565, 9634756, 2321717, 305409], [449705150318, -10905680, 1621040, 142117], [1097953427962, -8892046, -5939728, -122778], [1199150087802, 1932228, -2656566, 333066], [1087877186430, -14322021, 767645, -548826], [2743487594545, 10205471, 1414098, -1383816], [2891890328363, 16247522, 2155781, 1335487], [3430538346184, -3552210, -3919856, -771550], [5197087937974, -3346306, 7415562, -806819], [1614585135572, 6818847, 3591553, 1546751], [4213786949646, -2750517, -2396913, 107734], [7236431112750, -32434448, 5727548, -1629006], [6930413787943, 5900572, 6227199, -2240605], [-7170947685292, -8015833, -934769, 4500300], [12211783123348, -19687378, -4425636, 684570], [10788889519100, 17884112, 118984, -2676016], [11780145576564, -22469628, 4476246, 321860], [-10617078909502, 34508380, -4422586, -2440880], [24386687283896, 60389208, -25948748, 7601374], [14618306912103, 38150374, 18675265, -984444], [-5997195155707, 90327867, -369860, 5586671], [-18724038766590, 10397824, -28170824, -402321], [-24417278655310, -70149414, -20701362, -14104784], [-42417928025496, -45131453, 58985639, 7621249], [-86339840761426, -26013631, 10119991, 10368526], [44055914882286, -39234851, 63136709, 5889133], [-40985758876355, 23841668, 72501549, 1365889], [-42621946798926, 4756228, -13910066, -18549250], [-58279600604782, -162991791, -5958837, 28932078], [-150316462757208, 32985264, 80155922, -4841309], [58772475799920, -201577047, -142877931, -1909115], [-130433544907680, 296576439, -54630783, -11954053], [-65418728517753, -144664594, 54164061, 15580352], [-88253126383446, -181686934, 16044574, -21397604], [-189834176968506, 338569314, -51499666, -18403222], [-333846951170964, -94615736, 12838274, 2237517], [-332698229983818, 173075512, -81840356, 5173718], [-306164407798437, 47985710, 30403117, -11127335], [-196282621320365, 230173446, -36616331, -36132952], [-249170379608551, -402208374, -160206429, 68950393], [-27941507009248, 375492447, -47713145, -65147453], [-557341916413430, -107483282, -52756730, 10352978], [176830066743552, 184954672, 182899834, 66874860], [-607705047491542, 165848242, 174999294, 15269270], [-376529912079682, -129634104, 241057938, 14114360], [-75398761852082, 471819906, -231887464, -19495586], [-583402532117232, -503563724, -143700388, -35514600], [516225589381426, -316992796, -273740086, -46689400], [-811494979059363, -427349489, -66607240, -24528304], [544146665624664, 137010216, 271567202, -59619493], [-546178132786856, 77569527, -29542345, 83012001], [-483958264909810, 609130640, 482247812, 35084238], [-775372147665282, 463254606, 316081392, 17619821], [-87655244651338, -207803076, 469577730, -49608276], [633485524885298, -1565130054, -150053826, -9990666], [872676590892468, 1357397829, -205374973, 166828046], [563188576813849, 284029447, 358427920, -2504527], [-269050509389184, -895900688, -349155244, -127716676], [377104717443318, 935442126, -438813666, 37476168], [899639191031880, -199526636, 685947106, 148140549], [650678111447303, -644550, -11727819, 189859588], [824460936754956, -2123910824, -425369452, 56913578], [-582070422369954, -1203719141, -52875049, 31323641], [825591884463521, 2168592782, 842785655, -265734471], [986667894395444, -1128138028, 848342746, -110984000], [921274960655194, 2241403454, 1147811720, -19818720], [311915556446768, 18371261, 1116754657, -235508574], [-250313822331035, -1316838561, 1118857070, -60586408], [576915839358705, -1068184289, 878021926, -195381655], [319221464025430, 2295533472, -2687913032, 243312975], [-721894591369476, 850014564, -1311367662, 313503900], [876131576712666, 1562413390, -986290364, -345803768], [151441871136508, 341362023, -1327508701, 328914753], [-1332632214133705, -985999703, -235207212, 286223955], [-1935596173379477, 2523443587, 1252194346, 225720922], [-404453885953930, 2265394275, 1728212949, -152035238], [-2392671161905324, -2278934826, -286623000, 40417032], [-1441368751736196, -118524710, 1175984924, -600393398], [-1489038244583908, -1825845763, -1755548563, -4167945], [-295698186763689, 271559167, -757398476, 133971211], [-3991846618070370, -317720027, -587750719, -559469307], [188857985089878, 796527226, 859521154, 1025732198], [-2638780083576042, 1988097774, 1748027832, -594252322], [5062583577520630, -3717177704, -303136002, 408666886], [-3719349482094953, -5456881312, -2698679677, -198806360], [5461748842386940, 3903374306, 993498584, -488051743], [-6127170307997826, 3031461603, 1413277635, 531331172], [6000808112719002, -3509529854, -1985438534, -525892285], [2017665454533146, 426094209, -226736553, 64735072], [-5209877154791662, -6312443162, -157807488, -673113397], [5107898657087820, -9321462098, -216935984, 146028356], [-2715130562587832, -7174116400, 1923289830, -1666352308], [7295433679932422, -10480223934, 493396476, -462623588], [-185468058856704, 8371883594, -568504016, 425613570], [8572227759245632, -3071340012, -488527246, 200024178], [9064135116494905, -96367123, -1763925160, 798855633], [-1566154442354402, -4223903025, -2928436957, 1512371699], [612385931065902, 300502040, -5905865718, 1835030408], [-1144544409476214, 10403871397, -77186749, 1338398041], [6204228177918668, 6108453807, 328152147, -1321207174], [274624009372878, -18672547326, -3444709548, -94822362], [-6823057873901781, 2975080294, 3107691073, 1822905900], [681204523800356, 8516916767, -3619001539, -1850148079], [-1464364712833885, 14575269209, -1401828854, -729092687], [-3010261961353764, 14111541819, -252139899, -2080259264], [-7245145136103028, -10750223685, 1057088919, 346658218], [-10016800808057430, -1632403096, 6234003478, 1416430587], [-8414956687053060, 8377943359, -11447194415, 857444650], [-13997464855944218, -17743606923, -5310145609, -1787694817], [-3511550620889084, 6469112763, 7159774381, 1671408222], [-13593524114158299, -7923620710, -5129093837, -1189404005], [1647150238304310, 31472176970, -1460907354, 1858691239], [6024444887819626, -26488245986, 2705940568, -1073985357], [-1181830228034855, -2572846954, -6957464641, -5069753880], [-21127923372764010, -277764528, 487638792, 3032807196], [-6074484451149156, 15002540943, 5606299011, 51101243], [5786163741137529, -5364744203, 18736477916, 1209526360], [1476871907764140, -4925641822, 4204764690, 2196768856], [-20264986374922710, 53221887912, -12224196624, -962501013], [13084221568653009, 29145057579, 5920056882, 3016024778], [-11102288275078762, 27991182945, -13841169605, -2291017673], [7810042404187254, -47425112894, 12667101742, -2804979397], [1059702273842231, 23203967310, 17848970301, 2040438804], [41098074991553594, -18925148580, -6414435852, 600998420], [8159729974421412, 35936329866, -12037100724, 6257903270], [33884141423318449, 5623399135, -4210397420, 4396615168], [13677197764848368, 13796764419, -5962997637, 2117204058], [-8985393078870637, -18093189692, 17848000071, 1561642269], [14923527369506786, -24441937926, -25070310258, -655761740], [21697037984560331, -19174745974, -1480127687, 1977127525], [36421358765916382, 43642984652, 17643733206, -4779521525], [8663829121264238, 19682281696, -5048145952, -3990778135], [14662017235201284, -16655274941, -43090995895, -3437501657], [-18834677006765482, 46828985752, 26820343094, 2845153770], [18755313167336848, 8555515353, 11255629045, 9644595134], [-32269571873525496, 1387357552, -17069460704, 4792716972], [-2801837934610886, -13377563858, -24165833522, -6924699867], [28563824222116206, -48915196687, 14430216891, 216627220], [3478512093741686, 24261230383, -30093930501, 4196606469], [-6590694367319414, 127436978027, 45281114247, 3959982828], [26379937249330238, -11906227486, 12384480050, -10088241170], [246493591752000, 15078273773, 10780475565, -13588946204], [-29809212800454034, -15132964932, -4906041246, -11097671308], [44616189334652750, 3956532312, -1555589772, -2439765256], [-65503264310339146, -38800380586, 3222829808, 3540524070], [-13083499096134157, 31550999724, -36150362973, -10052323906], [-6580878307305730, 11961222119, -44977120903, 12837370763], [-29576950583865720, 27062401552, 40071386782, 11044141781], [4781179737056662, -41145972134, 58832680906, -12036130970], [-4263473650356756, -9107501849, 18351358715, -4729354653], [-70809250068165966, -43294764285, -20438225133, -138447383], [6810547127652122, -115055490816, 1516786032, 15882708972], [2929419446848650, -215828086485, -53089788979, 129332520], [38162743241785272, -20031334461, 9072317985, 9610891491], [-57644607150360312, -82467309857, 25787325575, -4504579555], [57804435160497750, 63265081185, -7237624731, 1714217521], [96313477091526265, 20655108480, -47121522587, -2938870427], [4830059547863585, -103286604106, -2969949653, -2206130360], [36054645914103832, 150538785148, -19916569110, -1021912038], [46642262219580302, -152754718116, -31744229132, -4996522775], [-72115948112209304, 45829838816, 8740492398, 11057481188], [586474078887079, 138446101670, 75634643573, -9368560745], [-59624857019459958, -97897426979, -11025581113, -19578150741], [39260778578741836, -30666740566, 54368469996, 32308924140], [-22249750235750273, -30765968043, -17025277010, -35878840153], [-96307986067809180, 251541863130, 21839270948, 1727676640], [70036913232479790, 42714463132, 4518346940, -26409246572], [-10399421049134940, 13527046724, 25838632920, 746937500], [-25086751299246222, 145083337764, 40661565822, 10524339516], [-75274304509704234, -149382392326, -102777867356, 24068047342], [-7474868395653180, -251597622370, -29771575344, 10706420700], [-50175321586259482, 125804699292, 24424045602, -13026177546], [-126962590990093630, 30594474734, 5388593012, -9672833507], [-157397326587087514, -75993412881, 54387116047, -330945228], [-42599357517625349, 39744413053, 55694383036, 818850475], [-56843301509796802, -83851199502, -9808601694, -30474815306], [66751753991701237, -78264979502, 5857188123, 27480812479], [52077381135030036, 174369233412, 13266808614, -15008306830], [-192446693776195812, 4290097726, -48938369606, -3885670306], [90252444729780044, -57046091602, 41966385602, -11112764508], [180023172157569402, -127316888338, 19565280030, 21666385256], [29883194761630760, -124629122061, 68810079169, -32623563569], [101740796891599449, -252847084388, -18277505527, -9843426483], [72008850946552488, 35026782358, -167937098006, 1146974428], [-153309723550086675, -125696251769, -154986454480, 21210462512], [-33639014462449326, 409653076483, -110188759019, 3284321876], [-178405174880944111, 4916160117, -4274684892, -4600647493], [70417851001055260, -60998406402, 81591694624, 6443470385], [205130128326270660, -95209961658, 32362878336, 15017282552], [15948492482299382, -357116279276, 160246360382, -38896490138], [-36777562942150390, 398411954999, 20969026925, -31731340243], [99242692722819726, -162219229778, -77137702286, -34824247030], [-148561523361255469, -22846680425, -107854300386, 46481626509], [85204625988088765, -158043115185, 55422485648, -12016856988], [54289180371844478, 619638237464, 194206926278, 43087690678], [-42021850948764894, -33502608151, -113243020577, -4821783591], [-53396080425635319, -173541316169, 80131105906, 42050548383], [-337203828507872960, 114009617456, -30033770236, 28497725438], [-137186055134445490, -359555725802, -117726384286, 24653163964], [106300675793608436, 121187974713, -228351126305, 40365541711], [122134769728225474, 333534742412, 103509125742, -65646755442], [156329297066993354, 219743242704, -160680029586, -34568082864], [-302390207679655356, -66735672650, 111800261180, 28566207489], [-57603444440965290, 349453478050, -165514710014, -6203592301], [-124654374056136312, -500971678833, -175624676715, 49264547344], [224808188445398736, -160948385117, 167050258423, 31438660640], [71719765284966378, -369372276230, -268091990140, -20086848113], [493297369098907560, -149202594531, -54978570657, 28355373244], [364244593080564830, 601252399772, 60249507364, 8359556418], [-270991699321812156, 2739882832, -55470472102, -46587290032], [-218787517556432571, 204827414677, 251454051998, 18442823202], [312088642055741846, -153742724400, 278155869996, 6400246482], [1657474067763076, -234573042664, -18918297292, -9410981842], [444567138844252560, 67484437364, -127707701342, 36057097304], [548627399317471523, 361470739794, 228915358737, -19145376304], [412479937692409290, 141867102784, -29059628498, -27274330712], [84681184680248080, -31150244637, 277168842119, 75364582137], [-213096787508904786, -45637278607, -175183195041, 3998898862], [254222025046298253, -123357599708, 241174804705, -13364419456], [257007554250011074, -399548066015, 28683648505, -43824735869], [-89716304586982193, -837578980645, 57618805712, 21504577667], [35973846817527702, 993824346925, -8016873247, 5244266061], [-17543058229031082, -522148850438, 365796834032, 46805819967], [338422005949282424, 93234811227, 48945096609, -12058671518], [35589759560429871, -891182346319, 462479883532, -2178427893], [2707931337785940, 944082875671, 266349351379, -75884181062], [196504391035462638, 628568377077, -355800007183, 5461101534], [96319062908557915, -1016268690448, -58743371185, 4512051358], [-281018114856462290, 300058028044, 433328681736, 41275369173], [-23585363068202405, -1407463051252, -584967396853, -19918870626], [-136001889627947482, 160510422678, -487389313872, 128184460842], [-371962700349006326, 400634367599, -134845389531, -64491535189], [-6670565981334538, -647021920598, 267815142086, 27260401260], [218566329338019834, -16928004504, 115242094472, 159761642328], [-903686681166554882, 888534165212, -259404267852, -30406357499], [-515959002725202822, -542956876075, 126979077283, 149686598299], [429072099333193790, -350142282942, 197797898418, -24887362539], [-127839418934922466, 561076903675, 358063399929, 96529366787], [140544596154463332, 512130634653, 295856603381, 5055022982], [-350394791206590982, 992050610716, 462858856922, -52922961582], [-463132133296455819, -601218949312, -191083960619, -55552027605], [981538029334074524, -259836153040, -968388136994, -112632491432], [346043995914727349, -1020176659657, -973698428044, -20686384987], [-343810988430589479, 198213212612, 301562055033, 46836869581], [444528761782571346, -1534435577330, 136581807212, -28399244135], [-3275990324773250, 173459205745, -354760423187, 10991786993], [-555766935757394042, -958552640382, 299498435864, 32704521418], [363496085372521985, 1961060756999, 309698784938, 29573154712], [-366503104711477680, 1991789685702, -257065702236, -147798679281], [1100660052311257102, 1221138310567, 279801733497, 9099161670], [-550935065537680406, 1128196181618, -343762932474, -129250557950], [-647917188139556041, -492622508130, 298980794745, -71984100611], [-43997586234042030, 13430622842, 104050009918, 203049901650], [-1155529874127989162, 853050031218, -562846419310, -109093117421], [-866051694974259330, 754186498238, 222569340528, -181027052752], [-39175470315487831, -607778052970, -16214917385, 51478428844], [-616832881871149817, 870431395057, 459981242596, 112665593495], [-161320951058801164, 2498642645508, 382364065974, 135675365191], [-88489168829562088, -831183361757, -389630755881, -90774597011], [41981168207064788, -1515131363252, -722216401942, -48576725853], [645998365236142382, -2002541908324, -477182788208, 42670774636], [-163186475275561170, 731144492633, -277840811909, -208780560695], [-20642457985221710, 2368511741621, -268324133089, 71596537110], [-182284525208423205, 1151092885138, -567560817511, -375170502371], [78395391657545630, -25435180983, -123579894153, -283577953594], [-868933884605345250, -1618957479795, 369243823107, -240155317271], [-760684503870898942, -1291533016003, 222440135645, -174154942907], [621034334426425470, -2856711219726, 93494380146, -66079055996], [662139025784110468, 665331970991, 30353416817, 309826142126], [-353216183381441736, 691293182271, 955049529381, 221338729796], [1073815963478524, -1193621437548, 811576812286, -60573778866], [-128273339911131624, -909636320138, 320875908560, 33758189589], [591382546314368317, 1797934818046, -262646898353, -11183122201], [492983307449703507, -208895578668, -1074578948389, 157000856846], [-570284022576751518, -579811368224, 5418731972, 79409141418], [1554207483721165191, -378459502151, -1337775215030, -275727022633], [-1331001341283665924, 1777769728550, 1198862517680, 22015219540], [1123228168008756678, -1878362294710, -2087431761986, -126716926032], [-592156308637170060, 3454254665940, 268203628136, 118240608680], [-143253060929387653, 3232656636627, 1467582835516, 201630911376], [373485087382272360, -1604754009874, -526199482080, -324217273318], [-1624404886336456344, -330651021820, -1232124674730, 345983674107], [-1248333591202722080, -4135515975602, -946940780166, -162629404330], [-1276432689223308936, -3590796383791, -914958025853, -92029232892], [-1348539908788678755, -486062239015, 704803621246, -24431004445], [862436922037626286, 5298579451156, 1927709713512, -113553111838], [664510486249255563, 1873207052593, -385021500184, 226455762891], [-825966725673210181, 4733321508978, -813865066455, 93838845441], [-12229808650172840, 2197086630938, -1571090467410, -96734736626], [2524597080568544642, -614941785056, 937844417780, 13456996589], [1167821536093284216, -4185264991946, 1248001433414, -72256427540], [-49129990989250278, -3161749755686, -1690917592910, -80850808572], [904860880493387328, 1670996680849, -336195530725, -507904234689], [958578398001816176, -4705314669632, -256807838410, 134958126906], [-539306186427622278, -218427137258, -106175664788, 129089895862], [2092146034381575714, -1378158676055, -1031055699749, -110264404582], [181930067371880149, 4120479779663, 90932914842, 26727315222], [1765586726544517670, -6490792139300, 1076552624616, 160201487374], [-1196662646768342160, -977446571942, 168353059540, 427162957239], [1387692720392406091, -2578312599879, -1096346740852, 7927490801], [-598149088824323561, 3551953123709, -148030385520, 47495704732], [2591172204388956082, -1986460126361, -882856362243, -279675730058], [-2767592534252096928, 3231688197577, -1487987830025, -192730715516], [99127138416888662, 2029905857716, -111365079210, 731535748676], [2546763130110524164, 3667479605756, 1602885055086, 62598293196], [-1480928652941520135, 3100569231127, 1814246332558, 105420248105], [757762165422612936, -244594419492, 1367841113702, 303339122836], [71274370799371082, -2210201856509, 3156841074051, -375388361825], [-734221563252011820, -104777109188, 129918112372, 198044491546], [-737700398769474698, 858780377098, 2011035681822, -138418308140], [3516561550952807042, 4488306026593, 928718770053, 196610221445], [876572634196204206, -2048090664822, -1639962538488, 94041212528], [2088749677449117956, 550961837166, -443540547500, 104748021709], [4038692810693729109, -1240998105843, -3617349944040, -298939105052], [-2372331924724833938, -1153404447751, -1194353532819, 16388285128], [-176481852094827230, 701847920369, 958894093547, -670225629890], [949119626091566678, -2098241075670, -1501104325052, -717863939031], [1436622142162104150, 1030963343465, 1223683995685, 412184736908], [973976985778181687, 5195452774511, 1338836736002, 892124684518], [2709788755576773406, -1392669621318, 1726594290928, 320506035414], [-77435898640830732, -6362030160020, -946941600950, -466406238148], [4008811347712508054, 4594107476346, 1881702636802, -414330044150], [-486618713505081836, -5135852935236, 242684312416, 331525076332], [-802674560467931958, -5351478426268, 2106609062292, -502253521100], [977414134233041029, -1490808325975, 528964826982, -952768883728], [184361715063312931, -1138478592583, 2319803515634, -224971561795], [2393943271655892026, -5173850286511, 4210015255853, -464456077586], [-2315360735959551508, 8247675209279, -3424341555235, 41541164643], [1619278487825154191, -5593420624440, 2163131977731, 518768577787], [-3272692358637921976, -7637009233881, -1720378826445, 502315965220], [2564786783572128028, 257245897852, -1360856726774, 453225593507], [-1893261132848391803, 238319304034, -3411098396057, -177962107839], [-22076404767362413, 9906249959566, -861709290547, 640698442448], [85753412163508390, 3524403397190, 2518752189600, -633721637335], [-2754848052532843055, -1104939141472, 3298799637521, 445405624790], [-1968917058909923222, -713222467230, 4490462983526, 1130033249786], [-4423930755091568247, -6268864124875, -783686412572, 896507700044], [-1862404981436901862, 4562881416452, -2573337574862, -159502881032], [-4062619147634614393, -8392434868385, -3282755198976, 1296358534138], [2644831553070917501, -7491609255235, 1891027024276, -572114279459], [-1392677609520404008, 6459761461629, -568743966923, -1333432918513], [-2802891993230320846, 6177967284392, 139997180620, -436059363729], [-1673141516223215061, -7400703506592, 654637343519, -564834323740], [-3451871062099638840, 7636714726945, -4522252251377, -248666105192], [4996713292863895218, 4909233018581, -2052759942029, 634609167999], [-1143985404230535186, 4202592221784, 3639600037052, 376659384920], [-1919070780821772118, 9505569792536, -1786641025972, 267388515808], [-4084605767535907813, 3943080038795, 4193323846022, -2267899568], [-3884333326095473850, -2814238020600, 5390993141378, 1413415039350], [3676882743493958911, 7331692945070, 2498463524601, -646204460003], [-1754642988471857490, 1740992064184, 556039942708, -859798908848], [6019171159740767731, 3119448456216, -5346228050009, 220256156787], [1378158658151423858, -5108402046560, -1440570486822, 1045447299353], [-3024682263982885636, 766162697234, -5707836829988, 1097753128191], [34623035116272642, -194812180129, 3296596595335, 1603089580791], [-1771235801832784524, -14631881923643, -2432137598219, -738454225682], [1594521435148474265, -11952590372491, 2565750822908, -347343922628], [-6888757053636297396, 13329122794228, -36862926716, -566793616390], [7383752544798850800, -3203394861795, -807939950157, -100424320115], [-3947156307072868074, 564844484544, 2780296403028, -1075475245642], [-1739854126466811933, -1627622865824, 3374943328699, 92018074077], [-8665566828306242456, 3300527574959, 1543257522131, -416495053456], [-2314390333398084302, 2741307641802, 2332448291906, 56253768578], [16146123608545396, -8329731645830, -2652154101990, -1137131422542], [2471148545718181246, 3027023148780, -4101699010684, 661281171101], [-177028498507977959, -2932224677782, -3829221759709, 121945817680], [2404834863421537957, 11763182875981, 2653742687434, -555864866521], [-5404007989264128612, 14661608951843, 2666255927383, -337728031093], [2466885570107132250, 4449555468254, -2831238810054, -453315566421], [-3602228403729338138, -7192672986610, 3210864972134, -130181381812], [1008014959170265990, 6117713030504, 2116963101012, 279685315478], [-809548250342127885, 621605755974, -7257830189391, -195593485205], [3478499846155375302, 4736612674762, -2472346431932, -89530834834], [4481001073189669698, -4205595534623, -2307947198071, -676505456573], [2173104126323391202, -4215873671175, 1828620374951, 2166960180439], [-12540109321124356328, -618285251661, -3672743744947, 625069696735], [6183121246286593759, -4969977023454, -7705235457023, -1429860157700], [3863698749315948402, -13071383440041, -2651230425405, -1445437934404], [7292448125630044722, 4340390611424, -1349598068084, 1587177419857], [4035985415594363519, 17775629600274, 1718796946629, 894028614504], [-886235866133505804, -4056553361560, 4493904172954, 1230658333636], [-913590143874926986, -8346734482353, -3974996373851, -1893542474523], [-5108154462491428650, 2502364132836, 2371315913076, 502339257810], [16158184632991927923, -5388744675035, -2849201534762, -303432313731], [667678741319177526, 3836943303998, 7000825946824, 3116810594786]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_210_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_210_12_a_p();".
// 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_210_12_a_p(:prec:=4)
    chi := MakeCharacter_210_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 12));
    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_210_12_a_p();".
// 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_210_12_a_p( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_210_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,12,sign)));
    Vf := Kernel([<11,R![-18380647870004233267200, 318363769618029696, -585819000032, -458260, 1]>],Snew);
    return Vf;
end function;