
// Make newform 6031.2.a.b in Magma, downloaded from the LMFDB on 23 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_b();".
// 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_b();".
// 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_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_6031_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-1077199680, -1781296928, 201297539176, 76786922992, -15476586191341, 6016736679892, 671942858267503, -604370078403021, -18839978596079005, 23660474925865986, 368020382890613840, -555979176325939907, -5267717339953475597, 8915998899576024483, 57361975922154048643, -104237879664422662377, -489644157684310715757, 926892124029575718815, 3358551029898459640138, -6462382799373326283037, -18899147983677220093892, 36156130255545420933041, 88766022363879860351997, -165319506449105850489430, -352944183520221540155341, 626878161193913802201125, 1201551217212772561049212, -1994923548306153761602326, -3533596006315301273808908, 5379884965229854295416166, 9038901391829951433363305, -12392789748130771354031763, -20218418200520197493746060, 24541726089035640724667675, 39712780440138568245530669, -41994143375867634019529526, -68730576692692331378323129, 62326354152476714036603298, 105116842183680736116234954, -80431126822990907106551829, -142435787171152166896084688, 90330342578775869974738259, 171399733478159379123388739, -88181504070405410120282538, -183561532983783785068435337, 74497425766906419474253775, 175303520251919775202133790, -53920097631408817716852541, -149558186453934496869962656, 32710040385369681152894567, 114161865220223638095624756, -15768371719007751750301282, -78072964894756330783058957, 5048461440535677814559900, 47886271486351568019351170, 134893861415181518066745, -26362401822037943507464577, -1725383317399421560126056, 13031974672353009260762123, 1620560812398501023000401, -5785078318994890345922454, -1045195689949715310874300, 2305221141492948073453599, 543155910548837378280408, -823799692730364066417918, -239376017258051882939894, 263605005005187583042496, 91526589830845271990894, -75345567269584374732441, -30720531692584270323549, 19168066646316151965074, 9110075935475061159234, -4317391730055929795544, -2395049531303906161945, 854124040687570537707, 559037276529992814964, -146538124450760400788, -115852013879190348745, 21322548163580280992, 21290031228617697501, -2513930741490677551, -3461262797033613028, 211675413801312792, 496062600609883964, -5449808320741321, -62366791896924308, -2136422891559431, 6833464270349933, 520478509082734, -646876061771324, -75249516170755, 52289383864991, 8188341881830, -3551213550620, -708898224931, 197885664240, 49479233092, -8710248888, -2769634120, 281881097, 122004621, -5536316, -4085340, 3512, 97915, 3459, -1498, -98, 11, 1]>],Snew);
    return Vf;
end function;