
// Make newform 4020.2.q.l in Magma, downloaded from the LMFDB on 25 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_l();".
// 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_l();".
// 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_l( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4020_q();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<7,R![9603801, -18866712, 50519602, -34733966, 72914079, -33739936, 74473693, -16579051, 39095831, -3391344, 15055256, -179041, 2666961, -63385, 326139, -6779, 25371, -729, 1420, -30, 47, -1, 1]>,<11,R![20729809, 126113547, 502104305, 1172948036, 2012947388, 2291390307, 2040258827, 1353876809, 769432123, 356462157, 157057563, 58135879, 20768528, 5948680, 1690719, 378971, 92445, 16360, 3337, 406, 74, 6, 1]>,<17,R![6233260401, -20859327906, 71200111459, -50878558236, 110431966346, -119823142425, 127137590522, -80724875255, 43326286762, -15671786806, 5188645787, -1233340211, 326273853, -60276156, 14439629, -1891259, 423500, -38405, 9450, -476, 120, -4, 1]>],Snew);
    return Vf;
end function;