
// Make newform 8007.2.a.j in Magma, downloaded from the LMFDB on 16 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_8007_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8007_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_8007_a();"
function MakeCharacter_8007_a()
    N := 8007;
    order := 1;
    char_gens := [5339, 1414, 7855];
    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_8007_a_Hecke(Kf)
    return MakeCharacter_8007_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8007_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_8007_2_a_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8007_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![2527, -445569, 6112363, 117886405, -1500914392, -5549298265, 89392805513, -9229689216, -1607964277142, 1422201498363, 14982679977045, -17633788413163, -87533234548873, 114584281972203, 352713274324158, -483559319220881, -1037016210777229, 1450492886536507, 2308037353668422, -3255487491236194, -3989981060970831, 5654149996856662, 5459425352367618, -7782779767944040, -5996364919184291, 8641912881120434, 5342508838154285, -7845916470871667, -3889936937731800, 5884761009705523, 2325073593637540, -3675331637238415, -1142345991870470, 1922669574590219, 460065029304987, -845972623359539, -150512170648424, 313884024739737, 39173465467481, -98311847435678, -7717686683534, 25981723859943, 984702420641, -5781668496989, -12222435639, 1079111043959, -31903000696, -167906427887, 9690403355, 21588855915, -1787794400, -2265403168, 238449679, 190622246, -23901716, -12539758, 1799319, 620700, -99191, -21725, 3792, 479, -90, -5, 1]>],Snew);
    return Vf;
end function;