
// Make newform 8007.2.a.i in Magma, downloaded from the LMFDB on 19 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_i();".
// 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_i();".
// 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_i( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8007_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![59195, -695592, -12271607, 138316642, 573597020, -7921418183, -6823656932, 196310440676, -86713160178, -2457927651745, 2622454234646, 17367429901937, -24762426269388, -77361625987603, 131822659300457, 233564786531602, -464976027869571, -497936975440088, 1176177891580170, 759369555173628, -2236314848934349, -805284499101555, 3295489197908985, 506711896928921, -3843550212552700, 17259802294654, 3599890103419509, -477337151755298, -2734532557256316, 662168973000477, 1694968087786803, -579233429926810, -859483604909936, 377341450496193, 356062292126080, -193261414970319, -119714956665409, 79716784033656, 32165469208715, -26792742310441, -6673787306849, 7373136856382, 977664556497, -1661381199316, -67448050627, 305221206770, -10799626718, -45307855765, 4594612060, 5351846911, -871120411, -490582711, 110762614, 33417286, -10083428, -1550096, 655171, 37797, -29052, 293, 791, -48, -10, 1]>],Snew);
    return Vf;
end function;