
// Make newform 8041.2.a.i 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_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_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_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_8041_2_a_i( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8041_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![2176, 79104, -9935360, -195838176, 10585508664, 5848326960, -1330176541986, -671759929126, 45293935268430, 19937821298664, -772430802425332, -267978818307959, 8054873829171798, 2008755781049469, -56801759542854944, -8918247725993613, 288220853498255346, 21169703785047519, -1098304908126133066, 377192006627670, 3243657453176076750, -210165944953069942, -7606027891095878370, 919736896606666199, 14432886843574027838, -2452702341242569075, -22502483715756645470, 4793694369260218867, 29183100957855688806, -7333168498048267244, -31797647378339798651, 9083249672651701049, 29345713131803476118, -9302916483365605519, -23089967020035969636, 7991490435441992941, 15570020069077700295, -5817432795388585710, -9034054065937661042, 3616000375806889518, 4523444741137635479, -1930038313487752133, -1958217063404271367, 888224051421954669, 733526038200345754, -353442976847741935, -237691381851698259, 121810474451469386, 66527259243826478, -36382005143625449, -16035399882502506, 9413285057599915, 3312352053098776, -2106667854465531, -581968701613226, 406714980900967, 85963920283214, -67465737221180, -10476356665187, 9561928826301, 1018432840877, -1149183212079, -73364537357, 115934309863, 3051344680, -9684833439, 66152500, 657547361, -23832717, -35340745, 2206930, 1445941, -124167, -42288, 4520, 787, -99, -7, 1]>],Snew);
    return Vf;
end function;