
// Make newform 1521.4.a.bc in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1521_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_1521_4_a_bc();".
// 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_1521_4_a_bc();".
// 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 := [4992, 0, -4210, 0, 805, 0, -52, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0], [-13, 0, 1, 0, 0, 0, 0, 0], [0, 210, 0, -35, 0, 1, 0, 0], [0, -546, 0, 51, 0, -1, 0, 0], [-688, 0, 426, 0, -43, 0, 1, 0], [156, 0, -33, 0, 1, 0, 0, 0], [0, -1590, 0, 547, 0, -46, 0, 1]];
    Rf_basisdens := [1, 1, 1, 16, 16, 16, 2, 16];
    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_1521_a();"
function MakeCharacter_1521_a()
    N := 1521;
    order := 1;
    char_gens := [677, 847];
    v := [1, 1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

function MakeCharacter_1521_a_Hecke(Kf)
    return MakeCharacter_1521_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 := 4;
    raw_aps := [[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [-3, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 1, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0], [0, -13, 0, 0, -2, 0, 0, 1], [31, 0, 6, 0, 0, -1, -1, 0], [0, -11, 0, 5, -2, 0, 0, -1], [0, 10, 0, -1, 6, 0, 0, 0], [28, 0, 8, 0, 0, 6, 3, 0], [126, 0, 12, 0, 0, 7, -2, 0], [0, 49, 0, 6, -4, 0, 0, 1], [11, 0, -26, 0, 0, -7, 0, 0], [0, -33, 0, 11, 2, 0, 0, 1], [0, -60, 0, 19, 2, 0, 0, -6], [0, 2, 0, 6, -4, 0, 0, -6], [148, 0, -10, 0, 0, -15, -3, 0], [-273, 0, -30, 0, 0, 1, -8, 0], [0, 131, 0, 11, -14, 0, 0, 1], [-273, 0, 6, 0, 0, -8, 12, 0], [234, 0, 16, 0, 0, 0, -5, 0], [0, 51, 0, -13, -8, 0, 0, 7], [0, -44, 0, 32, -24, 0, 0, 8], [-558, 0, 58, 0, 0, 48, -1, 0], [0, 4, 0, -81, 8, 0, 0, -8], [435, 0, -96, 0, 0, -5, -10, 0], [0, -263, 0, 25, 4, 0, 0, 1], [596, 0, -8, 0, 0, 20, 23, 0], [0, 77, 0, 4, -20, 0, 0, -15], [84, 0, -80, 0, 0, 30, -11, 0], [0, -72, 0, 28, 24, 0, 0, 8], [0, 143, 0, 62, 24, 0, 0, 15], [644, 0, -4, 0, 0, -2, 31, 0], [0, 344, 0, -67, -10, 0, 0, 14], [-547, 0, 96, 0, 0, 63, -29, 0], [-630, 0, -124, 0, 0, 77, 25, 0], [454, 0, 44, 0, 0, 24, 23, 0], [0, 124, 0, 124, 52, 0, 0, -40], [0, 110, 0, 2, -10, 0, 0, -40], [0, -239, 0, -71, -4, 0, 0, 33], [1418, 0, -150, 0, 0, -81, 12, 0], [0, -550, 0, -114, -24, 0, 0, 42], [1237, 0, -172, 0, 0, 90, 46, 0], [0, -194, 0, 46, -28, 0, 0, -34], [2983, 0, -36, 0, 0, -61, 24, 0], [-22, 0, -36, 0, 0, -168, 7, 0], [-2306, 0, -92, 0, 0, -62, 50, 0], [0, 47, 0, 7, 20, 0, 0, -49], [-1106, 0, 30, 0, 0, -70, -18, 0], [0, -24, 0, 44, 8, 0, 0, 20], [0, -1191, 0, 149, -62, 0, 0, -21], [1511, 0, 286, 0, 0, 194, -13, 0], [0, 620, 0, 120, -24, 0, 0, 16], [0, -515, 0, 162, -14, 0, 0, -37], [0, 631, 0, -93, -138, 0, 0, -55], [0, -1138, 0, 54, 94, 0, 0, 12], [1436, 0, -436, 0, 0, -218, -53, 0], [1432, 0, -494, 0, 0, 85, -26, 0], [0, -819, 0, 76, -96, 0, 0, 57], [1735, 0, -74, 0, 0, 25, 48, 0], [0, -166, 0, 259, 16, 0, 0, 78], [-2579, 0, 114, 0, 0, -133, -6, 0], [0, -537, 0, -49, 26, 0, 0, -35], [1078, 0, 94, 0, 0, 16, 57, 0], [0, -24, 0, -273, 44, 0, 0, -56], [-552, 0, 400, 0, 0, -150, 7, 0], [1883, 0, 358, 0, 0, -16, 84, 0], [0, -1921, 0, 27, 16, 0, 0, -37], [1428, 0, 184, 0, 0, 180, -139, 0], [0, -485, 0, -614, 126, 0, 0, -47], [0, -783, 0, -207, 18, 0, 0, -69], [2573, 0, -24, 0, 0, 309, -74, 0], [4476, 0, 134, 0, 0, 53, -51, 0], [4040, 0, 336, 0, 0, -18, -43, 0], [0, 386, 0, -46, 264, 0, 0, -34], [0, 804, 0, 125, 182, 0, 0, 158], [44, 0, -660, 0, 0, 120, -111, 0], [0, -2021, 0, 130, 92, 0, 0, 3], [191, 0, -324, 0, 0, -234, -50, 0], [0, 1438, 0, 254, 208, 0, 0, -138], [5156, 0, 64, 0, 0, -439, 37, 0], [0, -1043, 0, 601, -42, 0, 0, 87], [-1385, 0, 174, 0, 0, 38, -218, 0], [2313, 0, -292, 0, 0, 29, -220, 0], [0, -360, 0, -640, 120, 0, 0, -116], [0, -664, 0, -272, -28, 0, 0, 44], [-2579, 0, -370, 0, 0, 222, 14, 0], [0, 1358, 0, -819, 42, 0, 0, 92], [2413, 0, -68, 0, 0, 49, -58, 0], [0, 1209, 0, 637, -16, 0, 0, -135], [0, -224, 0, -404, 84, 0, 0, 12], [-4625, 0, -432, 0, 0, 29, 137, 0], [0, 1435, 0, 123, 200, 0, 0, -53], [1012, 0, 780, 0, 0, 356, 104, 0], [0, -2011, 0, -211, -110, 0, 0, -157], [0, -1112, 0, -177, -40, 0, 0, 212], [0, -1413, 0, 244, 138, 0, 0, 109], [5735, 0, -82, 0, 0, 79, 239, 0], [476, 0, 438, 0, 0, -357, -229, 0], [-5275, 0, -1130, 0, 0, -445, 80, 0], [0, 574, 0, -863, 40, 0, 0, -38], [0, -1096, 0, 796, 416, 0, 0, 4], [0, -4022, 0, 982, -234, 0, 0, -164], [-4439, 0, 622, 0, 0, 313, -203, 0], [4343, 0, 162, 0, 0, 516, 207, 0], [0, 4156, 0, -108, -224, 0, 0, -104], [0, -1569, 0, -942, 154, 0, 0, -91], [0, 270, 0, -794, -252, 0, 0, -66], [10893, 0, -156, 0, 0, 16, 127, 0], [4544, 0, 708, 0, 0, -456, 168, 0], [6800, 0, -800, 0, 0, 35, -1, 0], [0, 2273, 0, -214, -50, 0, 0, -301], [-838, 0, -968, 0, 0, -484, -51, 0], [12534, 0, 88, 0, 0, -144, -149, 0], [0, -565, 0, -782, -352, 0, 0, 39], [6962, 0, -224, 0, 0, 344, -305, 0], [0, -3392, 0, 464, -348, 0, 0, 212], [0, -3770, 0, -1222, 306, 0, 0, -140], [0, 470, 0, -242, 284, 0, 0, 194], [-16658, 0, 946, 0, 0, -29, 267, 0], [-5377, 0, -922, 0, 0, -314, 54, 0], [0, -3942, 0, 870, -18, 0, 0, -92], [0, 2570, 0, 122, 640, 0, 0, -2], [7751, 0, 530, 0, 0, -647, 514, 0], [0, 3498, 0, -134, -302, 0, 0, 124], [4256, 0, 1252, 0, 0, -7, 125, 0], [0, 326, 0, 1270, 20, 0, 0, -206], [41, 0, 1460, 0, 0, -743, -16, 0], [11696, 0, 1192, 0, 0, 89, -411, 0], [-17254, 0, 2080, 0, 0, 14, 286, 0], [0, -3314, 0, 602, -260, 0, 0, -46], [12745, 0, 292, 0, 0, 739, -53, 0], [16070, 0, 696, 0, 0, -396, -140, 0], [0, 596, 0, -168, -40, 0, 0, 32], [-6188, 0, -854, 0, 0, 532, 60, 0], [0, 2942, 0, 30, 354, 0, 0, 296], [9964, 0, 84, 0, 0, 614, 25, 0], [0, -4798, 0, -958, 12, 0, 0, 34], [0, -947, 0, -164, 70, 0, 0, -245], [-436, 0, -2384, 0, 0, -550, 55, 0], [0, 2050, 0, 42, -98, 0, 0, 152], [5532, 0, 140, 0, 0, -736, 436, 0], [0, 846, 0, 250, -156, 0, 0, 290], [-8280, 0, 2080, 0, 0, 729, -47, 0], [0, -1372, 0, -876, -416, 0, 0, 392], [-1198, 0, 458, 0, 0, 391, 19, 0], [0, -4587, 0, -86, -172, 0, 0, -475], [10631, 0, 1618, 0, 0, -355, 176, 0], [0, 3357, 0, -171, 474, 0, 0, -233], [-1258, 0, -1862, 0, 0, -127, -32, 0], [0, 4543, 0, -206, 202, 0, 0, 413], [-14914, 0, -1036, 0, 0, -164, 693, 0], [0, -1670, 0, -2, -160, 0, 0, 86], [20546, 0, 1416, 0, 0, 342, 230, 0], [0, -3744, 0, -208, 708, 0, 0, -224], [6668, 0, -1808, 0, 0, -244, -192, 0], [0, -3235, 0, -1356, -398, 0, 0, -517], [-109, 0, -274, 0, 0, -752, 407, 0], [0, -486, 0, -870, 1170, 0, 0, 4], [0, 3622, 0, 2530, -280, 0, 0, 206], [0, 2246, 0, 1182, -98, 0, 0, 260], [4975, 0, 1704, 0, 0, 845, 873, 0], [0, 578, 0, -2754, -64, 0, 0, 78], [0, -6857, 0, -154, 552, 0, 0, -269], [0, 7242, 0, -1142, -236, 0, 0, 270], [7749, 0, -224, 0, 0, -309, -253, 0], [17546, 0, 386, 0, 0, -1073, -21, 0], [-22354, 0, 786, 0, 0, -972, 155, 0], [0, -5772, 0, -507, 538, 0, 0, 394], [0, 831, 0, 763, -952, 0, 0, 327], [6734, 0, 2906, 0, 0, 697, -168, 0], [0, -7438, 0, 1958, 424, 0, 0, -210], [-1349, 0, 1986, 0, 0, -400, 488, 0], [15096, 0, 288, 0, 0, 1096, 836, 0], [0, 6047, 0, 278, 762, 0, 0, -747], [-17089, 0, -1698, 0, 0, -195, 920, 0], [0, 1938, 0, -1551, -142, 0, 0, -124], [-950, 0, 184, 0, 0, -764, -451, 0], [1600, 0, -2220, 0, 0, 140, 89, 0], [-8161, 0, 2132, 0, 0, -131, 221, 0], [0, -426, 0, 222, 844, 0, 0, -230], [-14868, 0, -1200, 0, 0, -311, 465, 0], [0, 2370, 0, -914, 542, 0, 0, 60], [0, 4159, 0, -141, 642, 0, 0, -491], [0, 8684, 0, -403, 12, 0, 0, 72], [-12544, 0, 544, 0, 0, 1232, -121, 0], [18038, 0, -528, 0, 0, -1218, -198, 0], [7369, 0, 354, 0, 0, 326, 786, 0], [0, -8623, 0, -55, 114, 0, 0, 795], [17073, 0, -1608, 0, 0, -344, 112, 0], [0, -607, 0, 3153, 544, 0, 0, -243], [13755, 0, -3114, 0, 0, -35, -560, 0], [0, 1438, 0, 1302, 628, 0, 0, 638], [0, 1001, 0, 1417, -1348, 0, 0, 193], [0, 3676, 0, 12, -520, 0, 0, -452], [18829, 0, -1242, 0, 0, 740, 64, 0], [8918, 0, -5438, 0, 0, -1759, -43, 0], [0, 13137, 0, 170, -266, 0, 0, 383], [0, -3906, 0, 1922, -876, 0, 0, 314], [0, 4634, 0, 401, 108, 0, 0, 102], [19720, 0, 1264, 0, 0, 946, 643, 0], [-34236, 0, 3032, 0, 0, -1111, -423, 0], [27537, 0, 920, 0, 0, -1432, 20, 0], [0, 6661, 0, -911, -432, 0, 0, 141], [0, -4214, 0, 1295, 430, 0, 0, -824], [27071, 0, 144, 0, 0, 543, -50, 0], [0, 356, 0, 2580, -1652, 0, 0, 132], [0, 5857, 0, 722, -350, 0, 0, -665], [52246, 0, -976, 0, 0, 246, 66, 0], [-27117, 0, -50, 0, 0, -246, -98, 0], [0, -222, 0, 914, 1082, 0, 0, -20], [15691, 0, 2152, 0, 0, 1807, -146, 0], [0, 12143, 0, -193, -592, 0, 0, 279], [0, 794, 0, -2382, 416, 0, 0, -326], [-21299, 0, -1070, 0, 0, 1606, -359, 0], [936, 0, 4548, 0, 0, 2158, 51, 0], [0, 7739, 0, -562, -924, 0, 0, -49], [0, 13408, 0, -1728, 64, 0, 0, 84], [0, -114, 0, -146, -538, 0, 0, -612], [14914, 0, 2532, 0, 0, -1237, 1047, 0], [34726, 0, -1340, 0, 0, -836, -301, 0], [0, -813, 0, 1760, 838, 0, 0, -383], [-26480, 0, 7104, 0, 0, 854, 649, 0], [0, -365, 0, 1603, -136, 0, 0, 1187], [-452, 0, -536, 0, 0, -737, 371, 0], [0, 4261, 0, 454, -142, 0, 0, 659], [0, 8468, 0, -1996, -12, 0, 0, -220], [17000, 0, -1940, 0, 0, -10, 281, 0], [0, 4902, 0, 3666, 580, 0, 0, -258], [244, 0, -1510, 0, 0, 1335, 607, 0], [-728, 0, 100, 0, 0, -1346, 421, 0], [9332, 0, 1664, 0, 0, -788, -832, 0], [0, -801, 0, -2568, -1776, 0, 0, -885], [16676, 0, -296, 0, 0, 1718, -631, 0], [0, 10530, 0, -3590, 1008, 0, 0, -278], [-38926, 0, -938, 0, 0, -2908, -1109, 0], [0, 3682, 0, -2055, -1140, 0, 0, -462], [0, -6232, 0, -4712, 832, 0, 0, -580], [0, -12611, 0, -2687, 394, 0, 0, -937], [0, 1813, 0, -3247, -2404, 0, 0, -299], [15379, 0, 4230, 0, 0, -2869, 115, 0], [16193, 0, -1588, 0, 0, -3833, 803, 0], [16132, 0, -2658, 0, 0, -1855, 365, 0], [0, 4559, 0, -2732, -524, 0, 0, 39], [0, 6558, 0, -726, -944, 0, 0, -782], [56000, 0, -756, 0, 0, 342, 1075, 0], [0, 358, 0, 906, 1900, 0, 0, 690], [-9153, 0, 1034, 0, 0, 485, 92, 0], [0, 5317, 0, 1781, 718, 0, 0, -853], [35976, 0, 1720, 0, 0, -1320, 307, 0], [0, -1754, 0, -1978, -1074, 0, 0, -948], [0, -1650, 0, -2846, -8, 0, 0, 302], [-4189, 0, 5302, 0, 0, 1916, -220, 0], [0, -8934, 0, -3082, -1000, 0, 0, 802], [0, -2989, 0, 2007, -216, 0, 0, 167], [-21946, 0, -5504, 0, 0, -1684, 76, 0], [7989, 0, 5634, 0, 0, -1439, -939, 0], [0, 2826, 0, 2554, 534, 0, 0, 1288], [-28543, 0, -2698, 0, 0, 2326, 753, 0], [29818, 0, 3120, 0, 0, 1550, 1394, 0], [0, 8182, 0, -1450, 864, 0, 0, -1438], [-5366, 0, 1778, 0, 0, -2727, 1073, 0], [-15884, 0, 4442, 0, 0, 885, 837, 0], [0, 13733, 0, -1074, 432, 0, 0, 721], [12041, 0, -718, 0, 0, -2765, -714, 0], [0, 8966, 0, 2826, 992, 0, 0, -442], [0, 4485, 0, 3794, -1558, 0, 0, -113], [15799, 0, 2094, 0, 0, 1787, 951, 0], [0, -2416, 0, 2085, -800, 0, 0, -876], [-39588, 0, -2214, 0, 0, -1859, 381, 0], [-27870, 0, -5096, 0, 0, 60, -351, 0], [13855, 0, 612, 0, 0, 836, -323, 0], [2984, 0, -4956, 0, 0, 2748, 384, 0], [-35362, 0, -2270, 0, 0, -124, -1401, 0], [65115, 0, -8796, 0, 0, -383, -887, 0], [0, -10816, 0, 24, -1528, 0, 0, 376], [55454, 0, 2092, 0, 0, -565, 206, 0], [6337, 0, 6206, 0, 0, 156, -1056, 0], [0, -20077, 0, -4257, 1832, 0, 0, -105], [0, -1211, 0, -5595, 1334, 0, 0, -353], [-59544, 0, -1132, 0, 0, 644, -808, 0], [0, 16392, 0, 4736, 224, 0, 0, -436], [-20806, 0, -3050, 0, 0, -1621, -185, 0], [42189, 0, 1626, 0, 0, 1657, 1341, 0], [0, 5259, 0, -4981, 974, 0, 0, -715], [-27117, 0, -2016, 0, 0, -1550, 2206, 0], [0, -7404, 0, 4649, -1276, 0, 0, 724], [-18779, 0, 2228, 0, 0, 1053, 374, 0], [0, 12743, 0, 1236, 48, 0, 0, -261], [0, -8882, 0, 3262, -2358, 0, 0, 792], [0, -3115, 0, -1515, 1428, 0, 0, 373], [0, -587, 0, 3874, 550, 0, 0, -797], [0, -19894, 0, 4082, -212, 0, 0, -1382], [-9336, 0, 512, 0, 0, 4016, 621, 0], [0, -13374, 0, 105, -204, 0, 0, 190], [28600, 0, -368, 0, 0, 604, -684, 0], [0, -15788, 0, -249, -722, 0, 0, -374], [0, 11950, 0, 2614, -1520, 0, 0, -114], [12853, 0, 6590, 0, 0, -1449, 674, 0], [-39553, 0, -5470, 0, 0, 814, -1294, 0], [0, -19770, 0, 4949, -1672, 0, 0, 662], [-10697, 0, 8172, 0, 0, 1385, -1115, 0], [0, -3300, 0, -2192, -772, 0, 0, -448], [-42935, 0, 974, 0, 0, -2553, -574, 0], [-3395, 0, -1334, 0, 0, 1294, -1446, 0], [0, -16971, 0, 1909, 824, 0, 0, 257], [-74136, 0, -2508, 0, 0, 4339, 28, 0], [0, -17078, 0, 3834, -2908, 0, 0, 466], [-85258, 0, 3604, 0, 0, 2135, 414, 0], [0, -10369, 0, -5233, 1062, 0, 0, -1615], [0, 1042, 0, 3518, 1414, 0, 0, 116], [0, -27231, 0, 1544, -1894, 0, 0, 1151], [-21085, 0, -4514, 0, 0, 101, -1318, 0], [0, 13925, 0, -5151, 662, 0, 0, -697], [39503, 0, 5702, 0, 0, -2744, 1760, 0], [0, 19985, 0, -3751, 3904, 0, 0, -371], [0, -5661, 0, -4765, -1902, 0, 0, 1029], [-123446, 0, -2850, 0, 0, -820, 475, 0], [0, -8891, 0, 516, 3264, 0, 0, -619], [80969, 0, 4434, 0, 0, 1311, -1740, 0], [-32984, 0, -4812, 0, 0, -1864, -1343, 0], [0, -22096, 0, 2311, -2964, 0, 0, 1712], [-52567, 0, 5580, 0, 0, -543, 1046, 0], [0, 15432, 0, -180, 2956, 0, 0, -1040], [-64825, 0, -3780, 0, 0, 5442, -286, 0], [-41201, 0, -6658, 0, 0, -2271, 542, 0], [78591, 0, 3882, 0, 0, 1855, -1037, 0], [0, -15413, 0, 5271, 314, 0, 0, 917], [0, 6958, 0, 4629, -216, 0, 0, 794], [26456, 0, 4584, 0, 0, -609, 2616, 0], [0, 9630, 0, -3147, -3498, 0, 0, 504], [48555, 0, 5404, 0, 0, -2301, 1376, 0], [0, -277, 0, 10307, -952, 0, 0, 571], [49021, 0, -9186, 0, 0, -1189, 400, 0], [0, -6399, 0, -4327, 1332, 0, 0, -1047], [-108706, 0, -2334, 0, 0, -1425, 1507, 0], [0, -2888, 0, 3572, 228, 0, 0, 72], [98219, 0, 7128, 0, 0, 5124, 333, 0], [27884, 0, -1740, 0, 0, -2610, -581, 0], [-790, 0, 4032, 0, 0, -4740, 212, 0], [0, -16417, 0, 3086, 1008, 0, 0, 79], [0, 4692, 0, 5847, -592, 0, 0, -800], [6759, 0, -1748, 0, 0, -3741, 2614, 0], [0, 482, 0, -3878, 622, 0, 0, 1760], [0, -17949, 0, 2623, -2900, 0, 0, 263], [34986, 0, 1862, 0, 0, 3605, -1335, 0], [86442, 0, -3116, 0, 0, 1878, -2254, 0], [0, -31535, 0, -879, 1170, 0, 0, -557], [0, 13322, 0, 8670, 782, 0, 0, -908], [-132423, 0, 2222, 0, 0, 1667, 622, 0], [80268, 0, 5934, 0, 0, 172, 116, 0], [0, -26264, 0, 6595, -2546, 0, 0, 370], [24615, 0, 10072, 0, 0, 927, -746, 0], [-68016, 0, -2376, 0, 0, 685, 864, 0], [0, 18939, 0, 268, 1472, 0, 0, -2593], [0, 11981, 0, -3755, -1162, 0, 0, -1821], [0, -14380, 0, 10072, 1232, 0, 0, -980], [0, -2853, 0, -4240, 3318, 0, 0, -223], [0, -18621, 0, -3905, -750, 0, 0, 617], [67736, 0, -1344, 0, 0, -4203, 848, 0], [0, -4853, 0, -10488, -2360, 0, 0, 1899], [0, -19706, 0, -9498, 176, 0, 0, 742], [0, -5834, 0, -7498, 1180, 0, 0, 650], [19162, 0, 3020, 0, 0, 5772, -1227, 0], [-76662, 0, -10342, 0, 0, 464, 1533, 0], [0, 42398, 0, 390, -1398, 0, 0, -1160], [21160, 0, -5916, 0, 0, 2906, -1601, 0], [-87957, 0, -1996, 0, 0, 374, -2159, 0], [0, 18416, 0, -5128, 1844, 0, 0, 2060], [-35519, 0, -6562, 0, 0, -3969, 136, 0], [0, -33765, 0, 779, -994, 0, 0, -2587], [0, 7626, 0, 111, 356, 0, 0, 542], [12585, 0, 6864, 0, 0, 7303, 575, 0], [-68666, 0, 6456, 0, 0, 1397, 458, 0], [0, 24507, 0, -4729, 300, 0, 0, -1489], [0, 1181, 0, 7613, 4550, 0, 0, -1129], [53532, 0, -2184, 0, 0, -4376, 949, 0], [0, -8743, 0, -6316, -134, 0, 0, 1283], [-39541, 0, 1384, 0, 0, 2078, 1962, 0], [0, -34842, 0, 934, -1166, 0, 0, 1832], [0, -10063, 0, 1914, -4128, 0, 0, 145], [-17471, 0, 9472, 0, 0, 1471, 679, 0], [0, -20604, 0, 4136, 1612, 0, 0, -2220], [61164, 0, -996, 0, 0, -9362, -185, 0], [0, -3773, 0, 2919, 1606, 0, 0, 3373], [-22657, 0, 2088, 0, 0, 3321, -1063, 0], [-17760, 0, 6188, 0, 0, -3196, 31, 0], [-70184, 0, -4340, 0, 0, -710, 589, 0], [0, -34498, 0, 3546, -1140, 0, 0, -6], [114019, 0, 2884, 0, 0, 628, -2903, 0], [0, 8512, 0, -2723, 4120, 0, 0, -516], [0, -26487, 0, 6385, 2232, 0, 0, -819], [-43977, 0, 170, 0, 0, -3217, -2197, 0], [0, -3094, 0, -2122, 1436, 0, 0, 2338], [57570, 0, 4126, 0, 0, -1188, -2521, 0], [152659, 0, 2596, 0, 0, 2341, 889, 0], [0, 39750, 0, -6094, -686, 0, 0, 516], [-93024, 0, 2264, 0, 0, -1156, 3432, 0], [0, -46874, 0, 921, -680, 0, 0, 1422], [48524, 0, 6130, 0, 0, -2482, 2887, 0], [0, 20356, 0, 1048, -1280, 0, 0, -8], [13648, 0, -11152, 0, 0, -4578, 1707, 0], [0, 22695, 0, -2166, 256, 0, 0, -845], [0, -24796, 0, -485, -66, 0, 0, -842], [23437, 0, 1836, 0, 0, 3581, -3378, 0], [-184524, 0, 7558, 0, 0, 2802, 413, 0], [0, 14105, 0, -1526, -3892, 0, 0, 1209], [95339, 0, 10478, 0, 0, -2651, -884, 0], [0, 34882, 0, 1054, -440, 0, 0, 1102], [29929, 0, 9362, 0, 0, 2916, 4112, 0], [0, 5350, 0, 4925, 4994, 0, 0, -736], [0, 239, 0, -6325, -3200, 0, 0, -1577], [35714, 0, -5068, 0, 0, 3046, -750, 0], [-40785, 0, -9086, 0, 0, -7476, 1536, 0], [0, -34896, 0, 2863, 1858, 0, 0, 986], [0, 7898, 0, -7754, -272, 0, 0, 2198], [32757, 0, 928, 0, 0, 1569, 4498, 0], [0, 7798, 0, -398, -4150, 0, 0, -1300], [0, -8500, 0, 2436, -212, 0, 0, -1976], [0, 1036, 0, -3663, -462, 0, 0, 1626], [101988, 0, -6698, 0, 0, -8187, 1593, 0], [0, 1777, 0, 4917, 1082, 0, 0, -2817], [0, -27879, 0, -5523, -76, 0, 0, -3023], [-27614, 0, 2834, 0, 0, 1656, 2561, 0], [0, 45092, 0, -1549, 1922, 0, 0, -2778], [0, 17904, 0, 2900, 44, 0, 0, 1288], [0, 16437, 0, 608, 1136, 0, 0, 1885], [20413, 0, -3042, 0, 0, 467, 4524, 0], [0, -19282, 0, -1678, -5372, 0, 0, 2494]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1521_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1521_4_a_bc();".
// 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_1521_4_a_bc(:prec:=8)
    chi := MakeCharacter_1521_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    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_1521_4_a_bc();".
// 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_1521_4_a_bc( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1521_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![4992, 0, -4210, 0, 805, 0, -52, 0, 1]>,<5,R![909792, 0, -9287935, 0, 140795, 0, -677, 0, 1]>,<7,R![-39884, -10894, -700, 11, 1]>],Snew);
    return Vf;
end function;