
// Make newform 315.10.a.h in Magma, downloaded from the LMFDB on 26 December 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_315_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_315_10_a_h();".
// 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_315_10_a_h();".
// 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 := [11500, 188, -295, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [-1, 2, 0, 0], [-295, -4, 2, 0], [250, -216, -3, 1]];
    Rf_basisdens := [1, 1, 1, 1];
    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_315_a();"
function MakeCharacter_315_a()
    N := 315;
    order := 1;
    char_gens := [281, 127, 136];
    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_315_a_Hecke(Kf)
    return MakeCharacter_315_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 := [[5, -1, 0, 0], [0, 0, 0, 0], [-625, 0, 0, 0], [-2401, 0, 0, 0], [-18299, 616, -63, -41], [4165, -1951, 456, -49], [-133622, 8221, 385, -146], [86727, -1030, 3133, -155], [-515984, 6163, -4341, 34], [2250610, -96797, -3533, -2034], [-2045301, 121165, 216, -649], [-49248, 176875, 38813, 10336], [-4547914, -16040, 32136, 20668], [11512730, -56171, -9157, -26880], [-16387850, -803973, 73345, -38288], [-28878011, -2155206, -29283, 47365], [-31633670, -2184546, 227188, -60878], [-13118502, 733675, 282519, 35030], [30594536, -1316595, 40009, -174054], [-70165541, 2854387, 832014, -19597], [151827431, -1173741, 1280520, 169981], [179578350, -13681448, -506290, -226962], [-103001938, 619026, 752284, -282662], [5545578, 1480832, 1471636, -304944], [-102478971, -2556899, -4029608, 817987], [-59766562, -32828282, 98794, 741440], [370072688, -22216384, 1949288, -587296], [-500805466, -1289809, -4700247, -287348], [-119267042, -44962524, -1049740, -945520], [-465407095, -19020276, -74761, -1057459], [-83666530, 4012128, -14892738, -1172918], [-770266660, -23007220, -15473540, 2300884], [2916423019, -115599446, 2475023, 604919], [-3032672357, 57598278, 3315349, -805239], [4015662884, 174938773, -5795073, -1035216], [-2943454752, 46984000, 647504, -1804180], [3124879599, -282394025, 12520408, 5310905], [4345813686, -233690757, 18588965, 8502112], [-7163785128, 389163339, 30184747, 3186918], [2537731964, 264193928, 5893506, -6869026], [10816868821, -39152368, 1283649, -6869777], [-325324908, 467071179, 16183193, -2168988], [-14480410199, -50811895, 15018298, -4891823], [4369638454, 13616022, -23796550, -16227136], [-3043005513, 709924424, 13048989, -14373753], [15753349223, 45078497, 4437488, -9770005], [19069456074, 515218014, 51946444, 1125298], [22216179438, 1715011204, -90108878, 27981074], [-28500647542, 774937002, 96924016, 22212430], [19333395798, 170152251, -44450821, 16717138], [15310445213, 640636926, 106496421, 20263109], [-11578554125, 1588977711, -129672566, -51439173], [-10074017012, 2021452644, -147766578, -16306778], [-24911470706, -814348128, -210900854, -23758278], [-49835238912, 1022540239, 54024425, -23205244], [28389710006, -1159118585, 27842357, -84292212], [-5545098118, 91958996, 136921148, -72981576], [90106566317, -1909642165, -294654344, -28626463], [72133475312, 1236676281, -195376869, -27986564], [32383287416, 920552024, 409702378, 4998358], [11067646676, 3865868872, -58383224, -71692560], [-5580037352, 1087233654, -11563884, 79593366], [66752538990, 3288458762, 327067612, -61078102], [42134783152, -1736767624, 286102592, -75763664], [-39792293607, 2834335623, 600842574, 50336779], [-30383731815, 2215700798, 426636861, 55943073], [-14869865898, -4157724526, 208770516, 64157038], [176233016874, 1557874970, -610836638, 142845108], [-41148923904, -12114714539, -143034615, 20371990], [-39355236042, 4186146329, 814014881, 134111854], [29057982498, -7796457585, -531654037, -80964326], [189397569925, -599592701, -1470559640, 67795761], [69475051310, 6854269262, -789499268, 78598238], [62340926042, -248519343, 1198224589, -171056582], [-130800473448, 9039091696, -218319532, 30268944], [-209708185480, 1023546387, 1923358251, -85918538], [-25787597196, -2476099241, -880382111, 48459332], [455585443905, -9293603677, -53319706, -320554849], [128650596878, -1510711874, 94270718, -24136300], [-411557121466, -12086598354, 370554042, -185737424], [27207277500, 5043538008, -2028726952, -380765052], [56089757630, -15099988824, -34168976, 143216848], [-586529356405, 21027507483, 1018155118, 396891107], [-276783705363, 1764830715, 282989150, -648665273], [519179515851, -11109717997, 93599414, 276545187], [-578704403784, 21252592529, 1469998237, -164428306], [283772375582, -4843243438, 4019644178, 860987428], [237515206004, 8382631622, 3769312768, 509627578], [-184432277802, 19406558826, 3257302254, -120668768], [67694338730, 37976238346, -16015564, -207451726], [-1493192234834, 2032338728, -412323662, 60943294], [-64932503976, 48121988836, -1167804580, -811656688], [3677734102, -955599494, -3198986312, -404862850], [-417899480779, 2032548176, -3149901543, -1208044921], [-168999747304, -38322214864, 4743926668, -271858728], [-256219557824, 67858183669, 3919830381, -605437278], [-1005529691782, 7987012396, 5272966596, 458497992], [310279944938, 17202062498, 1964984534, 622295580], [311441587962, 82857347182, -1418227196, -1021371602], [-2329990467230, 6225089638, 3183342058, -414915976], [207743857884, 6198153077, 3620172005, -2238914738], [40952923653, 89170693446, 3155288689, -373481923], [951292434616, 83703310172, -7503396656, 102893060], [2183535966778, 59292776590, 573636514, 1073151824], [-1504551183312, -79966177836, -5249427088, 3059012472], [-245520489655, -46646169157, -3516135270, 424781083], [334865238036, 115837806784, -4642914568, 1399705776], [-916628649966, 7240141409, -9078609267, -131360778], [1225417372497, -18759891387, -6911910970, -429310719], [-1431172107640, -23616954858, -6302157644, -2076970954], [527451672230, -108923180632, -2448035714, -326081350], [-2823290350364, -9159236837, 377781489, -3082295380], [-224936528967, -11546985182, 4632374245, -3130592783], [364206009523, -124040811232, -8463385945, -4574182707], [264912548490, 96870553890, 14659235356, 1395808038], [1234151353120, -150257932566, -18840814964, 784443082], [-146558186330, 77581250788, -9830221410, 4350492910], [3366459924916, 44929339457, 18015444253, -2251429370], [1213379497075, -44680981178, 5209132111, 3244582567], [-384495118509, 50345762006, 13439598533, 2653845677], [2334098177222, 24677050859, 6037615211, 423041378], [3206962718400, 161786999416, -17629344586, -1250704990], [573650449808, -144111788048, -23786187850, 1085154098], [755816518428, -284841570529, 3690017935, -769197058], [4519797382645, -37470454370, -21356445601, 1147101039], [-2268095155726, 42485216907, -31194154469, -2490264898], [1676245745358, -79785730166, -4716243582, -179740932], [-1961126605394, -128728788596, -5317956566, 6242342786], [2074046186610, 47541253846, 14944951648, -1444135694], [8835895601225, 157096288061, 5199201864, -1822024685], [6790113341212, 55394390742, -6652207866, 6769596560], [909653483646, -45909237521, 38130281429, -395588772], [-2117251197426, -318412249584, -1275509946, -3540583634], [170852181450, 33606401545, -63376500459, -1912522462], [-1066040242834, -85999838718, 16871175242, 280554768], [2395442417104, -91983468192, -4645269378, -8481084526], [93296661204, 242628652294, 25627687424, -5471135926], [6506937369722, -137786279340, 41618960402, 8705187034], [5920108240892, -147230834692, -26512573050, -1151743130], [3444378997028, -319040751034, 43089174836, 11804823422], [3652627616291, 280822478086, -55585839539, -2218098031], [-3188687613158, 449703404545, 6502801425, -8681753782], [11046796738426, 111874362730, 44211220508, -9554500374], [12407796731762, 163323329089, -14046441177, 4692758060], [6037988428512, 371216737269, 50210863815, -13682063380], [-4089354185586, 304768231544, -61149230050, -4380272206], [-3297087836459, 492162953671, 37488374998, 3593072955], [9434542603992, 387074444519, -22741339919, 11549622396], [-1517846632719, 168039879636, -54929511511, 1049927959], [-1395817987628, 127642187097, 3288982749, -13785835958], [-10441050031064, 245257875653, -6517555129, 11100109612], [-1396067714714, -372736634784, 103590933768, 2927858836], [6890624099012, 480661945951, 39522553399, -11454633886], [22861326680390, 71649603509, 3754654371, 7235738532], [9464008115884, -598831588933, -122690979101, -3175613590], [1259361747213, 379288164589, 8007385634, -2421122491], [1206256446978, -201106945732, -65687976850, -21953974102], [-5935828487274, -487889141318, 38964659762, -21171653936], [4575664037199, 745696462977, 64254896302, -17607390079], [-2773187877054, 126294850208, 67004404784, 9957656576], [11791489476716, -717398974499, -17191025355, 13796446730], [-2432588453827, -286867776200, -38210311441, -5607745999], [-8914645034284, 992721600958, 73628295498, 3964718296], [-3016213130214, -185956102214, 26653314560, -3868061870], [8539387358045, -1052899779830, -28869350071, 227027757], [-19765306176586, 786714283065, 29714811495, 17568573180], [12264025708706, 621916907580, 38397831718, 26857871714], [11009923795889, -1236989001429, -146786089354, -3363558745], [14279727241330, -441367806928, 64600215728, -13668978496], [18226736583784, -614514612392, 143580217062, 13086784106], [-5057530830559, -681840260652, -75696182647, -1999711485], [2882742252236, 235206152629, 62637181939, 5618965952], [-10824710949757, -296981956275, 116082364016, 9713431567], [4328815085298, -1461313913702, 49307883666, 26742799748], [26854273150425, 131229082541, -64800266522, -15131827575], [-36788660390, 1483469815036, 89109847072, 5373114288], [15348408931682, 126980858222, 38067677564, 6518020306], [-37708303310416, -811583195489, -87884298683, 13380501000], [5687709663578, -169131733050, 12196521336, -23179307814], [-36092839018516, -731345280333, -10506910399, 26992112068], [28941217830888, 347624981080, -78684176016, -6630603160], [-50732463200806, -983069428196, 89145593098, -10212756466], [12499372853662, 938886056181, -88885660731, 26225201414], [15765873972626, 1091127375189, -204898757671, 9131147350], [2238367858058, -936178153925, 65706751269, 14814484096], [32574560688618, -955025588390, 4186091034, -34879915036], [-341371808324, 1280370726099, -104237082199, 13699462436], [23725260340522, -633192242314, -4729443996, -21064295706], [-21277015488738, -1221486648344, 448783164, 58335545516], [-45017155229058, 1198112173604, 87612492962, 5770944498], [-17153502316819, -629897697535, 11241668660, -39932891565], [26207637050886, -1409488854389, 63033861973, -9419681476], [22265514722616, 751447240896, 204718212236, -18671431296], [19468649794402, -2054656658682, -14879496506, -41231997972], [-15742079576604, -15029995459, -206805355219, 57018060082], [11984707775286, 92010446165, -533489603427, 14621201650], [-37076326094334, 2521984628388, -154706135564, -62385432728], [26674739697170, -2483184030597, -29686153641, 3922359038], [13151403823620, 1444640982167, 283483102133, 2890010208], [-11428454154992, -520161779235, -198933425947, -108861566126], [81853646462362, -156636568681, 331375752959, 25435548158], [-6840794017093, -1611205543679, 126579159164, -79706426193], [-71209348422185, 183321882645, -416915312970, -13890340499], [25271094847580, -1514566629350, 77115983876, -60919340518], [11053960731294, 2827066106506, 223010309092, -39967813354], [58216838371220, 4349260029750, -221238316664, 14305823986], [-71435456690659, 2354662705837, 88402908426, -393326083], [10157932784650, 2720920582969, -188845333793, 43460422052], [100797086268888, 257314719236, 80016233734, 13888643318], [52754590147669, 257418145980, -171986966891, -20668189493], [24918401115096, 4755747826876, 63120741378, -36221034942], [25990150110682, 3760113913144, -262907214904, -29817813584], [84540140871308, -2610992370608, -198060040604, -64079397316], [-34511941826302, 3214020208082, 364458373448, 19244858774], [74465187298582, 1441618847752, -340935339962, 38581097818], [-62639621564760, -486195134352, 129906202430, 69747670338], [54927231172162, 772352554150, -253745246648, 3542833034], [96548642978366, -221962178254, 617733498882, 2931054384], [-7918728676266, -3551102805149, -59666515631, 27505725644], [55035058620407, 3246844513774, -291585878677, 53684590883], [-67716689915130, -1906463919254, -181848249862, 34053066756], [13097214240359, 2072336985615, -143967133010, -54482327417], [92910719587520, 1467111291034, 633993070012, -140505562270], [44743034679460, -260314139526, 357091074190, 3817072384], [-5694058957836, -5544600078614, 71298688330, 127500076316], [53790551578962, 3950293931790, -208830383766, 192508720552], [-71147152484252, 1721119689719, 280854325389, 101317014232], [-91837995639039, -3702527240545, -208433867832, -47947211307], [-33712584142840, -790972568842, -846929272506, -38394404204], [-35591068025579, 5306450358816, 58760746169, -140524122857], [67834597074850, 370854222459, 179094913847, -218100645602], [46782291326555, 3335854662182, -628299710323, 180295336537], [-11287851340492, -1199271899770, -936726820254, 21203679524], [60005648432960, 9273231474544, -496880011878, -41378971706], [9451605218634, 1975002237542, -873203067156, 65748031942], [7175753758922, 3841799280007, 512664122929, -131177260516], [-58677165080050, 5583573370770, -24144257362, -95813622024], [53502923725823, 5666075093156, 381853562273, -116442322097], [-8182520572763, 2157623100080, -1115266900775, 13527299639], [-152590906675898, -1572506182478, -690738280544, -48334922362], [20081948738994, 2890682843885, -287806367413, 275029604284], [-118800068232341, -3350499110368, -19759636897, 103355889213], [5537714500632, 3522527440616, -1056496453160, -6062311224], [-63583573172418, -5647177879798, -265266900118, -31340505604], [-101157322708264, -7178330933267, 224686796991, -195002316512], [-204659564391070, -409160290254, 420068630220, 25648608234], [71576974444774, 500939427394, 23948475832, 91965433574], [119496697952740, -3215910276382, 179684599850, 176988401496], [46211664557642, 9493479700272, 278905425414, -198201357730], [44975330331888, 1869355639777, 923909729841, 8330879438], [112502842454684, -8456624684863, -320794569625, 92930881192], [-85606275895034, 3711444389054, 677618186982, 25547411816], [72674926728936, 6869494545947, -762500500645, 137083309754], [-62375150108722, -2445840296104, 36834977724, -44430279452], [-79320955677616, -4876293843574, -895460605656, 94697336462], [-112021353346715, 11359745771234, 1201767602643, -1614056093], [-305279204969562, 3553167242260, 147267203140, 207364276352], [-125255320568580, -6745279152808, 93590528608, -346637077840], [4048680407196, -9025675804350, 102330433860, 146097166266], [-92369638092475, -10048519163665, -349649335134, 209923388943], [76937653445630, 3592557764414, 1341432912956, 100036686646], [57024099698912, -7856151557283, -255799707719, -279147832802], [-150202171838010, 9699190089233, 1317853035809, 269529876150], [305650031568307, 1052022442799, 904034252452, -210444558363], [222061014437158, -5918315877961, -598035563145, 98757625886], [82775216515437, 6356635915386, 670721033043, 168230126079], [22404357814922, 2531198922835, -182829758197, 81603607750], [-237824621765742, -12005937259442, 1000193377978, 91942348948], [85182173716472, 1698907412735, 1934710712083, 182727554118], [130984145125995, 7742281712238, 1646393311655, -86618537481], [-196823490485768, 6403074427741, 165796290743, -232323705580], [-234499742085094, -4319244067341, -775911543823, 27136027828], [473254773504485, 550035003445, 702717415240, -31761806437], [-209109781664454, 1345601537758, -502031204752, 554765602990], [-95330075648627, -5679584751567, 441648419764, 48472512947], [155773733170482, -5785772423652, 255243056486, -27438259914], [146157714173818, 763428457831, -1011159233915, -348187556496], [-78920468888738, 11041739804066, -582731906606, -172677995844], [50322155041626, -1559736520664, 643793211448, 8227604448], [-102469813853658, -12424465644174, 1676967636652, -90834334714], [-309930171955542, 6631837337857, -887401320421, -422891243056], [-260767979219374, -3061741690340, -2121167424658, -189524679358], [-258046780617410, -3068229800017, -1010189195883, 318685457800], [-4177675928496, 651089477267, -1686563230707, 383662677048], [-258488027333074, -17419507302590, 2115098432156, -57644011830], [134508783098869, 2126443088807, 1711079410932, 642866961289], [273290464635048, 1324809895394, 186675282440, 98617773830], [411166431950321, 723690141122, 1780388870497, -42134166287], [-38033421335365, 18997089788917, -686892388392, -652886951281], [-344440535247682, 809214636178, -2848190155630, -534244874832], [-140054318023918, 12270081058759, -1715830610233, -18319840602], [147978897802854, -1563426737720, 1035152170810, 134487993222], [-101403916259715, 15151729159878, -895889953315, -356731377051], [312098966721216, -2739309745762, -351597679142, -573311530556], [505841994398990, 15920627643531, -366068922605, -73945357158], [205542558838086, -7527697853846, 2075118658798, 649479512304], [-215704226907875, 4526144159357, 3644996875514, 28253098597], [-641892854034514, 12143989104002, 1620127464566, 363144355504], [-349637080624050, -8928933384636, 2773399193150, -198416342214], [-410765089087990, -27329495204136, 568172507654, -226955395790], [-415201539333145, 1146726477761, 404979659862, 765749034041], [-48761161614365, -20879371333002, -2270893448401, -85804398841], [509493027929988, 12660513698572, -360121887624, 670359296576], [536857297951984, 4784923918029, 457715921849, 319679423934], [-766159312931548, -2405576965840, -785808981360, -103489993020], [161370716399646, 6843012340368, -1303050155348, -232901741276], [51517695833222, -20909233401255, -1837724657437, -418117724936], [-433012451033806, -33006184682415, 1153719507685, 224131758418], [334938539559459, -20034143332809, -98118506550, -163256120773], [-110808127365098, -1862734144515, 2288295852965, -820029944058], [247344613215230, 1404233899733, -2369043252093, 579822641548], [-264078216442466, -13082559500361, 1373401629835, -81488803326], [-27414954984806, 6055717366482, 4005975445678, -115406770704], [-270622996365268, -9864217745169, 710575372399, -220610838646], [154739435444136, -10760566051999, 2139625364289, 357931515278], [-521168910052912, 9741827188174, 1255997992708, 327027376438], [-3951203412032, 34409028380518, 260416233050, 904508603268], [433799942042541, 30883282696209, -3320218728810, -17368242643], [558268745543885, 16808816437705, 2019828216700, 457555814403], [939709455167638, -3524727563040, -89674986552, -314290376608], [545802721253205, 865694302024, 1565202810361, 917154588699], [-84868287654856, -5060082974304, 1505277312894, 1013980885666], [-44194072833550, 32315013364854, 2497319916102, 286452318564], [-117813596584292, -6479889752432, 109836360924, -382030337676], [-245510670684625, -5626975162368, 2244558506041, -261278178673], [-366781067516476, -5735129841716, -3229462169298, -427446233666], [-333530211168080, 6388448783444, -4417360784680, 665824347096], [-274870710002672, -5484312997726, -561595368418, 592703995944], [-93168645597432, -693309419609, 4696776542735, 343255941274], [19798093002505, -5326238630712, -1582724465073, 1417380333333], [572708452728190, -10877367081616, 910910148752, 105382648856], [14208818638551, -40712226945678, -1677847015569, -244444675429], [-451770326498495, 14363053626629, 3850034465350, 259934433521], [-651659572807024, -6315831042822, -6782707093002, -240501034488], [-446538114361986, -197883040766, -2268891163364, 485028834222], [-1142138424857296, 9852093400182, 1939875182442, -574626598256], [-944159201092230, 16297960245502, 1763050117882, 151855924152], [901346373993596, 1406219028305, -273058723465, -175062095436], [355519813632492, 48540123759998, -3632367382544, 205509623114], [-1027191450333234, 2260640627648, 3203588041886, 49306292202], [-887744677799382, 16089469530033, 1980231999549, -923294664486], [-267822325963551, -17057276161534, 6315843439565, -563800897039], [1396121477130130, 11610229223720, 2151470542208, 531252945936], [185803219556736, 27462998461174, -4321612175866, 779907012312], [-170378253119033, -38544586597814, 2233280050375, -1733686223005], [936812320590631, 38166860388920, -1530727836469, 407192369469], [394953180678386, 61234498737651, -3029566853617, -394086658682], [180999534088272, 17493413935437, -1364651774359, 1058787535450], [-1152285985454402, 29790656057158, -2042824969148, -353821676154], [-256793560235480, 36859434536270, -6652251222004, -310104414714], [-1382960717892197, 10232526214496, -5664758390217, -660616386803], [-500816816662428, 2952975826338, -5872633478612, -973048508542], [425087111845198, 16763080104073, -3283323807131, 99256987550], [169589592752100, 28821247036096, -4057217694620, -722077186828], [-80335380920458, 21487339491790, 10846003405342, -235581084572], [-578086633983914, 9770306408911, 2776538770967, 1381432740622], [387907173131686, 32246008897360, 5448690145222, -531929020374], [-391686830206980, 32453987769274, -4470622382254, 528282389752], [-477082920634935, 62976558372988, 3110883401559, 2097562075749], [1173702563959862, 3488465619513, 4672294387287, -682008657888], [-210919802469126, -33489922961015, -2389736453611, -734626080038], [1319679330188706, -30482732371482, -5868264258350, -846244597972], [-1306168659807610, -25674768660559, -349532542601, -771475579944], [-442013484545353, -536903968490, -1531275393951, -232245318463], [-288484029117574, 8153291901180, 3174527132218, 1130429877314], [-1139306921399088, 39052439100046, 1312506942596, 261214680398], [-663928677521934, -16727201094866, -4366613567970, -1475678048548], [-516195105795220, -37557463126168, 1620684905980, 1059308851596], [105650444304490, -7716822405772, 5490251747492, -301880762728], [1008731617303869, -22853829933018, 8280481914143, 1443877955931], [-192348665479103, -72045455273708, -3593557275703, 476461325511], [1029496247017066, 42069935448765, 315548422407, 2839481541188], [-92335914543080, 56278636586891, 4200843163049, 706611181192], [697842900241949, 50535030625455, 54941518724, 507320664337], [-1301817854891972, -52393662072555, 9351569369179, -394885768960], [1548652153878676, 11699021689676, -1383772549244, -1996700360532], [2001175278216789, -6403765536467, 4394258480890, -2106381757131], [907925965614581, 30182034589587, 6524546376798, -1154216412001], [-1212573913050734, 10510845940906, -5460209067954, -213744876532], [-687363712323625, -27916421776557, -14486005945064, 505947055725], [-1065182332719818, -4187205301426, 12711778848450, 114759014424], [-1008324636636715, 43254896353440, 6725909701919, -1280951853575], [-1929116369978850, -2595119467166, 149365309800, 1307793273702], [-1429449388906413, -120123207454456, 8352086297549, 201561278267], [-164356082944393, 54387575948738, 7156395473973, -418495087363], [567309967852272, -83541535826289, 3230232845863, 1119572304646], [-140269143882682, 56983140825950, 8310330330860, 2097388193002], [551014234387245, 2188406011129, 9313519339984, 580400039935], [-1573851519581560, 54273780710869, 437679044089, -2241400467918], [-229283708517806, 64970422039633, -11071629456973, 2983930968], [1206989621294750, -8477268567744, 4585211841404, -1334464961228], [849578115334974, -73620477643628, 8329429162936, 142379689220], [-2201381058846901, -68434497912522, -1191384174763, 1616135642709], [-354718919713462, 4796094595546, -4311919030680, -3699669227754], [-259355907295001, -46776835222121, -9421113148050, 2693761302743], [707373884540350, -87333320538460, 6469739870760, -1263056929372], [-736926043896375, -32757279810957, -6319794067924, -3305393553931], [-1813709858027282, -24178672665672, -8317993829760, 1040883952828], [-2910678950638484, 46603014760262, -12412607097954, -2880484449232], [461468129627942, -42155614301011, -10323025983063, -1123980540042], [3664138304443744, 50029730234483, -7351809334715, 773804664480], [-2136432768560299, -40448280170120, -7014737593233, -904289994847], [157108675601700, -60646522659352, -12916292094644, 1463002888260], [810407547561636, -83061943733011, -4239826227117, 961221676868], [-1030983412268286, 9201061327944, 6366452397104, -130258069088], [1580417397649761, -10874015046381, 1679758931724, 2328393151117], [1800365143342636, 30905699124925, -2031967930493, 1295137151552], [-927298748358338, 57268999791622, -4211389950442, 3442661789292], [-1453672193135948, -41327964213878, -7954314160142, 1458475905756], [-2140791460826010, 19954328279354, 2871486884404, -202896613546], [3412048060726231, -42117365656635, -3133075041390, -682854964295], [655139123264921, 99809767548876, 8419782891187, -356925569011], [2013930710104812, -27856623311567, 7869116969441, -3146805100310], [2045925692560718, -91614495160512, -170494291166, -534712327678], [2219582558172478, -19000230713406, 12084147262438, 1723935873064], [-726686968496766, 88200360685908, 14224301873572, -631839940672], [-3002069470874933, 15907119136867, 132840825302, 3822611092171], [-1023069315527734, -113725869572216, -1673883945270, 1478921300214], [-956312764172722, 116434080992591, 16221411637415, 1835674917894], [3435310915515570, -60711727202971, 5379312957487, 561109191912], [-1958205398249340, -47415281324861, 16444059978069, -676447908396], [1604831984534929, 112441135788407, 4704328754146, -4898255204001], [-463398555896766, 19326826526711, -19312540561863, 436109223280], [-550760789561358, 137277142973826, -12120732838576, -598389354734], [4532400779136833, 107366260806547, 2004630324754, -767629524885], [575345976090408, -45556792550030, -10879450016312, -2007861362714], [4012669713648254, -22666853280117, -5795286052699, -659353245836], [2167234655306562, -48509103659712, 4643070608860, -813287835764], [-1436318558870999, 80614088992360, 7585498036773, 3061745550599], [1339046609956294, 72450233510196, -10738825491518, -2170907701534]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_315_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_315_10_a_h();".
// 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_315_10_a_h(:prec:=4)
    chi := MakeCharacter_315_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_315_10_a_h();".
// 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_315_10_a_h( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_315_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,10,sign)));
    Vf := Kernel([<2,R![150976, 12224, -1036, -20, 1]>],Snew);
    return Vf;
end function;