
// Make newform 4020.2.q.m in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4020_q();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4020_2_q_m();".
// 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_4020_q();"
function MakeCharacter_4020_q()
    N := 4020;
    order := 3;
    char_gens := [2011, 2681, 3217, 1141];
    v := [3, 3, 3, 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_4020_q_Hecke(Kf)
    return MakeCharacter_4020_q();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4020_2_q_m();".
// 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_4020_2_q_m( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4020_q();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<7,R![2742336, -7526520, 36504945, 9017730, 117527670, 6012918, 183916239, 23948526, 178221289, -8953827, 80762095, 1149434, 21954658, 556511, 3939141, 304739, 448005, 34877, 34383, 2939, 1762, 110, 55, 3, 1]>,<11,R![14482196964, 28401073026, 110876750191, -74573372987, 215942773861, -40850443068, 110493621044, -24707688315, 36128910745, -5472729869, 6155031295, -629745993, 739725875, -48416097, 60776754, -2290038, 3718551, -80147, 155557, -1886, 4727, -26, 86, 0, 1]>,<17,R![253956096, -1147184832, 5909989033, -6345855842, 24049261567, -19538975040, 75964886732, -32233939929, 76494157192, -49254023027, 58069760146, -22628510376, 9911165369, -1941341559, 591025947, -74661054, 24582651, -1898219, 632428, -25475, 12038, -224, 134, 0, 1]>],Snew);
    return Vf;
end function;