
// Make newform 462.2.ba.b in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_462_ba();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_462_2_ba_b();".
// 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_ba();"
function MakeCharacter_462_ba()
    N := 462;
    order := 30;
    char_gens := [155, 199, 211];
    v := [30, 25, 9];
    // 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_ba_Hecke(Kf)
    return MakeCharacter_462_ba();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_462_2_ba_b();".
// 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_ba_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_462_ba();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![1291129965841, -5007515648818, 13783471845774, 503037650317032, -1497196673454342, 183212864968580, 69623790613650927, 11469558996501754, -58819142034258102, 1272988240360896424, 5795631318970863874, 14487795232113695670, 29558846740085167043, 52906978075249033406, 77638125974372995762, 97870932264945109404, 109368942956294277170, 104342691211855815950, 83769884329382902111, 54381034964505728950, 28334277509059275424, 7569137371936927084, -1915966546217779883, -5720126303946150628, -5111085847513778500, -3283070022332290152, -1761858667764768276, -664808974314372652, -188580691597695178, 28076403420426124, 69003426809304103, 61478342706287206, 41555789404565595, 23038679685257188, 12206406029175550, 5182892429447882, 2250086121108054, 730465495476344, 221440965544803, 48171933286870, -1922154613445, -2819069100144, -3412522141986, -951791230790, -350065584609, -92689697722, 123077724, -3811116472, 2827875644, 199856912, 234520632, 51671864, 4881954, 4272780, -645666, 38340, -84066, -19484, -5031, -1232, 52, 8, 22, 2, 1]>],Snew);
    return Vf;
end function;