
// Make newform 354.6.a.h 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_h();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_354_6_a_h();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [-7060184373200, -5340414471536, -184506058580, 1816612536, 98085975, -154000, -17196, 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, 1, 0, 0, 0, 0, 0, 0], [3757903959923072022194600, -1090983151757535031607492, -24015765812473884854868, 413818596650176083735, 7662854129567508840, -59395676919722840, -639912128181572, 3531716616097], [2466030296544154766061300, 447903627862793835852124, 14020655241938427706501, 40881078223701439170, -4450296145865676045, -45540275145935855, 339562400775494, 4331671669311], [-1246432753351265153998100, 3100320863871597998825912, 118882081408474805243778, -77726975016093988395, -37470742214234503830, -187936906375918270, 2929018216048652, 18941466661253], [961370624180832490921100, 279549793018908407947528, 15858474912144450807232, 212054457767145037920, -4165604419827313895, -87615891526001305, 249623166066313, 7432150279107], [-2881296845168889228464600, -290245484235187120648048, -4284446168296475413242, 201230858717170732080, 2575360308409497765, -55517818438958185, -294881418090673, 4967625572903], [-7825638820126873133659600, -3326776608798912127855508, 101381882227450008974508, 5443382783511001755660, -27799458267591747885, -1466687196552360215, 1842957629844727, 108056909469313]];
    Rf_basisdens := [1, 1, 25010089037240329207500, 8336696345746776402500, 25010089037240329207500, 8336696345746776402500, 5002017807448065841500, 25010089037240329207500];
    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, 0, 0], [9, 0, 0, 0, 0, 0, 0, 0], [5, 1, 0, 0, 0, 0, 0, 0], [23, 1, 0, -1, 0, 0, 0, 0], [-44, 1, 1, 0, -1, 0, 0, -1], [15, 0, 1, -2, 0, -2, 1, 0], [59, 5, -4, -5, -1, 0, -2, 0], [167, 11, 2, -7, -1, 6, 0, 1], [141, 21, 8, 11, 15, 0, 1, 0], [654, 30, 8, 11, -11, 0, 1, 0], [2296, -1, 1, -3, -21, -16, -5, 0], [3748, -59, 31, 43, 58, 14, -8, 0], [1030, 33, 9, 27, -8, 21, 13, 10], [3828, -101, -11, 32, 91, 20, 13, 0], [-704, -97, -21, -15, 16, -9, 0, 10], [-4271, -55, 96, 40, 110, 80, 0, 0], [-3481, 0, 0, 0, 0, 0, 0, 0], [457, -54, -161, -9, -105, 97, 4, -10], [6940, -191, 3, 142, 171, 52, -4, 0], [-6158, 55, 129, 62, 10, -105, 34, 70], [-4027, -113, 262, 95, 10, -60, 7, 0], [16799, 91, 92, 206, -9, -5, 78, -70], [-11242, -87, 315, 89, 146, -5, 71, 70], [-14192, -437, 179, 67, 246, 103, 33, -1], [68947, 253, -44, -66, -39, -237, -53, -70], [62992, -554, -56, -92, 0, 344, -135, -110], [52458, 125, -143, 330, 221, 81, 13, -10], [19703, -210, 143, 229, -135, -200, -111, 130], [59584, -707, 91, 137, -84, 156, 51, 110], [27696, 60, -288, -358, -553, -412, 82, 130], [98533, 341, -1024, -652, -699, -427, 169, 182], [78911, 5, 146, -1010, -348, 395, -168, -121], [51825, 304, 1365, -222, 257, -371, 116, -170], [74660, 548, 1072, 994, 525, -210, 277, 111], [-58033, -2824, -113, -441, -43, -18, 212, -160], [116584, 1869, -285, 375, -1125, -274, 31, -190], [92355, -850, 891, -778, -222, 258, -160, -190], [188006, 50, -270, 35, 552, 321, -11, -199], [-77789, -821, -536, -261, -137, -901, -454, 442], [-37237, -1922, 2559, 335, -376, -144, 338, 0], [-81951, -744, -1025, 1370, -1349, -47, -452, 22], [84378, 1400, -1700, -155, 674, 525, 650, 230], [-225187, 8, 431, 2148, -673, 221, -667, -38], [13672, 5284, 434, -1334, -724, 304, -11, 400], [-202892, -3699, 405, 518, -1075, 717, 225, -232], [121515, -1087, 996, 2563, 2234, -1318, -735, -418], [-65040, 1791, -1111, -1137, -2631, 205, 469, -680], [51210, 3946, 1016, -814, -130, 72, -639, 208], [-254765, -331, 1478, 2397, 4723, 1878, 896, -782], [55453, -2368, -819, 2537, -941, 3423, 231, -200], [34549, 169, -178, -654, -704, -167, 50, 989], [-346730, -2257, -279, -3664, 818, -1433, -423, -488], [39903, 5669, 1256, -2790, -2380, -2853, -217, 701], [-389356, 6062, -1324, -42, -1057, 2618, -238, 560], [-108880, -1562, -3136, 1490, 1276, -2916, -323, -782], [-79153, -757, 3260, -3, 5759, 4101, 873, 618], [-325286, -5282, 3404, 5364, -435, -2388, 1117, 258], [131741, -1353, -1946, -3412, -6757, -997, -448, -1050], [3318, 575, -2983, -3686, 2467, 536, 86, 350], [-469030, -4294, 154, -4868, 264, 1148, -73, 752], [68102, -9099, -419, 2193, 3131, -3325, 1881, 1110], [-373407, -2074, 165, 3469, 4926, -1715, 388, -328], [-281939, 2317, 4524, 3276, -1766, 4491, -180, 151], [-162365, 23733, -1308, -3103, 3874, 273, 1245, -988], [694960, 17734, -5718, 3507, 199, 3, 1314, -968], [-513807, 3085, 2412, 780, -2550, 1440, -1232, -2192], [46739, -6369, -3200, -4570, 2636, 4571, -346, 1831], [-743086, 5954, -1996, -7561, -3603, -793, -1450, -3400], [-257193, 10928, -9723, -7707, -12644, 950, -956, 939], [-172613, 5410, 3775, -5684, -3528, -3200, -2511, -2020], [-872391, -748, 1749, -3617, 3101, 2132, 611, -1950], [921392, -1991, -9729, -7470, 3491, 863, 668, 692], [725992, -2344, 3460, -12248, -1830, 6675, -3465, -1670], [765062, 4011, 3549, -1129, -4343, -4393, 1564, 2572], [1363591, 8563, -980, 4224, 2071, 5749, -1039, -920], [1009346, -12193, 6273, 5600, -10752, 2503, 940, 1208], [775084, 7191, -11893, 6696, -11961, -5359, 2441, 340], [-18495, 16380, -3641, -8582, -1286, 9678, -3852, -2670], [202904, -12341, -6303, -1413, -3989, 4127, 1133, 2049], [-1211112, 15252, 4762, 892, 3514, -4432, 3566, -1982], [-865602, -42004, 3882, 20726, 4860, -2804, -4531, -2638], [-1365107, 15860, 2119, 8124, -8438, -12728, 3753, 2012], [-1376056, 6081, 541, -10941, -14180, 3189, -3906, 218], [-3107, -8150, 29465, 18419, 17979, 9618, 37, 9], [-1391944, -21638, 6940, 23449, 6229, 5451, -387, -1252], [567933, 3507, -3538, -11371, -15461, -3500, 3368, -3022], [-1857639, -21054, 6767, -9512, 11325, 7227, 534, 1050], [-1327147, 32187, -12766, -25617, -6862, -5650, -2207, 5216], [-1456089, 8024, -5583, -2371, 3804, -11383, -1260, -4268], [401888, 2526, -28542, -9013, -25582, -8508, 1841, -366], [-358079, 20925, -6712, 754, -20304, 6689, -363, -3883], [2423191, 26137, -6128, -21481, -8826, 3407, -3428, 2682], [-592586, 616, 11684, 30451, 26135, -4981, -1225, -1592], [-826603, -7606, 10435, -15923, 21212, 7794, 5943, 3268], [1095369, -47817, 3078, -900, -10263, 1295, -11403, -728], [3140148, 14757, -16775, -9993, 4308, -5663, 1412, -2372], [1877435, -10306, 4475, 14443, -2808, 3288, 343, 98], [1740396, 47583, -13939, -39147, 3046, 4181, -7016, 3400], [-456909, -20101, 25928, 25000, 17703, 16665, -4221, 6360], [-894977, -56506, -31693, -29038, -10670, -3370, -2471, -2508], [-1605542, -13050, 29846, 7319, -4711, -9235, -6910, 4712], [-1019224, -6731, 27717, 42436, 20123, -10575, -5777, -668], [1198644, -85057, -5685, -566, -40363, -3682, -4939, -6861], [274117, -52554, -15711, 801, 16502, 15538, 2549, 14040], [-4400208, -1369, -1127, -24804, -13983, -5540, 10406, 4640], [-2354483, -63562, -2367, 34216, 22717, 30375, 1517, -1631], [-2471352, -24261, -22925, -11534, -8363, -11646, 13994, 2299], [-24056, -30963, 3003, -6143, -15116, -9921, -13990, -10140], [1570714, -104483, 16937, -8064, 15049, 22437, 1108, 1240], [-3851954, -70624, 2530, 37665, 11229, 11301, 11342, 1798], [3771965, -75855, 9076, 13820, -14967, -1851, 3834, -4022], [-3968758, -3769, -1379, -8868, -20403, 4257, -4464, 6808], [261661, -94257, -4084, 51729, -3477, -11742, 5046, -6626], [3618365, -7957, -22046, -858, 10083, -10863, 6909, 3240], [413619, -56865, 1296, 4370, 52461, 12235, 13462, 14826], [-2121083, -24300, -47551, -24798, -277, -9163, -4009, -442], [-354078, 27660, 11680, 42637, -13649, 4407, 3168, 920], [4982828, 76375, 4821, 21092, -14663, -287, 3225, 2164], [2007102, -79338, -28156, 9001, -26089, 12504, -10599, -4692], [493627, 23795, 5716, -9441, -46323, -3572, -7285, -1548], [-1093488, 19014, 49744, 68753, 53040, 17435, -6186, -748], [-5127618, -1104, 16540, -21132, -21498, -10910, -7032, -1730], [847050, -22545, -5107, 11226, -24459, 3401, -7223, -7848], [488740, 195863, 15715, 30798, 10615, 7798, 5108, -11411], [-1879848, 150884, -5668, -1716, 55938, 5054, 2509, -11950], [1578907, -50160, -12819, -2955, 31778, 53330, -7752, -3132], [-2085848, -74794, 19140, -22998, -60872, 2812, 11732, -10910], [6826129, -26953, -33390, 84669, -34173, -3226, -1291, 5022], [2516364, -11334, -29022, -58970, -69230, -32384, -6711, 12364], [-4305292, 92199, -88193, -88034, -60031, -20582, -19206, 8544], [5282384, 116337, 40571, 8599, 14487, 5295, 6249, -21630], [-1379405, -31369, -18426, 3809, 45570, 21737, 7738, -28], [3851208, -21063, -24229, -51990, 20307, -4977, -8253, 5212], [-415422, 27995, -107471, -61579, -81237, -43127, 5794, 7762], [-3031703, 21122, 35411, 61012, 5491, -40385, 23107, -4222], [-4348744, -27828, 58104, 58927, 79527, 20383, 15434, -18564], [-11447690, -212470, 13306, 45982, -8538, 17908, 18222, -11052], [-852251, -3577, -85710, 20478, -59240, -14039, -7504, -661], [4247170, -81528, 51352, -33188, 49226, 46284, -20331, 5662], [-2505142, 4771, -50081, 46513, 24183, -7221, -10015, 6027], [2640582, -151680, 7174, -51916, -21076, 13684, -23401, 7320], [-5064877, -46306, 60743, 92323, -32850, -16566, -6302, -2730], [-12160794, -9234, 2100, 65762, -56334, -16851, -24495, -10804], [8812470, -127302, -2490, -67822, -37507, -35224, -10214, -11004], [1442540, 39440, 67926, -25485, -46942, -6443, -3414, -8206], [15062803, -52182, 21611, 66850, -1251, 42893, 6321, -2042], [-5242064, -344185, -21501, 94193, -8177, -12695, -7610, -20454], [1381445, 40459, -45898, -140270, -22665, 4509, 2166, 10929], [12584062, 62660, -94594, -43364, -37752, 40784, -6354, 5586], [8698593, -110485, -65306, -97883, -8513, -8634, 9277, -13406], [-1693390, -70314, -65478, 41068, -67774, -31614, 13438, -19278], [-983569, -171711, -56472, -17102, -16348, -40337, 14878, -271], [14476048, 165592, -30828, 77940, -15236, -23940, 1764, 4768], [18375709, -55862, 26949, -63072, -68145, 6839, -3221, -9268], [14188000, 157610, 66374, -1168, -31457, -34484, 3225, 719], [2603093, -302785, -17486, 71221, 110525, 62591, 23993, 4374], [9035240, 190323, -74195, -69822, -54607, -10747, -10905, -17786], [5028815, 246201, -64402, -122436, -19131, -18963, 7756, -10817], [6158531, -163257, 81466, 75530, 54967, 18317, 38303, 10906], [-7127908, 166788, -68316, -10278, -143575, -32706, -44092, -18510], [-4197099, 172630, -13189, -35417, -85592, -16792, 53571, 18770], [7205798, -108422, 1362, 98154, -79142, -68620, -3235, 9464], [5668510, 173378, -55452, -115683, -312, 30024, 17425, 20380], [16672967, -230816, 50133, 194893, 29893, -4152, 22147, -2544], [4444830, 37194, 26372, -104990, -32503, 15542, 6464, 6880], [-3057779, -361966, 42709, 93742, -32119, 37863, -24985, 27810], [-846908, 78398, 49322, -27339, -147572, 95096, -12949, -21022], [-1749694, -143878, -33562, 68881, 48546, 26875, -22998, -4362], [-7162558, -76810, 75862, -27492, 56416, 15294, -38148, -1396], [-80540, 162910, 103368, 74978, 107272, -7970, 47765, -9248], [4324274, 16026, -25082, -2772, -120839, -101548, -15244, -6726], [-2569160, 35871, 64735, 494, -75285, -3551, 38700, 36724], [3468471, -108469, 28174, 146973, 32762, 31255, 6673, -21688], [-5403835, 405193, -46494, -30864, -32901, -9951, 5173, 22216], [16545536, -213110, 41122, 102570, -52610, -115210, 5887, 16690], [26526837, 9780, -110779, -18646, -27351, -7745, -2566, 14686], [-3942394, 239340, -189242, -106394, -65623, 56092, -41481, 1809], [4806392, 249488, -94642, -11872, 38574, -4186, 20455, 49410], [10083140, -336578, -62980, -133753, 39041, -13087, 13096, 4600], [7355212, 211476, -36742, -63796, -10668, -66786, 53466, 3672], [11408886, 467114, 211032, 104904, 152196, 28588, -3608, 5856], [-7518856, -116524, -182988, -135608, -142066, 11198, 30340, -5568], [24826197, -285922, 18249, -35104, -50258, 91972, -60435, 16328], [-1403658, 66192, -13516, -61098, -139044, 53234, 14800, 37672], [-14997028, -241537, -12337, -33350, 22842, 76085, -15612, -3704], [-11331677, 30874, 66561, 156921, 143297, 26564, 6127, -40122], [-1506360, -497115, 18097, 39290, 149135, 97091, -24873, -21098], [-21901362, -92528, -34434, 175388, -44620, -84344, -46525, -7504], [-3112319, -37941, -25180, -47134, 132853, -8607, 9357, -17096], [-784267, -621237, -116970, 100381, 125091, 117508, -6269, 33440], [-11328187, -164089, 45904, -63542, -106305, -16277, 51287, 48744], [-34944334, 134041, 27407, 20584, 98825, -6878, 14266, 15993], [-5950852, 275154, 193750, 78150, 16602, -139058, -22441, 11354], [2079034, -220724, -22334, -79595, 10745, -94004, -11317, -50328], [-6332802, 362502, 61272, -113504, 15762, -105708, 7456, 14502], [-7065388, 355163, -98135, 220415, -93969, -97037, -29023, -7693], [22726832, 354599, -109429, -181105, -89067, -148323, -2586, 39622], [-12034271, 732420, -17815, -75451, -34195, 41053, -25403, -41020], [788730, -202999, 202111, 38873, 218974, -95377, 26953, 10989], [-2103817, -535293, -197932, -9367, 54839, 33360, 16227, 68690], [-10455924, 301509, 85705, 216280, -52605, 25751, 29563, -40116], [15677307, 30299, -170420, -223648, -80467, 53643, -27705, -45422], [754358, 31965, 93931, 61993, -26637, 20381, -25730, 32032], [-22938166, 507786, 109664, -144273, 29333, -90577, 19180, 83402], [9167556, -72258, -50514, -208166, -255636, 62072, -94098, 8268], [-8323557, 510640, 31297, -143133, 96320, -67108, -36176, -86512], [22835254, 526910, 29320, 75962, -29026, 101691, -78539, 24162], [-47898884, 35204, -76444, -151189, -48031, 125055, 19132, -34859], [-20478688, -354743, -230553, 105377, -11895, 141801, -38425, -5501], [-1037370, -172664, -105190, -29372, -56894, -185034, 28361, 27088], [-3765094, 417734, -243756, -15947, -121567, 33971, -60652, 14918], [-9237659, 160481, -183676, -124310, 24750, -183498, -5184, 82708], [-19292022, 578148, -102516, -252617, -191845, 81903, -21937, 36032], [-32748806, -277496, -298346, -7968, 21680, 4264, -7472, 36712], [153782, 208083, 254225, 194092, -24938, -67359, 109496, 5062], [-1822128, 115414, 207246, 181723, 97211, 28855, -43748, 64602], [24707155, 303371, 124628, 151982, -121783, -86515, 49510, 67050], [-52743030, 194579, -179457, 145349, 94028, -4225, -51621, 30974], [-36181555, 22533, -58808, -526563, -183885, -73956, -87045, 3716], [-34104197, 58409, -217594, -113312, -185092, 71786, -74794, -53040], [2413221, -308946, 211897, 94524, 60414, -195248, 95505, 20608], [24426884, 557648, -92212, -260448, 77114, 137321, 30189, 30028], [-706112, -155962, 151632, 50888, 293286, 38634, -56260, 71134], [185545, 550745, 160882, 63451, -93168, 11592, -35739, -24256], [1496734, -4120, 24074, 261124, 228610, -49402, -61855, -31882], [28871709, 95550, -7641, -146571, -164019, -98879, -40489, 65328], [-46003227, 210869, 32058, 67871, -180423, -45268, 18615, -19920], [8522134, -29848, -28342, 120826, -94962, -14004, 74454, -64324], [27035224, -644031, 5139, 175940, 172995, 247171, -4651, -92340], [-18539041, 914088, 40265, -110833, 62539, 8854, -5231, -11484], [40800509, -340926, 253647, 27867, 184399, 279649, 67489, 1728], [18588252, -1167839, -102133, 257144, -199737, 34362, -9687, -35272], [945354, -435910, -66092, 79111, -230118, -146424, 107687, 76980], [-16219158, -428846, 171680, 556902, 46699, -127922, 6514, -34266], [-11797060, 163148, 147648, 81456, -342502, -153228, -110134, 23270], [8544896, 748523, -496025, -153936, -261452, -78669, 132623, 32602], [55112583, -31675, 16012, 170440, 128603, -97531, -48515, 64974], [10499911, 626200, -397187, -292825, -360378, -197436, 38075, 12582], [-22366957, 987868, -176659, -61786, 30705, -45349, 71967, 47224], [52810227, 234281, 219318, 13253, -373947, 12823, 45053, -16496], [-5454488, -5484, -289914, -98450, -134909, -378304, -76016, -51940], [28416256, 103538, -18230, 335570, 51644, 151464, 42415, -54144], [30063747, 13861, 528350, -132594, 298785, -193463, 89792, -12350], [-3833588, -930698, 111716, 416914, -117528, -23150, 59176, -5808], [24603077, 662623, -144708, -50913, 43773, -67880, -78932, -59472], [-1634629, 425901, 417762, 490473, 217845, -191, 51069, 33708], [17855498, 372606, 403520, 538600, 381578, 64747, -77963, 94944], [33026407, -448056, -79147, -109772, -59549, 186869, -618, 49562], [6612139, -356189, 188422, -31947, 200458, -154222, 25947, 76360], [36771904, -127469, -117085, -75580, -454980, -134607, -107370, -173096], [36793416, 843289, 293497, 108347, -176501, 73573, -69216, 10588], [115337, -411904, -277459, -582077, -501831, 17816, 59919, -29452], [14153466, 1182783, 251601, -170395, 536240, -24235, 58648, 5456], [11208213, 341928, 119131, -108326, -221745, -387971, 41011, 144159], [-39762351, 367169, 35748, 235642, 279740, 147866, 162338, -12960], [-70685694, -206112, -258260, 25866, -194335, -50354, 48236, -22754], [34431408, -583803, 361717, 274524, 382635, 311338, -61056, 3288], [7432200, 375414, -137066, -194734, 220, 17582, 1716, 36936], [64469558, -477674, 398752, 95138, 257443, -42656, -20420, 24664], [-52147, -659798, 251017, 326041, 127507, 424072, 25945, -51771], [66204364, -205778, 23514, -37810, -479174, -124125, -10537, -119156], [-949114, -280630, 631522, -308420, -54587, -141530, 65782, -33550], [-14998094, 632960, -167764, 205534, 157886, -104336, 174074, 118062], [-43600302, 83294, 149066, -191734, -79954, 8512, -116080, -136966], [-94864159, 425572, -74411, 68458, -189387, 72589, 103905, -87388], [-21256220, -782890, 62702, 578438, -122128, 217488, -4531, -36738], [41546635, -826384, 425521, 152329, 347758, -154661, 103914, -70728], [14319190, -64340, -271384, -187850, 55598, -55234, -53582, -2116], [72609837, 112665, -41592, 401224, -111665, 110199, -11497, 77580], [21615923, -14765, 122828, 704718, 343270, 161224, 73032, 136940], [12412892, -646637, -443961, -209656, -90655, 99551, 32801, -179014], [10024884, -678550, -105724, -57957, -483146, 112327, -74205, -71191], [-83915908, 1305408, 57180, -483829, 217553, -150663, 39482, -73616], [62301715, -320301, 819492, 499678, 609143, -96819, 22542, 87608], [33378010, -76679, 173139, -131790, -429545, -231166, -216571, -241170], [20582204, -475644, -309612, -603069, -225614, -70630, -82015, 72350], [-20951631, -182204, 78021, -243031, 106768, -113552, -164249, 139522], [39461154, 849875, -296235, -347522, 413621, -143290, 38460, 250766], [-42670043, 444685, 265414, 1111566, 107875, -212061, -6095, 2060], [-9941906, -483470, -257450, 422504, 129395, 191112, 47408, 163130], [26942792, -93515, 273065, 423614, 55468, -308249, -203872, -8362], [37642862, 554141, -134311, -410954, -120009, -198511, -81995, 148410], [2823200, 658598, 104938, -715374, 263692, -28322, 47394, 27190], [-5547978, -69921, 1133, -333718, -610509, 272539, 85482, 131176], [8991460, 769249, 143087, 408670, -216935, -236758, 32678, -121092], [-20140368, -206941, -776305, -591847, -725684, -223427, -129194, 125738], [-23563031, 1896639, -152480, -260072, -139693, -154885, 187773, -129894], [11484429, -366132, -23377, 49689, -152110, 352685, 163186, -29092], [-61012154, 799798, -337972, -626546, 35644, -22847, -98687, 58466], [-9678994, -1055568, 85276, -112464, -580356, -30372, 109416, -88060], [34147458, -940174, -96348, 95270, 173033, -305810, -8419, 94576], [-4927160, 1118576, 546480, 121586, -538608, -182796, 40346, -110538], [-60707359, -445901, -383500, -313993, 294925, 381180, 36067, 229912], [100239185, -642522, -673183, -463826, -41263, 171737, 91600, 44894], [-127811144, -91025, 204435, 254598, 322435, -261498, -3678, 146958], [-4866212, 497362, -437582, -731666, 161367, -406626, -21545, -62048], [-39804327, 695541, -433666, -501097, -235368, -272750, 185418, -67448], [-82256839, 659811, 605494, -659238, 263548, 139828, -145028, -120376], [45730307, 59256, 777513, 729845, 640532, 582870, 6745, -48773], [-103116220, -19111, 301687, 451870, -133261, 159772, 49562, -50066], [27584996, 902242, -503244, -126949, -200510, -544939, -88888, -193630], [24110876, -749188, 119892, 507754, 700357, -616124, -58275, -1378], [60211350, -1890192, 116434, 265706, 368668, 770347, 32123, -179936], [6770824, -426702, -318734, -362606, -129404, -558586, 131033, 199846], [-42171411, -1554403, -127796, 1197008, 160138, -250485, -30006, -91017], [31198965, -907455, 634002, 137366, 485595, -70983, 305259, 161960], [1210850, -1440500, -541424, -292532, 116581, 166064, 103294, -97342], [110703345, -29988, -963715, -582767, -151997, 243595, 116633, 45892], [19104020, -557573, -219269, 1244375, 18274, -244721, 136198, 47504], [-102574880, -1769937, -411209, 272270, -192967, 370709, 131977, -52658], [36410840, -661767, -883483, -494010, -333486, -39561, 53488, 173692], [84385435, -310332, 18497, -463885, 280864, 122929, 241830, 138188], [55610555, -966080, 728627, -398276, -447405, 93841, 33700, -210690], [33873464, -470334, 165126, -353511, 1116, -37709, 2935, 7478], [-47780621, -832925, 251266, 1160765, -198050, 176961, -95473, -104916], [-10746775, 2521389, 387050, -289974, 53435, -411709, 106381, 274504], [11173314, -1541217, 372205, 385207, 942428, 380053, -28482, -72652], [97945916, -244855, 186845, 597336, -471154, 209417, 150410, 109442], [46822747, -1262489, -1076950, -357098, -978894, 116435, -155950, -30855], [45527341, -448100, -281963, 114886, -1017181, -134193, -22280, -204092], [-68371352, -1153248, 343448, 1687708, 106446, -208704, 243110, 59748], [-57837764, 1703922, -320672, -747574, 68582, -160590, 154340, -330560], [71299654, -545100, 107830, 710801, 11789, -182854, 173595, -219668], [37906716, -1923148, -258356, -946108, -388116, 154582, -29192, 126250], [-93894419, 1074064, -290431, -1023270, -686353, 158381, -219375, -119456], [46181242, 428960, 346728, 976092, 549238, -11878, -8082, -217398], [-33388448, 1093645, -505773, -1345648, -300773, 450624, -280945, 43348], [-141628640, -1739730, 768454, -443206, 550874, 168770, 52234, 130880], [-33121564, -631402, 840554, 670424, 553298, 416178, 152444, -70478], [2948339, 2252542, -1332497, -595999, -178252, 242392, -123401, 29208], [-60442728, 1659393, -228281, 357385, -347254, 233612, -57760, -99188], [-12072074, -136968, 259856, 121726, -26946, 239842, 334436, -110288], [-63761856, -1442785, 55421, -197692, 362173, 15645, -18605, -224104], [-212404440, -71732, -171470, -284372, -1227, -85380, 81906, 209772], [109359986, -1151558, 613070, 727275, 192599, -842203, -114712, 151772], [64959977, 3906582, 402935, -843085, -360264, -334532, -154337, 60738], [-100283140, 68122, -90260, -158839, 406548, -636775, 66948, 4542], [38582629, 391269, 367862, -132880, 1413520, -224933, 187176, -11433], [61481463, -458591, -57734, -1147309, 752516, 632938, -15945, -31262], [-135806431, -1195101, -1132994, -292254, -789679, -72677, 186911, 4324], [114880142, -572390, 3030, 1721910, 320872, -160230, 10660, -25522], [-28199761, 2424237, 404030, 788134, -1275709, -332489, 66906, -66469], [16663946, 229718, 303754, 308012, -454896, -329434, -279285, 219286], [-89329644, 430563, 724077, 969184, -256307, -639003, 137381, -241444], [99151098, 1230802, -1112334, -827924, 80752, -121574, 225681, -103540], [19110215, 2323696, 2589, -823252, 340279, 5793, -161134, 417794], [32774743, -379174, -108529, 1378504, 1104630, 532962, -131063, -107500], [-83672506, -752504, -449558, -548680, 144528, 398922, -394460, -339872], [-47061825, 1637448, -353531, 851572, 579779, 109091, 40825, -110860], [-49031880, -1222644, 599560, 210958, 1098895, 464594, 164002, 261972], [104138766, -1702341, 319755, -402607, -209011, -58517, 8860, -23744], [-59386552, -134936, 155450, 1222713, -444784, -14953, 169913, -90774], [157672562, -730532, 257690, -714871, -628491, 94572, -526121, -207568], [4435530, 62107, 599563, 1103449, 367673, -937592, -14905, 348220], [18237394, -1981396, 1017568, 495859, -89734, 569517, 186966, 60250], [30238080, -189692, 1586738, -502288, -159846, -288362, 80232, -128816], [-93029808, -1328500, 102408, 326656, 65800, -667274, 236422, 12914], [100918619, 2112036, -736721, -1347793, 37690, -114338, -212901, 190748], [134329649, -2129541, 420980, 735703, 482639, 260998, -141357, -308318], [49658100, 1843481, 210205, 717640, 665236, -389071, -225024, -267992], [-136327147, -675708, -910421, -1432106, -331236, -54266, -299211, -312820], [-13375125, -3027321, 699894, 1556987, 1235601, 930978, 285878, -366202], [66752648, 549827, -301771, 492402, 19807, -340105, -180892, -230286], [-57812177, 284214, 1155791, 627696, 1117873, -360875, 553822, 42394], [29405550, -138782, -1201766, 844653, -44358, 249727, 272221, 97827], [35740617, 86225, -275516, -316535, -387306, -243194, 151701, -345964], [-75597654, -179010, 1017870, 1474830, -111756, 41494, 82357, 29732], [101345046, 1041152, 295694, -737224, 184268, 133420, -7387, 321280], [180682716, 3307708, -279678, -157444, 54062, 351724, 257600, -255924], [68888763, -80570, 266977, 466233, -430460, -622460, 512205, -429874], [-13841850, -495877, 36759, -592218, -1148411, -450268, -152929, 267366], [-36792527, -1693582, -154395, -1318426, 44955, -845443, -328121, 80810], [-63533761, -2300270, 489423, 1133009, 96286, 534671, 138634, 220352], [85890210, -832479, 169073, -509806, 1143933, 715137, 250415, 69912], [34351212, 2498854, -675020, -1258101, -174264, 156395, 223610, 446964], [-226090150, -3823628, -103666, 468291, -325395, -56047, -14345, 42263], [87752515, -586865, 1184168, 537011, 561915, 818944, -288695, 145352], [-83791137, 218649, -476626, 846767, -1108728, 415058, -559697, 70836], [-45848353, -775609, -534862, 320412, -128804, 1049, -94894, -235353], [43876565, 803710, -631723, 817440, -326175, -394813, -142960, 209159], [21527898, 1017825, -117653, 581438, 854579, -768981, -32655, 20260], [-84437904, 2840491, -581029, 1288357, 192966, -595419, -304127, 66247], [131709942, 744380, 1737980, -252719, 1820331, 172611, -64791, 22374], [63895921, -4649013, 118378, 870352, -761377, -669513, 4860, 91389], [211875149, 334371, -341090, 1322978, 1570581, 35561, -508093, -358292], [-92832091, -2200862, 212853, 1211690, 1144389, 1116091, 261855, -325714], [109185249, -1284893, -608290, 1103816, -233177, -437911, 301172, -59374], [-40173760, 1346104, -382186, -516413, -413534, -730831, 133620, -643628], [-24835059, 2145337, -1451634, -658527, -1374523, -329036, 124152, 270603], [42036193, 1656444, -361705, 553722, -1084051, -203191, 209261, 160864], [67143213, -1472045, -283940, -218728, 28221, -267967, 280645, -103942], [-234869725, -463632, -38257, -559843, 1046039, -826658, -18776, -175220], [-98998560, -845726, -629926, 986383, 1830049, 810779, -397614, -82857], [5259070, -5283804, 1020062, -612972, 896962, 16636, -278635, 104544], [98785052, -813977, 259855, -599121, 788936, -18141, -51146, 125958], [57245128, -3781590, 1120632, 377954, -518536, 689134, -3424, 27844], [-300167397, -2520751, 1575780, 991125, 371212, 417496, 203731, -393460], [205200264, 87048, -929670, -1032800, 1298030, 153752, 124992, 150740], [-49306869, 263577, 89400, 1390103, -74645, -589368, -25698, 115359], [62722345, 1555905, 997396, -2197308, -826456, 454846, -535986, -73196], [-6697982, -2611501, 381429, -1239470, 189939, -453180, 186218, -205812], [-57238555, 281497, 182658, -2657648, -1306576, 238439, -237888, -372521], [188985420, -1332742, -670538, -2334284, -582912, -353344, -197501, 31596], [166375292, -3281713, -631543, 978807, -1439006, -136209, 56289, 442074], [63308915, 878062, -471693, -1970547, -1969676, -1028629, -53152, -173980], [-66872408, 556960, -2365212, -2829478, -2614442, -676225, -87989, 319154], [-154929890, -1252119, 312923, -81042, 890135, 149989, -223135, 272782], [2545630, -2263400, -154724, 1995096, 150420, -378830, -271457, 352096], [-169625000, 1637307, 188881, 47614, 207445, 69284, -303243, -580386], [-76235746, 1438188, 2044848, 731112, 1415109, -342248, 493662, -38468], [-137250227, -847064, 1073627, 2751931, 1295671, 691638, 278073, 471275], [-216972988, -592682, 1289574, 1126303, 2069665, 1601384, -317355, 16372], [55352409, 5527317, 1150776, 749033, 806035, 193236, 355061, 139348], [62640220, -4238520, -314968, 868498, -584971, 563662, 64515, 214505], [-5608737, -1451664, 1812385, 213094, -520409, -444085, 291545, 66973], [1116740, 4971141, 793073, -1626420, 851023, -763909, 314853, 235812], [-114684454, 3530556, -732406, -372244, -890744, 160698, -203580, 121514], [-16573238, 4405191, -822469, 766489, 475445, 346880, 504877, -91526], [122263096, 284352, -2628720, -994966, -1441667, -621968, 481258, 112650], [-182468999, -1644859, -2014336, -1382677, -1952253, 174255, -77825, 118650], [-139812923, -1864668, -1187911, -138747, -370239, 510890, -106645, -202180], [-408231604, -523365, 1149059, 1241712, 1179171, 238626, 268256, 116042], [4771253, -4458073, -188076, -1975649, 399404, -225169, -32162, 331312], [-15152226, 769026, -77380, -2526150, 25506, 738466, -308046, -379774], [-136950284, 1429200, -1161366, 449238, -780880, -850112, -346479, 109400], [-7562770, -3964287, 470079, -1329804, -769969, 347721, 68147, -214048], [-148075093, -2232917, -775740, 1678501, 229041, 937474, 472919, 69864], [-65166288, 2441685, -103113, -157549, -1544410, 1050025, -371811, -151384], [-98627743, -1255819, 1107118, 1038725, 791686, 1459452, 96485, -665600], [499265182, 2016523, -329215, -1391610, -442872, -121777, 198999, -50300]];
    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_h();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_354_6_a_h(:prec:=8)
    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_h();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_354_6_a_h( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_354_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<5,R![14863676640480, -3408310383036, -197010625370, -140791964, 95531225, 354880, -16496, -40, 1]>],Snew);
    return Vf;
end function;