
// Make newform 315.10.a.i in Magma, downloaded from the LMFDB on 18 March 2026.
// 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_i();".
// 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_i();".
// 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 := [192256, -844, -988, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [-4240, 542, 11, -1], [-4408, 1382, 11, -1], [-211468, -718, 431, -1]];
    Rf_basisdens := [1, 168, 84, 84];
    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 := 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 := [[10, -1, 0, 0], [0, 0, 0, 0], [-625, 0, 0, 0], [2401, 0, 0, 0], [8127, -346, 137, 39], [-33119, 1406, -347, 63], [-85406, -7280, -1228, -164], [17827, -738, 3137, -277], [-13814, -7796, 4466, -158], [-1737938, 58560, -9572, 1020], [-944833, -67642, -1675, -3821], [1281732, -95788, 2166, 12630], [1645984, 894644, -2598, -11254], [-17892520, -283696, 62024, 10780], [25432884, 899376, 61500, 17396], [37561481, 995470, -60159, 3827], [-5540690, 2616308, 189930, -38118], [-75421970, -351832, 122596, -69544], [-1363000, 5526016, -363872, -7724], [127804005, 3378850, -887585, -3663], [-38085069, 6456250, -120265, 18501], [-10853748, -6738408, 485296, -262756], [-49611640, 2562488, 282508, 164436], [-40598078, -1069288, 199608, -678172], [-476759287, 5993734, -2563895, 124475], [-328313888, 23254204, 4510634, -332738], [-801793728, 7288400, 251184, -600136], [349887780, 27286184, -2423536, -299592], [-1149693632, 16188324, -333058, -896358], [190420005, -51065554, -1882123, -599349], [1353128792, 55700528, -10513600, -100680], [-1524231224, 132152680, -6151504, 3189892], [1630002895, 10275554, -17028381, -1386539], [282572247, 85517110, -7257619, 2744311], [-3974746844, -16893492, 8275822, 2867410], [-3834115498, 58776636, -23526162, -254058], [1107124155, 98046082, -20254549, -2811663], [-1730594476, 74789992, 14295820, 9171776], [-1514785316, -626597072, -1773988, 2629396], [-3317537600, 138958300, 46828562, 4466198], [-119546481, -680283370, -10263103, -3733953], [-5377116544, 288829788, 33183762, -2399318], [-2044139065, 90149318, -20883275, 4657475], [-14911901918, -164872944, 11976632, 558816], [27633834259, -303809262, 13451527, -2506267], [-11694189193, -245507418, -1436571, 12975795], [-18530003416, -1041284040, -55638120, 2185396], [2475299934, -502637700, -58662446, -38222330], [-901089960, -1126672392, -93677604, -19150396], [-18062253002, -1261663448, 135543012, 20221112], [-7441459487, 629216966, 95495601, 8343359], [54015944069, -698390318, 21962535, 23992569], [-12576288144, 468689436, 231487618, -34244762], [2968507330, -850552020, -89057522, -64853074], [2820923676, -1084012940, 16465978, 49996734], [43864453748, 23787328, -335397864, -42565756], [31514734912, -3671362788, 8747650, 63422662], [-10970274419, -419717230, -365609489, 7368873], [-49846830636, -249984156, -509648714, 16383974], [-11885889184, 2420700276, -465178, -73902398], [-57939653304, 3674072264, -61126932, 49210244], [-24119651268, -3527985068, 579364990, 46532426], [-124442155906, -2212017228, 137339406, -43809910], [83453712000, -384421936, 448931744, 42116520], [71018068397, 1052882862, 375977133, -116078937], [43461148101, 4394524566, -475855203, -93769177], [41157456960, -3022738504, 295535904, 11447524], [-68405562574, -3028783312, 534766088, -39261824], [-30320860394, 2378383356, -277608290, 15824082], [142582983482, 3038808016, -5583728, 185310756], [-323808584814, 1393536704, -661056748, 8779980], [-16444993317, 3203180270, -254234455, -108311841], [-333476023298, 1162700428, -965461254, 90193046], [-89912734698, -10898419192, -1714031532, 40198688], [54569275170, 4706934252, 2190694798, 11795150], [58942936948, 6187927632, -343102124, -214065036], [-232821047640, -9528493276, -480201478, 45407382], [215507871429, -10485685546, 690670953, 63669155], [143550164614, -14619074944, 1475188560, 84041864], [76123633078, -7083441720, -155282860, 104247340], [118892557508, -17988159616, -2324213540, -86890256], [73560206446, 12782722352, 3470751760, -154312600], [305427029661, -10837150462, 2842147607, 152412577], [139239748105, -22214089226, -1176073479, -156653989], [367271950847, 19094184134, 1293728693, 234139291], [638217770062, -17561118676, -2502017298, 453751802], [-143065124534, -40773605176, 2031199812, 95616668], [-560205648888, -21532881172, -2596348926, -169072730], [278696345534, -7991154104, -5773018716, 324989660], [-25958626084, -917627352, -2372493204, 164281100], [165541610092, 16197969104, 2618493168, -548490408], [-46969986772, 21000410488, -1372342572, -238628388], [-661753107788, -21941349624, 657450236, -411350324], [-512483521185, 2759597350, 2781906025, -749472153], [96521921442, -31944518628, 2422584406, 327951494], [-533882018320, 9522536264, 446358712, -1615729240], [-1178646876868, -49089960972, 857231462, 461672642], [-209367747036, 65916477068, 1706367062, -500375762], [1752145784350, 30934076580, 3791828678, 97885666], [-569010088774, 9763985160, -3252304524, 1602585548], [-155860934612, 102333697448, 1579605220, -71134632], [505135283393, -29054048530, 5769005881, -470200029], [534487048824, -116314257240, 3151844124, 129582532], [1659566381830, -19103405040, 12525013480, -660942256], [1958014903490, -85568457364, 3890311814, -35480194], [-75359616547, 114673511198, -1100249803, -1499133185], [-1705689446788, 11079281536, 690444264, 1373571472], [-1973554732754, -119428595672, -331528384, 164035496], [374578312459, -90519459682, -3477795807, -196433201], [2386851951992, -6308684148, -4472149806, -440912410], [214719082398, 41373808988, 1939227450, -535486042], [1509274879392, -183717468756, 4036127338, -567486974], [-937278807395, -131848343426, -5759950699, -2968559221], [639530803883, 92761316942, -781551055, 3346011755], [2580755669992, -69708221712, -5710015756, 1513259616], [1756516890608, 102316616404, 4169524542, -1733761766], [-3166819179586, -189061175644, -17602569994, -1760845334], [-79490412300, 85399589680, 9803247988, 3069272748], [-1190399958057, -38833574566, 9206157251, 1787655521], [-19045490883, 41606946146, 3632345099, 2836248597], [3242108460206, -95926270664, -2983628372, -578481216], [1741703780940, -192382342444, 13876003374, -2674279102], [-4973659775228, -13340387980, -11333768538, -1465000446], [-721076153394, -62195430308, 22959209062, 1997462250], [-685371295035, 31517513570, 5118287367, -379147307], [-664797827482, 313621038512, -5094033980, 108561620], [-5541076452530, 104120475936, -5543925208, -2081158408], [-5380378671598, -79050822684, -5557236370, 2610928170], [-3375307681278, 209822884068, -28079466386, 1016318082], [6987830701365, -198065597242, -3368136783, 1966465859], [-5988047818966, 5066709532, -2626529954, -1438289346], [-22525388380, 94027738240, 9408017472, -1121289644], [-7237180056500, 59968340568, 15133545296, -2215159940], [17888152158, 362729094712, -24439159996, -3465882184], [1464840093622, -264973255920, 25700323204, 5180327000], [-5600135441660, 138764098372, 29978307462, 2089641226], [-677189040888, 317963130572, 8757573314, -6446605146], [-345188874118, -263232830628, 3743830650, -7383181562], [-9873240744156, -111479608540, 8777480414, 2946040794], [3197388802904, -659069865196, 3254341030, 3490305658], [-1431659392029, 644408626798, -11870220703, -1212449981], [1900243871358, 171432819424, 51824779876, 3714976068], [-11870488432912, -120718696832, -8769704912, 5597175336], [-816005467140, -187194120152, -83105932352, 525651744], [-3901993945256, -157097287700, -31173225702, -6378624822], [3544161848074, -191473957756, 25330626750, 6922696682], [-10022869565887, 383662889502, -8177155515, 2485512839], [-16518996680408, 132011513564, -23629539426, 590777378], [-18409306437427, -327585822574, 47592633863, 8023896501], [-12587429416990, 502320135996, -51357869494, 10813016050], [-2576660884272, 118426879436, 5704133658, -9578505046], [3385746141694, -277931202048, 2231840716, -7991712232], [-5019908394876, 57335826184, 57398913140, 11336374464], [-8560390606456, 272971836824, 437832424, -7781182720], [13537906779172, -134702100488, 53682474732, -3655982968], [-835204267893, 867363051822, 14752781841, 3483347607], [-4511677052352, -662383603600, -41201866908, -4798897784], [-4036547965074, -479704091952, -119534517084, -9901069160], [1594124827043, 118837168970, 60522636359, -14219412539], [1551759929754, 793274933328, 2089689720, 1288120008], [-399374317930, -471460071956, 121601767278, -1584191814], [-764977445063, 56514821094, 109324050769, -8999569545], [-7221710884236, 668767591496, -54562713780, 7644698460], [27414987785470, -50761816972, 4323520002, -10588606550], [-11507800276495, -334970342250, -48348475231, 267825879], [-5348293779572, 988871951296, -18867649084, 20116585540], [7843364174272, -248866256288, -28952461380, -8238393792], [4077829716677, 141075933414, 81703106769, 2213780859], [-5011554023888, 554501559484, 116064052074, 4763973222], [3888518852564, 1168466651892, 82989131702, 18482960610], [9173909915307, -981838652770, 84150299453, -1391067133], [17269154398504, 512641118476, 154277245914, 11995636666], [13577320377597, 354782757218, 11690048519, 640046281], [-40822713453874, 654180395096, 25824095252, -14151690476], [16423754367033, 1790740127354, -14525935581, 6452079205], [-22478701277120, 1253197549108, -100643879734, 4520580538], [-13598425189500, 1659492796928, -39155814684, -4459276024], [12724015295352, 274827734724, -3243622950, 20531410854], [5291462257318, -5073448404, -131587174966, 6349346998], [-21529246317964, -51723594860, 93810530998, -27016168586], [-40547936416232, 1320666053200, 24996458952, -8286612008], [-5933337470886, 2627785725356, -45001803202, -58528706], [23149895389558, 787310353864, -255399052164, -26628858624], [-5120220038394, 966812496328, 170834896576, 10351432600], [23323462498448, 926014603656, -192836977924, -4541624280], [-18477046722088, 87787471212, 158429947466, -21670944586], [14153247406384, -296466939652, -27311241398, 46759640362], [-14879183480554, 878294534180, 10937071046, -10320463422], [61987142334044, -1403478137884, 40075400438, -2317022262], [6716366394506, 348422063796, -327491728090, -1542058894], [-44438112095823, -100141190858, 44094285425, -2550101197], [50347478408808, -322164826608, -232767334044, 15433678028], [18882457680646, -3688059252124, 60798727882, -2192932070], [-9018731331550, 793289560784, 23964747952, 40911272064], [-14222397474998, -1022170077164, -340642262710, -22795076386], [-41626107325686, 263701073904, 209838746220, 13560944652], [68296875741328, 131108815452, 94917140618, 1803761094], [3417722691722, -473856111632, -26645710616, 15568741228], [-60631015242956, -1801476846300, 92495997010, 23019063190], [8202110462628, -2556194612784, 175988070996, -32534026132], [-78847361013386, -1847939871280, 169521378516, 13877033012], [-26122226663765, -2796419143938, 29652773753, -241554097], [-31477245512669, -2297831080302, 182756596499, 53168260481], [42932740019720, -326029626564, 9991254930, -14982077282], [-11527687315762, -526021434092, 43342383642, 91910469882], [-45717479808140, 3967373834772, -142240146482, 44263659226], [-118731067599871, -1164123935062, 169521320243, 14593822973], [-19719325078884, -2104595939112, 473165525232, 27839422232], [-47885172265668, -100071631764, -11259580062, 34291076206], [65081181047949, -1272516460366, -5033505009, 9607833445], [31680847833076, 1167434335236, -317696588746, 19144623578], [-73339130698708, -1611417032604, -69973291210, -76688919142], [-25530357680084, 3695338621320, 60333767516, 11361783284], [-6671644011212, 475065131680, 97643307104, 39868613208], [-13513219396686, -1361374374604, -73175465914, -47141359326], [16191208551788, 549996647812, -73315221578, -16778418582], [-23204966492788, -739614475608, -81333877308, -27608553396], [11351790930806, -3320480091968, 324992124756, -19246223168], [25156657120784, -4066531912456, -239888464508, -2095806784], [12198597431739, -2696075709054, -349266185505, 46683971621], [14882418404414, -3981211296896, -418913476712, 75641011720], [-90029640202805, -3694759320738, -263861024479, 18951827335], [-83126546124768, 3785832354356, -637275962458, 72455805018], [-64548707835688, -5691153451104, 2883278952, -86210478344], [-26437628208616, -4358105940264, -47914177324, -17157285500], [88270073272064, -3066837999164, -353426901626, 159030164850], [65394898569912, 1960222038684, -653497792266, -44985767582], [15507209067159, 1524129872918, -82505963803, -87001808909], [-119953947884036, -3357718307912, -29327211228, 22360514644], [85241991306731, -3334113868514, -267862055523, -39665683949], [-42823509435238, -1064453018288, 148906598584, -40683243636], [-51957954559073, -3369955342378, -174302961179, -134664059225], [39023292659014, 2375579034940, 289795922766, -158625394], [-66924509025476, -327533702004, -250017729614, 78259403214], [-9242726430722, -770244079132, -17550561218, 204298044306], [-16044704045736, -2833513941896, 696403308352, -70834372984], [-401267312406, 132376070304, -164776425464, -71017509896], [-60974987955245, 2900405732498, 841242006351, 18825069685], [16647823955003, 3302039634366, -164564183683, 175551541123], [-104839784103426, -2805605557732, -353244003358, 69967035534], [134258844699944, 678489834416, 466528845772, -63931374636], [41783557289967, 5321474537142, 111060501445, 227298305071], [33764209801068, 5810042789064, 62865368596, -190112575788], [137920350603676, -8619334361140, -31775114654, 105056340374], [-41663953003836, -10086279098188, 165266193434, -96296943370], [65833370702270, -3403542022660, -859395990350, 29115464478], [46843759110094, 10200496094828, 224112224626, -4919741722], [19941888879488, -10201680938488, -54194959544, 67915400716], [153060068682472, 2083314503608, 271443937920, 142842761916], [208891194284266, 2364083568108, 458691812530, -47491026422], [217511515015876, 6402156961428, 388874987774, 87602951374], [98269022178654, 2219505758864, 570998791220, -122677623672], [18214516841626, 3844803548908, -22016253598, 20432580290], [59807957364526, -3122992800888, 938725211012, -33837282076], [181014214254216, 495675808636, -182699126630, -10344857106], [144033299139463, 14048146601398, 685504793513, 41007865959], [28225585914536, 2884554396644, 41659274654, -167981049382], [148647973973856, -4238275732968, -420968565332, 191489681388], [-219537404418108, -6652247728860, 8833556598, 47473492466], [53054383674929, -3445970316970, 403162720553, -104215735973], [-51031947171568, 3016844301616, -1019591993288, -61824965072], [-34137349128562, 10915181203260, 149128165790, 341365210386], [252501142737174, -3743806794504, -562357745876, 62360834856], [75780827213863, 2626875140986, -1065962947185, -180369446147], [107517407650258, -2949038254080, 940745028364, 197714642844], [156700382160825, -247984681878, -1663535411309, 93317590713], [35047406945370, 420616198136, -737448862240, -407566696152], [-89720773411148, 7891746757100, 608131127694, 220731298558], [71264550456548, 2752990652024, 2076006195404, -35680806488], [462813996389759, 2639446099066, 167774934771, -44007745215], [6114104637860, -4696730593180, -986899266850, 25245856310], [-35212685575332, 2839775154904, -763781221492, -310664133976], [23672887444505, 808364055190, 831921978385, 221605356355], [-350205964148416, 3159406268400, 875755365900, 40672918512], [96143267577705, 7941683432742, 173227602313, 4349305435], [-440383299274798, -8837058697228, 824741780870, 176766455074], [19848747207244, -19644997727432, 534961977152, -203857674144], [175632573143542, -5918008100992, -838850161664, -443450190248], [-19116569140206, 8334924923536, -2118357997960, -55465162200], [-287358174149538, -7801795184860, -783224179726, 130286679458], [12714770169816, -5213947384440, 1678722149376, -321616830984], [409518267868080, 26608527696, -659532727412, 259718226264], [87962723559824, -2807957653864, 2282880791224, -39105749384], [-268342201796972, -3523480664348, 1716717594318, -253592061506], [260154815281118, 8305281607428, -1705315650690, -313398263678], [-15285437438001, 7486089490950, -129068512347, 118173698699], [-282374092087000, -9783429289412, 1684258271146, 546680711774], [-140762817773275, -5748335395514, -1255166258739, -7986577121], [-295452013576057, -23057133146842, -283881265723, 83794017763], [425221160433206, 14435634957280, 1262943355284, 196891918032], [-93668195511790, 13690465168072, 448070625960, -343136675840], [288985689771136, -9430200047624, -1591305322516, -207700771060], [44489287915625, 10168581433846, -2902359668103, 165804142455], [-562412329697476, 14481850869296, 1545993179308, -437554210304], [-49726848041802, -6532374994648, 67734272676, -453731412376], [33444821810190, -19853767283704, -1356640869148, 256320777468], [-176905591566863, 15278278919978, 2367905385931, -239577029827], [-478175307390518, 634294760912, 1000424723136, 58629222288], [-381955576293922, 2608069672324, -952400810790, -271613586758], [72100584601102, -21111603412700, 266369529846, -67662761462], [-528693762290573, -673715622678, 1477432454759, 632950606021], [70019862255951, 15688696032266, 2090644995035, 477045418521], [160298116285330, -1912262522780, 1435361067570, -326595609814], [-212306192076894, -14230417110396, 590589641274, 402400053270], [-395766787072902, -118580676548, 717448005398, -193050371210], [-60199119731126, 30904739313520, 916475894808, 255555918600], [-368902523508024, 16069988729152, -2668697113340, -83393753108], [51287335226278, -23682697969208, 1420563174036, -139400317808], [-171148261442903, -14871304007542, 1394670708531, -454373772827], [-403025729585514, 14884212278440, -578345062060, 301023490000], [232383784305136, 7033236040696, -79469159632, -297419548960], [-761689196712770, 6269977651120, 1638852511700, 15561946820], [280237153902886, -8334866373504, -1891723012496, 895329788888], [550619449723196, -15175994819464, 53479039436, -609796072936], [306264089024498, 16748240862636, 2338433143778, 412930715754], [-227401387699056, 40598442938332, -1846024727374, -211535048130], [-161131770591136, 49779197694408, -334974749944, 88739284188], [-830827727331005, 6284577271454, -219365926503, 171318496799], [-30456307429671, -29477693702010, -1587593182391, 67508093787], [106392788073498, 36665025353496, 2889310135260, 325254138924], [402526809606545, 6137946573002, 1319186833523, -432187924431], [-585073913679832, 22930823379420, -1407062352534, 185639235670], [-557675513570582, -17154184977824, -4752331123840, -322666662952], [111308749705712, 1799246891424, -4660885676400, 497325786352], [1041282557734147, -10353311919270, -619057815281, 280591377097], [-1020688925181344, 18416212772348, 810671060866, 379856400502], [195140470559838, 7327280021076, -2320938469670, -944713148222], [-378419500750664, -10685116985320, -932633912180, -598637091148], [1033596299264986, 34445271502940, -2845753528854, -450064669078], [168586602664869, -9382326151178, -4014745318499, -46403747121], [-445810506515536, -11073173650684, -5931571538242, 90449238202], [-65464110265397, 4370154800962, 2709992550815, 1110523220725], [407951459664365, -42046478866078, -885809601409, 601905193897], [-542083030004432, 35771083425160, -2212954800700, 999227068556], [110667588110264, -18133449262744, 2300721983792, -721562088036], [-465755169844600, 8733025329000, 2788622755388, -47572558868], [-47119985253238, -2784744365976, 1058180111148, -619043766900], [443579396905812, 19812000966772, 3440803795642, 48469109526], [-566718851229436, -26239358384124, 882454530942, -256376460894], [76680643325402, -28861918986988, -3349877343226, 844962636514], [375910620546858, -42724296101584, -3760687147296, 258570814916], [600743087216949, 57659338988174, 2640568416533, 525395750067], [-849729118420192, -21638698043668, -568161800774, -148132385986], [-462377744745106, -33661372113092, 1616488354726, 805524137422], [17102541368459, -4066122865118, 1385685450423, -191923900715], [918957212586365, -20588639865518, -7101692085861, 748697002853], [791813962020750, -23508614972264, -1126292752228, 215887530000], [86207799173808, -47430880575456, 853587204064, -151571041548], [-333927599138226, 9028597081388, -283611834046, 1459504790470], [1844459621460692, -11253974744796, 2259154875446, 234519227602], [-496042322186157, -85139624198546, 1141000916129, 361401271419], [426668922612116, 32867316902148, -6353327743098, -520603961534], [-1204820969494466, 19535861528848, 906596941532, -932639208676], [1437927136124368, 36148400864736, 2411850599432, -60689884880], [454755969100140, 28416455137532, 5933981764602, 1505487726270], [-348111356544498, -2270603488280, -4041487065584, -462055203216], [98969336654022, 5875336295628, -4434708904926, 55985957694], [-464962882027196, -65072783875456, 3821074489308, 1057980858584], [614895588745101, 25901126402878, -287638168235, 221844673043], [-86152838885488, 22938407915880, -852258563044, 161732110016], [1261120644942850, 20022259199744, -4948178544824, 301288960908], [2168532082352088, -23318500887916, 86764838258, 732145839570], [217104300515584, -39066331681288, -1187570026812, -534992914648], [-178540307477743, -33627461976966, 1205454011327, 1436700410353], [593388687774994, 97604034457644, -466776527062, -517717342802], [246515986518624, 2185003892252, -2672335454262, -1127685619074], [-69878717470966, 32422873778208, 2529827476088, -1720216976312], [1768667556551244, -37957283190104, -3205110881524, -13676304396], [-377821278808118, -23138331675392, 414611768928, -2046682143376], [-19572247262141, -24237720050546, -1026106469227, -1516480364365], [1335064145262393, 22454875363466, 1864389765003, 715652095905], [-578551765863888, 24588125753880, 7518392730396, -1306887015960], [1829233646602200, 15760592443780, -820157856998, -178644817162], [1821952329351925, -2470662425934, 6949274144447, -201656898903], [-621564033956108, -1060602291980, 2624196948174, -772924666082], [844234391562696, -13471598392248, 10009347074208, -567550058892], [-439173156333509, 49757053652814, 3859582864729, 632291297543], [-487196318521015, 49508709764758, 1223477631913, 937357674427], [1195342059731772, -31076927270772, 6121927947558, 974968536494], [733172701806171, -34001914680182, -344367533761, 820655790797], [-754917926232656, -16498892090292, -6416118069206, -2037304279690], [-1017914214394695, 27445673426726, -8287062005455, 349657350055], [-963920474744452, -39276000513448, -4273414939084, -936373232876], [978427651011175, -43949210085518, 541519585403, 1557360856565], [-1466200928615621, 14050766051246, 2464481939857, -679717665037], [748011165539572, 23025055793696, -978239265852, -333114393844], [-224838421833412, -6831606384536, -5430531941048, -318064679364], [668739450362337, 126431801659918, 2748654261869, 203390305287], [638999029188156, 60889243961848, -7261210631932, -247007128352], [-1963281314363396, 35438101822448, 1247505928332, 2698993073996], [-2473107408482764, -5664997987612, 5624803449350, 446962084842], [192372054400090, 38377907850944, 3117002218032, -200269293312], [550510591740081, 9311284743898, 4171482600967, -925707156927], [-388180570420822, 70665980819500, -7074969894710, 1322804827990], [-86119567454279, -1243875858006, -16738781411645, 1034459608021], [-1867988226419086, -60861245299152, 11020897623912, 2805754409080], [-1951029700153207, -135542189317142, -2318839995965, 70187266373], [3398535179213638, 55649803134464, 5520719770404, -13643858456], [337608319772838, -100776430585436, 970080495266, 325866676402], [761181298120994, 43271638786568, -6780138611792, 1443398459064], [-1692179027073968, -64805204096276, -5632979317350, -2673424310798], [2134468689581249, 42948028789382, 7858705083697, 934159937287], [-905859712645496, 62313333214256, 4649112867664, 995172338792], [-494794644520652, -81043424563036, -6973191446790, -2563640838914], [3011976361449650, 53336100274160, -9035905903088, -880943214200], [-374239212358359, -59706907252134, -7775512722317, 1134624696477], [-1827975676995396, -71262380351516, -1366492787578, 953740586998], [3725713713354138, -24427968462488, 5373850701748, -1156060703428], [633396993172400, -5418532542344, -2607879839732, 712879434996], [-292775313531566, -111657424185268, -8924147645778, -660207914746], [-798772348787549, 37779341312794, -55631272641, -805835045155], [712426416115141, 65772610153750, 9132164132189, -1775159031809], [-569565206613694, -5958642067724, -9668282437158, -3121903898066], [-418118996585312, 46451551201144, 11343578252016, 1728185835164], [-1864756257280598, 21741713974352, -4376516958296, 1013371766368], [1143308238062904, 11600682528460, 8484003070090, 3535492304318], [1270222197361981, -43353517155102, 5867577139855, 814345272561], [-1112943971960318, 34348622152116, -14513642354026, 2481239787506], [-474644210922418, -481441038792, 9753800823008, 1217808462104], [1093627307535672, -47538793095080, -10736983524248, 180218313504], [341056614427840, -113873153017884, -788689768358, 1783902613958], [-2018339671311107, 46100352288662, 15298145316217, -910150880141], [-1091840666803424, 103564850729512, -8863768901572, 1252650967384], [-1110841805870470, -98692191454740, -10001654972098, -1436505472330], [-224031849451643, 30013255445854, -10670611942011, 896381858159], [-542613078139384, -63196201044388, -10112832298454, 2244000719182], [-2685261565071352, -91023466137920, -2621392665900, -2643579581292], [-2417602098931758, -11070040729128, 9293803922748, 507289345452], [-1115265479213955, -54094370274126, -4916089361273, -880553657931], [-1100398532511526, 121473384888420, 1570934273342, -999524148566]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_315_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_315_10_a_i();".
// 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_i(: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_i();".
// 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_i( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_315_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,10,sign)));
    Vf := Kernel([<2,R![139776, 16984, -434, -41, 1]>],Snew);
    return Vf;
end function;