
// Make newform 11.5.d.a in Magma, downloaded from the LMFDB on 05 November 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_11_d();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_11_d_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_11_5_d_a();".
// 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_11_5_d_a();".
// 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 := [73205, 0, 2910655, 0, 953170, 0, 102975, 0, 5030, 0, 115, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1427754383, -5016493020, -13654448170, -2823880454, -3857093625, -549385674, -321264966, -40135806, -10477907, -1219776, -117304, -13052], [-1427754383, 5016493020, -13654448170, 2823880454, -3857093625, 549385674, -321264966, 40135806, -10477907, 1219776, -117304, 13052], [757840787, 7973305285, 13654448170, -1134660378, 3857093625, -827426403, 321264966, -79586472, 10477907, -2737673, 117304, -31452], [-676101899, 0, 4387794733, 0, 1386775659, 0, 120327945, 0, 4016197, 0, 45643, 0], [86861060, 129795853, 2997579640, 1241313470, 874263126, 350644875, 72240366, 29205906, 2319614, 952537, 25564, 10664], [-86861060, 129795853, -2997579640, 1241313470, -874263126, 350644875, -72240366, 29205906, -2319614, 952537, -25564, 10664], [-209313060, 68894617, -9047202395, 1241313470, -2622222042, 350644875, -219213027, 29205906, -7147008, 952537, -79937, 10664], [4416548158, -104516796175, -36929122516, -46854588548, -9732816588, -7708194267, -766470936, -530879748, -23961014, -15878131, -259930, -169940], [4416548158, 104516796175, -36929122516, 46854588548, -9732816588, 7708194267, -766470936, 530879748, -23961014, 15878131, -259930, 169940], [-7437120889, -169552623955, 48265742063, -93304347409, 15254532249, -16702393701, 1323607395, -1181014629, 44178167, -35561311, 502073, -380623]];
    Rf_basisdens := [1, 1, 1339827192, 1339827192, 1339827192, 60901236, 121802472, 121802472, 121802472, 1339827192, 1339827192, 1339827192];
    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_11_d();"
