
// Make newform 147.6.c.c in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_147_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_147_c_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_147_6_c_c();".
// 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_147_6_c_c();".
// 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 := [90230547456, 0, -29387167488, 0, 7244325760, 0, -655075344, 0, 42970860, 0, -1128902, 0, 21495, 0, -171, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [213916288910116301325944064, 0, -76138134044040961704755328, 0, 8859684979431615461269952, 0, -578552011046001501481540, 0, 15501119775100510452986, 0, -278948508450412221587, 0, 2204025893588703583, 0, -12301579329739865, 0], [-5542797664686946798848, 0, -20572181453913554304, 0, 5041533596636384064, 0, -1006133608893165164, 0, 27900528137932542, 0, -625594991538609, 0, 5080229838581, 0, -32290359027, 0], [0, 93795747111872899091712, 0, -86834930277461495183488, 0, 6868291418119419316416, 0, -518658446581656991524, 0, 13817863439746428842, 0, -275315464528306587, 0, 2204754465741831, 0, -13230933495217], [-222916172659403344950528, 0, 86834930277461495183488, 0, -6868291418119419316416, 0, 518658446581656991524, 0, -13817863439746428842, 0, 275315464528306587, 0, -2204754465741831, 0, 13230933495217, 0], [-487740448710031723309668096, -189876156238415013674904576, 181408867196671741439444352, 27051589729111251844949696, -17732510139024831960490112, -2151465807982502202936800, 1230483065376251159799076, 162106759492935007028728, -32680299236488178893130, -4369098493633355980212, 632118546227386814867, 87861945511751325278, -5044308354192319039, -706021421218384486, 29741709374154185, 4252913790283210], [-7417237399202581553385216, 0, -159776745747472101580416, 0, 39155780997346386507456, 0, -7552998693178671728500, 0, 216693382784964580018, 0, -4858771644022283511, 0, 39592501645908307, 0, -250787622883333, 0], [-4006613012002093585261435392, -4467861248298446024266173696, 1599611153781711543545194752, 639588684527287758407921280, -111185523669700726387570048, -56228185282761018535434176, 8885579580647609302997000, 2517355597961699808117220, -236382374923308100003252, -60572823363110628071882, 4859397945294221565958, 955990239905015612363, -39053231439573830174, -7313544642032725879, 238833664703505874, 37702369350241985], [0, -8667564681304513586525914368, 0, 1244671020036156379980238464, 0, -114371711884511868729666496, 0, 3812582376116107805594564, 0, -84357442697205588376954, 0, 995608216893022228723, 0, -7065852487170910271, 0, 25431645120704569], [264066671573665411896571392, 0, -90950436840819890180964096, 0, 11890875532097488493925728, 0, -747453342966525766046956, 0, 19844040775668986449550, 0, -363274738202799494693, 0, 2878984625917542601, 0, -16352302746402551, 0], [-975480897420063446619336192, -2303066054228665418371461888, 362817734393343482878888704, 329838830396782658469412608, -35465020278049663920980224, -28979338487603120714002432, 2460966130752502319598152, 1321850769857524411593644, -65360598472976357786260, -32271379101760086942766, 1264237092454773629734, 522401125972630157545, -10088616708384638078, -4026863892648369197, 59483418748308370, 21168225532957243], [-5916995281848674489727744, 0, -295683731966605784667264, 0, 72461905511964411839424, 0, -13551692607262949645348, 0, 401013976186458270122, 0, -8991669756177641019, 0, 73625366061321383, 0, -464108966034257, 0], [4006613012002093585261435392, -7505879748113086243064646912, -1599611153781711543545194752, 1072414120193067787927116416, 111185523669700726387570048, -90651638210481053782422976, -8885579580647609302997000, 5111063749848659920576868, 236382374923308100003252, -130478399261244323755274, -4859397945294221565958, 2361781368093036816811, 39053231439573830174, -18609887381526877655, -238833664703505874, 105748989994773345], [514750785080863175600474880, 120415353660367224296382720, -8589377699972266474730880, -60516849789627692548200960, 2104960834883733453238080, 8817539873837470093824960, -371795828829012818477740, -665855779149300791813940, 11649137683442753584990, 18316732986176616807234, -261200868832208511105, -353451089736539197095, 2156214321728041093, 2830472563003559235, -13481997053737315, -16543433246725029], [3375195583342893395370840576, -2311965291637496320356996864, 94256523219461295491801856, 1733590018143099438078741376, -23099029608386632464122496, -169296070029743825162546752, 4338831868045422539623448, 12784378435422940170544428, -127833151003438669807388, -343688631434065917644446, 2866317749434399516626, 6786233041902246883489, -23457295395154704410, -54344849935447166757, 147946243922234678, 323819591781731139], [3375195583342893395370840576, -4429673512083245097340445952, 94256523219461295491801856, 2966793161681277500767113856, -23099029608386632464122496, -324367463397080591353004736, 4338831868045422539623448, 24494581613606945698112004, -127833151003438669807388, -661852583192173174275098, 2866317749434399516626, 13002269913510388645827, -23457295395154704410, -104123510481719775951, 147946243922234678, 617928232352995177]];
    Rf_basisdens := [1, 64689333199312753375266816, 144430006205291326464, 258240851095060891717632, 18445775078218635122688, 32344666599656376687633408, 144718866217701909116928, 258757332797251013501067264, 129378666398625506750533632, 8086166649914094171908352, 64689333199312753375266816, 144718866217701909116928, 258757332797251013501067264, 21563111066437584458422272, 86252444265750337833689088, 86252444265750337833689088];
    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_147_c();"
