
// Make newform 252.9.z.c in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_252_z();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_252_z_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_252_9_z_c();".
// 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_252_9_z_c();".
// 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 := [63214027776, 45666643968, 25685059104, 4552713792, 582209889, 41253567, 2229058, 59551, 1442, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [10385400836607513563710951726752, 23670412897584825298516273226208, 3846903580412093833776248092389, 538652733031031925437154677919, 38394539797114026420659485446, 2190542520486224422709006723, 58163732835193296674394374, 1502269822242301134142915, -3186494936398341761183, 1030697870430285810692], [-4253349958884443336566984156480, 48537063291938511490321388544, 27245381291205410009631337440, 12199176230677951701975622725, 597075951213580638619254511, 40097688574391982601702242, 331005582793425382879183, 31252145203919660470242, -155548400327514803569, 13658650058195493821], [-62444966247717974086077822758225184, -19292725569823446200452216032635136, -2920605148698112326427173578879271, -100053414941989038438158131945803, 3221542485240245840317377075780, 1195100063483944827431566405163, 42006693284378482289536056164, 1690424355519846781368664171, -23475690752821862937502133, 1173843358015606911369110], [-340863474377470395736765558005135120, -43776218156775758226152576611256160, -14362592456948612372123256018717777, -1348208193559326436953952515930183, -115987959542693125014001148225544, -4885989219050623018455018165307, -157010671979983386678298497592, -2066282252378723783549897483, -26088611497512455797014791, -1830142209287638580557876], [-140908902774939618167886298547079168, -79288751965868852163563289526972128, -14397668204015891377599526948705506, -1810508567327659325393100691421511, -129714720424206619533352790235735, -7400040628859705160083449969100, -204458142028463369079938501303, -5540452570548694309716977452, 20824593332643910062471563, -3772487294881347041506277], [-31725482081885333342542871143531920, 6570930980161293327173120498161056, 2229845143119553881974610957440871, 296844298798834664417552981841825, 20471548434386228928560743567836, 960033401974483160694647504869, 24522650841230322026389978876, 499413256765552272419110037, 2710449097434077532956837, 347703494121554214607156], [-56593216173906372856013102596533984, -47562110454193961375283932037053952, -10880091703859610281905001309535342, -1378319461047584518173107736327213, -103982784157939497551773315244985, -5025643873897035254477627698664, -139343908369701796711251290297, -2399061347732601526190140648, -18183571878092701737843211, -1860167609407756545850427], [1086087319368116240165041940033088, 542989543533569507090576104983648, 72511604077245336800673448999401, 8119052430248244827601444385635, 516790032530003206067288876514, 29317438782871425297298702939, 761938413766396462137421954, 21450699265353932332431611, -73181436628106258815207, 14157220102452586339672], [-1192476841474308302702017122042816, -4198070192290174425851016223614624, -730510311747512760541251656190687, -118346364453615080871322916541213, -8502967248620214158215036601370, -533312211128327909483108123557, -13940242051771287986602803802, -405868404758120882305760261, 1785009164308942036996837, -271971886371848257241800]];
    Rf_basisdens := [1, 31689408572897426002152153138528, 9410965169499893174454417376, 73941953336760660671688357323232, 110912930005140991007532535984848, 221825860010281982015065071969696, 15844704286448713001076076569264, 73941953336760660671688357323232, 326694933741210577341774774624, 2286864536188474041392423422368];
    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_252_z();"