function MakeCharacter_11_d()
    N := 11;
    order := 10;
    char_gens := [2];
    v := [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_11_d_Hecke();"
function MakeCharacter_11_d_Hecke( : Kf := false)
    N := 11;
    order := 10;
    char_gens := [2];
    char_values := [[0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := ISA(Type(Kf), Fld), 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]];
    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 := 5;
    raw_aps := [[-1, 0, -1, -2, -1, 0, 0, 1, 0, 0, 0, 0], [1, 0, 1, 3, 3, 0, 0, 0, 0, 1, 0, 0], [0, 0, 4, 0, 4, 0, -1, -2, 2, -1, 1, 1], [-17, 5, -24, -7, -12, 4, -5, -5, 5, -2, -2, -1], [-10, 7, 7, -9, -51, -3, -1, 18, 2, -1, 5, 7], [16, 0, -6, -12, -28, -5, -28, -15, 28, 1, -3, 1], [-176, -29, -71, -88, -105, 1, 5, 0, -29, 9, 8, -8], [-68, 15, 68, -48, 48, 27, 0, -15, -28, -11, -32, -5], [-40, 8, -362, -362, 0, -28, -8, -8, 16, 8, 8, 0], [-502, -96, -640, -138, -320, 22, 96, 95, -95, 14, -11, -18], [-35, 208, 258, 0, -35, -38, -111, -104, 97, -25, 38, 25], [34, -166, 0, 34, 6, 0, -166, -11, -11, 0, 61, -32], [-330, 79, 330, 381, -381, -19, 0, -79, 128, 18, 2, -17], [516, -189, 615, 417, 1032, -14, 188, 188, 0, 61, -61, 28], [-503, 294, -503, -942, -942, 129, -198, 96, 99, 80, 0, -129], [236, -210, 756, 0, 236, 29, 262, 105, 52, -99, -29, 99], [-1636, 115, 0, -1636, -766, 0, 115, -308, -308, 0, 43, 171], [836, -426, -116, 418, 952, 20, 469, 0, -426, 169, 149, -149], [2285, -416, 1521, 1521, 0, -139, -79, 911, -832, -152, -152, 0], [0, -195, -2769, -659, -2769, 193, 139, 278, -83, -64, -129, -129], [2059, 505, 174, -1885, 87, -52, -505, -112, 112, 134, 26, -41], [-1901, 0, 948, 1896, 3797, 234, -69, -40, 69, 17, 268, 17], [-2156, 361, -4070, -1078, 1914, -17, -280, 0, 361, -219, -202, 202], [-80, 497, -437, -437, 0, 466, -90, -904, 994, -185, -185, 0], [2929, 2496, 1500, 0, 2929, 728, -1460, -1248, 1036, 348, -728, -348], [2060, 0, 1202, 2404, 344, -777, 876, -17, -876, 525, 273, 525], [-3065, -1125, 0, -3065, -3528, 0, -1125, 935, 935, 0, -274, -393], [-1959, -778, 1959, 2581, -2581, -62, 0, 778, 996, -277, 678, 616], [2022, -48, 5124, -1080, 4044, 302, 1498, 1498, 0, 386, -386, -604], [7273, -150, 7273, 2880, 2880, -216, 132, -18, -66, -724, 0, 216], [-2398, -2951, -2663, -1199, 265, 233, 1229, 0, -2951, -114, -347, 347], [5387, 2590, -2115, 12889, 10774, -53, -1471, -1471, 0, -422, 422, 106], [0, 2272, 1773, -2275, 1773, -1308, -2240, -4480, 2208, 874, 434, 434], [-7877, 2633, -12696, -4819, -6348, -1208, -2633, -549, 549, 314, 604, 447], [-11572, -1108, -13470, -5786, 1898, -442, -1291, 0, -1108, 477, 919, -919], [-1955, -122, 1955, -5196, 5196, 253, 0, 122, -2201, -780, 1054, 1307], [-4778, -3001, -4778, -720, -720, 178, 5698, 2697, -2849, -59, 0, -178], [-3770, 2210, -1173, 0, -3770, -1098, -382, -1105, 1828, 436, 1098, -436], [-15213, 0, -11418, -22836, -7623, -450, -331, 860, 331, -317, -1084, -317], [12160, -1873, -12160, 11084, -11084, 240, 0, 1873, -505, 63, -606, -366], [12434, -87, 12434, -3928, -3928, 243, -484, -571, 242, 2259, 0, -243], [0, -2628, -7678, 5306, -7678, -1868, 1769, 3538, -910, -143, 2011, 2011], [-17541, 767, 0, -17541, -10392, 0, 767, 1243, 1243, 0, -934, -1361], [20636, 1498, 10300, 10318, 10336, 1700, 251, 0, 1498, 1473, -227, 227], [-11378, -2692, -16394, -6362, -22756, -386, -700, -700, 0, -724, 724, 772], [4748, 2132, 21678, 21678, 0, 238, -548, -3716, 4264, -1300, -1300, 0], [-12032, 0, 750, 1500, 13532, 1191, 921, -3351, -921, -984, -777, -984], [-7631, 2010, -7631, -19488, -19488, -1059, 2310, 4320, -1155, -3462, 0, 1059], [14218, 1811, 29764, 15546, 14882, -322, -1811, 2634, -2634, 2072, 161, -875], [18274, 1550, -6486, 0, 18274, 1465, 2896, -775, 4446, 535, -1465, -535], [24753, 0, 7362, 14724, -10029, -2526, -3304, -2734, 3304, 712, -1102, 712], [22407, 2664, -22407, -1984, 1984, -2175, 0, -2664, -2039, 502, 3346, 1171], [-15207, -54, 6573, -36987, -30414, -389, -985, -985, 0, -1862, 1862, 778], [-40223, -10528, -21664, 0, -40223, 3750, 6815, 5264, -3713, 1197, -3750, -1197], [14329, -1413, 0, 14329, 53911, 0, -1413, -2024, -2024, 0, -2226, -2701], [-2018, -472, -26966, 22930, -4036, 2350, 7166, 7166, 0, 470, -470, -4700], [0, 392, -16304, -66610, -16304, 4150, -2725, -5450, 5058, -1875, -2275, -2275], [-2633, -7031, -5040, -2407, -2520, 4412, 7031, -5265, 5265, -4214, -2206, -99], [6148, 0, -5886, -11772, -17920, -517, -11330, 5831, 11330, 1573, 2629, 1573], [22638, 3764, -11909, 11319, 34547, 1304, 526, 0, 3764, -3818, -5122, 5122], [-15095, 4834, 15095, -32454, 32454, -533, 0, -4834, 9189, -1076, 3218, 2685], [-51004, 144, 10184, 61188, 5092, 634, -144, -91, 91, 5618, -317, -3126], [-930, -10429, -50067, 48207, -1860, 2886, -9982, -9982, 0, 509, -509, -5772], [32229, 7054, 32229, 38744, 38744, 905, -22682, -15628, 11341, -1926, 0, -905], [0, 10831, -49975, -42784, -49975, -1449, 2731, 5462, -16293, 1601, -152, -152], [-4170, 15366, 38298, 0, -4170, -1779, -11680, -7683, 3686, -8273, 1779, 8273], [2558, 841, 27447, 27447, 0, -1156, 9092, -10774, 1682, 3547, 3547, 0], [-29861, -11360, -45828, -15967, -22914, -3388, 11360, 21732, -21732, 11080, 1694, -3846], [49918, -1722, 34272, 24959, 15646, -1140, 8803, 0, -1722, 1444, 2584, -2584], [31192, -10763, -31192, -21168, 21168, 6640, 0, 10763, 2951, -4033, -5214, 1426], [-41559, -5094, 6747, 6747, 0, -3555, 7393, 2795, -10188, 494, 494, 0], [59447, 13311, 33548, -25899, 16774, 9148, -13311, -2137, 2137, -4546, -4574, -2301], [-50399, -1645, 0, -50399, -24240, 0, -1645, -9603, -9603, 0, 3750, -1655], [2742, -522, 51186, -45702, 5484, 1406, -10508, -10508, 0, 7880, -7880, -2812], [0, 23165, 25484, 109952, 25484, -717, -10318, -20636, -2529, -2015, 2732, 2732], [-7883, -16952, -15746, 0, -7883, 6170, 22897, 8476, 5945, -4061, -6170, 4061], [-34964, 1980, 0, -34964, -11460, 0, 1980, -1551, -1551, 0, 2423, -1254], [-32152, 19686, 62232, 62232, 0, 3226, -32248, -7124, 39372, -2622, -2622, 0], [0, -21536, -63243, -36589, -63243, -2394, 1702, 3404, 18132, 364, 2030, 2030], [121114, 0, 64398, 128796, 7682, 8497, 4010, 27539, -4010, -8757, -9017, -8757], [-3508, 3571, 15383, 15383, 0, -316, -8026, 884, 7142, 7575, 7575, 0], [-55946, -8287, -55946, -116988, -116988, 18058, 6358, -1929, -3179, 5929, 0, -18058], [-119785, 0, -62750, -125500, -5715, 2404, 31949, 26440, -31949, -813, 778, -813], [42733, -4696, 0, 42733, 57924, 0, -4696, -2090, -2090, 0, -7964, 6016], [89862, -4856, 127086, 52638, 179724, 3408, -12290, -12290, 0, -2702, 2702, -6816], [53361, -180, 53361, 14209, 14209, -3612, 6556, 6376, -3278, -7403, 0, 3612], [57133, -2916, 40773, 0, 57133, -17201, -7005, 1458, -9921, -4390, 17201, 4390], [69542, -4180, -86117, 34771, 155659, 8976, 8120, 0, -4180, 9790, 814, -814], [-18984, 23742, -7962, -30006, -37968, 5880, -9066, -9066, 0, 12330, -12330, -11760], [13394, 10800, -68544, -68544, 0, 1448, -13946, -7654, 21600, -8604, -8604, 0], [0, 18171, 53523, 33139, 53523, -11255, 4609, 9218, -27389, 2726, 8529, 8529], [-170654, 28087, -29045, -85327, -141609, 2311, -919, 0, 28087, -2400, -4711, 4711], [130459, -3220, 130459, 146478, 146478, 861, 26510, 23290, -13255, 1220, 0, -861], [39168, -39402, -59006, -98174, -29503, -3042, 39402, 8770, -8770, -3042, 1521, 3042], [48946, -27406, 0, 48946, -68937, 0, -27406, -2728, -2728, 0, -3535, -10016], [-134861, -21216, 134861, -91920, 91920, -9841, 0, 21216, -9135, 7148, 5386, -4455], [-90028, 24961, -90028, -3954, -3954, 1388, -57442, -32481, 28721, -5647, 0, -1388], [-40375, 21112, 0, -40375, 5952, 0, 21112, 1958, 1958, 0, -14020, -14380], [-162382, -38110, -67082, -81191, -95300, -3230, 56521, 0, -38110, -8412, -5182, 5182], [134842, 0, 84990, 169980, 35138, -9675, -26922, -27, 26922, 11439, 13203, 11439], [54688, -11357, -54688, 70242, -70242, 5419, 0, 11357, -61498, -9181, 7524, 12943], [-144414, 27186, -271064, -126650, -135532, -27738, -27186, -46469, 46469, 11790, 13869, 7974], [18364, 0, 58162, 116324, 97960, 13041, -58295, -51231, 58295, -5026, 2989, -5026], [-83591, 49306, 83591, 56734, -56734, 1270, 0, -49306, 21070, 3454, -9448, -8178], [119778, -39910, 76548, 163008, 239556, -10200, 39326, 39326, 0, -7804, 7804, 20400], [0, 5091, -119635, -135418, -119635, 7553, -23957, -47914, 42823, 14759, -22312, -22312], [-128674, 17377, 0, -128674, 27580, 0, 17377, -11154, -11154, 0, -8205, 14875], [-86207, 47102, 341, -172755, -172414, -6633, -49599, -49599, 0, -19558, 19558, 13266], [0, -45407, 56353, 205759, 56353, 11123, 30809, 61618, -16211, -4400, -6723, -6723], [157699, 7987, 86238, -71461, 43119, 4220, -7987, 20402, -20402, -39130, -2110, 17455], [-128105, 0, -65526, -131052, -2947, 17536, -343, -26144, 343, -13405, -9274, -13405], [102478, 40733, -102478, 21270, -21270, -1198, 0, -40733, 31645, 7351, -12306, -13504], [297875, -2910, 352959, 352959, 0, 4223, -21081, 26901, -5820, 8332, 8332, 0], [-73466, 2197, -73466, -326190, -326190, 2659, -13992, -11795, 6996, 14523, 0, -2659], [-28727, -24057, 0, -28727, -112044, 0, -24057, 8833, 8833, 0, -14660, -19305], [-127226, 27001, -127226, 117697, 117697, -27097, -7128, 19873, 3564, 19954, 0, 27097], [0, 3587, 61094, 41672, 61094, -8545, -2070, -4140, 553, 12111, -3566, -3566], [253069, -24960, 309654, 0, 253069, -25496, -23823, 12480, -48783, 7157, 25496, -7157], [30966, -25246, 0, 30966, 133436, 0, -25246, -33627, -33627, 0, 31873, 14774], [-2169, 34602, -30043, 25705, -4338, -6485, -5047, -5047, 0, -2430, 2430, 12970], [-150868, -3826, -129918, -129918, 0, 53134, 1978, 5674, -7652, -19336, -19336, 0], [-26957, 0, 4437, 8874, 35831, 9971, -599, -29496, 599, -15478, -20985, -15478], [412060, 43284, 232200, 206030, 179860, -6240, -20951, 0, 43284, 12205, 18445, -18445], [104800, -9522, 65676, 65676, 0, 35362, 48572, -29528, -19044, -17244, -17244, 0], [-215450, 29050, -38829, 0, -215450, 3818, 7550, -14525, 36600, 11510, -3818, -11510], [-4364, -69631, 4364, -188038, 188038, 10626, 0, 69631, -24553, 837, -22926, -12300], [0, 4700, -52060, 130802, -52060, -43158, -12907, -25814, 21114, 15061, 28097, 28097], [44959, 33585, 0, 44959, -40706, 0, 33585, 72919, 72919, 0, -13302, 4871], [227870, -3750, 177426, 177426, 0, -23780, 6566, 934, -7500, -9360, -9360, 0], [-106898, -31762, 218172, 325070, 109086, -27098, 31762, 3597, -3597, 2762, 13549, 12168], [62872, 0, -144621, -289242, -352114, 10876, 9188, 55295, -9188, -4428, 2020, -4428], [200134, -69001, 241685, 100067, -41551, 4571, -17217, 0, -69001, -4390, -8961, 8961], [-244331, -16258, -244331, -227532, -227532, 13981, 106678, 90420, -53339, 53890, 0, -13981], [-137120, -95514, -192270, 0, -137120, 10751, 61084, 47757, -34430, -28455, -10751, 28455], [-77999, 0, -54569, -109138, -31139, 3171, -80303, -27408, 80303, -16, 3139, -16], [157230, 42012, 74796, 239664, 314460, 3882, -67140, -67140, 0, -11262, 11262, -7764], [34348, -108869, 34348, 177628, 177628, 13022, 151602, 42733, -75801, 8971, 0, -13022], [309386, 22960, -71264, 154693, 380650, -2664, -77411, 0, 22960, 2864, 5528, -5528], [0, -66930, 411450, 69892, 411450, -3422, 44929, 89858, -22928, -1921, 5343, 5343], [-144276, 27881, 21283, -72138, -165559, 16697, -113279, 0, 27881, 8527, -8170, 8170], [109837, -22242, -109837, -51825, 51825, -37212, 0, 22242, 16938, 14589, 45246, 8034], [-114352, 5448, -318628, -204276, -159314, -6710, -5448, 92759, -92759, -26914, 3355, 16812], [166525, -59808, -254418, 0, 166525, 10066, 521, 29904, -59287, 41133, -10066, -41133], [-220128, 0, -376207, -752414, -532286, -12128, 120610, 6551, -120610, 19414, 26700, 19414], [461374, 13232, 0, 461374, 342480, 0, 13232, 1463, 1463, 0, 26417, 21022], [-65159, 7518, -65159, 117012, 117012, 26625, -46794, -39276, 23397, -1876, 0, -26625], [-661012, 26296, -324866, -330506, -336146, 986, -128281, 0, 26296, -12147, -13133, 13133], [-405092, 4355, -444461, -365723, -810184, -7850, 56150, 56150, 0, -4177, 4177, 15700], [-466207, 49846, -379113, -379113, 0, 62061, -26999, -72693, 99692, -45392, -45392, 0], [0, 53407, -24237, 133031, -24237, -27705, -80303, -160606, 107199, -11780, 39485, 39485], [-27290, 19581, 27290, -99510, 99510, 35730, 0, -19581, 117037, -22765, -25930, 9800], [243880, 52447, 383519, 383519, 0, 45934, -25046, -79848, 104894, -20725, -20725, 0], [116035, 48138, 116035, -176841, -176841, 200, -56540, -8402, 28270, 6541, 0, -200], [-99997, -153689, -230276, -130279, -115138, -46376, 153689, 87083, -87083, 5866, 23188, 20255], [0, -60636, -344236, -119311, -344236, 25820, 56125, 112250, -51614, 39650, -65470, -65470], [-43145, 143516, -210394, 0, -43145, 52842, -30859, -71758, 112657, -423, -52842, 423], [388982, 96613, 439111, 194491, -50129, -5115, -130601, 0, 96613, 2816, 7931, -7931], [0, -42753, 68309, -28606, 68309, -19627, 42807, 85614, -42861, 64859, -45232, -45232], [-343367, 0, -127701, -255402, 87965, 41711, -20063, -139480, 20063, -15116, 11479, -15116], [703516, -78140, 184828, 351758, 518688, -10328, 166259, 0, -78140, 4893, 15221, -15221], [-418569, -74686, 41641, 41641, 0, -9705, 24647, 124725, -149372, 7308, 7308, 0], [404171, 93271, 337918, -66253, 168959, -3764, -93271, -58078, 58078, 42526, 1882, -19381], [-214146, 12852, 10782, -439074, -428292, 15626, -46730, -46730, 0, 4982, -4982, -31252], [144361, -199270, 144361, 28898, 28898, -18617, 217866, 18596, -108933, 29730, 0, 18617], [-684446, -9054, 93006, 0, -684446, -22439, 72846, 4527, 63792, -47989, 22439, 47989], [-161025, 58385, 0, -161025, 341982, 0, 58385, -27137, -27137, 0, 31934, -36737], [448838, -43746, 257682, 257682, 0, 37776, -17766, 105258, -87492, -4872, -4872, 0], [-93812, 68330, -26160, 67652, -13080, -5774, -68330, -189339, 189339, 52634, 2887, -23430]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_11_d_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_11_5_d_a();".
// 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_11_5_d_a(:prec:=12)
    chi := MakeCharacter_11_d();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 5));
    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_11_5_d_a();".
// 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_11_5_d_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_11_d();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,5,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;