
// Make newform 4012.2.a.j in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4012_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4012_2_a_j();".
// 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_4012_a();"
function MakeCharacter_4012_a()
    N := 4012;
    order := 1;
    char_gens := [2007, 3777, 3129];
    v := [1, 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_4012_a_Hecke(Kf)
    return MakeCharacter_4012_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4012_2_a_j();".
// 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_4012_2_a_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4012_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![32, -2832, 35544, -163920, 272904, 73870, -647694, 367309, 464138, -459309, -116876, 229457, -10873, -58757, 12170, 7806, -2642, -437, 250, -4, -9, 1]>,<5,R![-408928, -20016, 5327536, -6859872, -8143086, 14338843, 5395974, -12342335, -2161908, 5696706, 606335, -1556390, -119039, 263489, 15419, -27934, -1228, 1805, 54, -65, -1, 1]>],Snew);
    return Vf;
end function;