
// Make newform 8041.2.a.d 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_d();".
// 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_d();".
// 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_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8041_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![18954, -63342, -2254500, 10378278, 76140660, -394573691, -1307755088, 7140581158, 14486471012, -76351823511, -116538005410, 534580005466, 710093361758, -2603439254425, -3296202132858, 9194426728104, 11694978615444, -24273323505328, -32017030255912, 48965389407696, 68519588552112, -76607181849604, -116172429551042, 93713715430077, 157930273118913, -89653908098330, -173893686936827, 66255589955011, 156339715653183, -36343720827318, -115478839048962, 12924258835585, 70385030433391, -845415729438, -35492742434774, -2583122115798, 14819625362957, 2175568594942, -5117688532326, -1093950271882, 1456567532396, 403719507979, -339440790931, -115752053566, 64066410156, 26313726067, -9618756777, -4767645030, 1113370525, 685719852, -93308152, -77351543, 4753552, 6697649, -18034, -429661, -19171, 19232, 1604, -536, -62, 7, 1]>],Snew);
    return Vf;
end function;