
// Make newform 8041.2.a.h in Magma, downloaded from the LMFDB on 24 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_h();".
// 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_h();".
// 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_h( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8041_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![37888, -2597632, 35039360, 485029248, -4341239040, -40939984176, 158273317544, 1601266284484, -1914631504814, -30708956311720, 1532661287392, 339460625725021, 181796388591106, -2415138535615501, -2153002491196444, 11886785489866034, 13605787525096110, -42516558579361154, -57552974124678290, 114407987830546726, 177616275556470870, -237291659116162292, -419401898980786968, 385405005436997543, 781571924636707238, -493927751986328617, -1175027674752809906, 497916835247469822, 1448690537007471724, -385826387037907721, -1483143119585416687, 212422318177193013, 1273119409329581778, -56154353169441582, -923154083250719011, -34936880358123342, 568664000849668721, 61050736169360692, -298813451228671253, -50160157258006442, 134303830862492566, 29815556002495471, -51703985925824058, -14060378548763373, 17049999982579948, 5449961758623408, -4809162566680975, -1765519944438431, 1156622928625640, 481941047936823, -235923978381283, -111230927601668, 40472707934138, 21706357048352, -5763025605619, -3571826929257, 666597340524, 492905220864, -60204973642, -56558958948, 3878745609, 5330047539, -125199181, -405313357, -6037769, 24243908, 1161129, -1097696, -83972, 35347, 3587, -721, -89, 7, 1]>],Snew);
    return Vf;
end function;