
// Make newform 11.4.c.a in Magma, downloaded from the LMFDB on 16 December 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_11_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_11_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_11_4_c_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_4_c_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 := [6561, 729, 810, 171, 109, -19, 10, -1, 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], [0, 280, 0, 0, 0, 0, 1, 0], [171, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1261, 0, 0, 0, 0, 1], [-6561, -729, -810, 1090, -109, 19, -10, 1], [-13851, -15390, -3249, -2071, 1090, -190, 19, -19], [0, 0, 3781, 0, 0, 0, 0, 10]];
    Rf_basisdens := [1, 1, 981, 109, 8829, 8829, 79461, 8829];
    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_c();"
function MakeCharacter_11_c()
    N := 11;
    order := 5;
    char_gens := [2];
    v := [4];
    // 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_c_Hecke();"
function MakeCharacter_11_c_Hecke( : Kf := false)
    N := 11;
    order := 5;
    char_gens := [2];
    char_values := [[0, 0, 0, 0, 1, 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 := 4;
    raw_aps := [[-1, 1, 1, 0, -1, 0, 0, 0], [-2, 0, -2, 0, -2, 1, -2, 0], [0, -2, 1, 1, 3, 1, -2, -2], [-6, 3, 0, 0, 0, 3, -6, 5], [25, -4, 24, -7, 36, -9, 19, -10], [-7, -4, -1, 7, -14, 0, 0, 7], [0, 7, -18, 9, -25, 9, 45, 7], [-19, -12, -19, -12, -58, -6, -58, 0], [-4, 0, 26, -36, 10, -10, 26, -10], [12, -31, 0, 0, 104, -31, 12, 1], [-89, -40, -45, -41, -48, 0, 0, -41], [8, 35, 0, 0, 10, 35, 8, 17], [-26, 62, -26, 62, -66, 47, -66, 0], [-177, 0, -168, -39, 31, -31, -168, -31], [241, -9, 241, -9, 161, 28, 161, 0], [-197, 2, 95, 41, -238, 0, 0, 41], [169, -32, 0, 0, 136, -32, 169, 2], [0, 42, 189, -105, 147, -105, 84, 42], [204, 0, 309, 46, 63, -63, 309, -63], [0, 120, -253, 43, -373, 43, -10, 120], [-480, 44, 0, 0, -293, 44, -480, -51], [-81, -128, 143, -13, -68, 0, 0, -13], [0, -14, -283, 194, -269, 194, 235, -14], [281, 0, -428, 57, -25, 25, -428, 25], [-471, 144, -594, -50, -421, 0, 0, -50], [127, 126, 777, 67, 60, 0, 0, 67], [2, -71, 0, 0, 650, -71, 2, 165], [-534, -52, -534, -52, -634, -271, -634, 0], [306, 0, 192, 120, -180, 180, 192, 180], [-887, -76, -887, -76, 8, 196, 8, 0], [0, -100, -681, -151, -581, -151, -188, -100], [712, 0, 79, -282, -83, 83, 79, 83], [0, -264, -925, -102, -661, -102, 169, -264], [168, 63, 0, 0, 250, 63, 168, 47], [0, -24, 1619, 115, 1643, 115, 458, -24], [-603, 107, -603, 107, -419, 528, -419, 0], [639, 105, 639, 105, 597, -204, 597, 0], [1344, -439, 605, 60, 1284, 0, 0, 60], [1219, -196, 1141, -591, 1810, 0, 0, -591], [-71, -237, -71, -237, 1971, -2, 1971, 0], [269, 498, 269, 498, -1512, 14, -1512, 0], [0, 970, -707, 697, -1677, 697, -1926, 970], [-856, -115, 0, 0, -1308, -115, -856, -473], [0, -44, 1155, 1, 1199, 1, -1340, -44], [260, 0, 1990, -46, 740, -740, 1990, -740], [-1938, 0, 318, -134, -492, 492, 318, 492], [733, 730, -1320, 1186, -453, 0, 0, 1186], [-529, -823, -529, -823, -213, -786, -213, 0], [2759, 290, 0, 0, 2096, 290, 2759, 856], [607, 210, 385, -281, 888, 0, 0, -281], [-819, -644, -1104, 56, -875, 0, 0, 56], [-4261, 73, -4261, 73, -2453, -250, -2453, 0], [-324, 0, 2889, -756, -351, 351, 2889, 351], [1437, -686, 273, -769, 2206, 0, 0, -769], [-1060, 516, 0, 0, -2549, 516, -1060, 1633], [4230, 0, 348, 1070, -362, 362, 348, 362], [0, -216, -225, 187, -9, 187, -3174, -216], [1982, -809, 0, 0, 3884, -809, 1982, -1395], [-1079, -76, -2925, -1001, -78, 0, 0, -1001], [0, 704, 2255, 892, 1551, 892, -581, 704], [-3343, -665, -3343, -665, -1495, -544, -1495, 0], [-2170, -483, 0, 0, -650, -483, -2170, -993], [-3141, 0, -4704, 701, -441, 441, -4704, 441], [3363, -123, 3363, -123, -913, -422, -913, 0], [0, 367, 446, -1375, 79, -1375, 1413, 367], [-1283, 912, -1081, 1143, -2426, 0, 0, 1143], [-3761, 0, 2868, -875, 647, -647, 2868, -647], [-1583, -328, 0, 0, -7332, -328, -1583, -428], [0, -2151, -3316, -1659, -1165, -1659, -3305, -2151], [-573, 1509, -573, 1509, -567, 2240, -567, 0], [3696, 0, 2403, 1924, -1049, 1049, 2403, 1049], [-564, 1189, 0, 0, 5224, 1189, -564, 1295], [-5694, -1143, 0, 0, 510, -1143, -5694, -75], [168, 0, -3500, 62, -1358, 1358, -3500, 1358], [0, -1590, -875, -1894, 715, -1894, 547, -1590], [-279, 1954, 4629, -241, -38, 0, 0, -241], [9262, -385, 0, 0, 6664, -385, 9262, -805], [1578, 0, -354, -532, 1986, -1986, -354, -1986], [0, 292, 2391, -378, 2099, -378, -3003, 292], [2645, -1776, 3413, 1137, 1508, 0, 0, 1137], [7177, 0, 7060, 1679, -775, 775, 7060, 775], [-4287, 307, -4287, 307, 1979, 554, 1979, 0], [-5683, -2182, 549, -1049, -4634, 0, 0, -1049], [-613, 1318, 0, 0, -4348, 1318, -613, -186], [10002, 0, 3606, 62, 732, -732, 3606, -732], [2610, 472, 2610, 472, -958, -2471, -958, 0], [-898, -1387, 151, -2454, 1556, 0, 0, -2454], [0, 1192, -741, -810, -1933, -810, 4469, 1192], [1938, 0, 4098, 628, 950, -950, 4098, -950], [-244, 0, 252, -2400, 2852, -2852, 252, -2852], [0, 2414, 4493, 3727, 2079, 3727, -4304, 2414], [0, -1610, -799, -1949, 811, -1949, 10968, -1610], [855, 1769, 855, 1769, 6831, 1338, 6831, 0], [-6572, -1446, 0, 0, 1041, -1446, -6572, -5], [4440, -1860, 0, 0, 7395, -1860, 4440, -545], [-2085, 1917, -2085, 1917, 59, 114, 59, 0], [-3783, -3063, -3783, -3063, -7499, 1534, -7499, 0], [-3137, 2678, 0, 0, 424, 2678, -3137, -422], [0, 4009, -3360, 2917, -7369, 2917, -7353, 4009], [6209, -3668, 3303, -997, 7206, 0, 0, -997], [11329, 1850, 11329, 1850, 3492, 4462, 3492, 0], [4042, -569, 0, 0, -2948, -569, 4042, 4735], [-9071, -994, -3444, -1522, -7549, 0, 0, -1522], [-12691, 1770, -12691, 1770, -5514, 3624, -5514, 0], [-9516, 0, 976, -556, 856, -856, 976, -856], [0, 1145, -948, 457, -2093, 457, 13471, 1145], [4743, -1094, 0, 0, 9780, -1094, 4743, -1452], [-3168, 0, -5533, 2992, 1815, -1815, -5533, -1815], [0, -592, -1169, -3395, -577, -3395, -6832, -592], [11668, -3244, 0, 0, 4355, -3244, 11668, -2203], [9303, 5140, 5317, 413, 8890, 0, 0, 413], [1353, -3043, 1353, -3043, 7461, 78, 7461, 0], [452, 0, 2659, -116, 3331, -3331, 2659, -3331], [1385, -944, 1385, -944, -7990, -2326, -7990, 0], [-1430, 3113, 0, 0, -13246, 3113, -1430, 2605], [-6806, 2034, -6806, 2034, -10726, 719, -10726, 0], [0, 2906, 4353, -436, 1447, -436, -3587, 2906], [4963, -5708, 715, -2569, 7532, 0, 0, -2569], [1240, -581, 0, 0, 4850, -581, 1240, -1611], [-948, 0, 9597, 582, -3997, 3997, 9597, 3997], [-12314, 0, -9360, 4732, -4568, 4568, -9360, 4568], [-1986, -335, -11877, -150, -1836, 0, 0, -150], [0, -984, -677, -2343, 307, -2343, 10580, -984], [4520, 0, 6800, -3604, 940, -940, 6800, -940], [10186, 7087, -239, 1474, 8712, 0, 0, 1474], [-4211, 371, -4211, 371, 527, -3410, 527, 0], [0, -1244, 13255, 1781, 14499, 1781, 6832, -1244], [8960, -2765, 0, 0, -7594, -2765, 8960, 2787], [-2174, 0, -22236, -714, -2130, 2130, -22236, 2130], [7124, -2015, 0, 0, 12004, -2015, 7124, -2743], [-16872, 2869, -12483, 156, -17028, 0, 0, 156], [0, -1606, 23221, 573, 24827, 573, 16150, -1606], [-11013, 275, -11013, 275, -2499, 518, -2499, 0], [-5637, -1510, -11875, -425, -5212, 0, 0, -425], [-2094, -1899, 10923, -2510, 416, 0, 0, -2510], [-5526, 0, 6148, -6096, -272, 272, 6148, 272], [14031, 731, 14031, 731, -3461, -5140, -3461, 0], [0, -5381, -17862, -1931, -12481, -1931, -14667, -5381], [0, 1998, 333, -3163, -1665, -3163, 1818, 1998], [0, 9263, 8194, 5345, -1069, 5345, -743, 9263], [27566, -2152, 27566, -2152, 16778, -2859, 16778, 0], [7184, 1399, 0, 0, 16142, 1399, 7184, -6423], [-17127, -3418, 5855, -1067, -16060, 0, 0, -1067], [-5660, -599, -10667, 2644, -8304, 0, 0, 2644], [-15942, 2301, 0, 0, 15322, 2301, -15942, -1545], [-3861, -2097, -3861, -2097, 18309, -1122, 18309, 0], [0, -1878, -7527, 1931, -5649, 1931, -25520, -1878], [2183, 0, -11612, -6273, 1341, -1341, -11612, -1341], [19680, 0, 10161, 2502, -5381, 5381, 10161, 5381], [0, 2536, -29333, 3395, -31869, 3395, -6886, 2536], [-15325, 1265, -15325, 1265, -17175, 3940, -17175, 0], [-15851, 0, 808, -7591, -2193, 2193, 808, 2193], [12816, 2162, 12816, 2162, 15436, -61, 15436, 0], [5006, 1795, 0, 0, 15680, 1795, 5006, 2729], [0, -293, -2898, 3553, -2605, 3553, -21247, -293], [-9125, -4072, 3037, 1965, -11090, 0, 0, 1965], [0, -5474, 9577, -8037, 15051, -8037, 18516, -5474], [0, -4793, -19782, 2081, -14989, 2081, -3903, -4793], [-9064, -693, 22071, -2544, -6520, 0, 0, -2544], [0, 1866, -26759, 6961, -28625, 6961, 386, 1866], [9228, 0, 13653, -4198, 467, -467, 13653, -467], [2936, 986, 0, 0, 8725, 986, 2936, 10977], [21122, 0, 1634, 1134, -964, 964, 1634, 964], [-1863, 3131, -1863, 3131, 3621, 860, 3621, 0], [4565, 3468, 14677, 5181, -616, 0, 0, 5181], [-11878, 479, 0, 0, -30524, 479, -11878, -1727], [30364, 0, -38, -2496, 730, -730, -38, -730], [10672, 1391, 0, 0, 23266, 1391, 10672, -7951]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_11_c_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_11_4_c_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_4_c_a(:prec:=8)
    chi := MakeCharacter_11_c();
    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_11_4_c_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_4_c_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_11_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;