
// Make newform 1080.6.a.p in Magma, downloaded from the LMFDB on 03 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1080_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_1080_6_a_p();".
// 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_1080_6_a_p();".
// 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 := [91480, 60219, -4517, -762, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [-12345, 50452, -5423, -250, 13], [29267, -116400, 16269, 750, -39], [1067248, -131647, -25070, -114, 37], [-2502968, -682093, 79238, 3250, -169]];
    Rf_basisdens := [1, 971, 971, 1942, 1942];
    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_1080_a();"
function MakeCharacter_1080_a()
    N := 1080;
    order := 1;
    char_gens := [271, 541, 1001, 217];
    v := [1, 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_1080_a_Hecke(Kf)
    return MakeCharacter_1080_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 := [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [25, 0, 0, 0, 0], [1, 1, 0, 0, 0], [39, 0, 0, 1, 0], [154, 0, 1, -1, 0], [-93, 0, 2, 2, -1], [295, 2, -1, 0, -2], [796, -12, 1, 3, 1], [216, 8, -1, 4, -2], [-517, 20, 12, -7, 2], [61, 41, -12, 5, 5], [2082, 25, -19, 6, 6], [-1126, 63, 2, -10, -4], [2940, -41, 24, -19, 5], [3924, 29, -33, 22, -12], [13490, -125, -5, -36, 2], [-707, 4, -7, 29, -25], [7923, 96, -51, -21, 7], [-500, -46, 38, 17, 31], [-11237, 267, -68, 39, -25], [22316, -289, -38, -54, -1], [7628, -54, -76, -25, -95], [4534, 86, 88, 13, -25], [8865, -642, 127, 20, 50], [-17948, 533, 32, -84, 44], [44337, -340, 105, -243, 37], [-8784, -705, -61, 227, 1], [11448, -53, 1, -233, 97], [4687, 239, -41, 142, 5], [81678, 130, -186, 304, -22], [26045, -291, -169, 318, -35], [-5934, -595, -533, 65, -23], [75445, 133, -240, -93, -79], [22746, 74, 655, -169, -111], [104286, -954, 105, 327, 58], [39485, 1593, -441, 338, 63], [142889, 976, 466, 192, -108], [-9668, -1258, 350, 139, -129], [-72202, -1949, 101, 143, -127], [-95140, -35, -225, -774, -344], [283891, 1448, -319, -1031, 91], [87208, 4675, -273, 162, -42], [96043, 317, -154, 745, 107], [-185026, -2726, 464, -1121, 125], [172690, 3168, 349, -781, -88], [222763, 1090, -843, 262, 598], [596754, 1556, -554, -1486, 120], [316520, -2636, 1308, 71, -355], [490858, -2605, 675, 45, 293], [-328728, -3081, 391, -1031, 629], [440708, -2681, -417, -1298, 364], [490959, 323, 611, -205, -503], [203865, 5063, 279, -117, 104], [36095, -2484, -1662, 813, 266], [417724, 6382, -718, 1982, -426], [-133662, -4654, -1159, 2962, -468], [278095, -1967, -2512, -1953, 661], [898714, 1327, 745, 401, -435], [-13840, -782, 1596, 404, -1172], [438864, -1286, 622, 56, -268], [-7150, 5231, 2033, -1731, -451], [618248, -11794, -3495, 2451, -93], [372372, 1837, 2383, -412, -160], [531765, 4279, -2400, -285, 1751], [219522, -9359, 2109, -2423, 575], [1046695, 3473, 3010, 2377, -1267], [602081, 3877, -814, -5225, 29], [405530, -17279, -4619, 3222, 602], [1802159, -3343, 918, 758, 198], [-450795, 3978, -2544, -5709, -578], [161050, 7041, -787, -1961, -1037], [1390723, 6083, 424, -4814, 2376], [1153146, -3532, -757, -665, -1958], [957361, 4696, 2991, 2282, 1458], [510542, 6138, 1817, 749, -1305], [-1940188, -857, -344, -1953, 2323], [2356857, 15550, -1280, -2899, -162], [-1551068, -4881, 3133, -2386, 3268], [-486005, 4507, 1345, -5129, 225], [482427, -18616, 2754, -3016, -611], [1700393, 15143, 844, 7854, -1102], [1498508, 11389, -1345, 5093, 479], [1957920, -11478, 84, 3258, 1444], [2957562, 18099, -4269, 793, -1173], [123884, -147, -1249, 5313, -1595], [-1011452, 1001, -1255, 4848, 1640], [817676, 16375, -1215, -4095, -3601], [-2383868, -11972, -4726, 3857, -1107], [-1134019, 10402, 4715, 127, 5715], [4098984, -4987, 5847, 158, 2642], [1201430, 331, 1939, 9880, -2420], [469069, -20432, 5363, 4431, 2127], [230016, -31263, 3315, 3593, -3997], [-2654346, 25989, -11879, -1185, 1469], [3131170, -24123, -4918, 2290, 2362], [-2513370, 4397, -3452, -5348, -648], [-1448922, -12845, 2703, -2333, -7445], [5643, 22546, -8812, 1518, -3682], [1348779, -22335, -2814, -11416, 130], [2734279, -39321, 3085, -2505, -3255], [-743904, 46885, -6193, -6534, -1106], [-626276, 73065, -7279, -3043, 1177], [-2169976, 22490, -7134, -13313, -4917], [-2643047, -6602, 7375, -9306, -3010], [-940851, 29394, 3993, 20426, -678], [6610632, -1724, -3846, 9608, -870], [-2530113, -63975, -2779, -2957, 3990], [2050426, 23327, 15189, -4420, 5588], [585190, -18308, -12057, -10645, -885], [-3751291, -25736, 1181, 8693, -5015], [1305410, 9827, 15038, -24478, 5789], [1174213, -47427, 16445, 140, -5347], [2487723, -29754, 18217, -8384, 6318], [-4112725, 55115, -1334, 3043, 3461], [-5215864, 10513, 13045, 16897, 1301], [-8807032, 7762, -3159, -10861, -697], [6801646, 55814, -5748, 10665, -9099], [-2808036, 17601, 5995, 20013, -7447], [3063866, 16711, -2169, 17401, -9797], [-8768203, 19986, -16645, 10103, 2193], [-1182615, -668, 19341, -14982, 166], [1601464, -18896, -23896, 9163, 6235], [2250100, -22341, -4179, -7076, -10558], [-319580, 1161, -10547, -6825, 9603], [-10290914, 93739, 4690, 6350, 6798], [4726107, -30517, -8814, -6484, -2266], [1259178, -33748, -18084, 16963, 8687], [882606, 24585, -1739, 15881, -233], [-9800670, 26395, 889, -12011, 6033], [-93222, -6298, -2336, -11310, 7908], [2607018, 32128, 16149, -28268, -4138], [-12920760, 5697, 14512, -15230, 3095], [-5417202, 16143, -13920, 14644, -7459], [139468, -72506, -19964, 17902, -5132], [-16443641, 31356, -14612, 18820, 440], [-11552430, -54299, 14035, 24162, -9730], [-18279941, 25078, -2386, -7712, -204], [4784542, 5206, 10348, -32450, 11344], [-19182682, -23099, -19915, 33319, -12747], [-1266160, -70733, -665, 22245, -9451], [-6310316, -27956, 19678, -40571, -4011], [-17954309, -60614, 18651, -17463, 10609], [14525082, -5597, 17097, 32586, 3844], [-8358079, 42108, 17219, -27129, 9267], [-1308268, -100821, 4551, -3755, 7921], [9443714, 47523, -17658, 47554, -5759], [3836098, 56109, -13785, 36116, 1764], [-19995963, -119538, 10571, 10236, 9762], [2155200, -145117, 2404, -22731, -2319], [-22487100, -28009, -19706, 1090, -5373], [-6285018, 119604, 1160, 33828, -412], [-477435, -63296, 11659, -1979, 5941], [13663088, -155169, 28100, -35018, -2102], [1521633, 153881, -21959, -19799, 10279], [-1398710, 27739, -21573, 49215, -26447], [-933373, -166759, 16765, -16390, -21841], [-6061138, 64079, 40591, -56150, 15062], [3062551, -72161, 3540, -64169, 16817], [-76114, 39437, 31788, -8638, 25622], [17602762, -18084, -25676, 8999, -9999], [-12542091, -185540, 9974, -12680, 12523], [-21783027, 52051, -53882, -12332, -7074], [7227519, 224701, -669, -36961, -1712], [36233891, -116083, -19111, 11787, -9614], [1072992, -12874, -35517, 43875, 653], [-2263760, 182457, -7038, 25620, 2063], [10248373, -202499, 12931, 42472, 25], [-5196499, 55770, -37846, 54532, -9516], [-8788986, 29682, 31534, -13937, 14037], [-13739111, 52756, 39036, 54300, 16749], [-23337712, -5984, -2626, -33858, -31688], [1347226, 21874, -11882, 28425, 14395], [20587659, 3996, -15995, -19600, 6628], [-468990, -84036, -61891, 45397, 17326], [4003866, -175418, -3636, 44353, 4349], [18159668, -235791, -33653, -331, -22271], [-8890370, 51280, -66772, -1562, -25338], [-6788075, -60496, 9891, 15993, -3793], [10111242, 122151, 77349, 7779, -18361], [18313951, 164902, 40711, 2305, 17], [-3869254, 234817, -56203, 9673, -16569], [-28833271, 228635, 41593, -11908, 7133], [21515975, -272132, 32718, -31522, -22805], [-34929856, -41602, 16602, 55756, 2328], [-14839942, -306936, 19464, -5851, -2887], [-4663958, 153942, -11465, -67103, -14558], [14107575, 236199, -28843, -44041, 43745], [-14335623, 2850, 20183, -26489, -4073], [14042592, 81835, 37283, 36658, 3042], [9076617, 213990, 36955, 28048, -9162], [-19529044, 95281, 33773, 10289, -15719], [20944783, 94654, -67705, 72092, 616], [-25027162, -38018, -90927, 3340, 10526], [37425160, 69244, -17612, 30413, 4945], [13193750, -101533, -70287, -13979, -17883], [-3010045, -70714, 76833, -128763, 11473], [35334290, -166824, -69299, -27893, -27296], [49331398, 273495, -5183, 57155, -20989], [-6490302, 209854, -75460, -13119, 9997], [-21562776, 230759, -35998, 20665, -8083], [26321979, 16891, -33586, -675, -59389], [-508153, -346273, -64876, 112599, -7301], [22316905, -273536, -52663, 36337, 10001], [913231, -93821, -123501, 77063, -25910], [2079624, 129630, 54166, 7387, 24201], [21973686, -120233, 61354, -61298, 9293], [-42859096, -236339, -5519, 24399, -17187], [-14500830, 51967, 3501, 885, 26473], [-14249759, -247542, -69679, -8000, 4724], [30654913, -100294, 86717, 11140, 18968], [9460986, -119640, 5647, 37846, 22272], [20498643, -567393, 1890, 29140, -13996], [27457322, 256776, -62380, -36568, 44028], [-91786664, 129012, 13482, 9441, -1065], [38621955, -148454, 66098, 71370, 20202], [20123918, 67257, 16671, 76083, 22381], [25686338, 162372, -48028, -43098, -24070], [63190936, -99932, 60175, -35402, -15416], [-7279440, 237383, 5727, -56404, 3666], [21277093, -86254, -72855, 30743, -93], [8038975, -89638, 11702, -95395, 702], [40532290, 183038, 216, -72436, 22078], [316754, -147190, 23332, -42732, -1966], [-16585758, 51761, 52463, 122445, -17087], [14610505, -273012, -84747, -33099, -2277], [18260173, 266915, 86773, -93533, -2754], [-61017680, 269102, 97444, 972, 54494], [37636635, 517510, -11881, -72799, 1767], [-51510289, -351461, 99305, -152113, 48032], [35403627, -286265, 162920, -35903, 44985], [45067190, -287151, -41837, -110935, -3973], [20673159, 278627, 41943, 51980, 2741], [67992232, -102735, 9997, 16269, -32585], [14445245, 282180, -106161, -36953, 90147], [63499328, -50848, -37560, -105429, -11237], [-15196473, 386407, -34187, 91991, -35951], [-38409758, 205762, 92820, -168641, -17859], [-73285064, -356337, 66573, -35834, -18212], [42540774, -487518, -73180, 50938, -8496], [-24885664, -229294, -109434, -14263, 92255], [14757015, 187599, 163726, -178721, 19465], [-31715939, 120755, -163506, 49780, -84078], [7551625, 51475, 149286, -132750, 93832], [83536024, -278515, 205441, -62724, 32864], [-86188966, 230749, -206243, -39227, -6195], [-9515429, -197082, 34853, -11991, -65179], [-44013261, 134026, 39004, -170535, 32154], [58892002, 7052, -92544, -144700, -21770], [14178074, 313505, 104454, -193923, 65837], [16701239, 200518, -109956, 48169, 20656], [26806598, -512511, -112855, -26380, -59746], [-9062408, 696538, -100510, 203935, -30025], [-40790779, 161200, 113601, 69951, 70435], [-36896824, 113210, -71864, 36224, 77570], [-53389487, -107302, -76680, -62168, 112987], [22830161, -544476, 37123, 62743, -12073], [-7251510, 206013, -45106, 69780, -38578], [13600694, 63422, -3274, 46975, 655], [24064776, 198943, -64081, -103955, 66235], [3520897, -188988, 89443, 124643, -36309], [56710238, -24716, 132704, 19368, -33012], [75845, -605249, -53058, 139746, -19686], [26526156, -163616, -186417, 76003, 7740], [146346803, 61981, -63053, 94284, 56417], [41010920, 213490, -128898, 113832, -69556], [-149688978, -148202, 48650, -21510, 20342], [48185100, -602811, 8915, 105946, 75660], [-56606576, 208452, -8537, -69879, 139157], [13694282, -965612, -174626, 239327, -15271], [53068113, -456837, -50516, 190084, 8370], [-34987783, -749564, 132504, 83466, -98302], [-35422204, 122323, 171523, 34915, -60931], [86314936, -142162, 191409, 119741, 33090], [-17490308, 13431, 207631, -170859, 29091], [-68692159, -877148, -86737, -6769, 85835], [22446706, 637492, -28974, -72406, -68658], [-104629258, -234816, 109830, -94886, -103058], [-35338944, -572825, -105070, -194254, 51516], [-95171333, -24637, -183469, 104161, -66108], [-81998800, -295974, 26613, -103351, -5705], [19723103, -148886, 94666, -134551, -67590], [55738482, 302503, 85300, 212773, 12841], [-43070765, 117604, -12779, -154537, 156331], [29165531, -412179, -260273, -422647, 14335], [39211908, 416984, -55574, -19839, -41983], [-13739627, 253488, -126665, -183732, -41346], [88993528, -323828, -132850, -47028, -4436], [-2842984, 233365, 242990, -266346, 65117], [-103248894, -146182, 219450, -248144, 25056], [-66408866, 179435, 61508, 68254, -99898], [62817196, -739764, -19764, -46591, -54189], [82808917, -822005, -97157, -38371, -22954], [-79081442, 483657, 15581, 37523, 51725], [-12296126, -656945, 43625, 305527, 3703], [-50970004, -276932, 233330, -347850, -36430], [-91352207, 5029, -398070, -27117, 86577], [-21484836, -221310, 188992, -47467, 61653], [-50725509, 680704, 52724, 98124, -82237], [-105406325, -893510, -75373, -81367, 180069], [92214221, -489872, -205029, 204618, -98238], [-70748024, -551305, -24659, 211718, -129672], [-6481103, 843227, -104101, -287494, 61733], [-127203310, 851823, -278539, -3815, -71445], [21822613, -640533, -78882, 354351, -68675], [-141819436, 1403714, 38200, 183776, 86898], [148930024, -1035673, 111563, 26066, 27874], [-60628989, -202737, -228720, 371038, -23088], [-62315622, -656119, 138587, 70247, 182385], [-20441018, -198196, 229455, 114417, 146320], [-86472188, -248959, 249880, 27545, -192559], [-169997296, -377082, -75012, -125090, 101538], [22253798, 1151283, -176471, 31418, 176582], [-37702053, 489259, -137375, 43507, 150257], [95868076, -420550, -40317, 98751, 7957], [-141163214, 313152, 260313, -348363, -138315], [-60044489, 152796, 157714, -94798, -155937], [-18339782, 11744, 423358, -24250, 58746], [-75903470, -579403, 205225, -6935, 229321], [54847540, 392091, -86969, -120859, -102873], [-151169665, -1080532, 107861, 7302, -71900], [40314179, 266437, -338400, -187327, 128427], [-66367402, -70723, 251364, 448493, -14559], [-117924728, -77954, 319678, -390870, -80254], [71781861, -451688, 26780, -41300, -235335], [-68180239, 525932, 109932, -66698, -92038], [26999756, 530146, -103970, 82820, 93224], [-154087888, -32314, 181254, 63438, -173350], [129355280, -243318, -331305, 204175, 7489], [-161432098, -1086499, -333459, -165491, 202889], [-3569027, -458153, -55190, 40096, -246472], [-54605242, 1057397, 476911, -110266, 106170], [21093494, -375314, -5267, -249503, 60964], [61725002, 210448, -178744, -440871, 73441], [-18034168, -1085127, 173463, 224559, 43399], [172339670, 367796, -151856, -219453, 84143], [-132856829, 71077, 99488, -88444, 325348], [96990922, -649631, 559139, -198641, 58835], [39848606, -279054, 211855, -219513, 152075], [-7250390, -152695, -286801, -290329, 105001], [-58212408, -84117, -335714, -244278, -41977], [205608525, -1028262, -275026, -60851, 16254], [-171608110, 661952, -484000, 379591, -93273], [-250193696, 112656, 241139, 79747, -79552], [-126120836, 952460, -566428, 396704, -124980], [98471501, -502309, -234567, -163677, 63030], [-38870280, -332521, 212391, -152945, -51547], [-165624044, -690542, 89918, 478842, 18162], [-84625170, -606457, 269447, -290985, -89999], [-266522086, -663888, 128220, 297122, -80750], [-75555871, 211661, -727718, 531621, -69743], [-92967017, 299229, -96856, 551581, -142199], [-39987476, -751075, -151530, -444200, 205428], [-173748318, -1307671, -124757, -308171, 184799], [-30084771, -1291724, 73699, -813273, 139173], [19776697, 655621, 593777, -468250, 203903], [-137839076, -1121035, -173681, 188050, -86176], [241967725, 1718368, 12892, 188318, -226829], [178343695, 684606, 608070, -173112, -97617], [52762122, -444595, 721346, -403461, 14243], [-1046899, 502469, -192800, -103535, 163261], [-15135466, -2388353, 454223, 49279, -216955], [41885186, 104488, -545306, -329971, 158917], [62100117, 679735, 407645, 6689, -48796], [-88820553, -254107, -401673, -31837, 188305], [47931579, -984176, -381591, 226142, -30856], [-39002836, 168787, -259739, -53646, -217826], [-167551365, -1028773, -68204, 435762, -248744], [82956801, -30367, -249967, 299539, 205221], [-198864167, 1528407, 179673, 101883, 132922], [184952739, -386831, -164418, -485699, 34593], [114357098, 317380, -140071, 56471, 134681], [-95905826, -1043254, 169786, 671749, -50683], [90460557, 313697, 201274, -800841, 119445], [-43623778, -1183113, 315548, -474506, 152319], [-169317709, 720995, -515261, -251124, 59087], [181350400, 1864455, -244015, -314087, 226817], [173521633, 473041, 249338, 337529, -243239], [-139611256, 1160636, 367994, -388121, -21287], [52758377, 769681, 270576, 98449, -392773], [-374615002, -18968, -146543, 138606, 23648], [21411137, 2805455, -404901, -643339, -87994], [-14701259, 1129193, 690974, -76922, -190092], [104039891, -1228112, 56448, 336956, 266567], [231744661, 131773, 83168, -224343, 19981], [155768776, -2275825, -149628, 168928, -49776], [-17917930, 888401, -52127, 362255, 324693], [293127379, -1386591, 204626, 121685, -121963], [-138402847, 1093700, 96466, 851706, -188098], [21005730, 957292, -22571, -96322, 218712], [-152865586, 77026, 516849, -622469, 47823], [-148291700, 812338, 713588, -421108, 67032], [155600576, 1469157, -354249, -765407, 80919], [-231436345, 1683128, 5228, -328806, -110242], [-35395584, -292964, 286292, -557100, -109658], [282559739, -175827, 242540, 401667, 164555], [342797327, -831945, 200626, 263393, 160275], [274435974, -383024, 272342, 172621, -199169], [123168038, -992147, -58825, -1183373, 160693], [-184068890, -1694755, -289186, -200989, 243451], [-64765852, 1705671, 237761, 615423, -141143], [22248919, -1105836, -735780, 779782, -77131], [249294898, 710179, -523313, 529895, 30601], [92451319, 870338, -244894, 3252, -50101], [-434732568, 861678, 260824, 258448, 164612], [82797374, -1272043, -129515, 746779, 174189], [-28927652, 271568, 81741, 84907, 41286], [-187905552, -3270561, 203387, 652030, 66828], [59225069, -850764, 351927, 45691, -415561], [197999901, 2052531, 71487, -676364, -11891], [267929234, 950713, -495061, -944199, 199849], [63220588, 1374045, 3757, -980525, -1713], [254247576, 595240, 371334, -335577, 73031], [24538317, 674701, -509588, -6211, -185025], [163759195, -1400573, -227164, 516701, 66989], [-37898346, -2583158, 229206, 215532, 225124], [90449764, 1143916, 628202, 461599, -178073], [62849035, 16407, 521446, -20632, -86160], [-273375618, 735969, -782565, -105722, 241666], [290153392, 1024746, 184015, -286762, 162136], [-9032420, 1565848, -192185, -529553, -389975], [41475346, 354179, 210145, -679301, -283265], [188750534, 768452, 843575, -674182, 398776], [133644339, -1458189, 357669, -620316, 52481], [395871204, 313688, 331110, 250110, 143636], [-363640146, 72460, -448044, 355764, -291662], [313776504, -1401244, -122088, -530018, 207732], [38581936, 813554, -124938, 484945, 25351], [140104884, -428421, -135433, 1017951, -77193], [271952234, 869618, -520090, -1155437, 436367]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1080_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1080_6_a_p();".
// 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_1080_6_a_p(:prec:=5)
    chi := MakeCharacter_1080_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_1080_6_a_p();".
// 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_1080_6_a_p( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1080_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<7,R![-628981784, 235397228, -616346, -42695, -4, 1]>,<11,R![815319053492, 18359581328, 49735673, -424697, -197, 1]>],Snew);
    return Vf;
end function;