
// Make newform 4024.2.a.g in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4024_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4024_2_a_g();".
// 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".
// To make the character of type GrpDrchElt, type "MakeCharacter_4024_a();"
function MakeCharacter_4024_a()
    N := 4024;
    order := 1;
    char_gens := [1007, 2013, 2017];
    v := [1, 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_4024_a_Hecke(Kf)
    return MakeCharacter_4024_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4024_2_a_g();".
// 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_4024_2_a_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4024_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![-116224, 216560, 8213712, -42870476, 15046752, 282073467, -395122372, -670863595, 1509266059, 567496506, -2710706003, 309568238, 2739445725, -1063783683, -1661322904, 1003920503, 611581038, -528322928, -125996155, 176429505, 7179668, -39014549, 3372238, 5729902, -1051227, -539075, 149528, 28952, -12061, -529, 532, -23, -10, 1]>,<5,R![-9535488, -604430336, -1848786944, 7919519744, 30289558528, -11360591360, -122642361856, -58193667200, 181637683904, 143500203232, -142831215184, -146719926064, 69470887880, 88699032622, -22553670053, -35658067522, 5094929202, 10070552217, -819260517, -2053065687, 94723267, 305410238, -7865910, -33096020, 461698, 2576528, -18352, -139884, 446, 5010, -5, -106, 0, 1]>,<7,R![-1527027904, -1474503705, 187972944081, -1054080762474, 1678579501180, 1313720029196, -5415710831593, 1308967071951, 6408747812048, -3592649659031, -4047443454997, 3168258477551, 1507095377024, -1581940435442, -321952625662, 509530844842, 26345057906, -111394648814, 5338009697, 16827099670, -2054439717, -1748377000, 324250883, 121352211, -30521071, -5217651, 1810796, 109528, -66228, 486, 1361, -71, -12, 1]>],Snew);
    return Vf;
end function;