function MakeCharacter_147_c()
    N := 147;
    order := 2;
    char_gens := [50, 52];
    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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_147_c_Hecke();"
function MakeCharacter_147_c_Hecke(Kf)
    N := 147;
    order := 2;
    char_gens := [50, 52];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
end function;


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


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 6;
    raw_aps := [[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1], [0, -2, 0, 0, 27, -6, 0, -3, 0, 9, 0, 0, 3, 0, 0, 0], [0, 7, 0, 0, 0, -20, 0, 0, 6, -7, -8, 0, -14, 0, 0, 0], [0, 65, 0, 0, -7, 20, 0, 10, 0, 48, 0, 0, -10, 0, 0, 0], [27, 0, 27, 230, 0, 0, 8, 0, 0, 0, 0, 11, 0, 16, 30, 8], [-23, 0, -23, -118, 0, 0, -30, 0, 0, 0, 0, 37, 0, -60, -5, 19], [0, 220, 0, 0, 85, 14, 0, 7, 0, -104, 0, 0, -7, 0, 0, 0], [1328, 0, -5, 0, 0, 0, 44, 0, 0, 0, 0, 84, 0, 0, 0, 0], [0, 26, 0, 0, 0, -72, 0, -164, 52, -26, -32, 0, -216, 0, 0, 0], [6899, 0, -118, 0, 0, 0, -135, 0, 0, 0, 0, -49, 0, 0, 0, 0], [0, 81, 0, 0, 0, -316, 0, 53, -22, -81, -8, 0, -109, 0, 0, 0], [-190, 0, -190, -1820, 0, 0, -125, 0, 0, 0, 0, 60, 0, -250, -149, 19], [0, 188, 0, 0, 0, -448, 0, 111, -119, -188, -304, 0, -265, 0, 0, 0], [0, -1133, 0, 0, -1002, -384, 0, -192, 0, 653, 0, 0, 192, 0, 0, 0], [12750, 0, 215, 0, 0, 0, 221, 0, 0, 0, 0, -316, 0, 0, 0, 0], [18, 0, 18, -36, 0, 0, 56, 0, 0, 0, 0, -94, 0, 112, 292, -368], [0, 1121, 0, 0, -1619, 522, 0, 261, 0, -1036, 0, 0, -261, 0, 0, 0], [31749, 0, 506, 0, 0, 0, -613, 0, 0, 0, 0, 836, 0, 0, 0, 0], [0, -381, 0, 0, 0, 724, 0, -1370, -199, 381, 800, 0, -608, 0, 0, 0], [0, -789, 0, 0, 0, 2644, 0, -1664, 282, 789, 512, 0, -86, 0, 0, 0], [0, 3407, 0, 0, 5466, 1170, 0, 585, 0, -2658, 0, 0, -585, 0, 0, 0], [0, -1319, 0, 0, 0, 3884, 0, -1298, -844, 1319, 1392, 0, 1340, 0, 0, 0], [0, 3101, 0, 0, -4349, -2524, 0, -1262, 0, 1034, 0, 0, 1262, 0, 0, 0], [444, 0, 444, -1920, 0, 0, 116, 0, 0, 0, 0, 212, 0, 232, -599, 1255], [-46, 0, 1275, 0, 0, 0, 886, 0, 0, 0, 0, 766, 0, 0, 0, 0], [700, 0, 700, 4064, 0, 0, 292, 0, 0, 0, 0, 116, 0, 584, 596, 220], [-29896, 0, -1775, 0, 0, 0, -1217, 0, 0, 0, 0, -721, 0, 0, 0, 0], [0, -1300, 0, 0, 0, 6136, 0, 1493, -797, 1300, -936, 0, 4093, 0, 0, 0], [103, 0, 103, -23906, 0, 0, 1003, 0, 0, 0, 0, -1903, 0, 2006, -890, -910], [0, -6432, 0, 0, -67, -2238, 0, -1119, 0, 9485, 0, 0, 1119, 0, 0, 0], [1273, 0, 1273, -6110, 0, 0, 883, 0, 0, 0, 0, -493, 0, 1766, 2254, -1474], [-80564, 0, -1678, 0, 0, 0, -90, 0, 0, 0, 0, -3521, 0, 0, 0, 0], [0, 2837, 0, 0, 1058, -3904, 0, -1952, 0, -6625, 0, 0, 1952, 0, 0, 0], [156437, 0, 859, 0, 0, 0, 1252, 0, 0, 0, 0, -5437, 0, 0, 0, 0], [0, 70, 0, 0, 0, 4864, 0, 360, -1502, -70, -5144, 0, 220, 0, 0, 0], [0, -1835, 0, 0, 0, 10132, 0, -2934, -4348, 1835, -2792, 0, 736, 0, 0, 0], [-391, 0, -391, -19598, 0, 0, -750, 0, 0, 0, 0, 1109, 0, -1500, -3504, 4222], [0, -1976, 0, 0, 13929, -5326, 0, -2663, 0, 275, 0, 0, 2663, 0, 0, 0], [3069, 0, 3069, -42038, 0, 0, 3588, 0, 0, 0, 0, -4107, 0, 7176, 564, -1602], [245667, 0, 4630, 0, 0, 0, -1822, 0, 0, 0, 0, 6766, 0, 0, 0, 0], [-6562, 0, -6562, -14924, 0, 0, -3392, 0, 0, 0, 0, 222, 0, -6784, -5978, -362], [0, -9807, 0, 0, 5780, 15126, 0, 7563, 0, -4407, 0, 0, -7563, 0, 0, 0], [-417232, 0, 200, 0, 0, 0, -36, 0, 0, 0, 0, -3556, 0, 0, 0, 0], [0, -7489, 0, 0, -16888, 13358, 0, 6679, 0, -2618, 0, 0, -6679, 0, 0, 0], [0, 64, 0, 0, 0, -3448, 0, -4745, 3317, -64, 3192, 0, -4873, 0, 0, 0], [0, -2373, 0, 0, 30995, -4246, 0, -2123, 0, -6288, 0, 0, 2123, 0, 0, 0], [2249, 0, 2249, -29750, 0, 0, -1563, 0, 0, 0, 0, 5375, 0, -3126, 2514, 5110], [1552, 0, 1552, -66880, 0, 0, 976, 0, 0, 0, 0, -400, 0, 1952, -3154, 4306], [0, -7352, 0, 0, -40864, -3938, 0, -1969, 0, 19105, 0, 0, 1969, 0, 0, 0], [0, -2701, 0, 0, 0, 10180, 0, -10918, 12417, 2701, 624, 0, -5516, 0, 0, 0], [0, -625, 0, 0, 0, 20140, 0, -1024, -3746, 625, -17640, 0, 226, 0, 0, 0], [5445, 0, 5445, -143422, 0, 0, 1380, 0, 0, 0, 0, 2685, 0, 2760, 10252, -2122], [0, -7892, 0, 0, 0, 39160, 0, -13884, 8049, 7892, -7592, 0, 1900, 0, 0, 0], [0, -22506, 0, 0, 22230, -28324, 0, -14162, 0, 19615, 0, 0, 14162, 0, 0, 0], [-118466, 0, 13505, 0, 0, 0, 6116, 0, 0, 0, 0, -4356, 0, 0, 0, 0], [8978, 0, 8978, -84788, 0, 0, 152, 0, 0, 0, 0, 8674, 0, 304, 16022, 1630], [0, 7939, 0, 0, 36261, -29984, 0, -14992, 0, -24472, 0, 0, 14992, 0, 0, 0], [0, 2835, 0, 0, 0, -21700, 0, -24262, -9905, -2835, 10360, 0, -29932, 0, 0, 0], [0, -25472, 0, 0, 13247, -70250, 0, -35125, 0, 24003, 0, 0, 35125, 0, 0, 0], [0, -13013, 0, 0, 0, 16836, 0, 6587, -12902, 13013, 35216, 0, 32613, 0, 0, 0], [0, -18160, 0, 0, 35851, 62496, 0, 31248, 0, 17700, 0, 0, -31248, 0, 0, 0], [-10606, 0, -10606, -79444, 0, 0, -4367, 0, 0, 0, 0, -1872, 0, -8734, 2837, -15315], [-643668, 0, 29863, 0, 0, 0, -31321, 0, 0, 0, 0, -10304, 0, 0, 0, 0], [-605890, 0, 2345, 0, 0, 0, 6279, 0, 0, 0, 0, -34741, 0, 0, 0, 0], [-14799, 0, -14799, 9394, 0, 0, -4206, 0, 0, 0, 0, -6387, 0, -8412, -30648, 9462], [0, 81498, 0, 0, 99568, 49500, 0, 24750, 0, 28684, 0, 0, -24750, 0, 0, 0], [0, 10577, 0, 0, 0, -57596, 0, -31444, -8164, -10577, 15288, 0, -52598, 0, 0, 0], [18407, 0, 18407, 188134, 0, 0, 8788, 0, 0, 0, 0, 831, 0, 17576, 3058, 16180], [0, -8256, 0, 0, 175023, 29538, 0, 14769, 0, -39986, 0, 0, -14769, 0, 0, 0], [-63404, 0, 20777, 0, 0, 0, -19798, 0, 0, 0, 0, 49458, 0, 0, 0, 0], [-131731, 0, -7658, 0, 0, 0, -32221, 0, 0, 0, 0, -4767, 0, 0, 0, 0], [0, 27115, 0, 0, 0, -60580, 0, 50425, 25408, -27115, -47880, 0, -3805, 0, 0, 0], [-24213, 0, -24213, -148978, 0, 0, -5971, 0, 0, 0, 0, -12271, 0, -11942, -21222, -15262], [0, 5827, 0, 0, 177879, 2314, 0, 1157, 0, -124716, 0, 0, -1157, 0, 0, 0], [-18453, 0, -18453, 435230, 0, 0, -11955, 0, 0, 0, 0, 5457, 0, -23910, -8600, -4396], [0, 56604, 0, 0, -100647, 72536, 0, 36268, 0, 45840, 0, 0, -36268, 0, 0, 0], [0, -36110, 0, 0, 0, 67096, 0, -32508, -10838, 36110, 77344, 0, 39712, 0, 0, 0], [-1403725, 0, -880, 0, 0, 0, -16699, 0, 0, 0, 0, 77035, 0, 0, 0, 0], [-46171, 0, -46171, 256570, 0, 0, -21540, 0, 0, 0, 0, -3091, 0, -43080, -33300, -15962], [0, 130260, 0, 0, 156541, 53770, 0, 26885, 0, -109909, 0, 0, -26885, 0, 0, 0], [0, 110504, 0, 0, -108842, 19536, 0, 9768, 0, -30633, 0, 0, -9768, 0, 0, 0], [6128, 0, 6128, -509704, 0, 0, -11756, 0, 0, 0, 0, 29640, 0, -23512, 8645, 27123], [-15738, 0, -15738, 622932, 0, 0, -9904, 0, 0, 0, 0, 4070, 0, -19808, -24566, 12898], [-1133013, 0, -98524, 0, 0, 0, -756, 0, 0, 0, 0, -133824, 0, 0, 0, 0], [0, 37962, 0, 0, 0, -124664, 0, 95596, -5536, -37962, -27184, 0, 19672, 0, 0, 0], [-45361, 0, 68714, 0, 0, 0, 11945, 0, 0, 0, 0, 45367, 0, 0, 0, 0], [0, 8983, 0, 0, 0, -35172, 0, 53195, -32424, -8983, -760, 0, 35229, 0, 0, 0], [0, -26681, 0, 0, 0, 106796, 0, -92033, 3566, 26681, -72, 0, -38671, 0, 0, 0], [-2349865, 0, -37826, 0, 0, 0, -33859, 0, 0, 0, 0, 87168, 0, 0, 0, 0], [22897, 0, 22897, -77686, 0, 0, 41790, 0, 0, 0, 0, -60683, 0, 83580, 2401, -40187], [4313740, 0, -23303, 0, 0, 0, -655, 0, 0, 0, 0, 73022, 0, 0, 0, 0], [0, -25706, 0, 0, 0, 148712, 0, -47012, -6126, 25706, -45888, 0, 4400, 0, 0, 0], [0, -34418, 0, 0, 0, 80936, 0, 35848, -35573, 34418, 56736, 0, 104684, 0, 0, 0], [0, -28587, 0, 0, 0, 112556, 0, 37892, -62280, 28587, 1792, 0, 95066, 0, 0, 0], [0, 126297, 0, 0, 166183, 100104, 0, 50052, 0, -132822, 0, 0, -50052, 0, 0, 0], [-562258, 0, -200795, 0, 0, 0, -34688, 0, 0, 0, 0, 28148, 0, 0, 0, 0], [-5581858, 0, 4142, 0, 0, 0, 106712, 0, 0, 0, 0, -80192, 0, 0, 0, 0], [47924, 0, 47924, 412336, 0, 0, 44959, 0, 0, 0, 0, -41994, 0, 89918, 61849, -55919], [0, -42566, 0, 0, 0, 270552, 0, -29161, -17621, 42566, -100288, 0, 55971, 0, 0, 0], [21317, 0, 21317, -791494, 0, 0, -5959, 0, 0, 0, 0, 33235, 0, -11918, 42054, 12498], [4838610, 0, -34775, 0, 0, 0, -36785, 0, 0, 0, 0, -62274, 0, 0, 0, 0], [0, -384534, 0, 0, -87481, -122880, 0, -61440, 0, 172674, 0, 0, 61440, 0, 0, 0], [0, -25073, 0, 0, 0, 199500, 0, 29030, 32933, 25073, -99208, 0, 79176, 0, 0, 0], [0, 92979, 0, 0, 0, -310268, 0, 109408, -106374, -92979, -61648, 0, -76550, 0, 0, 0], [42567, 0, 42567, 886, 0, 0, -2520, 0, 0, 0, 0, 47607, 0, -5040, 77946, 12228], [0, -218837, 0, 0, 521857, 167240, 0, 83620, 0, -289305, 0, 0, -83620, 0, 0, 0], [0, -189496, 0, 0, -144549, -185870, 0, -92935, 0, -66750, 0, 0, 92935, 0, 0, 0], [-2680591, 0, 108733, 0, 0, 0, 67771, 0, 0, 0, 0, 33413, 0, 0, 0, 0], [-83564, 0, -83564, -133720, 0, 0, -55740, 0, 0, 0, 0, 27916, 0, -111480, -38204, -17444], [0, 48407, 0, 0, -461137, 85332, 0, 42666, 0, -18546, 0, 0, -42666, 0, 0, 0], [3785465, 0, 216165, 0, 0, 0, 50712, 0, 0, 0, 0, 57330, 0, 0, 0, 0], [-51095, 0, -51095, 6874, 0, 0, -6305, 0, 0, 0, 0, -38485, 0, -12610, -103868, 14288], [0, -86428, 0, 0, 361931, -284282, 0, -142141, 0, 164871, 0, 0, 142141, 0, 0, 0], [0, -4205, 0, 0, 0, 15988, 0, 90603, -53934, 4205, 832, 0, 99013, 0, 0, 0], [-99866, 0, -99866, 793732, 0, 0, -20807, 0, 0, 0, 0, -58252, 0, -41614, -170255, 12137], [-23482, 0, -23482, -162380, 0, 0, 8912, 0, 0, 0, 0, -41306, 0, 17824, -88468, 23680], [0, 729421, 0, 0, 206597, 74094, 0, 37047, 0, -534300, 0, 0, -37047, 0, 0, 0], [-3202654, 0, -276193, 0, 0, 0, -57363, 0, 0, 0, 0, 14273, 0, 0, 0, 0], [0, 25244, 0, 0, 0, -132792, 0, -29048, 123797, -25244, 31816, 0, -79536, 0, 0, 0], [-143142, 0, -143142, 437916, 0, 0, -52228, 0, 0, 0, 0, -38686, 0, -104456, -183545, 1717], [0, -308869, 0, 0, 355319, -316388, 0, -158194, 0, 182834, 0, 0, 158194, 0, 0, 0], [-115449, 0, -115449, 767022, 0, 0, -55654, 0, 0, 0, 0, -4141, 0, -111308, -162035, 42445], [-4324371, 0, 127025, 0, 0, 0, -86553, 0, 0, 0, 0, 161265, 0, 0, 0, 0], [0, -238157, 0, 0, 0, 1017972, 0, -340819, -38664, 238157, -65344, 0, 135495, 0, 0, 0], [0, -64897, 0, 0, 288831, -430356, 0, -215178, 0, -332385, 0, 0, 215178, 0, 0, 0], [0, 800255, 0, 0, 333769, 528830, 0, 264415, 0, -141454, 0, 0, -264415, 0, 0, 0], [-6498844, 0, 284191, 0, 0, 0, -71321, 0, 0, 0, 0, 33614, 0, 0, 0, 0], [84608, 0, 84608, 1518064, 0, 0, 52892, 0, 0, 0, 0, -21176, 0, 105784, 158582, -95150], [-2204729, 0, -67312, 0, 0, 0, -75381, 0, 0, 0, 0, 134836, 0, 0, 0, 0], [-6846820, 0, 66390, 0, 0, 0, -17084, 0, 0, 0, 0, -39956, 0, 0, 0, 0], [0, -71265, 0, 0, 0, 246060, 0, -53100, -73178, 71265, 39000, 0, 89430, 0, 0, 0], [0, 545535, 0, 0, -657125, -137932, 0, -68966, 0, 153669, 0, 0, 68966, 0, 0, 0], [0, 1289, 0, 0, 0, 99852, 0, 140974, 123396, -1289, -105008, 0, 138396, 0, 0, 0], [0, -57709, 0, 0, -798288, -436554, 0, -218277, 0, -96251, 0, 0, 218277, 0, 0, 0], [0, 129447, 0, 0, 0, -314716, 0, 174158, -172253, -129447, -203072, 0, -84736, 0, 0, 0], [221121, 0, 221121, -829782, 0, 0, 108635, 0, 0, 0, 0, 3851, 0, 217270, 271516, -46544], [0, 462112, 0, 0, 454038, 53876, 0, 26938, 0, 185468, 0, 0, -26938, 0, 0, 0], [-108496, 0, -108496, 178976, 0, 0, -88939, 0, 0, 0, 0, 69382, 0, -177878, -71553, 32439], [7496169, 0, -442793, 0, 0, 0, 150190, 0, 0, 0, 0, -95619, 0, 0, 0, 0], [116915, 0, 116915, -645290, 0, 0, 105574, 0, 0, 0, 0, -94233, 0, 211148, -29201, 51883], [0, -685781, 0, 0, 1176355, -109898, 0, -54949, 0, -219642, 0, 0, 54949, 0, 0, 0], [0, -303150, 0, 0, 0, 1242376, 0, -313628, 30950, 303150, -29776, 0, 292672, 0, 0, 0], [0, -358474, 0, 0, 423095, -38782, 0, -19391, 0, 541717, 0, 0, 19391, 0, 0, 0], [0, -31955, 0, 0, 0, -149812, 0, -375956, -131488, 31955, 277632, 0, -312046, 0, 0, 0], [0, -1040685, 0, 0, 512476, -637658, 0, -318829, 0, 1117981, 0, 0, 318829, 0, 0, 0], [-71173, 0, -71173, -929954, 0, 0, -78284, 0, 0, 0, 0, 85395, 0, -156568, -191690, 205912], [-6632681, 0, -114349, 0, 0, 0, -92065, 0, 0, 0, 0, -438147, 0, 0, 0, 0], [0, 150940, 0, 0, 0, -689080, 0, 77692, 166602, -150940, 85320, 0, -224188, 0, 0, 0], [-3561595, 0, 560026, 0, 0, 0, -36277, 0, 0, 0, 0, -190155, 0, 0, 0, 0], [0, 111715, 0, 0, 0, -302428, 0, 451621, -371696, -111715, -144432, 0, 228191, 0, 0, 0], [191812, 0, 167471, 0, 0, 0, 111855, 0, 0, 0, 0, 202414, 0, 0, 0, 0], [250510, 0, 250510, 364148, 0, 0, 45432, 0, 0, 0, 0, 159646, 0, 90864, 356848, 53308], [-4289356, 0, 534799, 0, 0, 0, 267737, 0, 0, 0, 0, 260064, 0, 0, 0, 0], [0, -197463, 0, 0, 0, 722084, 0, -416920, 13076, 197463, 67768, 0, -21994, 0, 0, 0], [0, 864889, 0, 0, 219961, 655980, 0, 327990, 0, -88097, 0, 0, -327990, 0, 0, 0], [0, -195144, 0, 0, 0, 862960, 0, -267524, -327851, 195144, -82384, 0, 122764, 0, 0, 0], [-19339, 0, -19339, 45698, 0, 0, 72994, 0, 0, 0, 0, -165327, 0, 145988, -40720, -143946], [-100216, 0, -100216, -2726984, 0, 0, -49356, 0, 0, 0, 0, -1504, 0, -98712, -77520, -24200], [16788788, 0, -155141, 0, 0, 0, 282961, 0, 0, 0, 0, 179249, 0, 0, 0, 0], [0, 184060, 0, 0, 0, -985392, 0, 184193, 240459, -184060, 249152, 0, -183927, 0, 0, 0], [-112303, 0, -112303, -2524078, 0, 0, -108701, 0, 0, 0, 0, 105099, 0, -217402, -150148, 142944], [0, 297083, 0, 0, 0, -893012, 0, 492047, 228506, -297083, -295320, 0, -102119, 0, 0, 0], [-1412491, 0, 259306, 0, 0, 0, -262861, 0, 0, 0, 0, 891054, 0, 0, 0, 0], [0, 1261303, 0, 0, 2329075, 583902, 0, 291951, 0, -797482, 0, 0, -291951, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_147_c_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_147_6_c_c();".
// 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_147_6_c_c(:prec:=16)
    chi := MakeCharacter_147_c();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 6));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 1;
    while true do
        trunc_vec := Vector(Kf, [0] cat [f_vec[i]: i in [1..prec]]);
        B := Basis(S, prec + 1);
        S_basismat := Matrix([AbsEltseq(g): g in B]);
        if Rank(S_basismat) eq Min(NumberOfRows(S_basismat), NumberOfColumns(S_basismat)) then
            S_basismat := ChangeRing(S_basismat,Kf);
            f_lincom := Solution(S_basismat,trunc_vec);
            f := &+[f_lincom[i]*Basis(S)[i] : i in [1..#Basis(S)]];
            return f;
        end if;
        error if prec eq maxprec, "Unable to distinguish newform within newspace";
        prec := Min(Ceiling(1.25 * prec), maxprec);
    end while;
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_147_6_c_c();".
// 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_147_6_c_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_147_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<2,R![300384, 0, 97832, 0, 7746, 0, 171, 0, 1]>],Snew);
    return Vf;
end function;