
// Make newform 462.2.n.e in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_462_n();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_462_2_n_e();".
// 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_462_n();"
function MakeCharacter_462_n()
    N := 462;
    order := 6;
    char_gens := [155, 199, 211];
    v := [3, 2, 3];
    // 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_462_n_Hecke(Kf)
    return MakeCharacter_462_n();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_462_2_n_e();".
// 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_462_2_n_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_462_n();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![65536, 0, -912384, 0, 11401616, 0, -16802592, 0, 16606208, 0, -9220072, 0, 3683208, 0, -922588, 0, 164601, 0, -15752, 0, 1079, 0, -40, 0, 1]>,<17,R![589824, -294912, 540672, 218112, 223744, 41728, 21444, 1830, 1365, 58, 47, -2, 1]>],Snew);
    return Vf;
end function;