
// Make newform 354.6.a.f in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_354_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_354_6_a_f();".
// 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_354_6_a_f();".
// 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 := [-8433643, -7344954, -1919598, -192180, -6296, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [163231989243, 247814195181, 57421225892, 2534385203, 3994798, -405091], [1019381753668, 595939730716, 84919990542, 3397439158, 4297543, -544836], [9856228127, -10304481901, -2676131527, -126842723, -243763, 20471], [-21635683855423, -14910972914901, -2190963083437, -85051805363, -93564873, 13570971], [-15137248321417, -9432995734379, -1475985997048, -60236074227, -80139592, 9653159]];
    Rf_basisdens := [1, 4974382385, 3553130275, 92979110, 49743823850, 24871911925];
    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_354_a();"
function MakeCharacter_354_a()
    N := 354;
    order := 1;
    char_gens := [119, 61];
    v := [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_354_a_Hecke(Kf)
    return MakeCharacter_354_a();
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..(prec+1)]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 6;
    raw_aps := [[-4, 0, 0, 0, 0, 0], [-9, 0, 0, 0, 0, 0], [-8, 0, 0, 0, 0, 1], [-18, 0, -1, 1, 0, 1], [-108, 0, 0, 0, -3, 2], [106, -1, 4, -2, 7, -3], [115, 5, 1, -10, -7, -4], [-70, 1, -3, 1, 3, -22], [-573, -19, 1, 10, -4, -15], [261, 9, 23, 10, -16, -2], [995, -24, -37, 14, -26, -3], [6218, 21, -13, 7, -68, -25], [2319, 29, 33, -52, 103, -13], [1843, -80, -58, 39, 4, 87], [2027, 11, 81, 76, -26, 72], [3562, -90, 56, -70, 54, -97], [-3481, 0, 0, 0, 0, 0], [-4020, -226, -3, -23, 177, 88], [4397, 376, 78, 7, -255, -272], [-30863, -337, -208, 195, -104, -72], [-3742, 54, -279, -333, -83, -352], [-2780, 159, 78, 80, -149, -391], [-7325, 611, 151, -116, -263, -189], [-29870, 175, 67, -375, 1021, -657], [-36114, -201, 50, -218, 918, -228], [-70698, -282, 438, 694, -85, -135], [-20794, 400, 470, -62, -204, 752], [-93289, 262, -131, 140, -54, -882], [-15758, 209, -109, -563, 3, 922], [-98853, -15, -852, 363, -515, 765], [30162, -709, 394, -468, -158, -414], [-54940, 1186, -110, -1014, 1234, -200], [-89860, -838, 560, -174, 565, 1000], [-109550, -773, -676, 250, -452, 502], [-160127, 54, -93, -202, -1005, 1799], [62791, 1458, 1869, -1056, 1598, -7], [5580, 1017, -1054, -436, 422, -928], [-36664, -2060, -59, 475, 2741, 764], [-95928, -209, 1623, 1519, 2027, -2769], [-108314, -949, 241, -459, 2040, -1894], [-58346, 566, 442, 388, -3085, -4330], [27801, 90, -3473, 4, -762, 1301], [-155804, -1800, -262, 980, 4098, -2625], [191700, 1124, -224, 168, -4581, -615], [239522, -1408, -26, -114, -508, -5862], [-9270, 2552, 93, 241, 5525, -3514], [151936, 3820, 1275, 2503, -6672, -8534], [46536, -2452, -2068, -3050, 2553, -763], [66057, 1473, -4383, -5158, -4215, -4818], [140326, -4042, -3187, 2885, 1594, -1077], [-142714, 1882, 3482, 696, -3440, 9302], [-209571, -463, 5932, 485, 3121, -6873], [-191170, -5890, -6804, 1734, -3689, 9067], [-369593, 2179, 1294, -2751, 4261, 11697], [319602, 6710, 2172, -5398, -4641, -1029], [-314708, -847, 6099, 77, 2120, 11368], [-422637, 2229, -8768, 1737, -3184, 18272], [211060, -2891, 10300, -6722, 3877, -6501], [155997, -2844, -6992, 2633, 6157, -2782], [-160684, -8388, -3870, 2506, -7419, 3893], [-22874, -4838, 953, 3379, -11714, -10772], [466243, 12645, 661, -2884, 5810, 5713], [483050, -3150, 12500, -5210, -1940, -13578], [-858637, -5528, 723, 6432, 2219, -5311], [264064, -12323, -131, 9961, 13147, 5494], [28966, 718, 13064, 5954, 20782, -16729], [366772, 5204, 8682, -11638, 4232, 7680], [747398, -7407, -3747, 1531, 5833, 16544], [22373, -7523, -743, 9946, -1116, 26284], [227776, 4121, -8762, 25442, -7437, 16993], [-75257, -3342, 1589, -24500, 2772, -13880], [-790830, 7946, 7556, 8392, -3433, 5709], [-1013537, 16214, 7996, -1673, -14959, -15582], [480702, 1546, -10689, -2793, -38033, 10957], [-2672182, -10391, -10446, -404, -3160, 12390], [-1913619, 6421, 16642, 10261, -20596, 12956], [-394116, 7128, 4396, -10198, -2862, -34226], [552788, -4567, -2490, -17076, 15298, 4790], [-714923, 9844, -10583, -21898, -19554, -39086], [-2094518, 8152, 6112, 6684, -20632, 11864], [-1749396, -5660, 7612, -9682, 56291, 9801], [-1847186, 17647, -162, -14856, 36513, -12335], [-2639875, 7613, -16081, 16560, -36024, 12978], [804388, 8890, 14945, -4679, 20366, -2562], [-2835968, -1101, -1045, 12899, 37554, 14933], [718147, 4369, -4619, 5344, -25895, -19214], [580414, -10712, -4574, 11230, -35545, 55750], [826028, 7170, -19987, -14851, -6365, 21080], [-369907, -5141, 21901, 12710, -16988, -56011], [-1422650, 30390, 10857, 9297, -24687, 23027], [409818, -6314, -24728, 9528, 21493, 13619], [-136167, -15226, 17531, -38088, 69448, 22738], [1636058, 19137, -22011, -40997, -38322, 9611], [-1478304, -2343, -6731, 24793, -52261, 40441], [-1405894, 937, -4246, 15448, -5498, 37386], [419179, -8195, -437, -33170, 42746, 38504], [4652346, -16203, 7763, 1693, 19651, -25601], [665797, -21783, -22671, -4328, -46074, 14046], [782742, -4251, 31022, 19684, 12554, -62704], [601296, -24521, 15124, -2456, 34301, 36361], [175016, -35253, -16457, 15409, 9301, -20616], [4989020, 36782, -12516, 41962, 5524, 45126], [2141058, 54922, -33704, -9620, 17910, -12475], [-12168, -10651, -31411, 833, 23691, -73559], [-3296809, -32572, -23340, -15289, 22185, -338], [363401, -2564, 17660, 49223, 12226, 50053], [4033608, 59808, -8230, -15990, 37421, 60586], [4424297, -63343, 52645, 10036, 57702, -13802], [3075534, 81614, 13450, -7058, -68271, -51471], [-2991630, 46707, -23005, 26005, -23971, 176772], [-681500, 20289, -54776, -18486, -24667, 78551], [-1164928, -11066, -33566, 31394, 66893, 76187], [-3534097, -85127, -20217, 41124, 67293, 55368], [-1481486, -3425, -13088, -12098, 9232, 8214], [2667710, 29181, 22550, -48034, -87435, 31891], [-201040, 42562, 1978, -5730, 23776, -81383], [3393836, 31483, -66263, 23795, 1137, -1324], [-1562040, -17292, -64256, -1240, -112880, -48504], [3422455, 7947, 3261, 37714, 554, -122712], [-745131, -7605, 43301, -53700, 7240, -2945], [-2656465, -41832, 38455, 12250, 10836, 26959], [2179816, -27594, -18508, -18010, 76526, 65120], [4110026, -11868, -11774, 28422, 79292, -55688], [6565920, -3418, 11726, 14818, -4303, -131722], [-519084, 51500, 65498, -4930, -29003, -92421], [-416322, 72239, -38185, -62217, 81624, 114194], [-1607468, 4784, 17166, -22632, -39164, 175178], [689887, -17981, 41771, -59452, -47232, 32345], [-3281512, -31930, -136184, 18282, -54611, 168241], [-2578581, -68764, -66028, 92547, -31853, -2230], [-3555602, -37632, -22321, 39661, -73522, -191052], [2391789, 74740, 3493, -11930, 50234, 70532], [-827216, 76996, 36282, -26460, 46944, 101658], [-2034580, 13144, 14637, 47035, -100681, 142743], [5905098, -2060, -99240, 47422, 2980, 45197], [4019240, 15543, -62063, 961, -179937, 219728], [8603992, 20612, 15202, 78882, 37216, 115192], [1923242, -28870, 83094, 25384, 73154, -12176], [13195536, -35240, -29142, -14132, 78581, 144021], [4697755, -90626, -45037, -53614, 66694, -29510], [-2213882, -85592, 22258, -20216, 31513, 31869], [8239256, 135761, 27141, -27325, -78286, 5954], [-96389, 8262, -99034, 105993, 86255, 71752], [-4789473, 36035, 72934, -66775, -123513, 179325], [569741, -39204, -23147, -26290, 99830, 248169], [-14258946, 33738, -16060, 78956, 13320, 68807], [-9241428, 66806, -36931, -2881, -195225, 194639], [6501729, 190215, 3044, -84851, -24193, 7669], [-14369506, 51418, 56572, -90020, 83138, 16224], [11510415, -184177, -105321, 144920, 20000, 254305], [-415868, 88704, -83332, -134298, -235200, -44372], [-1975188, 173536, 111106, -40978, -9868, 49404], [-4831164, 88628, -56232, -16700, 68452, -114988], [6184036, 115178, -42326, 90240, -81916, -79159], [1000686, -73185, 140270, -20872, -67970, -208668], [-3834316, -112467, -135041, 104801, 29638, 220132], [1269050, 15124, 146750, 91286, -61906, -206268], [-6523315, -9731, 185730, 27379, 92379, -103109], [-13415086, -71289, 82506, 56954, 134780, -98966], [13783587, -113245, -32212, 163691, 97965, 248011], [1630528, 197381, -36925, -95169, -270917, -127709], [-7479334, -157858, -41700, -3290, 150197, 34149], [-21915114, 5954, 18559, 113447, -123557, -263939], [-10142135, 32224, 37277, 91074, 170976, 71538], [2200413, -27769, -56948, 122497, -139107, 111441], [-9313644, -142036, 142244, 49658, 277978, 334443], [-15120624, 100092, -91161, 135633, -145619, -313537], [-3382601, 198488, -31773, -23474, -176890, -241499], [-29220076, 153390, -153632, -47982, 96216, 162432], [7429650, 284310, 92680, -202556, -360761, 93107], [-7789535, 107431, -9924, -251763, 3937, -117621], [-2924370, -3278, -15336, 141882, 92963, -39759], [-3778635, -24530, -7321, 310498, 129183, 201569], [-1833732, -79169, 242840, -235258, 147250, 86150], [5090468, 62350, 36396, 150750, 209315, 452369], [-534774, -42726, 148740, 29964, -294669, -231896], [-20088718, -82671, -1820, -54498, -223142, 231294], [8486726, -149794, 273862, -9326, 135047, -212395], [-23369744, 20605, 49011, 46673, 352563, 370850], [-8974880, -80286, 120192, -31770, 101258, -626700], [643148, 259748, -233156, -243500, 53952, -40834], [-16617124, -54538, -93396, -59220, -432126, 286352], [5206342, -6303, 84754, -6912, -112783, -661377], [-10813632, -129336, -185270, 277036, -12540, 285918], [-20245251, 111389, 89220, -47125, 238470, -304800], [-14884749, -60330, -212573, -126410, 35460, 177218], [4988012, -235166, 62590, 213588, 128648, 431256], [18939482, -12640, 202954, -259336, 373277, 206721], [16299070, 183779, -54762, -152066, -280176, 204934], [10394451, 37331, 218735, -134980, 54278, -34703], [11264458, 124633, -51514, 36590, -254048, 241172], [29086582, 129316, 280280, -21418, -285319, -745020], [7487288, -177978, -95644, 240596, -94701, 390639], [-5088847, -65281, -16579, -350068, 182998, 54146], [13262860, 63026, -345268, 226236, -349374, -411672], [3032991, 146360, -123463, 112524, -45054, 276442], [24574098, 171124, 15947, -82733, -264387, -352543], [44267474, -123864, -20279, 153681, -3314, 78185], [9206800, 254283, 61761, 125589, -78743, 702597], [9023041, -57739, -8521, 95666, -183902, 425817], [963466, -41934, -32400, -252668, 19732, 274264], [8445976, 232051, -69098, -67110, -133696, 1156700], [30286266, -26630, -31087, -126571, 466187, -321695], [-4069556, 35149, -154247, 83093, -199709, 154542], [-2847884, -195238, -28210, 117818, 198870, -772840], [-9814198, 7081, -189055, 496105, 281130, -191486], [37524555, -128054, 25498, -129543, 124423, 22762], [18000313, -232611, -38153, -139756, 666885, -168652], [-7954993, 136308, 532727, -417218, 99214, -165466], [3896230, -3294, 291142, -100448, 246441, 503207], [20000316, -102223, -157833, -6357, 75755, 463594], [-6916228, 27918, -289678, -292894, 425562, 169777], [9698090, -84887, 53317, -290445, 407822, -206285], [-56104372, 191202, -55104, -63552, 366416, 179056], [-22046205, -200741, 65046, -120077, -62058, -996868], [-20055250, -84459, 9773, -52497, -28503, 338672], [20206048, -444755, 382194, 221224, -208351, -277595], [-22791183, -39153, -227121, 24948, -198583, -189375], [-6683197, -450143, -51881, 16920, -149130, -517801], [29614462, -196534, 149188, 22242, -65002, 276225], [52511714, -359743, 424854, 144944, 438413, -157829], [14767863, -737382, -251908, 254703, 478983, -523958], [-35332332, 221238, 100952, 94744, -374078, 570984], [54058072, -420768, 82809, -57925, 231339, -867534], [-45736336, -297490, -95350, -242836, 965533, 663901], [-9393902, 51142, -29167, -90763, 154656, 449553], [23020071, -29761, -492585, 528106, -433446, 111739], [-30058346, 520940, -108114, -597288, 1984, -499180], [7780116, 447656, 367692, -374466, -711810, -573008], [-1360919, 237830, 63843, -86024, -282436, -129876], [40457720, -199436, 111043, -444791, 800148, 45809], [-990767, -215226, -363162, 1565, 206056, 642887], [1368196, -349172, -857827, 374027, 125155, 1052753], [-67709015, 79917, -88500, -410103, 84593, -373303], [20630360, -53754, 102940, -104042, -697384, -119854], [-53915023, -444651, 102436, 641377, 132653, -457221], [-4916246, 366525, -447200, -344264, -603914, -500262], [66902028, 52421, 241667, 46819, 4213, -560269], [-16409738, -3924, -727608, 244708, -833922, -354999], [9410014, 90965, 106695, 238147, -290090, -508102], [3849293, 135253, -1678, 46427, 341687, -225981], [-19602342, -337160, 277780, 257250, -533495, -118829], [25834932, 88167, 772834, 23576, 479091, -766099], [-27469312, -57840, 505694, 5504, 96332, 750476], [-27692471, -170697, 111273, -219524, 882117, 580178], [-71406292, 17317, 287555, -154683, 725946, -333740], [5278141, 413774, -555032, -249763, -695149, -795702], [31001498, 239412, -271076, -54930, -836051, 1064284], [52083512, -208634, 33687, -319255, 604799, -848822], [25777255, 266643, -103686, 159931, -585486, -325428], [-25665606, -196176, 500595, 266643, -317947, 439443], [22688113, -153418, -303999, -263382, 266308, -583576], [-92253513, 449749, 570005, -771272, 212282, -776490], [-28755949, -41804, 411866, 542719, 769810, -417871], [15998702, -53872, -205002, -185960, -1337358, 177273], [57187583, 817901, 187666, 57193, 133217, 750975], [-60264731, -592828, -476310, -147869, 197071, -110404], [2977118, -554338, -235202, 114542, -907508, 463526], [-44231199, -184511, 148856, -21035, 360227, 1259981], [-57197082, 817694, 472059, -693503, 1522, -1336508], [34380305, 516, 276130, 251995, -75203, -881092], [-93521073, -133185, -291112, -137157, 1412331, 1152847], [69273362, 264978, -682482, -139338, -145984, -909548], [-132439918, -104608, -485734, 22558, 646234, 910492], [-40625504, 244164, -210786, 968858, -1261200, -112459], [51585708, -726268, -894100, 803144, -480541, 180609], [12252625, 153117, 705377, -486354, 54268, -1504417], [11189778, -998, 702542, 239716, 47236, -1495748], [129141028, -523639, -418598, 683746, -476226, 1933708], [11751910, 101666, -304502, -640412, 451534, 543037], [-11618706, -174518, -611380, 31148, -1017976, 1575530], [19246220, 602548, 211481, -871433, 904873, -305378], [12853096, 501013, 178133, 476761, -571847, 62156], [72360048, 189507, -178174, 1053568, -7921, 1184887], [-31992395, 98940, 783974, -731647, -417498, -173583], [-56957936, -493904, 412477, -313805, 348269, -859349], [115721256, -36117, -667691, -270135, 347563, -45455], [-73456827, 307742, -851004, 740689, -737527, 528404], [-58272494, -692169, -280382, -299618, -758034, 616824], [-68484293, -436675, -880884, 536943, 633051, 1860741], [-19206321, 818169, 142520, 21745, -783752, -357482], [93482164, 171554, 492114, -413944, -34654, -438850], [-68370572, -1219454, -348234, -477814, 740402, 1472906], [-111448540, 737952, 469476, -507320, -255159, -1676155], [-44361579, -1286910, 24562, -27717, 836753, 1209162], [30187445, -547045, 687417, 802806, 745912, -663180], [-10729520, 192265, 496224, -391374, -663014, 1553794], [-51029017, -401069, -312335, 615008, 835024, 1024953], [-62051657, 375964, -929142, 1024129, 71725, 729838], [-47704262, 621500, -349524, -408180, -1322508, 74676], [-109646445, 134057, 298582, -154337, 543736, -1220830], [53919130, 1163212, 321286, -594816, -2073378, -377278], [13016227, -602723, 390595, -224878, -474150, -1987051], [65308736, 867478, 260762, -17222, 723109, 458214], [16471479, 24286, -771284, -292317, -579903, -1828228], [18754417, -826111, -19070, -683479, 1973228, 305958], [-44984248, 614670, 30411, -175685, 25710, 725861], [-24766844, -490662, -122798, -445046, 1432560, 1803311], [10294267, -728953, 368971, -742872, 1178887, -129631], [-153792913, -887748, -712478, 610341, -422197, 40842], [88379697, -722934, 264925, -77614, 412244, 388945], [12601219, -187127, -403750, 457267, -2143876, -654314], [-112418841, 1019726, -606542, 916949, -1884889, -933060], [114852974, -269972, -171560, -413832, 422171, -536155], [55264562, 189922, -341956, 117974, -403094, 3181932], [-121607832, 562171, 1269550, -240360, 53144, -1750456], [-19431343, 2058909, 476720, -347847, -1933605, -1038897], [-33419154, -113226, 887173, -767783, -873552, -558107], [40219715, 417249, -269313, -710674, 113646, -162864], [47428264, 557570, 107514, -262232, 593492, 410900], [64986819, 931035, 317812, -1105931, -364314, -315180], [-63026251, -240681, 31091, -488932, -661838, 1472371], [80726966, 557758, -758978, -1249558, -1302685, 495762], [166062765, -442622, -928003, 35100, -1114177, 1927326], [-15942685, -896234, 302111, 604612, 402133, 1107997], [110619014, 457595, 1215150, -1015550, 1893186, 338540], [-10229593, -174087, 1402543, 839042, 2069028, 1480264], [194058471, 1268507, 828822, 1935, 1198492, 120508], [-2475326, 654304, -738410, -1387206, -1708318, -2302166], [-2738370, -352888, -1538980, 481256, -790309, 2460744], [-74599658, -142326, -317008, -991194, 572840, 1368500], [-101648746, 837130, -371174, -510658, -338542, 697886], [147651583, 413943, -43975, 1456830, -743962, 1002044], [32467388, -1602836, 79212, 999424, 1756328, -218694], [-12992102, 323978, 1291206, 1435380, -1354230, -307765], [19178876, 95190, 1840268, 24210, 1817328, 395570], [208884587, 379326, 59374, 65095, -1275386, -1530685], [49846272, -455432, 1581106, 259898, 71412, -746820], [64170106, -1222920, -778976, 523578, -587202, 1315494], [122595120, 287197, -1179935, -251763, 713179, 1304091], [-69354580, 686461, 1270029, -843981, -341692, -2794363], [-45002206, -2140130, -182306, 1115212, -495042, -890026], [22397584, 430064, 1003548, -2244246, -1149542, -524028], [-20498537, -778469, 719564, 806415, 2423683, -721309], [-17797162, -638291, -758405, -110121, -860987, -1338064], [-92251344, 1862981, 1101427, -1078841, 142223, 800655], [8073939, -376268, -302109, -917758, -510854, -2457973], [90331098, 1427454, 1342856, 135570, 1454582, -1470618], [-33822892, 1195712, -1059279, 568965, -2469913, -412846], [107590, 1657145, 653380, -554546, 893168, -2375928], [13913694, -419178, -464470, -681582, -2225296, 1419468], [26201005, -77065, -1504616, 815769, -611981, -2184963], [67120452, 679648, -115722, 489648, -1061503, -2643439], [-5332500, 648872, 1945108, -650610, 388676, -1164958], [-11260118, -992148, -303534, -574310, 756923, 991427], [46330614, 2909008, 1529760, -1267894, -522019, -989032], [-15243128, 1606663, -299882, -742586, -854723, 625817], [108138614, -398442, 383740, 436714, -1762108, -13550], [-54940192, 1070034, 316654, 824976, -1317654, -1584211], [106208755, -159719, -404036, 982963, 1288921, 618011], [-31429080, -1582816, -642053, -4011, -1789703, -624661], [-13674313, 778100, -1249431, 366178, -1863295, 456452], [-21360347, -1193885, -406111, 1334400, 1574542, -118658], [-21756971, 177480, 36955, 1362900, -782608, 1705967], [84444581, -1020930, 1073869, -1136882, 2355482, -3049439], [62831610, -597584, -13600, 1520314, 236682, 1396030], [-53864084, -2362256, -1019848, -414076, 2103866, 451136], [53660426, -151729, -1036673, -1135043, 1744317, -938691], [-59576831, -581333, -761845, -860836, -957180, -3356427], [-230286621, -304615, -1035822, 283615, 557924, 835212], [57544078, 1943785, 927524, -1883482, 2146035, 1074413], [117928273, -109523, -946283, 703100, -1263793, 3034450], [-23118524, 170668, -1160212, -1710134, 340055, 1303199], [116281508, 1063448, -105452, -252548, 739971, 3195968], [71459114, -806014, -1832829, -348949, 243403, -1374332], [100312600, 1011432, -1216005, -518941, 2276127, 990330], [-108959098, -9048, 617892, -329976, 3756887, 2489855], [-183496114, -563084, -1353990, 1136418, 830343, 2507869], [25133760, -1244980, 357256, 1168206, 132198, -2173630], [-139918800, -1798117, 83297, -162243, 337437, -1039127], [-33401069, -840140, -853172, -290779, -597000, 4114787], [-69834704, 678774, 2066384, -1482566, -533284, -1650341], [71170357, 1522143, 956701, 1645666, -3013684, -1094823], [-18642624, -663428, 1445810, -468196, 1189502, -5046762], [-127270689, 1222804, -393671, 948708, -697256, 3359215], [153386567, 309993, -865331, -1076758, -753794, -3475587], [-129695941, -1393755, -678099, -858270, 439420, 1907223], [168350074, 342636, 973437, -1230185, -311293, 1646734], [-43237524, -1182034, 832456, -296144, -317020, 4831140], [-207208415, 688350, 119314, -1717029, 3870811, 152020], [-283026626, -1092168, 211346, 111318, 870122, -1515106], [-69105068, 1688703, 1194005, 278637, -954843, -4756739], [-86429608, 1098169, 2055007, -803189, -1098136, -533727], [-107134521, 562599, 638998, -357831, -780839, 4898277], [-135486496, -736879, -100984, 218264, 2179316, -1627602], [-101675360, -1675900, -319368, -69162, 2392478, -2281265], [-161653022, -354695, -137012, 609976, -1822955, -1818283], [68825071, 1242648, -108707, 854396, 551640, 126879], [106532196, 2306795, -1145455, 572187, -515787, -3846384], [-72717280, 1573314, 2913848, -1039618, 3303792, -1762427], [-90250544, -1359397, 955232, -687190, 788988, -2647774], [-67542401, -1699184, 894525, -915946, 3714345, 3003877], [-87532885, -565681, 91343, 2907970, -2702341, -1375908], [-342255800, -546758, 607694, 947062, -1247131, -1168779], [52081867, 898011, 354339, 2782262, -1821116, 870794], [193049496, -111580, -803294, 2828956, -385628, 5382108], [253016256, -943070, 469687, 1651317, -2407075, 1878764], [-3994032, -2262908, -549128, 891118, -808882, -2098018], [263507370, -2600061, 1135663, 808003, 1094985, 1967580], [-4472866, -302116, -3062864, -158122, -3430930, 5748937], [99577283, 746000, -2396896, -160925, -2355027, -5569530], [68818630, -1013370, -302980, 1780134, 2946514, 1402602], [18274878, 461588, -377990, 2638114, -67295, 4678577], [-339609257, -43337, -207055, 941060, 741905, -2317035], [33605539, -158571, 3527453, 690580, 1799468, -1058735], [222014259, -1592646, -2980466, 1600813, 828365, 1015470], [199443170, -1901872, 188658, 1453922, -5225250, 1408056], [-56648598, -2803818, 894098, 1349436, 536009, -773855], [96801899, -1949386, -2415600, 1685781, -1674938, -4911535], [-10745633, -1941099, -1313244, 3049639, 3604687, -49813], [-190302630, -1052164, -936679, 1895619, -3255602, -469448], [294760493, 1873699, 781703, -3149826, 889156, 2224006], [-72364521, -736951, -2080849, 1795732, -610808, 5681709], [57192744, 2509751, 2122072, 111408, 258766, 380664], [-225790521, 1431338, -2661534, 4338735, -5473396, -2830119], [-147354818, 720074, 1455820, -1206244, -1556086, 4130522], [56345356, 479158, 1118992, 1923332, 1567828, 4809542], [-100946537, 299160, -758625, 1977834, -247134, 2163693], [-260723407, 2547599, 104840, -761359, -1551945, -4853277], [-171275242, 1267193, -1022099, 1020781, -2067346, 5695502], [87776915, -1124014, -804037, -33954, 1137856, 6545162], [-296181, -833538, 2608366, -92319, -1755809, -4234554], [-57839571, -2546692, -2491989, 2456536, 991636, 1048996], [-78711746, -650970, -1534994, -554960, 3954628, -604832], [-13638648, -268296, -1587380, 324836, -2635933, -504947], [-263649384, -769868, -2902032, 211798, -778396, 2790274], [-99917917, -2995273, 122387, -435320, 3034380, -988159], [-132655793, 1558329, 724629, -194916, 372773, 7873621], [131909782, 1021638, 1797519, -2561725, -1913623, -31044], [-184671501, 1347631, -1388466, 3744213, -2088819, 234703]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_354_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_354_6_a_f();".
// 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_354_6_a_f(:prec:=6)
    chi := MakeCharacter_354_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 6));
    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_354_6_a_f();".
// 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_354_6_a_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_354_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<5,R![-4482583056, -153366726, 29222465, -212480, -10250, 46, 1]>],Snew);
    return Vf;
end function;