
// Make newform 84.9.m.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_84_m();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_84_m_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_84_9_m_a();".
// 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_84_9_m_a();".
// 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 := [15758720495290800, 4263507454127400, 119846615988780, -71600654137860, 5194605060018, -139470625170, 1483053595, 0, -38255, 0, 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], [2560106014199641516715702430770984676831048480, 310007330258636047056371023027532001368945580, -50311808783007248050547388838766467752232152, 2361167606711182835213093021122334838884122, -49432323370232420671816106511466809823710, 407247873947801469805329113847737444505, 295816416513335686392206334903581040, -10508963126474563853994149197651605, -7804201098746205229207193944284, 272153962454078370610521305639], [-1078735705906769675415332633077119427873704893649810, 586448131599276055459085751241829208346571679040140, -40242428444367127486561034996929984578050403227196, 2233381193858871090009298488823372903064410792956, -62876999260667221030581873809544404857848115080, 775352444641497378675785892510643463540083910, -294398589639692400218010034596205124844645, -19994495655697126596428117946280492544005, 7870412045695935977777751606167139423, 532630612913952831343276059927313052], [-2598814389843358830802168363680544682375898814149870, -263577652563944625609641101301157681568421512160460, 16944013800571923749735267866200265950623106507168, -898604579864163378810330486014199328406070050970, 23946551205117981449732536802869245497095310730, -296034674386757575598878888639092410056688255, 118019207271863297887038018968875916038890, 7627898151160140166317081586356955394110, -3246451082198705599763328915997444869, -204614186603676854088703130386730570], [33464348625032329313820696140810334992737920, -1819449872910862947016101531720000456316920, -152333793468636799121418589411954938505920, 16872517881168933617029012438624753922319, -515871636771755277492400915734308895140, 6188375721497063895916391112390776055, -1820481341930148198652470129183830, -159590479431792254941050535412205, 48826521187590904857733922530, 4204770312641237494384848933], [-4294548229985885807395075384212369224834365652847450, 34832055152195878846278109115358683323428396428460, 93300647143174493333824794251437218022775609173896, -7851473574291654631049349409823274193323312329526, 222027676673540012619104989929351376380509513790, -2406385278346685811283500413143991438396776550, 95583868167182138326520184262962142427190, 62081366160749117215994564164255013429395, -2272436844388429587685896996872381793, -1618439339072742924425118221464244117], [-1485761827155484536329503772546514717139114517722680, 1020101344318079450977636648620781996729425256488420, -86572196292660480900155655360631781758804887647640, -2838752209987202470948260202434074813749717371762, 193500313102657780166256211917881434787130996510, -3180336698686086901112384376876310259729577085, 2848568278746643391370152984756331778875660, 81995458216232489810648481079270894506125, -75268334323461281196264785746980750240, -2179483260990883745836929408241933939], [-1631428644599401802435045072699269149239259600518040, -464422025971117234463332559981837535006056401378860, 84864340784719869974155988031904158946959730446696, -2525897975933825053216766986534381152420318526794, 9805364357520911139214322426785574771683111590, 448478185031561734110814343907563332462607675, -1399932730182171774073007736150029718527940, -11582160003070321206854790597848640629635, 36578504403459235578355632876886077432, 318443371724602025613880767677021597], [-4966690042660575942850729595967244584029629695676950, -241821570560664249202218062952866912341391278432260, -61307193571096435941381695732933183527777990379088, 5303505008538672248969271906736760067256100165424, -133799452544367282982944886967264428178391771690, 1066738181227501224504906927562310518687879685, 991271384753550460027738691536799868051660, -27543685197067700292026033244281398806220, -27004682297995660733339267495566312551, 684070894048704959508734332969630298], [-30733528526416724760261931925663268401776539663600, -15346834890558830124294893024572179403018021941240, 2339759522782711753070849660808964247862078994824, -133802328271531062019350797042258591132398654316, 3217746710447923589952203054212526480124886640, -31568804114576470524035623949368973401800165, -6432943521603493526685349644701775026650, 814169950798001130867605097419409420375, 166802970724034577546937084981332038, -21285468882417707370951983948134087]];
    Rf_basisdens := [1, 1918217540567141519798952270265420544310290280, 5744581979613447066417912311377368175073241816030, 1914860659871149022139304103792456058357747272010, 24018431490963621383815999754761571666265, 5744581979613447066417912311377368175073241816030, 7659442639484596088557216415169824233430989088040, 1094206091354942298365316630738546319061569869720, 1914860659871149022139304103792456058357747272010, 58026080602156030973918306175528971465386280970];
    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_84_m();"
