
// Make newform 819.6.a.f in Magma, downloaded from the LMFDB on 15 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_819_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_819_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_819_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 := [-1600, 1800, 2750, 75, -111, -3, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [2080, 1240, 178, -77, -6, 1], [-3840, 760, 338, -77, -6, 1], [-2720, -3720, 230, 141, -2, -1], [-320, -6880, -610, 303, 14, -3]];
    Rf_basisdens := [1, 1, 160, 160, 160, 160];
    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_819_a();"
function MakeCharacter_819_a()
    N := 819;
    order := 1;
    char_gens := [92, 703, 379];
    v := [1, 1, 1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

function MakeCharacter_819_a_Hecke(Kf)
    return MakeCharacter_819_a();
end function;


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


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 6;
    raw_aps := [[3, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [-2, 1, 1, 0, -1, -1], [-49, 0, 0, 0, 0, 0], [8, 26, 12, 8, 2, 11], [169, 0, 0, 0, 0, 0], [224, -42, -6, 2, 2, 41], [-16, -13, 75, -12, -27, 5], [810, -35, -97, -14, -49, -67], [1002, 325, 73, -10, 163, -95], [-2372, 47, 97, 62, 21, -82], [-2250, -366, -148, -68, -78, 357], [346, 476, 92, -532, -36, 126], [-1568, 211, 327, 54, 501, 145], [398, 31, -797, -68, -303, -30], [-322, 901, 443, 138, 439, 346], [-6610, 2564, -210, -430, 248, -244], [-14114, 2760, -6, -18, -780, -507], [-6820, 762, -838, -752, 102, -66], [-2584, 1892, -212, -200, 2196, -960], [-14446, -1495, -1055, -118, 1623, -1921], [-40768, 2299, 781, 50, -1479, 940], [11130, -4217, 4255, -4, -1439, 1408], [3162, -4633, -2471, 1382, 1909, 586], [-43650, 16193, -5505, 114, 1755, -2026], [31020, -4852, -2510, -370, -2432, -2978], [-82788, 6224, -5554, -2240, 1740, -2845], [76598, 2384, -3338, -3362, -2628, 2826], [-11462, 1524, 1122, 4812, -4344, -1257], [-13506, 7475, 4649, 3166, -727, -3850], [-106628, 10428, -3372, -3420, -1164, 198], [113956, -4548, -118, 5174, 2280, 7887], [19624, -9870, -7306, -5620, 1062, -5877], [-132712, -3270, 8130, 8148, 1014, 4428], [-49872, 5748, 15494, 4270, -8008, 2270], [-22056, 13144, -8858, -3406, 1308, -2357], [58838, -1862, 14256, 4938, 4938, 10597], [-8800, -6612, -9196, 244, 996, -5418], [-14806, -16135, -11937, 12116, 5819, -6235], [56180, -22394, -6892, 7866, -4586, -8864], [-49198, -61051, 3365, 7140, 4363, 14374], [-41138, 12744, -19272, -11208, 9912, 10068], [-229090, 47604, -23480, -7580, 7404, -6393], [-88486, 19304, 28700, -5648, -2784, 13130], [-100852, -37876, 5154, 6878, -16888, -5194], [-92988, -34680, -18430, 3928, 17148, -6999], [-241532, 40991, -33525, -9510, 15753, -19057], [1208, -50243, -2421, 32550, 1503, 15856], [-246426, 36144, -14234, 10190, 32212, -9218], [-75050, -26644, 10004, 10516, 25524, 25316], [-214446, -11163, 24119, 21454, 7151, -916], [-192300, -62488, 20332, -25228, -8984, 14152], [349350, -38679, -16401, -10494, -12573, -34002], [451824, -82286, 6632, -7562, 6434, 16175], [-157116, -50540, 51346, -1390, -16760, 45484], [120046, -152701, 19551, 9244, -22907, -26258], [-393808, 106766, 20112, -38926, -11482, 9728], [80036, -17960, 25800, -6324, -40440, 29602], [-917934, 79493, -9933, 11214, 13143, 9086], [-94060, -146752, -37658, -11042, 20484, -9372], [-378952, -35292, 66936, -16224, -18732, 13188], [48650, -8475, -6481, 2058, -29513, 15994], [-435224, -155859, -645, -18306, -60321, -8286], [504392, -1374, -26374, 600, -44018, -17618], [-159438, -97476, -85408, -1244, 46812, -53454], [-24892, -21002, -5352, 7670, 16646, -18910], [237776, -105598, 42070, -22456, -21258, -43594], [-486806, -161703, 48917, -46088, -50217, 17199], [-195442, 249436, 81502, 11338, -39000, -8976], [-815462, -213443, -31013, 34034, 73983, -38], [648646, 223624, -40920, 21796, -53408, -20096], [-71640, -58836, -66756, 26712, -5124, 29220], [776812, -414774, -9142, 7960, -3738, -37716], [215206, -364288, 57764, 42604, 9048, -13318], [-323668, -140462, 60022, 28424, 88518, 32392], [350702, 188256, 16216, 38134, 32040, -45633], [593694, 130352, -26556, 38136, 51336, -51900], [1211850, -171347, 195, 35130, 80031, 21046], [-1508248, 216514, 125160, 88334, 19730, 44096], [-376670, -687583, 90413, 35914, 807, 30725], [1109288, 73650, 67212, -56134, 107834, 6449], [-275698, 196386, -3474, 75600, 14694, 109416], [1487788, -373342, -118114, -33232, 13518, 15870], [-1802278, 71458, -14142, 29340, -43170, 43042], [206664, -68718, -71448, -23784, 186, -4461], [684334, -160399, -21351, 44320, -29537, -93680], [-2645552, 180242, -79522, -78508, 6, -27633], [306550, 569162, 88158, 24252, 2334, -1498], [1434862, 385876, -57850, 50330, 44160, -135729], [-244224, 297174, -97904, -145234, 59910, 90423], [-1151216, -194510, 44912, -11410, -37038, 39063], [656750, 212433, -60761, -57392, -143373, -147861], [831676, -412746, -130986, -116784, -46758, -239244], [-2158622, 9056, 69938, -32566, -78588, -17766], [958000, 541220, -100608, -98040, -68748, -73528], [2116932, 121154, -177338, 42368, -137546, -35462], [320214, -479447, -28347, 90756, 50559, 21045], [1840844, 51330, -10922, 52486, 33414, -441], [-321480, 776778, 73690, -1300, 34422, -234960], [2042642, 862926, -137432, 59768, 194598, -135069], [385064, 685729, 186079, 65942, -15381, -77762], [-768984, 47230, -382700, -183130, 167494, -222386], [5787412, -587072, 343222, -158922, 89348, 10223], [-5530142, 365493, -123501, -100334, -17657, -47270], [1401756, -922529, -113891, 187910, -32931, -246434], [-1481046, 557908, -206276, -120748, 30540, -83192], [660518, 825743, 214195, 198988, 139137, 283848], [-3012346, -848515, -14561, -26222, -39633, -127734], [1778382, 1001597, 154439, -73814, 26639, -192721], [-2413014, -89508, -184872, -24504, 208284, 167718], [-3184144, 57358, 339308, -50816, -241842, -236621], [5440390, -841538, -105356, -193852, -77634, 95419], [-2514424, 343532, -74344, 167460, -344372, 72985], [2371036, -235756, 38122, 366674, 31248, 437219], [363812, -296110, 269944, -386734, -140526, 88451], [-4998298, 599207, 111629, -49722, -129179, 5278], [2094544, 204360, 317654, 252610, -115044, -1395], [-2053260, -684110, 526034, -158276, 121790, -47800], [-5377250, 302520, -448542, -76424, 180892, -326303], [1275406, 861187, -187481, -81768, -216379, -323704], [322002, -992407, 155591, -16826, -19581, -143614], [3444338, 1474225, 134845, -217384, -286977, -67901], [-604744, -217324, 387354, 360566, 84920, 70376], [1805780, 380756, 268522, -67352, -72528, -43707], [4001076, -668023, 456563, -300806, 317979, 566], [8773554, -1273405, -417095, -172966, 406489, -61142], [297750, 267524, -352212, -237516, -362628, -595636], [4325468, -1701598, -32138, -72164, -153018, -384738], [-8053976, 27178, -42096, 129096, 435666, 101251], [-1711198, 1290317, -51417, 188754, 111927, 289184], [-3192420, -1753666, -262338, -166020, 138258, 199814], [502152, -1265992, -341628, 162504, 603816, -255030], [3488896, 1089759, -504291, 326382, 6285, -9258], [2725842, -1330627, 242467, 314282, -124065, 5822], [-10708522, -961527, -203313, -44662, -83365, 693608], [2247250, -1501365, -190253, 238022, -209307, 555369], [1704410, -2388328, 394998, -100330, -252124, 231335], [977848, -495885, 558611, -71828, -419931, 443925], [7777856, 366604, -252170, -377498, -15384, 147366], [-14847338, -218385, 666101, -62650, 163437, 658362], [-1269104, 979028, -467306, 354878, -427560, 248879], [-6109784, 541256, -166110, 357370, -572252, -131114], [-8324824, -1181600, 513544, 203348, 194256, 272536], [1920248, -847504, 413006, 544692, -274844, 171847], [-610518, 1191720, 78198, -218670, 401004, -1128555], [-7377834, 893552, -196394, -538762, -162668, -401708], [431258, 2273999, -369083, -326554, 131421, -508600], [9902940, 170436, -192118, -163046, 508232, -713848], [-8605680, 560874, 575466, 96864, -683562, -446400], [9353408, 865128, 1373332, 223768, -282552, 135810], [-2211342, 339014, -360714, -617988, -124806, 279752], [-17402332, -771132, -430488, 53570, 218756, -610939], [-16777296, 499460, 637770, 176520, -638472, 323807], [-227628, -150320, 1413468, 202548, 355752, 414024], [2778504, -1221257, 344617, -428398, -450579, -105350], [2206322, 1336015, -718967, -81206, -502227, 572283], [-5979312, 749816, -587484, 20856, -430080, -305986], [-30119074, -413515, -62805, -315802, 240959, -48808], [10463250, -1707338, -549310, 40144, -536238, -141212], [-1137186, 1956531, -110803, 158938, 862697, 235298], [-3706524, 2012230, -1202340, -321036, 354894, 136047], [-13350098, -2086153, 1372505, -186346, -325731, 366744], [-12507500, -2022098, -766864, 13750, -553218, -290603], [-13135908, 1785682, -898106, -822628, -147338, -946016], [-31537716, -1635504, -532840, 364408, 222416, 75677], [-2424798, 599285, -1538209, -344132, -588361, -102853], [5739388, -3537612, 854092, -642640, -525444, 390450], [-8192054, -1145702, 2096922, 434880, 91302, -114224], [16346910, 3702432, 701348, 13240, 61224, -820872], [-12704612, -650778, 1762224, -443930, -992738, 915094], [-16754004, 2759298, -180176, 6452, 211042, 461863], [12710070, 2808284, -440596, -438608, 140916, 319952], [-21664918, 4644059, -355205, -237320, -92331, -518382], [839206, 2023586, 1069346, 830476, -332514, -490552], [-12246112, -5561088, -90386, -294148, -602532, 1120593], [-27700140, 516282, 1029644, -934802, -1212262, -529792], [454044, 3762836, 123816, -239676, -1040460, -281698], [-43996604, -38996, 796146, 185674, 37768, 40630], [7406536, 3624810, 157134, 410484, 1490190, 334020], [-7748754, -2945108, 1486794, -514974, -1190664, 282487], [492712, 3568716, -999866, -904930, -286272, 61041], [-7491748, 3894586, 1383574, 98692, -85698, 772608], [-20530730, 3782632, -807480, 509100, -748056, 678220], [-1298914, -35895, -2383989, -1159762, -291373, -946894], [-617492, -2988946, 146574, 649036, 711754, 1239796], [-17436352, 4637484, -975922, -349194, 1028344, 526174], [-5614534, -1924281, 396389, 801334, 1325925, 553920], [-14087780, 2439059, 380455, 801272, 1184061, -73123], [-18285962, 1149528, -838748, 343568, 992832, -435420], [-14488634, -1093459, -1585833, -215168, 411919, -155591], [-10310010, 4147546, -783450, -565176, -126498, 468418], [20820608, 43694, 2632688, 1606368, 431374, 1865107], [-13560716, -118073, 313949, 2253166, 746517, 426370], [24700142, -566047, -788255, 1312192, 336399, -107637], [6416966, 2066479, 779315, 886716, 72553, 1468540], [-8049196, 1355050, -619286, 275806, 1399830, 1185669], [-10245006, 3225812, 202520, 980956, 1170084, 17198], [7029114, -221703, -1127489, -730342, -1203549, -256710], [-8550654, 4476423, -273015, 622950, 650133, 649866], [34288804, -1822386, -780378, 556048, -148286, -1889732], [-30302572, 1414678, 560792, 867462, -332570, 143170], [2853544, 238180, 444590, -26780, 262704, 1424179], [-20449486, -2735527, -611425, 1211602, -596637, 577922], [-13247722, -444374, 1351802, -1081340, -291834, 1465492], [37732582, -7266113, 86567, -1571212, -417303, -106554], [21897904, -208122, 1960032, 656122, -2390834, 481372], [-38880696, -4960309, -2169463, 500026, 114321, -604678], [26827154, -1154835, 536005, -2762780, 242883, 218442], [-13012728, -6758562, 1310766, 56064, 442002, 1635621], [4631648, -9178398, 1501010, -321428, -1524882, -1095420], [9400370, -4952281, -577229, 405128, 95961, 759521], [-27503676, 5294718, -124992, -25026, -760506, 1327782], [-16510072, 391912, -1626412, -489044, 2426400, -246002], [2809910, 4340400, 1663566, 128702, 407732, -1647754], [31705102, 4647427, 1535513, -2145196, 259617, -642843], [-1582078, 9006127, -646729, 660142, 1433697, -535727], [-41440476, -131581, -1373479, 679042, -838839, 434888], [2445600, 3859506, -1634786, 871178, 2667286, -359351], [16613500, -3462316, 608000, -306148, -2035092, -1317696], [-3331812, 934346, 1280924, -1806002, 1128770, -1101094], [-3339110, -6017031, -251117, 478634, -3001653, -1468692], [2099924, 1900184, 2153508, -3097200, -552624, 941204], [-17621224, 6867190, 477818, -286668, -569582, -145853], [-59312404, 3117074, -171078, 826728, 526734, -415792], [-20349964, 2050466, -1353624, 355958, -903070, 2050121], [-399366, -2096721, 2728409, -1816778, 1034421, 306726], [-3986660, 7561846, -2919450, -1651010, -1019942, -1184963], [-12607114, -10008377, 56227, -924500, -1361247, -896958], [-24121664, -4495998, -330584, 1356440, -2139942, 468087], [21192576, -1410522, 1946324, 2607280, 519134, 1526813], [10086494, 2568412, 747028, -363232, -2156172, 1928176], [-14099260, -2593588, 5654608, -482740, -2280420, 955310], [16158980, -5873508, 1015794, -899862, -2811000, -739743], [-49855474, -2446292, 404744, 484572, 1750204, 2233390], [20033396, 7515866, 361186, -293848, 1297782, -1732246], [15653446, 12153435, 1527969, -1029524, 272185, 2086237], [-9576810, 4960108, -2149878, -1029396, 1802496, -1392893], [7405280, -903398, 4088600, -3281886, 333898, 57418], [47002546, 2528091, -380949, -188060, 82789, -808784], [12279432, -6975598, 542926, 1197152, 881878, -31532], [-35962992, -12197172, -1641544, 151612, -393724, 329600], [-36261284, 8644962, -697410, 457140, 1286358, 200040], [-66951316, 4172436, -794094, -2807928, 1298520, -3977097], [18605074, -911920, 6483108, 552528, -199080, -83836], [-15463406, -5641357, 7781, -1150786, 792969, -3138186], [-14831216, 1827704, -1732536, -1824908, 1716808, 778360], [24249760, -2654619, -3452509, 1663558, 1548231, -1031652], [63615218, -4848951, 1320793, -509324, -1425489, 539466], [-36445992, -4907544, -4387392, -1102968, 2578392, -2651970], [13774226, -8203157, 3758941, -914486, -3260175, 1527819], [-23229254, -1349486, -3067544, -204280, -1170438, -2939459], [-16812338, -8614416, 4477700, 891260, 2324640, -157158], [-44274868, 1630374, -4309866, -692728, 1022546, -1388692], [31118678, 839880, -3737812, -1635392, -2888496, 284040], [16776316, -1167936, -70090, -1530442, -3859956, -186570], [55405336, -169156, -1880234, 2500332, 2328944, -1637431], [-36996606, 11690279, 430765, -338326, 1569477, -1154320], [46744680, -3798144, 860268, -552756, 1271640, 1036080], [36834000, -2813898, -1686240, 2945298, 284958, -768264], [29849946, 7660841, 1717745, 2609050, 3915207, 4105595], [25796456, -13939325, -200263, 1428022, -2089047, 1626730], [10134378, 9669479, -313437, -3930096, 657921, -1895838], [-45840654, 7691253, 5064219, 1100502, -1916937, 5650146], [45915622, -2128316, -1002194, 2396870, 446568, 202249], [24368098, 5304416, -3173296, 290708, 2611656, 2285010], [6783100, 6068950, -548402, 1683728, -2054742, -1089314], [-38610836, 2802864, -1445686, -2286946, 2515020, 4402956], [41891426, -6253485, 345317, 1466082, -3934679, 3592822], [45310092, -9015838, 2158254, 1079940, 2414502, 1623560], [-25457038, 5432580, -1088276, 3353908, 1927500, 174000], [-12468974, 688260, 5508512, 1837180, -939564, 3494232], [-27308568, 18272564, -7447924, -854216, 1667004, -3578746], [12694262, 12420288, -3988854, -1953996, 422532, -4002747], [-43424112, -12569363, 2137343, -21182, -401913, 4559086], [-9731650, -12642326, -4708738, 378700, 3788814, -1310378], [-14776836, -675280, 2779852, -2105452, 953832, 277004], [110814356, 2106644, 3020466, 1672424, 1134320, 2211401], [62411862, 4495674, 5785372, 1511732, -4365606, 1375053], [14736058, -8768822, -4548494, -1275496, -2919018, -5437658], [40712604, 921476, 7989372, -835080, -3359268, 2141688], [36613200, -961742, 2502270, 1838352, 5163510, 51804], [-5452488, 1755014, 7728964, -242758, -1556850, 5876321], [3441256, 17389612, -1795228, 1012532, 5041716, -2993172], [-81142, -8579347, 5233447, -2829574, 4408839, 2933288], [-55944828, -7515412, -3695966, 4793138, 1007928, -939049], [83651342, -5515475, 759909, 3364280, -1039357, 5164418], [31062058, 4728663, 3622103, -2433860, -1803135, -3469377], [58100208, -2162870, -222900, 1830774, 1131186, 2048340], [63024008, -1213176, -9356304, -1027500, 3424104, -795216], [69539184, 11408782, 4160262, -1859886, 1674402, -4662945], [-136671190, 1243749, -4661555, 599758, -1292517, -275433], [78461632, 205072, -1853378, 2333502, -986668, -2443243], [-11834412, -11664572, 5249944, 3470996, -4615484, -2423777], [52023194, 5563885, -9186323, 2909824, 462555, -3953790], [16711954, -9115615, 3331487, -3216734, -2917845, -1372870], [77954632, -7156966, -4302736, -7558234, -4877982, 431106], [7930492, 8628978, -1804478, -6505768, -900162, -2484180], [88184028, -14752974, -3360560, -5573830, 419002, 698380], [26703340, 9918476, -467826, -372134, 2820352, 1401769], [61636040, 5889887, -3714133, -359552, -4908927, 5917103], [-16136694, -4851152, -11572684, -1975688, 4547640, -5362658], [35618800, -6610198, 974272, 2449878, 803978, -1177642], [-130582860, -9443025, 825949, 1398386, 2243133, 1097136], [-107149674, 2421453, -15845535, -2217444, 3190203, -5734830], [92464604, -10491683, 2310829, 5482334, -5101725, 3094999], [68692550, -18879124, 4049980, 1901564, -3630300, 164294], [-44163618, 8375040, 7552522, 270590, -1995068, -798116], [-11560838, -4370538, -2219412, 3754002, 1702782, -4682049], [-2395836, -835654, 220278, -6784452, -1494714, -6028902], [-24982198, -16405521, -7378551, -6504762, -2684235, 644430], [17802428, -13977860, -2143536, 5915504, -2860564, 8673380], [-111853728, -16029268, 2154934, -2351818, -1119392, 133018], [-200982418, 7737060, -317904, -3441316, 2606612, -5032750], [76666516, -26201731, 3175553, 281086, -6608229, 2483837], [13103340, 11185056, 11053640, -3305672, -6459064, 7020218], [-49428834, 4018450, 13848942, -113064, -8687226, 3733018], [-78794866, 10591369, 7584077, -2512752, -6990089, -3008186], [-42258384, -16505582, -7716650, 2890952, 5923582, -2924792], [61581434, -22356969, 968343, 499566, -5128743, 6661389], [-42313994, -31072165, -4250735, 1549902, 1167377, 2477282], [92751996, -9611028, -904552, 6352960, 2977020, 31674], [-65216494, 13938334, -3966250, 923356, -1047726, -3378134], [-58584608, 2403024, -6504118, 2707934, 999012, 2386122], [48969256, -4548120, -31746, 399546, -682980, -7421445], [-79662600, 3597570, 6500542, -4314700, -4963178, -490769], [-82175410, 7075110, -1977578, 376244, 4209450, 6094044], [117121056, -2836668, -7035984, -4703112, -3517980, -360624], [180149204, 16062037, 4487205, -2121180, 4706019, -1810739], [45114750, -31590088, 6185764, 4981460, 2103736, 4448863], [-26574954, -4304548, 96158, 7677568, -1553176, 4957577], [94190370, 6086320, 10877450, -1619540, 1121700, -2656271], [-191472798, -617063, -2049751, 39742, -3397849, 1029203], [-29088892, 4807042, 7679802, 2453304, 1707246, -6020636], [126174478, 28927127, 2698963, -596520, 6635225, 5913752], [33987144, 14921346, -3541518, 156192, 5660670, 6950556], [16618182, -10121759, -10078511, -526276, 2193559, 1370980], [46464334, -34687166, -2986132, -2295164, 3157026, 1167493], [33636362, 4570788, 859236, 7516856, -1344892, 2092742], [3413154, -809396, 10612948, 1372172, -739932, -7525088], [44605676, -16636346, 9348792, -7338924, -1778466, 2449183], [91700978, 19745494, -9867594, 3366420, 7798602, 1335772], [-81989722, 12357844, -18456016, -2486568, 3423796, -7421594], [95832278, -3220604, 15498322, 1499902, -3450648, 2161125], [56104756, 8177592, 12841472, 746140, -4759416, 5499738], [-46592464, -11441518, -6564188, 2141650, -5442774, 4840692], [-186277022, -32401084, -2551466, -394290, 2056352, 5512718], [-69174334, 14990712, 2360482, -7596730, -6484572, -1808445], [2225308, -18346268, -5913360, -2804100, 94212, 6773938], [160221658, -1969975, 58733, -2692660, 4415751, -7869450], [65694224, -1062608, -305714, 1818838, 1233228, -11848188], [-65862392, 21349275, -2332827, 4014090, -5240727, -1205034], [93147086, -2085208, 5336296, -6924808, 1651320, -7023730], [-81863936, -19446410, -3202148, 1477302, -1701394, 4447298], [82051896, -23140750, 3877910, 1810420, -8762730, 7461800], [-125320658, -12972960, 7138632, 10641960, 4107984, -672576], [-91222812, 2925040, 11868956, 285490, 2954024, 2427689], [54919502, 31886923, -3824035, -4449732, -149183, -3171485], [125866702, 14500463, -14188941, 283564, -2793551, -8059628], [-41170254, -3043376, -20247428, 1028480, 5180392, -4514384], [34048452, -19425882, -7942858, 6428740, -1068766, -8465572], [87164742, -14525560, 11995514, -929720, -4872468, -3968197], [-54352140, -8381912, 64388, 12752122, -5288416, 824321], [62380862, 304265, -10962097, 9374046, 6084331, 1447021], [-19510712, -19676700, -4067024, 6349812, 11898620, -2409760], [-102127600, 14227262, -15919798, -4390424, 3811338, -9000670], [57726694, -19548705, 1192217, -7502486, -10901259, 7639110], [164646854, 11050237, 15492825, 339548, -7207669, 8388737], [-234003804, 2991558, 2401104, 8663454, -2882250, -1962471], [8216522, 16439763, -22953809, -994504, 148077, -10132803], [116665722, -53086216, 2288090, 511966, -27748, -416290], [61846068, -7495582, 5400406, 5013068, -677130, -6194896], [30127776, 28693520, -9753720, 457968, 10582056, -1039620], [-92091206, -32132451, 10825921, 21078, -11091109, -8755771], [-274563920, 24685584, -3645250, -5398028, 9215964, -5933739], [-85333190, 18514011, 9569017, 10997930, 8850465, 3711696], [42996358, -4318192, 5277154, -925794, -3288964, 6054080], [148752090, -24721172, 14580672, -674268, 4693572, 7978689], [-143702394, 8963228, 6750370, 5568140, 2294832, 6399167], [19036720, 9922006, -4131302, 2897370, -3164446, -4857943], [-28042714, -5006532, -13802752, -12800516, 4028460, 1042752], [150374986, -17291175, -7927957, -5051734, 8305779, -6555858], [23845020, 38584544, 11789136, 347304, 2227488, -3239931], [-16823604, -356316, 10578282, 1381506, 6341472, 10886961], [134878716, -67087950, 8684916, 1724466, -8503590, 8396820], [-213164472, -294643, 19246659, 6195198, -218529, 10993334], [226243114, -8598069, 5238589, 1963776, -896047, 11054285], [-75729548, -913224, -1307994, 201834, -8458980, 9314769], [-118026806, 1379586, 17185132, -3108970, -17753430, 5640129], [43123792, 36949312, 1730788, -1485712, 3240504, -9279908], [14228632, 34986396, -7262328, -8218652, 1475836, 2157358], [64809006, 622560, -14294548, 5100436, 394056, 17727336], [-25877346, 7356447, -6336911, -9956710, 6515917, 10129750], [471694316, -5178980, 7231236, 2758952, 1372364, 4080212], [75794360, -8738616, 8580636, 6607008, 2682672, 7508340], [159748120, 2294740, -5087172, -5789132, -4748780, -9491372], [-157645946, 52235853, -5196261, 4646502, -8344785, -3224274], [-182733104, -7565056, 4672292, -4637120, -960120, -9631018], [162915664, -34257696, -2910520, -2573218, 8245056, 1321785], [242259720, 6906769, 1770449, 5583922, 11237151, 4497505], [-10335528, 43593250, -5062428, 4541694, 11396778, 16032], [164852578, -2074273, -6903019, -212366, -4245987, 119948], [166335674, -5022047, -4678825, -7595142, -1451141, -7585598], [5861576, -3959890, -10026528, -3578442, -9627618, -11068297], [31717258, 50418119, -3576651, -11435126, -3421187, -787448], [299994474, 7777961, 8817579, 8457426, -7590477, -8642022], [-42695644, 53171164, -1471182, -495240, 8410560, -9614777], [-122639394, 50375490, -7328978, 701768, -15018906, -5343636], [17862064, -66804278, -2755986, -5867204, -7714370, 3736123], [166153536, -5232111, 876285, 16103328, 45375, 8569005], [87656342, 35657611, -23368213, -2251680, 2343373, -11037002], [-12177054, 8070114, 16863590, 5545204, 53862, -7048548], [-130256890, 3092059, 12574367, -11572626, 2974717, -7286075], [131756818, 24323123, 9130855, -309576, -1002139, 4091690], [-121742228, 5436660, 852978, -13065468, 9506376, -6414639], [-126603782, -14913005, -3249897, 9446616, 6081501, 2629033], [-217602076, 40903230, -1385272, -815646, -10220762, -257390], [289004748, 16653092, 13593532, -2709304, 8657092, -9919046], [169972872, -4963060, 10286802, -2501964, -21843984, 11569169], [-47463014, 39986236, 15015160, -11251344, -8095948, 717824], [181284696, 69416836, 556932, -7221912, -346548, -1414572], [150449050, -33565535, -15140911, -2708242, 14587551, 6328335], [-58346778, 15980284, 2544972, -5822892, 19050372, 3069208], [119364200, 30938988, -12968444, 10449484, -2336100, -3599352], [-143241104, -24101092, 7191200, 9806420, -6505380, 13543512], [-177856114, 11993072, 354402, 15199836, 5111028, 4050485], [183747418, 6810545, 15381899, 14494946, 4571499, 13180698], [-75580874, 36449857, 22474073, 6558812, -4749633, 487164], [-81384288, 4800926, -3923428, 7685182, 7196678, 10833200], [-77312988, -50081831, -12317575, 3158476, 801423, -8001479], [296380828, 20349942, -11566866, 2849716, -4566134, 617164]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_819_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_819_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_819_6_a_f(:prec:=6)
    chi := MakeCharacter_819_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_819_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_819_6_a_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_819_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<2,R![21584, -8580, -2164, 987, -21, -15, 1]>],Snew);
    return Vf;
end function;