
// Make newform 8007.2.a.f in Magma, downloaded from the LMFDB on 24 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_f();".
// 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_f();".
// 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_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8007_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![787, 1015, -218463, -123609, 10273984, 3703491, -185646057, -12775996, 1685041014, -180273313, -9028767355, 1837276263, 31499612337, -7966793865, -76349314284, 20943049363, 134485965188, -37461865096, -177786723709, 48378890641, 180568315085, -46765479077, -143326830249, 34650636114, 90010477491, -19995146791, -45101403054, 9078739488, 18122486935, -3262073122, -5850905170, 929007428, 1515937660, -209161371, -313724060, 36957940, 51396467, -5057388, -6569034, 524438, 640263, -39788, -45907, 2081, 2280, -67, -70, 1, 1]>],Snew);
    return Vf;
end function;