
// Make newform 252.4.j.b in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_252_j();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_252_j_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_252_4_j_b();".
// 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_252_4_j_b();".
// 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 := [5500612092612, 1324018291596, 655546044172, 114591208112, 26802380109, 3599409199, 358194386, 73649097, -3758051, -57172, 166449, -169303, 43732, -12243, 2687, -470, 81, -7, 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, 0, 0], [-1842555855894, -800967100779, -145421056607, -30829848495, -4027468386, -428059187, -69864801, 3784296, 26245, -30927, 135522, -33781, 9951, -2292, 395, -75, 6, -1], [-116580749049536069497368, -31868395054573493278170, -10383177724615955168890, -1615394096202361273185, -245152146093031333293, -29543405127212658064, -412547145864241521, -590608070231663955, 50256977890674110, 27019261047320319, -5357935068192207, 2482336757105530, -639270116555289, 144361057555383, -26780596660724, 3153303989877, -468924789381, -13315800857], [-464396716562452808324190, -114461929263992641354566, -38670595329535605423791, -5850450196503191312541, -909433856547434475246, -99814262517300381347, 458413780959705585, -2629925749006371672, 265594891716414313, 99047133357274653, -22536757427037804, 10141182689344577, -2680955378956353, 629547150035334, -124540717085305, 16444663818747, -2313647830569, -9988724986], [-152377127259409722530328, -430033984255033874010, -5361947343016804551290, 255724465807000035615, 25498408347055087827, -4430882560499337104, 7662634801042297359, -942356588222826195, 68997473241627070, 59894778453147519, -25973820358208847, 8042682088562810, -2172786707640729, 462832600118583, -85460950299124, 12045789087477, -1343101290501, 87164256743], [1245115109834095486888434, 275503805564435814349710, 93994409721886472385205, 12290445346717856888085, 1845505158809816982444, 220985470955047942957, -10310230434880559517, 6695540736339845550, -818942256410141795, -263233836597346257, 71486092324490706, -29312743281552835, 8022621727128417, -1855377197024424, 359420053452287, -48031849953471, 6794583925713, -133776214024], [-235405553302236589374102, -44475396597257734186038, -15709959719493607025843, -1727428316646712567533, -279317041563965678850, -27391848724391882687, 3150072701260064121, -1310508564781732476, 201857339992033189, 43270860967811925, -14845223982533040, 5851869770644781, -1648336188413505, 387846820484274, -76601942339581, 10638858706899, -1450917493401, 52446298994], [3813712563302326219002, -3559151763419097933126, -819795063291250302091, -326430947106959972421, -47077444909330366434, -7267831316077867351, -976695734708706351, 28821123162823668, -25891808439339187, 1809063074792397, 1133477226885024, -295874142739883, 117512906055303, -30681598044558, 6901775515771, -1262052587301, 163188313455, -21375320078], [199640860819024447248348, -70753648528273560695226, -12207206554862892581756, -7117181122299752079501, -990121454810876979363, -167508341581618323878, -23349046402765226049, 1030133185737863223, -674901471527606372, 24017204040634599, 33114499458330843, -9715051369935808, 3608609672794371, -925913453445519, 203299474367714, -35551554518235, 4635014468847, -541960125439], [212969668982302808498208, -171979375753517328954702, -39181165677579006501362, -16779091826574927425787, -2346799132337023002099, -377463511820240057180, -49216645720002454899, 1583732185260697371, -1298754835431025034, 74121405106170957, 64956241358289639, -17966061030501766, 6877912344986733, -1776555936941415, 391725238900304, -70210606342593, 8981968251993, -1127380069015], [-1996318482980846059703850, -635242897576427569591086, -197573386582095247391561, -35944720093817458645821, -5464271441064704744856, -723407552850215487017, -24896233798916969715, -11085954006236786682, 428973285056160463, 482786678102726193, -66460058210998494, 36712882086841727, -8439376098995193, 1833523278864924, -311340631185475, 24220753702287, -3731737888569, -808888063876], [-373784798998292943161550, -24138398717057057304978, -14364505320239100864523, 1253947125370374952197, 179151384508592013372, 51466066663262063309, 15143000982058328595, -2077338202865906466, 579877899585645149, 44368602058199199, -34763086329172542, 11953379544648061, -3741100769912559, 898024623511272, -185999581724705, 29911777199121, -4149165254847, 345092458312], [1337459081995976438887752, 481867745763076562621934, 144664848834399811941214, 28787394897827919952419, 4317944756837326367991, 588423154770848237824, 30908442870423963219, 6462536782200803913, 248718149382532438, -404904968846267133, 39542883518250909, -22011683320753438, 4192191575165643, -825805139295093, 117611454367916, 865211681409, 295562583375, 835642665467], [7960137035704649359775016, 2249302688825050345047246, 717480309616191297923966, 119476843497180014922051, 18100214786711034759927, 2310366631251866702240, 50932386163964856147, 41024331746091476457, -2415443478244567018, -1940546540977081341, 344231952665490333, -159342061943449502, 38742333615652971, -8613482756881845, 1558368178227628, -162934882103391, 24078182823471, 1808290611835], [924100941905741907002202, 432691915800409583607828, 121499479051532528986043, 26992325841508720959108, 3878159588309020057455, 558273296575425407357, 40398257464466373474, 3837274780301664171, 656276595717482651, -329791798074569730, 6353319825171315, -9682825997402441, 683596606436760, 29980675117311, -59978426067029, 27222686370246, -2977298291364, 985735662991], [8722946418932296918730220, 1084363512444308889389358, 468263194752432099244628, 24184958895951049879143, 4523888170846831016073, 157323199889094758546, -231941394755648806845, 51706224065871399291, -10412611390104433204, -1278989065022301429, 664898634204218127, -250750351048317536, 74639272418675319, -17941342908716787, 3667883539275130, -553906196437551, 74078356177587, -4518126258467], [-2890887473171211341138220, -1814204302357830528047346, -500800627337151902170576, -122247938831166756829281, -17930646704571786099411, -2583581727335824053082, -219120055231244881485, -12987579818889790977, -4075878816920270872, 1201700843187897963, 99409102814805651, 4562272683547852, 8267812217474367, -2780896817102511, 797135476182310, -201658791233823, 24231887336811, -5301535780511], [-3260417988187224655284, 381974508700326322267302, 91141537205666036636012, 30646604467595396861907, 4447081725194280935973, 675768281049567568562, 78923554987170922287, -972733387961635041, 2010316302768900164, -208908924981034569, -85306117915969533, 20575975123994056, -8673974267785341, 2272911163990521, -519472989416822, 99424585969077, -12687264062385, 1807606890121]];
    Rf_basisdens := [1, 282429536481, 2837853609355218130560, 1418926804677609065280, 2837853609355218130560, 1418926804677609065280, 472975601559203021760, 109148215744431466560, 1418926804677609065280, 2837853609355218130560, 1418926804677609065280, 472975601559203021760, 709463402338804532640, 1418926804677609065280, 709463402338804532640, 2837853609355218130560, 2837853609355218130560, 945951203118406043520];
    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_252_j();"
