
// Make newform 6040.2.a.s in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_6040_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_6040_2_a_s();".
// 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_6040_a();"
function MakeCharacter_6040_a()
    N := 6040;
    order := 1;
    char_gens := [1511, 3021, 2417, 761];
    v := [1, 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_6040_a_Hecke(Kf)
    return MakeCharacter_6040_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_6040_2_a_s();".
// 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_6040_2_a_s( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_6040_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![512, -16352, 138672, -318296, -607116, 2536060, 180572, -6018223, 1725924, 6454054, -2638921, -3657761, 1678216, 1214112, -584720, -248751, 122485, 31874, -15853, -2487, 1242, 108, -54, -2, 1]>,<7,R![58789888, 118094848, -723250944, -1261921856, 1439198464, 2459293232, -1486236336, -2143303060, 959236848, 1024260874, -398029671, -290737839, 105667460, 50765298, -17830623, -5527710, 1902930, 372827, -126624, -15020, 5053, 329, -110, -3, 1]>,<11,R![628228096, 1586200576, -39203174400, 172494878720, -372199503360, 445600896576, -267582603496, 7362891824, 98372236217, -53070640325, -1535427465, 10402348950, -2498534205, -696408907, 356758849, 533851, -21327696, 2170225, 604245, -109944, -6181, 2247, -45, -17, 1]>],Snew);
    return Vf;
end function;