
// Make newform 825.4.c.s in Magma, downloaded from the LMFDB on 21 December 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_825_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_825_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_825_4_c_s();".
// 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_825_4_c_s();".
// 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 := [900, 0, 7104, 0, 3625, 0, 631, 0, 43, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2202, 0, 1891, 0, 445, 0, 37, 0, 1], [9, 0, 1, 0, 0, 0, 0, 0, 0, 0], [150, 0, 817, 0, 289, 0, 31, 0, 1, 0], [0, 14, 0, 1, 0, 0, 0, 0, 0, 0], [46, 0, 19, 0, 1, 0, 0, 0, 0, 0], [0, 6306, 0, 4039, 0, 757, 0, 49, 0, 1], [-600, 0, -2242, 0, -619, 0, -46, 0, -1, 0], [0, 22398, 0, 8893, 0, 1093, 0, 55, 0, 1]];
    Rf_basisdens := [1, 1, 720, 1, 120, 1, 2, 240, 60, 360];
    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_825_c();"
function MakeCharacter_825_c()
    N := 825;
    order := 2;
    char_gens := [551, 727, 376];
    v := [2, 1, 2];
    // 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_825_c_Hecke();"
function MakeCharacter_825_c_Hecke( : Kf := false)
    N := 825;
    order := 2;
    char_gens := [551, 727, 376];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 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 := 4;
    raw_aps := [[0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 4, 0, 0, 0, 0, -1, 0, -1], [-11, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 4, -6, 0, 0, -3, 0, -1, 0, -1], [0, 0, 10, 0, 0, 0, 0, -6, 0, 7], [18, 0, 0, -9, -16, 0, 2, 0, -1, 0], [0, 12, -29, 0, 0, 2, 0, -15, 0, 4], [22, 0, 0, 6, -4, 0, 1, 0, 11, 0], [-58, 0, 0, 3, 0, 0, 3, 0, 11, 0], [0, -24, -39, 0, 0, -11, 0, -15, 0, -5], [-16, 0, 0, 4, -68, 0, -7, 0, -12, 0], [0, 12, -62, 0, 0, 11, 0, -45, 0, 3], [0, -4, -33, 0, 0, -11, 0, 33, 0, -33], [0, 24, -182, 0, 0, 26, 0, 24, 0, -14], [235, 0, 0, 5, -44, 0, -5, 0, -11, 0], [-24, 0, 0, -53, -116, 0, 22, 0, 2, 0], [0, -160, -150, 0, 0, 20, 0, -19, 0, 22], [-95, 0, 0, -39, -132, 0, -2, 0, 22, 0], [0, -8, -64, 0, 0, -38, 0, 22, 0, -44], [520, 0, 0, 2, -116, 0, -39, 0, -6, 0], [0, 32, -330, 0, 0, -35, 0, -2, 0, -15], [494, 0, 0, 14, -28, 0, 47, 0, 35, 0], [0, -112, -393, 0, 0, -4, 0, 90, 0, 58], [-136, 0, 0, -24, -176, 0, -16, 0, 41, 0], [0, -64, -44, 0, 0, 77, 0, -82, 0, 27], [0, 240, -134, 0, 0, 1, 0, 2, 0, -29], [474, 0, 0, 23, -164, 0, 5, 0, -37, 0], [0, 132, -126, 0, 0, -44, 0, 56, 0, -24], [0, -12, -394, 0, 0, 44, 0, -184, 0, 3], [-402, 0, 0, 126, -176, 0, 27, 0, -59, 0], [0, 564, 228, 0, 0, 33, 0, -54, 0, 81], [1122, 0, 0, -72, 152, 0, -1, 0, 7, 0], [388, 0, 0, -88, 348, 0, 31, 0, -68, 0], [-626, 0, 0, -203, 172, 0, -28, 0, -10, 0], [0, 448, -606, 0, 0, -6, 0, -21, 0, -32], [0, -488, 846, 0, 0, -30, 0, 73, 0, 86], [0, 68, 1280, 0, 0, 14, 0, -240, 0, -160], [0, -108, -892, 0, 0, 99, 0, -216, 0, 38], [959, 0, 0, 107, -136, 0, -133, 0, 11, 0], [-1181, 0, 0, -96, 448, 0, 95, 0, 67, 0], [-279, 0, 0, 97, -392, 0, 138, 0, -30, 0], [0, -652, -576, 0, 0, -82, 0, -83, 0, 44], [0, 648, 1690, 0, 0, 81, 0, -10, 0, 34], [606, 0, 0, 95, -176, 0, 95, 0, 35, 0], [-2258, 0, 0, 321, 284, 0, -232, 0, -14, 0], [0, -528, 1302, 0, 0, 50, 0, 355, 0, -34], [0, 1332, 780, 0, 0, -67, 0, 170, 0, 21], [-2339, 0, 0, 48, -8, 0, 63, 0, 73, 0], [0, 176, -492, 0, 0, -58, 0, -82, 0, -63], [1438, 0, 0, -196, -752, 0, 22, 0, 134, 0], [-1934, 0, 0, 59, 348, 0, 320, 0, -44, 0], [1340, 0, 0, -658, -684, 0, -112, 0, 140, 0], [0, 264, 838, 0, 0, -113, 0, 44, 0, 121], [0, -24, 334, 0, 0, 278, 0, -104, 0, 46], [-1362, 0, 0, 72, -476, 0, 324, 0, -230, 0], [-742, 0, 0, 152, 420, 0, 201, 0, -204, 0], [0, -1188, 252, 0, 0, 58, 0, -423, 0, 82], [-2478, 0, 0, 252, 20, 0, -351, 0, -28, 0], [0, 136, -746, 0, 0, -156, 0, 889, 0, 9], [0, -340, 846, 0, 0, 34, 0, 182, 0, 105], [0, 436, 966, 0, 0, -98, 0, -503, 0, -128], [1264, 0, 0, -540, 128, 0, 73, 0, 5, 0], [0, -720, 2473, 0, 0, 253, 0, 362, 0, -15], [0, -1684, 3754, 0, 0, 154, 0, 720, 0, -8], [-688, 0, 0, 404, -2056, 0, 96, 0, 150, 0], [0, 884, -3544, 0, 0, 104, 0, 265, 0, -180], [0, -884, 2698, 0, 0, -86, 0, -150, 0, 448], [-2852, 0, 0, 704, -224, 0, -3, 0, -129, 0], [0, 732, 5058, 0, 0, 77, 0, -314, 0, 213], [5994, 0, 0, -82, -108, 0, 210, 0, -276, 0], [0, -2280, -2094, 0, 0, 225, 0, -383, 0, -35], [0, -956, 4482, 0, 0, -404, 0, -853, 0, 254], [-2738, 0, 0, -181, 1032, 0, -174, 0, 98, 0], [0, 1516, 1024, 0, 0, -609, 0, 560, 0, 301], [-1372, 0, 0, 594, -680, 0, -418, 0, 286, 0], [0, -688, -1478, 0, 0, -706, 0, -53, 0, -220], [-1874, 0, 0, 162, 1352, 0, 211, 0, -207, 0], [-536, 0, 0, -709, -908, 0, 138, 0, -346, 0], [1973, 0, 0, -29, -1180, 0, -181, 0, -61, 0], [593, 0, 0, 685, -1000, 0, -681, 0, 265, 0], [-1250, 0, 0, 1672, -116, 0, 34, 0, 104, 0], [0, 8, 5058, 0, 0, -165, 0, 31, 0, -193], [-4618, 0, 0, -1629, 1120, 0, 343, 0, 158, 0], [0, -1148, 6379, 0, 0, -11, 0, -205, 0, -623], [-3212, 0, 0, 146, -1856, 0, 349, 0, -85, 0], [0, 1480, 752, 0, 0, 532, 0, 338, 0, 138], [-5546, 0, 0, 1276, 1360, 0, 106, 0, -96, 0], [0, 1272, 9214, 0, 0, -231, 0, 76, 0, 315], [0, 1900, 2924, 0, 0, -528, 0, 182, 0, -592], [186, 0, 0, -690, -1548, 0, 696, 0, -234, 0], [0, 1400, -2784, 0, 0, 243, 0, 143, 0, 361], [88, 0, 0, -588, 4404, 0, -131, 0, -137, 0], [3424, 0, 0, -273, 1184, 0, -60, 0, 844, 0], [0, -392, -1910, 0, 0, 202, 0, -1204, 0, 118], [-4202, 0, 0, -462, -1692, 0, -608, 0, -208, 0], [-5724, 0, 0, -56, -404, 0, -3, 0, 83, 0], [0, 1320, 2228, 0, 0, 465, 0, -895, 0, -134], [-3420, 0, 0, -1293, -500, 0, 805, 0, -497, 0], [0, -620, -6900, 0, 0, -125, 0, 576, 0, -776], [0, 5380, -3386, 0, 0, 151, 0, -148, 0, 79], [0, 1132, -4748, 0, 0, 316, 0, 2098, 0, 112], [3838, 0, 0, -26, 560, 0, 127, 0, 170, 0], [1358, 0, 0, 811, 1244, 0, -891, 0, 871, 0], [0, 5496, 977, 0, 0, 213, 0, -444, 0, 87], [0, -568, -5427, 0, 0, -629, 0, -15, 0, -69], [0, 1192, 1162, 0, 0, -1022, 0, 240, 0, 112], [4481, 0, 0, 407, 3184, 0, -529, 0, 129, 0], [-4158, 0, 0, -1295, 4404, 0, -530, 0, 22, 0], [0, -2232, -2714, 0, 0, -528, 0, 358, 0, -316], [0, 48, -5730, 0, 0, -636, 0, 1124, 0, 392], [0, -1956, -2042, 0, 0, -115, 0, -2496, 0, -11], [-516, 0, 0, -225, 4528, 0, 896, 0, 134, 0], [-3824, 0, 0, -2341, -72, 0, 878, 0, -332, 0], [-3096, 0, 0, 856, 4412, 0, 663, 0, 17, 0], [0, -2560, 3800, 0, 0, -22, 0, -2236, 0, 130], [0, -2960, 2579, 0, 0, 77, 0, 977, 0, 377], [0, 676, -3186, 0, 0, 428, 0, 274, 0, 126], [-6238, 0, 0, 1988, 972, 0, -781, 0, 425, 0], [1795, 0, 0, -57, -4200, 0, 113, 0, 555, 0], [0, 1192, 42, 0, 0, -486, 0, -1496, 0, -178], [0, -684, 122, 0, 0, 801, 0, 1114, 0, -451], [0, 1612, -1415, 0, 0, 385, 0, 1241, 0, 667], [-356, 0, 0, 2828, 472, 0, 410, 0, 612, 0], [-6314, 0, 0, 766, 3140, 0, 778, 0, 17, 0], [6029, 0, 0, -452, 5144, 0, 757, 0, -261, 0], [17096, 0, 0, 194, -1292, 0, 284, 0, -792, 0], [0, -1816, -3752, 0, 0, -97, 0, -207, 0, -685], [0, -2368, -8820, 0, 0, -1, 0, 1308, 0, 515], [20058, 0, 0, 1372, -3428, 0, -493, 0, -792, 0], [0, 4140, -3494, 0, 0, 258, 0, -2140, 0, 1252], [6464, 0, 0, 1330, -2560, 0, 651, 0, -1381, 0], [0, -4608, 7670, 0, 0, 198, 0, 377, 0, -1512], [-13038, 0, 0, -836, 4652, 0, -156, 0, 1358, 0], [-2002, 0, 0, 783, 3892, 0, 448, 0, -326, 0], [0, -520, 11544, 0, 0, -534, 0, -2938, 0, 108], [0, -784, -4496, 0, 0, -454, 0, -615, 0, -133], [0, 1312, 10384, 0, 0, 794, 0, -3860, 0, 202], [2074, 0, 0, -248, -4896, 0, -785, 0, 130, 0], [-9438, 0, 0, 2607, 2944, 0, 121, 0, 128, 0], [-3834, 0, 0, -1920, -1484, 0, 303, 0, -779, 0], [0, 5448, 10742, 0, 0, -282, 0, 523, 0, -1304], [0, -6400, -6580, 0, 0, 497, 0, -2404, 0, -121], [9278, 0, 0, 628, -9480, 0, 808, 0, 536, 0], [-13892, 0, 0, -3394, -4740, 0, 1036, 0, -228, 0], [0, 4604, 7304, 0, 0, -1354, 0, 1085, 0, 1378], [0, 2720, 12862, 0, 0, -1566, 0, 2590, 0, 721], [7642, 0, 0, 1370, 752, 0, -282, 0, 1700, 0], [0, 1928, 564, 0, 0, -1265, 0, 3566, 0, -843], [0, -3524, 4874, 0, 0, -1131, 0, -2821, 0, 723], [-1084, 0, 0, -2092, -5372, 0, 269, 0, -15, 0], [0, 3144, 4868, 0, 0, 288, 0, 1317, 0, -314], [0, 4600, -15702, 0, 0, -372, 0, -1388, 0, 1062], [0, 5344, 1268, 0, 0, 102, 0, 3056, 0, -504], [-13431, 0, 0, 3389, -752, 0, -675, 0, 1693, 0], [18302, 0, 0, 289, 120, 0, -287, 0, 204, 0], [-18628, 0, 0, 2758, -2344, 0, -2221, 0, 925, 0], [0, -4204, 7232, 0, 0, 1310, 0, 3091, 0, -924], [11294, 0, 0, -4476, 664, 0, -523, 0, 114, 0], [0, 1308, -13191, 0, 0, 893, 0, 3961, 0, 363], [0, 4440, -1820, 0, 0, 324, 0, -5196, 0, 205], [0, -7512, 18674, 0, 0, 1050, 0, 858, 0, 366], [21023, 0, 0, -2597, -3816, 0, 173, 0, 55, 0], [0, -48, 23120, 0, 0, -978, 0, -770, 0, 638], [0, 6472, -26495, 0, 0, 364, 0, -1147, 0, -494], [14110, 0, 0, -1187, -4016, 0, 1196, 0, -46, 0], [0, -1992, 6914, 0, 0, -1296, 0, 372, 0, 696]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_825_c_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_825_4_c_s();".
// 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_825_4_c_s(:prec:=10)
    chi := MakeCharacter_825_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_825_4_c_s();".
// 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_825_4_c_s( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_825_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![900, 0, 7104, 0, 3625, 0, 631, 0, 43, 0, 1]>,<7,R![75458991204, 0, 4405598425, 0, 78865816, 0, 522294, 0, 1300, 0, 1]>],Snew);
    return Vf;
end function;