
// Make newform 8007.2.a.h 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_h();".
// 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_h();".
// 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_h( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8007_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-845, -49663, -212741, 18229411, 103455438, -1460136869, -606363785, 27858799898, -18444016631, -242893593618, 268941691058, 1226533727336, -1690115831695, -4025045618666, 6437634982271, 9153443591617, -16755586829014, -14952498861155, 31746145051216, 17792776992246, -45535312147142, -15213007155910, 50762172465451, 8624727167031, -44790670163499, -2010105754261, 31681861426717, -1723771766449, -18118562167234, 2472127050539, 8420822809391, -1743676258088, -3186979544295, 862942027480, 981059998766, -325272160020, -244456748480, 96258376750, 48827489930, -22626321624, -7683007469, 4231947465, 922699779, -626366891, -79187947, 72437675, 4004108, -6404731, 8280, 417876, -19695, -18949, 1608, 533, -62, -7, 1]>],Snew);
    return Vf;
end function;