
// Make newform 462.2.bc.a in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_462_bc();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_462_2_bc_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_bc();"
function MakeCharacter_462_bc()
    N := 462;
    order := 30;
    char_gens := [155, 199, 211];
    v := [15, 20, 21];
    // 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_bc_Hecke(Kf)
    return MakeCharacter_462_bc();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_462_2_bc_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_bc_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_462_bc();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![214107550677460700233934606881, 2851901758401917179342868665365, 17058610983604831010357911173345, 108058122818775588980235149153640, 686261994213002837202016793776235, 2834225391196765656232141118149950, 8799125562815175375737107517291414, 23960303114306698204443331346065270, 40771146575661817229671786319893460, -29481980602512460851531484482499415, -584782972706917615935380370053216780, -2466143546503824795361925926106036865, -5753524396249674036650629990148780097, -7610065265663311636245079343174953175, 3306878708917695071832308541055543236, 44008500353254262031755674646260836210, 136644341219235612355568070177304487926, 281965660151872913097004292312546122460, 469342440064343537306292210643836887098, 647228963833449650516736186089111262315, 790205818107866345104129710905691765266, 835687841265820657814587167130596536780, 741943803870693505740209269443513406306, 316674887293941311777450356325407374305, -648252987437174838136032299581970115324, -2364444631645970697603837781633395272425, -4608557654478573674682545474693226552867, -6661038464611178793856765335603589098870, -7376188632272182222531000390678381579537, -5801517683931811074144551540035026040670, -1769805684529115621199756322996598782798, 3900773904616622255184755793157044463915, 9678570050084878618314809771925331734267, 13998405349052083009436770438728252453795, 15835173267333999848395580760075274737402, 15031355756726390744771309796838109169470, 12196479646857721117444216795698559210439, 8364439087977571464120603763938373285500, 4569262142585385731380999156691995716789, 1534189638579685282541153448265461570620, -433774934966764134083222688179483243031, -1388759934383993626357664822725861474320, -1591840751773893778283588959457118337311, -1360839514907968349861189516000725435515, -963891031538383345824806903114026500174, -575071921104809705668171033393361861225, -276932419944535395852646821786263072854, -86456836986935958558048642203953620080, 14028847871332331259989740394530188478, 53582254849976990746232895791966383765, 58854222128712376726942266913467007998, 48941078430895705568207647635667768860, 35105947162340696766180862647502596418, 22711193733331207094820531334225847270, 13520052713063203554229880292316279253, 7474861053087747469129344321759752225, 3853122315154359638635020115781288558, 1851119308366216690582336465895094860, 825473380510301383447648959485492563, 338557429356820476439442550016494070, 125330435888127798836610149299307333, 40269338232137345778578584708637655, 10013208896202247425210331463852003, 980754430468561204333609392175005, -899851227374789557658367392244942, -837145458163656829061339957766520, -480928466828527309238466306037768, -225795478063632332779546248007835, -91302333851594858354319916815902, -32400210445438723440797267640880, -9688751948095058934357036375583, -2198427801554269996824862055555, -163993525122021392988347493932, 198963824895699263493790408865, 154765963628045874563736249688, 81829564626468750856463007105, 33452744929171226768102593744, 12379645864185877658076772110, 3809595058710165602028527163, 989492347555606832534962365, 191961043457193167625263836, -9075676965092577267429410, -18556072697483241519047371, -15726981532955117729798275, -5389315289301205591281521, -2481901560536623064112060, -628003484268160551636919, -191052959709862034684445, -38277463940341505812297, 950886705168005155370, 490306122527463248501, 2324072598038311367765, 422581364539821637652, 322131630821084762915, 56815378230800738369, 20023283460688974500, 4895828584836918186, -660379662786814715, 285870633267273929, -276848867826853015, -2733548473745930, -25715545814608685, -4024643322229578, -480518736850890, -584433883732378, 134762860144410, -35351091586725, 15003185226800, 811589821928, 572155464065, 313850266512, -21526647035, 23999686263, -4097703595, 629459494, -273686470, -41941855, -9246835, -5734048, 160030, -294255, 41625, -1765, 2300, 762, 50, 46, 0, 1]>],Snew);
    return Vf;
end function;