
// Make newform 4031.2.a.c in Magma, downloaded from the LMFDB on 19 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_c();".
// 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_c();".
// 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_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4031_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![9, -1191, 47839, -651340, 208554, 38627135, -69051109, -988904926, 1437284265, 13524504473, -14660657015, -113460401841, 94185141695, 639371828377, -423922156015, -2570815562311, 1416366482829, 7691084903532, -3637848187216, -17647342304966, 7347924240185, 31771423755493, -11857219302395, -45675382344391, 15465166949760, 53160249489118, -16451383800027, -50635677233252, 14376430050845, 39808715750360, -10379716776711, -26000465645540, 6218922679901, 14175557388451, -3101612507521, -6471954514147, 1289946129498, 2478439233496, -447523749341, -796164728200, 129354238144, 214201601062, -31054815680, -48099523389, 6159793608, 8963950542, -1001356019, -1374793006, 131852002, 171434036, -13825827, -17083344, 1126217, 1326667, -68626, -77297, 2941, 3176, -79, -82, 1, 1]>],Snew);
    return Vf;
end function;