
// Make newform 462.2.u.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_462_u();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_462_2_u_a();".
// 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_u();"
function MakeCharacter_462_u()
    N := 462;
    order := 10;
    char_gens := [155, 199, 211];
    v := [10, 5, 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_462_u_Hecke(Kf)
    return MakeCharacter_462_u();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_462_2_u_a();".
// 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_u_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_462_u();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![885481, 9955780, -70440875, -668226190, 4721905940, -4220443050, 2503163357, -4986562870, 7330752159, -4867949950, 1154074765, -176950870, 671337979, -459659400, -103450864, 225376620, -47358924, -43187730, 21054758, 3467180, -3732957, -156540, 511836, 8700, -59485, -1010, 6288, 340, -521, -80, 27, 10, 1]>],Snew);
    return Vf;
end function;