
// Make newform 162.2.g.b in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_162_g();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_162_2_g_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_162_g();"
function MakeCharacter_162_g()
    N := 162;
    order := 27;
    char_gens := [83];
    v := [8];
    // 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_162_g_Hecke(Kf)
    return MakeCharacter_162_g();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_162_2_g_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_162_2_g_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_162_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![2163784203674077249142784, -9862674662200699668529152, 3839935105319228540780544, -57505636468225888844120064, 304525784995279173771411456, -293935089809926304086597632, 860783773094835233074532352, -1071059594812861120105494528, 675639319029391357274492928, -3276843512126123653663371264, 3485221352150551854315641856, -4769047955389781332202675328, 7598161538874375068591376192, -3524514765645467317889355840, 14143023309965392116437798016, -7219160523294617290624580304, 18846158645335012763819787936, -13052959761107015672418190566, 13466359432484510396981260743, -9324570534844648648583017521, 22468899189394876965923342214, -19274893745098595880695693103, 10025537701520304834165724716, 186072182037808652969492085, 19987311860779359930380418600, -8220157629446437962791465475, -2641351231633686074707117176, -6513357017984872248246957444, 2848456034563110747036788709, 3746152965213370716483385773, -213902949342769725630796398, -615473213179954777712304876, -744000885593744946674536440, -108181032051909813359804010, 285463096760160390000918627, 35909817816133618000250553, 39543162387433124901825798, -37558115046638207961898428, -4483674900541729648436337, 151377945412765544333901, -467112100191177372223113, 836861199459883872543153, 153273797907869100335454, -31668841512366898040721, 163498481799491804973759, -147405157172736804808227, 19929529166113712619936, 5794485434190770233518, -3220125759018869838327, 2133896119490138973651, -707149525081102433379, -60548283948033569529, 434559364641225455751, -314876374223690518785, 99310226536061712972, -16143925626605563065, 2008298410228848933, -1094104737479163285, 366205736133129213, 82185776764317441, -83512317182777046, 17722648468233045, 2431845517854726, -2179837803028608, 241283604609126, 98648407198593, -46862802103995, 14626993751289, -310113318528, 505217165517, 256550208768, -42151663548, 24185855529, 1639840059, -929247633, -65730204, 98528886, -24612417, 1084239, 1119420, 401679, 199554, 18657, 10341, 2673, 1377, 45, 30, 9, 0, 1]>],Snew);
    return Vf;
end function;