
// Make newform 513.2.h.c in Magma, downloaded from the LMFDB on 05 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_513_h();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_513_2_h_c();".
// 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_513_h();"
function MakeCharacter_513_h()
    N := 513;
    order := 3;
    char_gens := [191, 325];
    v := [2, 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_513_h_Hecke(Kf)
    return MakeCharacter_513_h();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_513_2_h_c();".
// 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_513_2_h_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_513_h();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-9, -63, 177, 1638, 2250, -1905, -4485, 531, 3270, 137, -1193, -96, 235, 17, -24, -1, 1]>,<5,R![35721, -142884, 3196179, 19394802, 170177274, 378561924, 965704140, 1245372462, 2408204988, 2655256374, 3674796309, 2816662995, 2764861119, 1546493157, 1316027925, 582107640, 441462336, 151502058, 108257049, 29715627, 20171787, 4327692, 2838685, 493953, 303199, 41633, 23851, 2690, 1345, 110, 49, 3, 1]>],Snew);
    return Vf;
end function;