
// Make newform 4031.2.a.e in Magma, downloaded from the LMFDB on 20 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4031_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4031_2_a_e();".
// 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_4031_a();"
function MakeCharacter_4031_a()
    N := 4031;
    order := 1;
    char_gens := [3337, 697];
    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_4031_a_Hecke(Kf)
    return MakeCharacter_4031_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4031_2_a_e();".
// 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_4031_2_a_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4031_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-16810773, 10040686441, 615614081019, 8531324060114, -16574977957962, -894559957950283, -1615093310701741, 40345574218283390, 110205930609625133, -1074101105322688903, -3148357056412485447, 19049987091029024089, 54065812407266106463, -240359128610552574871, -630962352861787734510, 2252528252378085284116, 5351699473996137195552, -16191205016975821290318, -34486641811772828164462, 91587069424146270184273, 174350756203129402300886, -416414287255336063241755, -708660130253618580133320, 1548953228546111664523214, 2360846661625655727619395, -4784606120654374945274453, -6547417597880162463267184, 12428907590241980342368903, 15310715937510583392518793, -27445184621015116435652626, -30511897221815220249865573, 51992065630920454863193344, 52286423497071134199986485, -85167390811035409372701612, -77637084220544927144996933, 121458962857070655708589390, 100542180631312327345416238, -151691130240802859167441160, -114200706678885229045452166, 166754694088223769198390099, 114324506553531023311359622, -162069626681871824844066529, -101293668815648190271747969, 139795352019137908134287093, 79720665296366414343997683, -107371015080053069923949504, -55905983621919182946568646, 73640791608831836242712480, 35026773584699015617711661, -45210381123304840287567384, -19650441556818135015774755, 24896024564830014934303932, 9889726542260819741476137, -12317477110979333161490602, -4471867588088042552271072, 5482689592569466643135260, 1818818402583446801236667, -2197778211199267382847754, -665951548932620755148079, 793946896637226316995698, 219614592947891739312689, -258569200009895234536380, -65239569175540854349300, 75920539374344780964488, 17454508144452290540776, -20091501911543592079805, -4203468051044451715590, 4789118440990922470539, 910329990636006752091, -1027170459580595826371, -177044743618987046444, 197945310088686912481, 30864279158341369332, -34208381785405816060, -4811491215333818423, 5288614686608374298, 668719324401126325, -729192348894714453, -82550184938672885, 89327126258872510, 9009161990993436, -9676782025337165, -864265351990060, 921667222821465, 72361213555829, -76630108793889, -5240523172971, 5512002155172, 324574269472, -339120859001, -16940206122, 17584121132, 730545605, -753458444, -25331469, 25961181, 678588, -691129, -13177, 13338, 165, -166, -1, 1]>],Snew);
    return Vf;
end function;