function MakeCharacter_252_z()
    N := 252;
    order := 6;
    char_gens := [127, 29, 73];
    v := [6, 6, 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_252_z_Hecke();"
function MakeCharacter_252_z_Hecke(Kf)
    N := 252;
    order := 6;
    char_gens := [127, 29, 73];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
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 := 9;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [112, 56, 0, -1, 0, 0, 0, 0, 0, 0], [178, 50, 0, 0, 0, 0, 1, 0, 0, 0], [-746, -747, 0, 4, -3, -1, 4, 4, 3, 1], [-405, -808, 5, 0, 9, -10, -9, -9, 1, -1], [-5208, 5207, 14, 25, -26, -7, -25, -25, -26, -1], [-12927, -6457, 13, 168, 26, 13, -13, 0, -39, -13], [12, 41748, 268, 244, -37, -268, -12, -488, -49, 12], [-76081, 0, -1301, 342, 23, 0, 23, -171, -37, -37], [-70434, 70380, -748, -132, -207, 374, -153, 132, -207, -54], [128, 201010, -3579, -132, -299, 3579, -128, 264, -427, 128], [313473, 627364, -3863, 0, 173, 7726, -173, 65, 209, -209], [76310, 0, 7728, 504, -574, 0, -574, -252, -294, -294], [-97499, -49132, -1194, 5672, 297, -1194, 765, 0, 468, 765], [-2102619, -2102484, 0, -3748, -2244, -5559, 2109, -3748, 2244, -135], [2474955, -2472419, 4582, -1636, 458, -2291, -2078, 1636, 458, 2536], [-1084054, -542932, -61, -4740, 3723, -61, 1810, 0, -1913, 1810], [9597593, 9599547, 0, -4176, -2454, -12333, 500, -4176, 2454, -1954], [3198238, 0, 22652, 25984, 6436, 0, 6436, -12992, 6778, 6778], [-8880921, 8886477, 25520, -4518, 2776, -12760, -2780, 4518, 2776, 5556], [-4112, -10753594, 56370, -11364, -14509, -56370, 4112, 22728, -10397, -4112], [16104980, 32194468, 44634, 0, 15672, -89268, -15672, -28612, -7746, 7746], [32213550, 16105365, 16254, -43272, 198, 16254, 2820, 0, 2622, 2820], [-29360261, -58735684, -55897, 0, 13475, 111794, -13475, -65157, -7581, 7581], [47944092, -47932698, -115284, 40395, -11280, 57642, -22674, -40395, -11280, 11394], [-39557188, -19780136, 16196, -102240, 13705, 16196, 3084, 0, -10621, 3084], [13647, 32680209, -36643, -102684, -25634, 36643, -13647, 205368, -39281, 13647], [134839262, 134830660, 0, 107181, 16024, 129198, -7422, 107181, -16024, 8602], [48091983, 0, 22491, -197834, 1683, 0, 1683, 98917, 51375, 51375], [-1957466, 0, 571608, -180840, 27850, 0, 27850, 90420, 66174, 66174], [145659998, 72809655, -129601, 2268, 13138, -129601, 40688, 0, 27550, 40688], [-329646212, -329757429, 0, 94379, 73992, -540151, 37225, 94379, -73992, 111217], [-154491916, -309140852, 338790, 0, -14486, -677580, 14486, 58200, -78510, 78510], [115920, 149859912, 591120, 205213, 117480, -591120, -115920, -410426, 1560, 115920], [352116876, 352018598, 0, 4884, 9395, -544596, 88883, 4884, -9395, 98278], [-233054857, 233146218, 800930, 501240, 7090, -400465, -84271, -501240, 7090, 91361], [108200, -149913577, 400293, -435588, 154942, -400293, -108200, 871176, 46742, 108200], [139473338, 278755220, 140056, 0, -200269, -280112, 200269, 473920, -95728, 95728], [50889826, 25355640, 186487, 97926, -65269, 186487, 178546, 0, 243815, 178546], [38471708, 38249379, 0, -141944, -138405, 1918717, 360734, -141944, 138405, 222329], [-5473352, -11196708, -900246, 0, 30514, 1800492, -30514, 843636, -125002, 125002], [294375, -144121572, -1445918, -405168, 195419, 1445918, -294375, 810336, -98956, 294375], [-365062568, -365048545, 0, 1100097, -11948, 26961, -2075, 1100097, 11948, -14023], [126365453, 0, 2867989, -397206, -95659, 0, -95659, 198603, -172651, -172651], [189861196, -189792626, -1199344, 1095228, -155949, 599672, -224519, -1095228, -155949, 68570], [174410566, 0, -252072, -910824, -513330, 0, -513330, 455412, -219746, -219746], [586865556, 1173892400, 797824, 0, -391670, -1595648, 391670, -1013328, 80644, -80644], [-1124892454, 1125099969, 1993226, 805728, 243859, -996613, 36344, -805728, 243859, 207515], [1667837320, 833438708, 638044, 383685, 364488, 638044, 959904, 0, 595416, 959904], [172884, -97016619, 4337453, 371563, -467375, -4337453, -172884, -743126, -640259, 172884], [-677493110, 0, -3157756, -2744728, 6859, 0, 6859, 1372364, 158260, 158260], [977931143, -978556929, -1331508, 2569374, 5516, 665754, 631302, -2569374, 5516, -625786], [-972796618, -1946466352, -3246014, 0, 281891, 6492028, -281891, 1099900, -436558, 436558], [-2822585092, -1411378839, -2984563, -2134065, -953339, -2984563, 172586, 0, 1125925, 172586], [2906123315, 2906424000, 0, 2995036, -274236, -1386956, -26449, 2995036, 274236, -300685], [-1183695345, 1181938318, 4858594, 1535810, -1114738, -2429297, 642289, -1535810, -1114738, -1757027], [250530822, 125805462, 2110990, -795936, -522805, 2110990, -1080102, 0, -557297, -1080102], [-3567791975, -3568926952, 0, 3899526, 59756, -3222207, 1075221, 3899526, -59756, 1134977], [431179417, 0, -811735, -6039214, 1434157, 0, 1434157, 3019607, 1409869, 1409869], [2203470136, -2203342875, 3517586, 9113604, -41785, -1758793, -169046, -9113604, -41785, 127261], [-2569296668, -5134831748, 930458, 0, 1065874, -1860916, -1065874, 2672960, 1880794, -1880794], [-162035988, -325805236, -4353534, 0, 1372486, 8707068, -1372486, 5329344, -866630, 866630], [-2138811535, 2138236460, -11176904, 5371984, 1518896, 5588452, 2093971, -5371984, 1518896, -575075], [4790571622, 2396825047, 6578658, -4377576, -1405002, 6578658, -3078472, 0, -1673470, -3078472], [-3154104, 3276147420, -9006531, 895784, -1341351, 9006531, 3154104, -1791568, 1812753, -3154104], [-2075238, 2833676221, -4096017, -3965100, -513240, 4096017, 2075238, 7930200, 1561998, -2075238], [-3042867371, 0, -10670439, 4621410, 1136985, 0, 1136985, -2310705, -2071575, -2071575], [-4787899025, -4783671249, 0, -1914456, -3434190, 235259, -793586, -1914456, 3434190, -4227776], [-638156935, -1277391064, -2355021, 0, 1765023, 4710042, -1765023, -11582067, -538597, 538597], [6732198816, -6732245089, 13869878, 3140761, -1874090, -6934939, -1827817, -3140761, -1874090, -46273], [-3503445, -5979661662, 15800200, 1163528, -2549155, -15800200, 3503445, -2327056, 954290, -3503445], [152875933, -150841670, 10265452, -21535704, 4517562, -5132726, 2483299, 21535704, 4517562, 2034263], [1159704, -11851904086, -6294747, -1909416, -351255, 6294747, -1159704, 3818832, -1510959, 1159704], [-316951506, 0, 2798364, -3879864, 410353, 0, 410353, 1939932, 677588, 677588], [19755915777, 9879357340, -8357402, -4821380, 2023781, -8357402, -2798903, 0, -4822684, -2798903], [-15704953268, -15700195578, 0, -4855547, -1344048, 8414246, -3413642, -4855547, 1344048, -4757690], [9864658948, 4928781166, 5276632, -11256177, 2312572, 5276632, 7096616, 0, 4784044, 7096616], [3723180, 13335998607, 56305915, -2324305, 6058835, -56305915, -3723180, 4648610, 2335655, 3723180], [-15278765768, 15282780511, -37182450, -9858597, 2442038, 18591225, -1572705, 9858597, 2442038, 4014743], [9948338672, 19896742484, -21644030, 0, 2640230, 43288060, -2640230, 4076572, 32570, -32570], [-13032487743, 0, 23008893, 28132554, -6071047, 0, -6071047, -14066277, -3863055, -3863055], [-5606671832, -5616350676, 0, -9649344, 9616113, 7436726, 62731, -9649344, -9616113, 9678844], [-4566710991, -9141217468, 15249965, 0, 4648729, -30499930, -4648729, 6420753, -3897743, 3897743], [-26095085797, -13047602926, 18696564, 20937936, 2471333, 18696564, 120055, 0, -2351278, 120055], [5274237, -14170246803, 27006093, 17929512, 3744078, -27006093, -5274237, -35859024, -1530159, 5274237], [-2536801853, 0, 26695487, 28428526, -11977265, 0, -11977265, -14214263, -2427569, -2427569], [12569808, -20377527179, -54171570, 15075024, 15066138, 54171570, -12569808, -30150048, 2496330, 12569808], [-4813618785, -9651845432, 20271397, 0, -2194723, -40542794, 2194723, -15602701, -12303931, 12303931], [-3231845578, 0, -34098264, 75017016, 5937936, 0, 5937936, -37508508, 2656782, 2656782], [34527077762, 17262851463, -14881429, -14979852, -4388246, -14881429, 1374836, 0, 5763082, 1374836], [-11166183469, 11170525846, 57649644, 30599120, 1745526, -28824822, -2596851, -30599120, 1745526, 4342377], [-3834289495, -3844554312, 0, -51413352, 7170956, -69040488, 3093861, -51413352, -7170956, 10264817], [-15278047062, 0, 47263692, 18009544, 22351659, 0, 22351659, -9004772, 19959684, 19959684], [9969344, 27219348251, 58419213, -33926448, 8435094, -58419213, -9969344, 67852896, -1534250, 9969344], [-13042313764, -26090630120, 26030484, 0, 12792954, -52060968, -12792954, 42338792, -3001296, 3001296], [-28440222904, -14229506834, 42168162, 4931011, 1323954, 42168162, 18790764, 0, 17466810, 18790764], [1941687055, -1922334653, -83014732, -13622140, 19757740, 41507366, 405338, 13622140, 19757740, 19352402], [-11731271157, -5871479615, 8332759, 8363268, 1436404, 8332759, 11688073, 0, 10251669, 11688073], [-22265412, -25335585778, 47251176, 25595661, -28966992, -47251176, 22265412, -51191322, -6701580, -22265412], [14853618070, 0, 79552356, 20544312, 25499581, 0, 25499581, -10272156, 19419236, 19419236], [55858724404, 55833503064, 0, -33506759, -19278360, -175547752, 44499700, -33506759, 19278360, 25221340], [-42161456617, 42161728467, 38420162, -64928652, -11627906, -19210081, -11899756, 64928652, -11627906, 271850], [-221640, 15573861555, 163323328, 3540306, -20887204, -163323328, 221640, -7080612, -20665564, -221640], [-60047528240, -60048292853, 0, 4947432, 11643213, 22432473, -10878600, 4947432, -11643213, 764613], [17391370059, -17371442309, 10102796, -11361102, 12033540, -5051398, -7894210, 11361102, 12033540, 19927750], [-27738835148, -55463433156, -63641342, 0, -3935098, 127282684, 3935098, -62610984, 7118570, -7118570], [-50453717156, -25224354371, -69587413, -32332139, -12517481, -69587413, -5008414, 0, 7509067, -5008414], [82380617551, 82392561120, 0, 512896, 9333468, 72734132, -21277037, 512896, -9333468, -11943569], [27357895207, 54711730132, 72179087, 0, -24837689, -144358174, 24837689, -93568617, -2030141, 2030141], [-4833030187, -2421760864, -8570118, 22535796, 24697483, -8570118, 10491541, 0, -14205942, 10491541], [-27049626294, -27038332926, 0, 41741973, -16274968, 324579444, 4981600, 41741973, 16274968, -11293368], [-37787196027, 0, 22277205, -105926246, -16371603, 0, -16371603, 52963123, -29291571, -29291571], [45591627711, -45596050297, -186543446, 40022688, -15088752, 93271723, -10666166, -40022688, -15088752, -4422586], [9732471490, 0, 27350988, -168397824, -25700102, 0, -25700102, 84198912, -16862590, -16862590], [16166677849, 16191472515, 0, 69895794, -2720316, 67602914, -22074350, 69895794, 2720316, -24794666], [-21341792600, -42682149868, -41612742, 0, 10386876, 83225484, -10386876, -101046216, 717666, -717666], [3568266233, -3574361352, -44685400, 12619932, 44762764, 22342700, 50857883, -12619932, 44762764, -6095119], [-9376068, 55701622668, -314519341, 73931562, -19258457, 314519341, 9376068, -147863124, -9882389, -9376068], [-62689222166, 0, -78949864, -105252280, 19449118, 0, 19449118, 52626140, -18341846, -18341846], [-22166558813, 22177572268, 116845630, 171442848, 8734590, -58422815, -2278865, -171442848, 8734590, 11013455], [-79766766627, 0, -334824447, 12062994, -3833843, 0, -3833843, -6031497, 5670345, 5670345], [79937976492, 39976152012, 237491940, -103791333, -31799232, 237491940, -14327532, 0, 17471700, -14327532], [-41236057122, -41214268167, 0, 7123580, 38892813, -297988569, -60681768, 7123580, -38892813, -21788955], [-13038910568, -6493292655, -104148103, -66806496, 10940774, -104148103, -52325258, 0, -63266032, -52325258], [-83623903914, 0, 40523304, -200315440, -75150900, 0, -75150900, 100157720, -56328888, -56328888], [-26092520, -98514071930, 788709759, 60642366, 5365343, -788709759, 26092520, -121284732, 31457863, -26092520], [193442103406, 96731199514, 71497154, 279026848, -3290867, 71497154, -20295622, 0, -17004755, -20295622], [-84993108264, -169887807968, -114022644, 0, -43884808, 228045288, 43884808, 2001360, 49204280, -49204280], [14477781182, 7229713940, -294272327, -347253666, 30073109, -294272327, 18353302, 0, -11719807, 18353302], [165250020112, 165300749941, 0, 30718404, 18058677, -37486581, -68788506, 30718404, -18058677, -50729829], [-101264425030, 0, 283864408, -252819352, 47000330, 0, 47000330, 126409676, -28285150, -28285150], [19190449, -118649559264, -37574790, -229837968, 90578313, 37574790, -19190449, 459675936, 71387864, 19190449], [-99798923293, 0, 378068043, -159799818, -55726177, 0, -55726177, 79899909, -33642005, -33642005], [259924856616, 129989300143, -144838913, -246881381, -29735641, -144838913, -53743670, 0, -24008029, -53743670], [-142471959293, -284923609484, 196097143, 0, -29166793, -392194286, 29166793, -96199485, 10154551, -10154551], [116916970170, -116958466198, -199956664, 208922749, -1436288, 99978332, 40059740, -208922749, -1436288, -41496028], [-46390552915, 46377162921, 280877686, -423487776, 20833698, -140438843, 34223692, 423487776, 20833698, -13389994], [-53975956967, -107926322400, -94720985, 0, 60062915, 189441970, -60062915, 139461669, 12795767, -12795767], [-11052319251, -11131533771, 0, 136933642, 27782316, 772008288, 51432204, 136933642, -27782316, 79214520], [-125629470276, -251362686436, 233081794, 0, 43565644, -466163588, -43565644, -374537100, -51872942, 51872942], [-84253944, -75694215432, -318005682, 113201995, -89239662, 318005682, 84253944, -226403990, -4985718, -84253944], [207254772069, 207201363448, 0, 49062504, 49150960, 1069162428, 4257661, 49062504, -49150960, 53408621], [-103280200170, 0, -271399668, -538271152, 68973636, 0, 68973636, 269135576, 22985766, 22985766], [14398603660, -14461780392, -922051720, -177466887, -73574852, 461025860, -10398120, 177466887, -73574852, -63176732], [-200171249116, -400306855504, -199382708, 0, 32688182, 398765416, -32688182, 192261424, 17821364, -17821364], [-154193674177, -308327960880, -67452035, 0, -77619123, 134904070, 77619123, 449249979, 29693737, -29693737], [47770972207, -47605881037, 201262572, -376852820, 76732476, -100631286, -88358694, 376852820, 76732476, 165091170], [329049500521, 164461329557, 140099931, 641081316, 69761972, 140099931, 126841407, 0, 57079435, 126841407], [-2749386, 66041861514, 146822758, 2644888, -118707871, -146822758, 2749386, -5289776, -115958485, -2749386], [50845208, 180353531846, 656716962, 428266059, 12487882, -656716962, -50845208, -856532118, -38357326, 50845208], [-217791675640, -435635163096, 393727736, 0, -115616900, -787455472, 115616900, -102153864, -25905908, 25905908], [-339808967462, 0, -512685972, 280928208, 68409156, 0, 68409156, -140464104, -40137546, -40137546], [64270022171, 32094515582, 9789748, 838830776, 85016927, 9789748, 80991007, 0, -4025920, 80991007], [-72063545801, -72027636271, 0, -207846324, -209349632, -152315163, 173440102, -207846324, 209349632, -35909530], [-591318643222, 0, 570385408, 573729928, -121704814, 0, -121704814, -286864964, -42393034, -42393034], [-10706887, -134110244686, 924058980, 7891752, -216249009, -924058980, 10706887, -15783504, -205542122, -10706887], [674131779758, 336952262303, -191721434, -333903550, 119447402, -191721434, 227255152, 0, 107807750, 227255152], [5925250304, 12063669832, -649754268, 0, -162464888, 1299508536, 162464888, -499246080, 106584612, -106584612], [-229150255775, 229003259158, -1008086290, 1255604, -112586702, 504043145, 34409915, -1255604, -112586702, -146996617], [152584536, 146830015041, -372033125, -286193760, 115030070, 372033125, -152584536, 572387520, -37554466, 152584536], [-592765287981, 0, 1915026087, -362835314, 84485679, 0, 84485679, 181417657, 144861387, 144861387], [-126365013362, 0, 279400392, -486665016, -82496744, 0, -82496744, 243332508, 100344250, 100344250], [-101959813898, -51023692331, 252120173, -329031236, 57106936, 252120173, 87570764, 0, 30463828, 87570764], [692344133456, 692162334141, 0, 207168631, 60238116, -357100061, 121561199, 207168631, -60238116, 181799315], [85596741748, -85356526382, -777708640, 94334072, 198104209, 388854320, -42111157, -94334072, 198104209, 240215366], [-172998923315, -173050589386, 0, -802700964, 197941576, -12101274, -146275505, -802700964, -197941576, 51666071], [479505686849, -479549830068, 1499239146, -226227930, -117149702, -749619573, -73006483, 226227930, -117149702, -44143219]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_252_z_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_252_9_z_c();".
// 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_252_9_z_c(:prec:=10)
    chi := MakeCharacter_252_z();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 9));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 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_252_9_z_c();".
// 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_252_9_z_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_252_z();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,9,sign)));
    Vf := Kernel([<5,R![4137130570859290461939001875, 33594686141478886755088875, 95827489161816219992775, 39746058814580193270, -277882314887427237, -248983749198495, 751173109353, 873652230, -810267, -837, 1]>],Snew);
    return Vf;
end function;