function MakeCharacter_252_j()
    N := 252;
    order := 3;
    char_gens := [127, 29, 73];
    v := [3, 1, 3];
    // 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_252_j_Hecke();"
function MakeCharacter_252_j_Hecke(Kf)
    N := 252;
    order := 3;
    char_gens := [127, 29, 73];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 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, 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 := 4;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -10, 0, 0, 1, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0], [-3, 0, 3, 1, -1, -1, 0, 0, 0, 0, 0, 0, 1, 0, -1, 1, -1, -2], [-3, 0, 1, -1, 0, 0, 1, 2, 1, 0, 0, 1, -1, 1, 1, -1, 0, 2], [-7, 3, 0, 0, -1, -2, 1, 1, 0, 0, -1, 0, -1, 1, 1, -1, 0, 2], [-28, 0, 28, -1, -2, 0, -1, -1, -1, 0, 1, -3, 3, 0, -3, 2, -3, -2], [-1, 6, -33, -3, 3, 2, -1, 6, 1, -2, 2, -2, 4, -2, 0, 0, -3, -3], [-8, 7, 7, 4, 0, 0, 1, 8, -2, -3, -2, 1, 0, 0, 0, -3, 1, -2], [0, -3, -4, -8, 0, -5, 6, -8, 0, -1, 2, 0, 2, -2, 4, 2, -3, -2], [1, -15, 0, -6, -5, -3, 8, -18, 8, 1, -3, 6, -8, 0, 8, -3, 3, 2], [9, -29, -16, -3, 3, 4, -6, -3, -7, -7, 3, -3, 6, 1, 0, 0, -3, -3], [2, 3, -123, 0, 3, 1, 6, -12, 3, 4, -2, -1, -1, -1, 0, 0, 0, 0], [70, 21, 18, 13, 5, -4, -16, 50, 9, 7, 3, -2, 5, -5, -4, 5, -9, -12], [-39, -27, 53, 6, 0, 0, -3, 5, 3, 5, 1, -3, 5, 0, -5, -1, -3, -4], [8, -23, -38, 4, 4, 7, -18, -28, -5, 1, -5, -3, -6, 6, 0, 0, 4, 4], [-62, -7, 80, 30, -6, -1, -1, 49, -9, 9, 8, -6, 0, 0, 0, 9, -7, 7], [179, 27, 18, 1, 1, 4, 8, 47, 0, -2, -9, -2, -7, 7, 3, -7, 18, 4], [-7, 39, -9, -6, 10, 5, 8, -4, -9, 0, -2, 0, -2, 2, 2, -2, 9, -8], [38, -91, -15, 3, -4, -11, -11, -48, -7, 8, 0, 1, -3, -7, 0, 0, 3, 3], [-4, 24, -84, 9, 9, -7, -13, -21, 0, 7, -2, -16, 7, 2, 0, 0, 9, 9], [137, 21, 30, 0, -13, -19, 3, 74, 12, 10, -3, -8, 5, -5, -4, 5, -12, 0], [48, -117, 90, -5, -1, -11, 5, -55, -14, 1, 13, -7, 21, -7, 0, 0, -5, -5], [-12, 51, -183, -21, -21, -10, 28, 48, 23, 9, 23, 19, 13, -20, 0, 0, -21, -21], [213, 31, -205, 47, 8, 11, 10, 74, -20, -12, -20, 7, -8, 0, 8, -2, 18, -1], [271, 48, 57, 3, -4, 14, -18, 141, 21, 24, 15, 6, 9, -9, 4, 9, -3, 1], [-76, 88, 12, 17, 19, 33, -30, 56, 3, 24, 13, 16, -3, 3, -6, -3, -2, 0], [-206, -57, 206, -21, 7, 3, -13, -94, 20, 9, 1, -9, 18, 0, -18, 11, -6, -14], [-147, 19, -49, -30, -36, -16, 34, -104, -36, 8, -4, -17, 13, -13, -7, 13, -2, 6], [92, -84, -39, 26, 4, 30, 5, 37, -7, 8, -16, -21, 2, 0, -2, 1, 9, 12], [-73, 189, -97, 12, -24, -7, -23, 18, 24, 25, 7, 5, -2, 20, 0, 0, 12, 12], [52, 69, -52, -21, -18, 21, 27, 102, -36, -18, -9, -12, -27, 0, 27, -9, 9, 39], [-534, -57, 569, 38, -20, -27, 11, 47, 21, 26, 28, 18, -30, 0, 30, -25, -9, 31], [37, -126, 206, -1, -25, -15, -21, -41, -20, -2, 14, 12, 12, 7, 0, 0, -1, -1], [53, -50, -21, -42, 13, -35, -8, 47, 19, 18, -2, 40, 5, 0, -5, 2, 5, -42], [371, 66, -21, 129, 10, 20, -133, -25, -12, 3, 4, 21, -17, 17, 26, -17, 21, 28], [-577, -63, 626, -32, -4, 6, -17, 57, -13, 4, -9, -27, 47, 0, -47, 15, -21, -50], [6, -48, -1159, -9, 21, 41, 18, 6, -16, -30, -16, 4, -11, 16, 0, 0, -9, -9], [792, 42, 41, 15, 43, 22, -24, 115, 14, 12, 9, -13, 22, -22, -38, 22, -12, -78], [-473, -36, 34, 131, 38, 30, -131, 60, 30, -20, 0, 30, -30, 30, 24, -30, 24, 22], [87, -186, -745, -45, -21, -31, 39, -51, 7, 9, 40, 26, 55, -40, 0, 0, -45, -45], [-460, -138, 516, -90, -14, -9, 12, -12, 40, 45, 36, 7, -46, 0, 46, -31, -2, 73], [1460, -234, -9, -91, 2, -49, 88, -90, 27, -51, 3, -9, 12, -12, 22, 12, -21, -23], [103, 38, -44, 3, 17, -34, 15, -69, -30, -14, -18, -34, 16, -16, -22, 16, -4, -67], [82, -103, -10, -63, 0, 47, -28, 55, -27, 18, 8, -75, 48, 0, -48, 21, -28, 7], [-82, 157, 609, -1, 48, 14, 23, 187, -13, -67, -28, -19, 24, 17, 0, 0, -1, -1], [-139, 297, -1543, 18, -39, 29, -98, 75, 32, 13, -24, 45, -53, 57, 0, 0, 18, 18], [459, 142, -599, -84, -43, 28, 16, -286, -10, -90, -53, -55, 64, 0, -64, 13, -27, -89], [659, -24, -77, 56, 61, 40, -68, -172, -14, 3, 12, 7, 5, -5, -66, 5, -45, -59], [-876, 0, 842, 56, -39, 12, 81, -113, 23, -43, -61, 30, -62, 0, 62, -38, 42, 13], [-61, 274, -63, -37, 30, -7, -94, 67, 62, 23, 35, -28, 69, -40, 0, 0, -37, -37], [2048, 45, -113, -87, -27, -72, 105, -223, -50, -21, -18, -8, -10, 10, 46, -10, 0, 29], [-1261, 255, 1150, -69, -58, 87, 82, -14, -80, -111, -64, -63, -42, 0, 42, -38, 24, 65], [24, -147, -1537, -33, -90, 1, 91, -12, -17, -6, 58, 65, 23, 23, 0, 0, -33, -33], [1672, -288, -84, 81, 25, 52, -129, -287, 6, -31, 48, 35, 13, -13, 1, 13, -30, -3], [1791, -503, -160, -147, -36, -52, 232, -545, -57, -178, -85, -17, -68, 68, 65, -68, 115, 87], [-105, 330, 1341, -29, -70, -62, -49, 83, 70, 55, 79, 20, 84, -16, 0, 0, -29, -29], [-108, 168, -2035, -21, 69, 54, -25, 492, -63, -165, 30, -78, 45, -21, 0, 0, -21, -21], [146, -123, -97, 253, -62, -79, 63, 12, 62, 69, 39, 80, -103, 0, 103, 17, 1, 63], [-2787, 264, 2753, 229, 14, -9, -20, 299, -93, 2, 43, 3, -17, 0, 17, 53, -6, 51], [-338, -327, -125, 47, 17, 12, -47, -387, -36, -29, 0, -60, 60, -60, -156, 60, -84, -137], [-2713, 96, 2761, 116, 14, 0, -74, 309, -75, 21, 75, -60, 59, 0, -59, 0, -60, 16], [-290, 669, -1004, 27, 37, -47, -127, 447, 68, -55, -111, 47, -21, 33, 0, 0, 27, 27], [-10, -207, -308, 66, -123, -19, 75, 27, -93, -29, 16, 41, -71, 83, 0, 0, 66, 66], [-184, 368, 2153, -32, -74, -88, 114, 530, 21, -75, 64, 42, 81, -29, 0, 0, -32, -32], [2130, -613, -1784, 39, -7, 26, 59, 220, 62, 78, -91, 26, -20, 0, 20, -44, 52, -45], [-4364, -72, 4414, 147, -24, -48, 3, 90, 34, 59, 78, 27, -60, 0, 60, -42, -21, 90], [-304, 760, 444, 86, -66, -166, 188, 418, 104, 50, -76, 56, -66, -4, 0, 0, 86, 86], [-1, 42, 1227, 9, 36, -99, 4, 369, -14, -59, 23, -68, 33, -116, 0, 0, 9, 9], [2028, 207, -189, -274, -56, 31, 250, -360, -99, 24, 24, 72, -48, 48, 122, -48, 57, 176], [-52, 34, -138, 26, -96, 44, -373, -47, -13, 26, 26, 44, -75, 65, 0, 0, 26, 26], [652, -255, -686, -320, 57, -25, -108, -507, 139, 126, 141, -26, 18, 0, -18, 42, -51, 98], [1878, 354, 59, -209, -46, -43, 238, 251, -18, 8, -29, 33, -62, 62, 167, -62, 120, 141], [-2412, 105, 2629, -100, 10, -54, -13, 922, -156, 19, -22, 51, 38, 0, -38, 43, -3, -114], [-91, 219, -1463, 9, -24, -119, -302, 393, 36, -29, -20, 35, -7, -73, 0, 0, 9, 9], [587, -356, 102, -229, -101, -132, 228, 110, 60, -54, 1, -53, 54, -54, 63, 54, -17, -6], [-727, 579, 485, 114, 65, 33, -20, 59, -131, -152, -89, 12, 64, 0, -64, 50, 45, -120], [-1161, -565, 1416, 337, 158, 211, -148, -104, 6, 75, -22, -201, 160, 0, -160, -2, 10, 29], [-3763, -9, 3867, -156, -80, -6, 134, 356, -42, -58, -107, 60, -81, 0, 81, -76, 54, -32], [195, 55, -1311, -25, 100, -93, -26, -713, 172, 277, 26, -101, 111, -133, 0, 0, -25, -25], [1500, 330, 34, 318, 37, 103, -381, 174, 43, 137, 63, 87, -24, 24, -55, -24, -102, 74], [3788, -427, 27, 100, -47, -35, -68, -91, -9, -99, -32, -79, 47, -47, -11, 47, 65, -79], [-186, 306, 580, -3, 111, 165, -240, 756, -81, -237, -12, -96, -90, -27, 0, 0, -3, -3], [295, -495, -1723, -54, 39, 97, -597, -477, -13, 92, 136, -121, 32, -100, 0, 0, -54, -54], [1617, -840, 60, -113, -227, -227, 260, -212, 69, -184, -147, -70, -77, 77, 46, -77, 36, 234], [-71, 60, 180, 43, 96, 146, 487, 101, -108, -117, -5, -134, -18, 80, 0, 0, 43, 43], [49, -618, 1030, 63, -216, -92, 149, -72, -199, -97, 31, 122, 41, 197, 0, 0, 63, 63], [-1934, -432, 2266, -77, 24, -142, -45, 489, 25, 150, -21, 121, 87, 0, -87, 156, -21, -250], [2720, 573, 4, -65, 129, -18, 59, 262, -32, 94, 6, -55, 61, -61, -112, 61, -81, -245], [-86, 303, -887, 24, 99, 83, 352, -240, 25, 38, -42, -81, 31, 81, 0, 0, 24, 24], [1631, 621, 6, 135, -85, -308, -74, 265, 30, 90, -61, -6, -55, 55, 91, -55, -150, 134], [-3566, -567, 3464, -355, -141, -105, 63, -1215, 327, 96, 54, 27, -39, 0, 39, 33, -78, -12], [-519, 905, 214, -549, -190, 35, 56, 322, -268, -219, 14, -169, 64, 0, -64, 22, -134, -15], [-1189, 603, -34, -313, 68, -88, 196, 203, 29, 206, 117, 1, 116, -116, -91, 116, -297, -183], [-230, -42, 478, 399, -145, -21, -8, 767, -141, 68, 124, -132, 37, 0, -37, 2, -153, 66], [-2904, -369, -23, -286, -45, -99, 448, -193, -59, -123, -162, -173, 11, -11, -191, 11, 45, -139], [-2406, -472, -367, -16, 264, 390, -118, -989, -66, 11, 134, 95, 39, -39, -312, 39, -151, -208], [-378, -195, -133, 730, 153, 79, -726, -344, -24, -28, -4, -39, 35, -35, -218, 35, -96, -227], [928, -2002, -2655, 24, -128, -93, 179, -2292, -15, 477, -12, 116, -36, 35, 0, 0, 24, 24], [1944, 174, 613, 147, -80, -35, -192, 1392, 289, 149, 45, 27, 18, -18, 20, 18, -87, 89], [768, -969, -711, 18, 72, 72, -48, -1335, 375, 174, 60, -48, -36, 0, 36, -54, 24, 168], [249, -600, -487, 30, 291, 110, 426, -489, -71, -66, -281, -40, -77, 53, 0, 0, 30, 30], [317, -125, -106, -92, -371, -231, 280, 566, -28, -12, -122, 140, -67, 0, 67, 116, -91, -286], [78, 887, 227, -475, -213, -279, 524, 826, 15, 56, -49, 53, -102, 102, 477, -102, 194, 368], [99, 6, -6192, -216, 156, 70, 350, -147, 35, -51, 194, -134, 428, -68, 0, 0, -216, -216], [-5865, 405, 172, 93, 53, 131, -297, 521, 172, 99, 204, 328, -124, 124, 458, -124, 57, 399], [-3418, -132, 3468, -452, -422, 54, 122, -180, -116, -58, -18, -354, 196, 0, -196, 228, -300, -160], [-174, 460, 1117, 85, -19, -76, -202, 413, 45, 12, -44, -22, -135, -63, 0, 0, 85, 85], [-3925, 919, 3480, -234, 76, -86, -125, -49, -107, -36, 187, 37, -13, 0, 13, 119, -49, 114], [-1478, 331, -119, 88, 111, 147, -260, -88, -102, 118, 172, -17, 189, -189, -42, 189, -50, -317], [2559, -156, -3093, 611, 48, 72, 51, -2047, 401, -93, -8, 27, -142, 0, 142, -229, 99, 206], [1025, -2314, -1610, -211, 231, -87, 179, -1286, -143, 4, 2, -22, 363, -168, 0, 0, -211, -211], [-3745, 1767, 237, 498, 216, 294, -642, 1182, -54, 462, 144, -21, 165, -165, -309, 165, -138, -402], [-445, 1458, -240, -3, 189, -24, -125, 654, 217, 16, -52, -134, 48, -116, 0, 0, -3, -3], [393, 527, -581, -828, 98, -58, -37, 259, -43, -69, 65, 119, -89, 0, 89, -167, 61, 96], [-3665, 225, 757, 461, -87, -114, -413, 1732, 307, 175, -48, -127, 79, -79, -220, 79, -159, -119], [7535, -525, -7204, -572, -78, -114, 159, 421, 147, 151, 56, 195, -296, 0, 296, -218, 81, 238], [-1229, 3387, -5639, 135, 27, -269, -745, 1587, 384, 74, -1, -161, 116, -44, 0, 0, 135, 135], [-2953, -1148, 3693, -333, 154, -5, -98, 749, 85, 360, 61, 61, -19, 0, 19, 77, 56, 75], [271, -731, 2292, 32, -274, -107, 63, -1634, 18, 357, 17, 225, 126, 308, 0, 0, 32, 32], [287, -330, 7041, -129, -354, -140, 312, -612, 197, 379, 333, 150, 53, -195, 0, 0, -129, -129], [6230, 54, 335, -695, -205, -100, 863, 675, 101, -65, -168, 42, -210, 210, 214, -210, 240, 457], [-206, -111, 9447, 316, -393, -409, -47, 116, -330, -33, 214, -137, 198, 284, 0, 0, 316, 316], [884, -408, 1090, 412, 226, 166, -736, 2310, 676, 212, 324, 120, 204, -204, -76, 204, -354, -310], [88, -380, -934, 24, 328, 212, 398, 270, -260, -326, -36, -316, 84, 28, 0, 0, 24, 24], [838, 2274, -215, 430, -123, 54, -277, 287, -422, 273, -153, -8, -145, 145, 133, -145, 348, 260], [-150, -66, 2182, 192, -84, 414, 843, 33, -153, -78, -168, 60, -621, 237, 0, 0, 192, 192], [-8603, 1432, 7997, 384, 249, -446, -428, 362, -78, -66, 337, 267, 270, 0, -270, -9, -179, -379], [-402, 88, -115, -171, -524, -521, 504, -279, -216, -202, -333, -161, -172, 172, 385, -172, 358, 535], [-2917, -666, 2858, 265, 578, -54, -425, -1137, 431, 202, 132, 207, 140, 0, -140, -183, 153, -62], [6245, 1096, -6804, -363, 97, 94, -20, -280, -236, -177, -95, -17, 38, 0, -38, 377, 77, -39], [-292, 2743, 795, 311, 296, 410, -610, 2758, 219, 618, 299, 307, -8, 8, 242, -8, 46, 19], [7112, -624, -6558, -584, -102, -252, -114, 974, 6, 392, 298, 36, 32, 0, -32, 236, -216, 14], [-5332, 1270, 4484, 865, 247, 15, -146, -937, -85, -282, -116, 86, 161, 0, -161, 218, 101, -262], [-11448, 273, 690, 397, -13, 17, -478, 1590, 384, -30, 81, 348, -267, 267, 712, -267, 300, 628], [4158, -1917, -2923, -34, -124, -194, 207, 1272, 166, 417, -210, 277, -80, 0, 80, 187, 83, -324], [1394, -648, -902, 149, 390, -42, -240, 799, 127, 438, 344, 192, -254, 0, 254, -143, 150, 556], [-3668, -3, -94, 692, 3, -90, -263, -247, -256, -343, -429, -227, -202, 202, -32, -202, 534, -28], [4597, -1020, -389, 356, 138, -166, -618, -1066, 21, 7, 262, -168, 430, -430, -346, 430, -606, -736], [217, -471, 12493, -333, 168, -87, -582, -177, 0, -169, 128, 37, 699, -17, 0, 0, -333, -333], [-5058, 718, 4602, -230, 146, 324, -146, -526, -138, -384, -74, -324, 220, 0, -220, -410, 0, 30], [11970, -1014, 1090, -232, -85, 167, 223, 1956, 505, 17, 9, -69, 78, -78, -233, 78, -6, -62], [447, 669, 242, 769, -307, -631, -671, 851, 36, 209, -98, -336, 238, -238, -178, 238, -375, -267], [1158, -2649, -6981, -69, 468, 520, -85, -1995, -201, 39, -330, -69, -322, -9, 0, 0, -69, -69], [-616, 995, 3407, -107, -617, -268, 114, 1850, 15, -195, 457, 267, 153, -62, 0, 0, -107, -107], [-736, 1779, 17434, -141, -93, 148, 817, 1596, 343, -119, -145, 379, -349, -104, 0, 0, -141, -141], [4984, 1074, -6192, -1249, 210, 139, 165, -2445, 239, -417, -309, 236, -231, 0, 231, -39, 375, 61], [-13634, 201, -883, 696, -82, 257, -792, -1900, -523, 140, 96, -98, 194, -194, -334, 194, -75, -210], [-5269, 649, 4732, 272, -116, -208, 157, -727, 123, -357, -248, 249, 50, 0, -50, -202, 41, -506], [-8245, -444, -320, -269, -173, -362, -232, -702, 112, 86, 501, 207, 294, -294, 647, 294, -423, 86], [-4547, 3426, 1468, -466, -56, 55, 323, 4450, 384, 751, 143, 174, -31, 31, 385, -31, 123, 261], [961, 1437, -1047, -497, -6, -63, 90, 2070, -460, -158, 126, 147, -300, 0, 300, -264, 84, 363], [-716, 2392, -8729, -35, 390, 342, -218, -346, 494, 251, -383, 28, -111, 189, 0, 0, -35, -35], [-827, 2100, 2604, 261, -117, -405, 155, 1101, 210, 104, -118, -26, -90, 1, 0, 0, 261, 261], [10863, -2787, -337, 112, -378, -542, 258, -1766, -54, -586, -370, -441, 71, -71, -353, 71, -84, -134], [1169, -3312, 15441, -417, 108, 628, 324, -834, -471, -419, 277, 32, 137, -37, 0, 0, -417, -417], [2533, -1092, 244, -1258, 107, 366, 1174, 75, 216, -47, 84, 81, 3, -3, -261, 3, -60, -29], [17837, 654, -17973, 1663, -242, -216, -286, 558, -206, 8, 426, -312, 388, 0, -388, 42, -528, -178], [-826, 648, 5167, 258, -414, 131, 987, 1644, -269, -467, -310, 466, -620, 493, 0, 0, 258, 258], [-12790, -390, -175, 37, 847, 730, 113, -563, 41, -351, -150, 278, -428, 428, -230, -428, 372, -141], [4965, -3287, -3418, 1208, -115, -247, 4, 233, 619, 873, 235, 136, -128, 0, 128, 94, -111, 116], [-6220, -951, -772, 750, 92, 98, -1014, -1988, -133, 6, 264, 62, 202, -202, -222, 202, -450, -232], [8685, -291, -8679, -169, 209, 255, -227, -518, 40, -3, 65, -273, 180, 0, -180, -167, -18, 140], [52, -849, 22981, -300, 189, -73, -287, 1197, -378, -748, 122, -11, 748, 64, 0, 0, -300, -300], [-4478, -1270, 763, 51, 219, 328, -268, 1217, 528, 118, 217, -25, 242, -242, -572, 242, -436, -486], [-750, 2136, 9970, 165, 3, 153, 333, -258, 390, 348, -312, 144, -369, 258, 0, 0, 165, 165]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_252_j_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_252_4_j_b();".
// 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_252_4_j_b(:prec:=18)
    chi := MakeCharacter_252_j();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    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_252_4_j_b();".
// 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_252_4_j_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_252_j();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<5,R![52444912836996, -83327262188598, 321478263979821, 139000635955458, 811474750097325, -296960546362968, 116976039417180, -10572760083708, 1852923139029, -47486544840, 17780999634, -185166486, 94605300, 281502, 352323, 1368, 738, 6, 1]>],Snew);
    return Vf;
end function;