
// Make newform 4022.2.a.e in Magma, downloaded from the LMFDB on 07 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4022_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4022_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_4022_a();"
function MakeCharacter_4022_a()
    N := 4022;
    order := 1;
    char_gens := [3];
    v := [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_4022_a_Hecke(Kf)
    return MakeCharacter_4022_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4022_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_4022_2_a_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4022_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![1936765, 335138965, -1046327586, -7957372646, 23159579889, 77438979692, -214910089120, -405169973356, 1107421344857, 1273207461463, -3574649935595, -2548210064360, 7764121161183, 3315936993210, -11896490794349, -2706729573770, 13287048958071, 1081030063581, -11072248834836, 331409988132, 6999869022141, -824963342082, -3396435040837, 646023126034, 1273861584436, -322037681142, -370270106092, 115005051464, 83194090870, -30675149273, -14312212077, 6212597036, 1846727627, -958594044, -171228989, 111940313, 10273745, -9723684, -253318, 608553, -15218, -25918, 1698, 672, -66, -8, 1]>],Snew);
    return Vf;
end function;