function MakeCharacter_84_m()
    N := 84;
    order := 6;
    char_gens := [43, 29, 73];
    v := [6, 6, 5];
    // 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_84_m_Hecke();"
function MakeCharacter_84_m_Hecke(Kf)
    N := 84;
    order := 6;
    char_gens := [43, 29, 73];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, -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], [-54, 27, 0, 0, 0, 0, 0, 0, 0, 0], [92, 93, 0, 0, 0, 1, 0, 0, 0, 0], [139, -35, 0, 1, -1, 0, 0, 0, 0, 1], [-6, -170, -5, -3, 0, 10, 4, 1, 1, 2], [-3044, 6087, -9, -2, -6, 9, 5, -2, -1, 14], [-1823, 894, 41, -11, 6, 0, -5, -1, 1, 18], [-1913, -1984, 0, -7, -22, -72, 4, -2, -4, 12], [62565, -62712, 298, -2, -4, -149, -24, 16, 0, -27], [-29031, -46, 168, 208, 161, 168, -46, 0, -22, -92], [32395, -16058, -396, 273, 18, 0, 156, -39, 39, -216], [382026, -381634, -1170, 193, 386, 585, 754, 18, 0, -1393], [-443984, 887650, -2338, -305, 1433, 2338, 928, 26, 13, -2230], [-86376, -399, 828, 1962, 779, 828, -399, 0, -33, -798], [-18739, -20622, 0, 1590, 2472, -1343, -1065, -15, -30, -1776], [2333, -2133843, 2507, -801, 4617, -5014, 975, -105, -105, -4269], [2455609, -1223884, -10160, 4518, 232, 0, 2199, 120, -120, -4406], [-921868, -931566, 0, 712, 7502, -9756, -327, 443, 886, -3693], [5459, -4147853, 4410, 3848, 4484, -8820, -4897, -348, -348, -6582], [11281684, -1052, 27373, 5165, -242, 27373, -1052, 0, -95, -2104], [5795718, -2890169, -18513, 5395, 2982, 0, 2262, 871, -871, -3284], [-8441730, 8441359, 4932, -2095, -4190, -2466, -8083, -297, 0, -9692], [-4115919, 8232315, -32788, 1302, 13383, 32788, -3081, 1650, 825, -27720], [4526518, 4447018, 0, -1492, 3452, -78888, 440, -1664, -3328, -2338], [-22923541, 45846697, -114975, -1246, -39390, 114975, 2877, -1722, -861, 79550], [20453594, -10219180, -3876, -18791, 21061, 0, -7433, -3925, 3925, 43777], [15063151, 15128174, 0, -47779, -80390, 47862, 32470, 1852, 3704, 57356], [-36590156, 36632667, -96828, 5903, 11806, 48414, 18408, 5204, 0, 22650], [-31920, -81678453, -26361, -14580, -90407, 52722, 20139, 7656, 7656, 101525], [17158510, 8490, -8357, -49413, 8508, -8357, 8490, 0, -6963, 16980], [-82585431, 4101, -145530, -25398, -63128, -145530, 4101, 0, -4893, 8202], [64234629, 64461483, 0, 37021, 170088, 237489, -23828, 2558, 5116, -95679], [-86324, -240245162, -63892, -85389, 264795, 127784, 107821, 4339, 4339, -219931], [-57072150, 114186625, 285228, 47658, -22273, -285228, -137641, 10666, 5333, -40104], [-6901736, 6604560, 483352, 55500, 111000, -241676, 227709, -5709, 0, -199665], [-312196, -83056493, -345690, 111506, 13297, 691380, -145000, -22470, -22470, -80285], [188124740, -94321840, 507852, 20982, 64690, 0, 9894, 1194, -1194, 42514], [-228842164, 228840024, 5616, -668, -1336, -2808, -22514, 19842, 0, -227536], [-10628914, 21119882, 33601, -157401, 462556, -33601, 452748, -38910, -19455, -649220], [222408363, 223175058, 0, -174646, 857544, 713751, 113795, -7907, -15814, -375828], [813431, -324900142, 791683, 92484, 713571, -1583366, -114232, 5492, 5492, -757067], [200543712, -401112859, 691389, -19317, -1239, -691389, 64069, 12236, 6118, 53348], [-383211871, 383129232, -61758, 113518, 227036, 30879, 436686, 17386, 0, -1020435], [-1217444, -24685623, -1168470, -194939, -230281, 2336940, 243913, 957, 957, 328229], [54303750, -62692, 330963, 311161, 1078712, 330963, -62692, 0, -2299, -125384], [45473880, -23991118, 2533068, 8349, -375391, 0, 33061, -57773, 57773, -325967], [-470011346, -117688, -821664, 526445, -1067173, -821664, -117688, 0, -61995, -235376], [26922121, -53567414, -4060062, 226450, -264241, 4060062, -729728, -100756, -50378, -25174], [-1273989616, 637441172, -804333, -211495, -453758, 0, -123100, 34705, -34705, -276968], [79165118, 75686504, 0, -1030999, 122168, -3804291, 678338, -26984, -53968, 264593], [-1204274785, 1203249864, 2388778, -169468, -338936, -1194389, -660255, -17617, 0, 2059152], [-589220860, 190060, 2877890, -972652, -1211264, 2877890, 190060, 0, -22352, 380120], [-1066223242, 532435686, 2037015, -1453618, -112939, 0, -768473, 83328, -83328, 1257351], [211715991, -423030225, -4202852, 464798, -1060245, 4202852, -1331353, 126082, 63041, 1316976], [614805723, 614445006, 0, -2369810, -2160438, -1137771, 1573432, -19324, -38648, 1857273], [2700170, -1426063474, 2526598, 523026, -3010134, -5053196, -696598, -171262, -171262, 2662990], [-3535432306, 1771661115, -7678808, -323383, 867870, 0, -112267, -98849, 98849, 1290102], [2069842547, 2067760327, 0, 1213706, -894960, -1704960, -795483, 40963, 81926, 70220], [-4636014, -527653629, -4370409, -1375353, 1093604, 8740818, 1640958, -312933, -312933, -562394], [-1547274580, 94576, -674863, -625573, -3293966, -674863, 94576, 0, -152693, 189152], [-2577223081, 1286000129, 4367286, 1760191, 744609, 0, 904654, -49117, 49117, -966465], [2215156503, -4429912224, 4024226, 376705, 476106, -4024226, -1154192, -48154, -24077, -1753776], [2071992296, -4145281621, -1241568, -1289444, 4200371, 1241568, 3875917, 15170, 7585, -5806684], [-3102287900, 1546446948, 10234832, -1755235, -2226483, 0, -914407, 73579, -73579, -544827], [3398141265, 3399764291, 0, 598738, 3445986, 1765638, -370675, 85451, 170902, -1865605], [-9662974873, 9661842147, 1879400, 193026, 386052, -939700, 441798, 330306, 0, -2060031], [-7987753453, 7986106078, 1975536, 659607, 1319214, -987768, 3399525, -761097, 0, -3066417], [-4773288191, -656886, -7291170, 3272931, 1436163, -7291170, -656886, 0, -11499, -1313772], [-2494003, -11538818900, -1677309, -3625488, -3209685, 3354618, 4442182, -358712, -358712, 4843073], [3587223030, -7176278864, 7278012, -1521627, 4672453, -7278012, 4876058, 622354, 311177, -5679298], [3002236259, -1501668266, 2105183, -1769970, -3930859, 0, -765060, -239850, 239850, -1921039], [-11376233384, 11377799442, -1760716, -685700, -1371400, 880358, -3200559, 457759, 0, 7389747], [-722665345, 353495206, 16037208, -951544, 2850595, 0, -589269, 226994, -226994, 3575145], [-18153840650, 18145626074, 16616646, -93747, -187494, -8308323, -111702, -263286, 0, -89463], [-5994829402, 80779, 5051574, -1712975, 4622948, 5051574, 80779, 0, -1309080, 161558], [12051475195, 12052146558, 0, -6794122, -8861430, -1601215, 4533350, 11806, 23612, 6703293], [-5226255, -20032183310, -6453425, 4701459, -620076, 12906850, -5928629, -207221, -207221, -1834264], [9870433892, 9871573268, 0, -1454041, -24798, 850995, 871211, -294449, -588898, 300780], [-22568061725, 22570613472, -1671454, -1716020, -3432040, 835727, -6607224, -256856, 0, -11146089], [6471654662, -3215298327, -40355064, -1617732, -2996856, 0, -914788, 211844, -211844, -1590968], [-7198174316, 14393784142, -27807188, -2843324, -9513958, 27807188, 8251138, -557668, -278834, 24156896], [-7059903506, 1574349, 21724569, -6093921, -9198607, 21724569, 1574349, 0, 1777824, 3148698], [2727779, -22729355264, 2656335, 458295, -18048114, -5312670, -529739, 172519, 172519, 17905226], [-3664876, 8462477, -16593021, 923774, -10148286, 16593021, -2980273, -417902, -208951, 18031122], [20131284455, 20135315531, 0, -9038854, -14099528, 986256, 6041837, 47803, 95606, 10094584], [-16214723850, 16206807855, 16836036, -502023, -1004046, -8418018, -1988823, -19269, 0, 25311543], [6386448106, -1584260, 16899967, 5937218, 21313, 16899967, -1584260, 0, -1984082, -3168520], [-27632510665, 27624987913, 14577984, 233760, 467520, -7288992, 859674, 75366, 0, 14279034], [664455590, -1328447944, -20593186, 1649133, 16117543, 20593186, -3761502, 2371794, 1185897, -33161558], [-6118208110, 1460133, 21643740, -8415423, -12242292, 21643740, 1460133, 0, -1114758, 2920266], [9601387281, 9570132648, 0, -22110050, 26802906, -39064395, 14959906, 659618, 1319236, -5591691], [-14717859959, 7342967870, 33366055, -2902394, 8582755, 0, -1460558, 18722, -18722, 11466427], [7478529, -6538126838, 7757946, -1465944, -1350187, -15515892, 1745361, -348276, -348276, 1909021], [11203524175, -2685675, -3426311, 10640091, 20035365, -3426311, -2685675, 0, -2788284, -5371350], [-6377773263, 6363263940, 23924304, 2547171, 5094342, -11962152, 9414171, 774513, 0, -8845625], [1093502348, -2195750410, -37248844, -9075251, 18573385, 37248844, 26896216, -659074, -329537, -19655342], [-2573944950, -2600851375, 0, 38056942, 38791522, -14747389, -25107989, 789917, 1579834, -31554797], [-4391492628, 2179643176, 10834846, 43292940, -2785018, 0, 21921510, -550080, 550080, -45527878], [17663836767, 17704346888, 0, 4692055, 44290828, 41288112, -2735023, 1179041, 2358082, -22923405], [-4879129784, 4859530376, 48234402, -4517793, -9035586, -24117201, -20706123, 2634951, 0, -21800760], [-33334934916, -3420956, -29406708, 17489107, 45101963, -29406708, -3420956, 0, 384327, -6841912], [46665822, -2587422029, 43146022, 7392942, 18221853, -86292044, -10912742, -6686258, -6686258, -25261453], [-67339254285, 33685937688, -38277756, 10633795, 45131709, 0, 4977130, 679535, -679535, 33818379], [14977061390, -14977547232, -16576020, 8773852, 17547704, 8288010, 33071319, 2024089, 0, -40011519], [-4333497, 47537348821, -7708500, 13860414, 8681154, 15417000, -17235417, 360402, 360402, -15431160], [19974034892, -10029969429, 91604934, -15441991, 8391471, 0, -9741023, 4040055, -4040055, 19793407], [-2578262637, 5145652893, 114919617, -6953575, 896355, -114919617, 24779531, 7837612, 3918806, 19952052], [-44163155562, -43957781320, 0, -26325448, 40151404, 196559558, 17570066, 59302, 118604, -11261018], [-54424254, 59280192502, -54173378, 5702979, -47667603, 108346756, -5452103, 6706483, 6706483, 48169355], [5808662071, -11622729134, -87634962, -4341823, -13056837, 87634962, 14088638, 2126338, 1063169, 36923658], [7064176426, 7154560161, 0, 32146967, -81386518, 99470322, -20616777, 2443603, 4887206, 31606672], [-36979358, 35929407348, -28878678, -37101230, -57678894, 57757356, 45201910, -4698510, -4698510, 73880254], [40077070678, -5208048, -72484664, 28988361, 16599591, -72484664, -5208048, 0, 2948121, -10416096], [-7397518459, 3707447701, -28830204, 23431590, 15043364, 0, 11978329, -525068, 525068, -7863158], [-14493713403, -5833178, -78430446, 31984831, -95283082, -78430446, -5833178, 0, 2818941, -11666356], [83424359, 15609920512, 78061365, 20600949, -22161900, -156122730, -25963943, -851027, -851027, 11435912], [23368083798, -46743457953, 13800618, -3835273, 23950154, -13800618, 14960903, 6910168, 3455084, -33319594], [-73599950916, 36875832138, -119807112, -61919117, -66247851, 0, -30012869, -1893379, 1893379, -2435355], [26536975741, -26511620907, -34901700, -7903984, -15807968, 17450850, -35822214, 4206278, 0, 67052937], [133813128740, 7957486, 597581, -43958620, -12566339, 597581, 7957486, 0, -4171190, 15914972], [94232682514, -47237413893, 259577073, -32940381, -1602778, 0, -15508580, -1923221, 1923221, 33260824], [6137700521, 15988884, -11193966, -90606156, 82002442, -11193966, 15988884, 0, -10661736, 31977768], [-98391191643, -98434031757, 0, 5904456, -72662700, -43206072, -2769249, 3501165, 7002330, 36697308], [-25813081, 20056786980, -18039358, -28285059, -25068729, 36078716, 36058782, 2809833, 2809833, 40616175], [-9877536893, -9862532288, 0, 12633863, 61547818, 26305794, -11967526, -10634852, -21269704, -42075098], [170328950321, 1145058, 135719129, 274746, -24803724, 135719129, 1145058, 0, 6000036, 2290116], [73470742726, -73412954442, -145160064, 14791748, 29583496, 72580032, 64927118, -5760126, 0, 124589458], [-118780712644, -118829599946, 0, 3629592, -212585392, -48401818, -2057538, 1086570, 2173140, 105807212], [22395068309, -44776109491, -72377280, 17862106, 92314530, 72377280, -49751339, 7669958, 3834979, -212683314], [-76471002354, -76794373830, 0, -53313693, 78591230, -342274293, 36108255, 1697379, 3394758, -20392798], [-15237753, 138241437067, -12672162, -28131453, 171060033, 25344324, 30697044, -17869089, -17869089, -165928851], [341038846994, 6053666, 92894882, -31295273, -141775177, 92894882, 6053666, 0, -1026943, 12107332], [113808968212, -113712894799, -180162936, -5991945, -11983890, 90081468, -30289662, 6321882, 0, -255697585], [-49760213274, -9610696, 87839190, 49424819, 103624027, 87839190, -9610696, 0, 1371339, -19221392], [-168991584981, -168988022296, 0, 143477670, 6733702, 56815103, -98365044, -8139792, -16279584, -56619269], [-119523853581, 239057802520, -368437482, -511653, 32406267, 368437482, -9072052, -21214022, -10607011, -85003250], [54199651830, -27085680136, -47312008, 29977271, 568087, 0, 10956821, 8063629, -8063629, -37472813], [247966887812, -124223836892, 436341186, 83903065, -35955639, 0, 39458279, 4986507, -4986507, -124845211], [-235981014589, 472000085144, 206706561, 39846363, 61828825, -206706561, -117748692, 3580794, 1790397, -199769582], [65357413, 95231661234, 43360315, 74989860, -90454449, -86720630, -96986958, -12998532, -12998532, 46460253], [21951863306, -43980552160, -307181340, -80691063, 170547361, 307181340, 238207674, -7731030, -3865515, -187443626], [169124020816, -169006581723, -231682082, -1598052, -3196104, 115841041, 27785451, -34177659, 0, -71979549], [208000864, 99604948706, 177511842, 118684003, -145535425, -355023684, -149173025, -3272085, -3272085, 84557381], [500358487943, -8807103, -113314654, 34354431, 69829020, -113314654, -8807103, 0, -9681084, -17614206], [314971685436, -157737311491, 538093863, -65915496, -48640875, 0, -30759179, -4397138, 4397138, 21671759], [-160321361088, 320681733636, -243526844, 43961027, -124274463, 243526844, -126933514, 9899134, 4949567, 170526006], [10116787554, -20246896657, 658490643, -17089343, -150446577, -658490643, 47500235, -7535588, -3767794, 327536252], [-146539282004, 73425525504, -291633970, -26925501, -124042737, 0, -6790467, -13344567, 13344567, -83772669], [-50797123492, -50299107962, 0, 40452902, 43249704, 512105328, -27271350, -908246, -1816492, -35714650], [-48154995102, 48099792870, 192525448, -41060492, -82120984, -96262724, -164481288, 239320, 0, 477906300], [378742013606, -378668618268, -76720968, -35034854, -70069708, 38360484, -167150582, 27011166, 0, -200253970], [-224148268750, 448312924064, 699335187, 42950255, 47169436, -699335187, -102287074, 53127382, 26563691, -127112000], [53544244282, 75176547, -157346766, -386343141, 195934278, -157346766, 75176547, 0, -10460406, 150353094], [-251486703326, -250774401100, 0, -135815064, -267421136, 671092858, 88512216, -6093480, -12186960, 174919936], [495822421, 145795793517, 526580676, -113879741, 122201651, -1053161352, 144637996, 9153279, 9153279, -60685141], [652139459152, 20639558, -109708379, -121517783, -151533724, -109708379, 20639558, 0, -18319993, 41279116], [-143533206561, 143763832470, -351046008, -55102905, -110205810, 175523004, -239858898, 19447278, 0, 27247930], [-213414197135, -212983712062, 0, 101654136, 18938122, 458139601, -64654332, 9345276, 18690552, -37123589], [94445813803, -188774978824, 96174810, 110403482, -61636058, -96174810, -337455746, -12490600, -6245300, -110025448], [-402543637447, 201071376033, 256020991, 273949090, 28729140, 0, 129084700, 15779690, -15779690, -260999640], [-269495666086, 269355362166, 127641792, 76483024, 152966048, -63820896, 258603204, 47328892, 0, -143765568], [286449543676, -11313294, -371932283, 102349776, 297199521, -371932283, -11313294, 0, 45783306, -22626588], [-21856609227, -31154491, 237994092, 142941863, -719980599, 237994092, -31154491, 0, -12830592, -62308982], [-379411823320, -380010740615, 0, 209622381, 621751004, -525440974, -141549351, -5403291, -10806582, -384351823], [-366923344, -95743541206, -375561872, 40974900, 382696428, 751123744, -49613428, 6420788, 6420788, -399973484], [-374550449509, 186601021758, 1402999243, -93905375, 82213320, 0, -39312125, -15281125, 15281125, 191399820], [662626879, 199998793080, 644254344, 45699157, -359790100, -1288508688, -64071692, -27790983, -27790983, 323045030], [-205983734832, 103241195277, -595183167, 165469072, 75335933, 0, 68941627, 27585818, -27585818, -117718957]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_84_m_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_84_9_m_a();".
// 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_84_9_m_a(:prec:=10)
    chi := MakeCharacter_84_m();
    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_84_9_m_a();".
// 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_84_9_m_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_84_m();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,9,sign)));
    Vf := Kernel([<5,R![475187804790098809326750000, -5015124775706433393600000, 9441969406808159677500, 86555484350433360000, 38523776306784975, -381886886416725, -19821737736, 894492387, -876, -1389, 1]>],Snew);
    return Vf;
end function;