
// Make newform 4017.2.a.g in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4017_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4017_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_4017_a();"
function MakeCharacter_4017_a()
    N := 4017;
    order := 1;
    char_gens := [1340, 1237, 1756];
    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_4017_a_Hecke(Kf)
    return MakeCharacter_4017_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4017_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_4017_2_a_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4017_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-64, 2085, 2817, -25550, -18305, 122698, 41022, -298462, -25173, 403989, -26960, -326900, 52434, 165500, -36577, -53536, 14007, 11029, -3194, -1397, 432, 99, -32, -3, 1]>,<23,R![138468131840, -1394389728180, 3838723064444, -1860675587024, -4927927397569, 4536944752776, 1959222261124, -2806360738149, -80691932325, 777594086190, -131256142425, -100013996671, 33827202734, 4026133627, -3239607945, 257472706, 115269488, -25272080, -75174, 568371, -62179, -493, 558, -41, 1]>],Snew);
    return Vf;
end function;