
// Make newform 4006.2.a.i in Magma, downloaded from the LMFDB on 19 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_i();".
// 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_i();".
// 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_i( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4006_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![-87552, 3725056, -34708736, -274513344, 3184256256, 10823556976, -50321038200, -112958345872, 404260608288, 500370888030, -1901180273059, -939272413368, 5437542565210, -33964359334, -9721508233238, 3494153116490, 11069064411626, -7304850756458, -7951693182951, 8111762517474, 3250922929592, -5744630899993, -280120503276, 2741089402622, -511652225663, -885238497394, 350937904760, 182936374843, -124836742972, -18164666394, 28407988481, -1668032323, -4234770479, 918359068, 383607078, -158540620, -13728611, 15241170, -1090320, -807087, 161811, 15645, -7802, 462, 122, -21, 1]>],Snew);
    return Vf;
end function;