
// Make newform 4006.2.a.g in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4006_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4006_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_4006_a();"
function MakeCharacter_4006_a()
    N := 4006;
    order := 1;
    char_gens := [5];
    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;

function MakeCharacter_4006_a_Hecke(Kf)
    return MakeCharacter_4006_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4006_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_4006_2_a_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4006_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![-6140, -620736, -3789592, 38463812, 65098095, -513192418, -649371442, 3008970260, 3831277512, -9204713986, -12401054654, 17162873178, 24512363721, -21531577762, -32325378360, 19347144055, 30137046130, -12961596562, -20619548045, 6639641704, 10604996766, -2638125143, -4161332828, 817872116, 1255556715, -197647067, -291799411, 36961404, 52015434, -5274340, -7033157, 561414, 706914, -42997, -51051, 2231, 2498, -70, -74, 1, 1]>],Snew);
    return Vf;
end function;