
// Make newform 6031.2.a.d in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_6031_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_6031_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_6031_a();"
function MakeCharacter_6031_a()
    N := 6031;
    order := 1;
    char_gens := [816, 5218];
    v := [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_6031_a_Hecke(Kf)
    return MakeCharacter_6031_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_6031_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_6031_2_a_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_6031_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![5092864, 328139392, -18148254720, -623189369872, 14238882431671, 388288711178289, -2601984803856044, -91363677406497517, -47455533739572592, 8038578775716633954, 22803475321970063798, -361343262100099340483, -1425265536441211943372, 9916015183423703796549, 45709603099952937949720, -187243120629361804528905, -939113625378639842617146, 2636099008122553675107035, 13674482541594354967446009, -29206921361023438165996326, -149690118558880622934654452, 263893178700859358572514067, 1280561445787930893691335064, -1988221354462669967389474436, -8799235094508886553330303451, 12659768842716986569949013874, 49567277524516131065474106144, -68696346196523257722492238494, -232541950208766690762339010696, 319576885966694954813856705067, 920019159111676795774811022292, -1281073290221466214865341103002, -3100738345868191666970764650781, 4447145151094706944612713840959, 8975687902797785875503669818070, -13435534499272856834938001157986, -22463741506105097258051790541000, 35501080050402859706386248433669, 48862020828977462723515135543938, -82439226894324558192251609496020, -92724603988575642761629385080213, 169017108628867050100145013957965, 153868021423845620217901952833023, -307261249922349522063439253157463, -223356740887512618120795100881471, 497280498696499886819383287367172, 282962289849519851919610191608523, -719117325301743866889778390691819, -310708453402809119725324350416083, 932268014771324911906472059026883, 291112317783661003875650738642594, -1086710038858920491620193966211782, -224328727562272860257859331135017, 1141988235651154078063449781386201, 127815990280057530240057571576177, -1084388755318564747951930334354241, -28752818154956865937377867914139, 932274170494467061428194734313777, -48212188318810541964590514234551, -726871181173823040929606205824795, 90464261629807945970977855083877, 514640773667140684116599017075424, -99460041591403852768569139026427, -331217759328364389270827064077695, 85989387346692269477698709035838, 193890259945939254427882933987574, -63022661871944024978231991325751, -103257767523024205180848259567116, 40395557573420152953173197584087, 50014375044390156891888314596179, -23011343295990591109015943555576, -22013653788361022980148152693152, 11760159606357854588612716514943, 8790020723039763975958030055588, -5424148867027470740825389660188, -3175249735011705845558786314778, 2266717411503104890598589352932, 1033019279545013717064292807030, -860476975127734233132177778674, -300478189095309942821465733979, 297223451354087749432894482073, 77174804446163657586708093194, -93507578997865845874030672620, -17096832011407561059168116411, 26803651890993135421598934817, 3100769328599513579588038095, -6999403320779576452248673508, -391058902126074419514315170, 1664050455434726779620355930, 2599549565972710849002580, -359753135767793591802952299, 17547595316912837000690632, 70602985768796556972435936, -6815526290165355257241237, -12548207292297900350386435, 1795394459276177100770709, 2013181036736840497034467, -382372760338688489328117, -290306998151886690397894, 69380359787126733517176, 37408686284444494676817, -10957173684212382682619, -4272526319934599971772, 1520532289064545207414, 427334654282515963474, -186081859387422759740, -36714034980854074796, 20084615680074522688, 2614841846402678247, -1907168679480439943, -142126658819133355, 158562825040916050, 4259611622617819, -11459864480956437, 174853747350977, 712767474699628, -38385814743113, -37621351086333, 3419061220493, 1652017449274, -212723378666, -58578699446, 10047987540, 1596075098, -364189501, -30210812, 9910228, 285484, -191882, 2353, 2366, -106, -14, 1]>],Snew);
    return Vf;
end function;