
// Make newform 8041.2.a.g in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_8041_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8041_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_8041_a();"
function MakeCharacter_8041_a()
    N := 8041;
    order := 1;
    char_gens := [6580, 2366, 562];
    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_8041_a_Hecke(Kf)
    return MakeCharacter_8041_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8041_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_8041_2_a_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8041_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![5248, 208640, -10135296, -22086176, 1484134216, 6751790208, -35778066930, -210329100506, 384421959390, 3073221945890, -2057719796243, -27219382912346, 2656903818447, 163032935937700, 40817702292627, -701243646674718, -347266420247829, 2248416218041096, 1549749295943177, -5509268564403530, -4742721886720143, 10491735652642512, 10807772884504824, -15694874717476644, -19099729074236406, 18521090148432458, 26835351294304594, -17159408443262804, -30491297132869831, 12207925600938579, 28363798126485433, -6218290400264998, -21794414107814425, 1660660586400312, 13919673510820889, 577064510938779, -7418164236010319, -1057749520697315, 3303775352759029, 773352357589289, -1228300307286322, -395748451610271, 379560377336438, 157134793621325, -96591979038688, -50203160089554, 19890112961397, 13099641552813, -3198262434295, -2804970952651, 367879270019, 492025460091, -20939039059, -70185642276, -2142065430, 8031023283, 757858811, -720691694, -111493168, 48838922, 10709178, -2329125, -711205, 65777, 31814, -346, -869, -41, 11, 1]>],Snew);
    return Vf;
end function;