
// Make newform 161.4.e.a in Magma, downloaded from the LMFDB on 23 December 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_161_e();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_161_4_e_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_161_e();"
function MakeCharacter_161_e()
    N := 161;
    order := 3;
    char_gens := [24, 120];
    v := [1, 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_161_e_Hecke(Kf)
    return MakeCharacter_161_e();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_161_4_e_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_161_4_e_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_161_e();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![2834136431345664, 21226418570330112, 121306687156584448, 359574235265839104, 921537441716527104, 1449958919863839744, 2512645701001194752, 2721735624400000384, 4480858566746037632, 3257138578431917184, 4832389394295407568, 1899857993108574144, 3635558438353747432, 717227923599468060, 1868916544264853433, 85427969357719250, 695703106609431667, -14540244435026812, 182892826782818002, -8589258004275831, 36126901437185680, -1887390070916768, 5442048638435936, -265841679316443, 646296344183984, -27131692624294, 61233121826028, -2095926074579, 4701577572727, -125935320464, 293233946608, -5901495749, 14915229774, -216182946, 613419942, -6036569, 20230183, -125256, 519681, -1739, 10053, -14, 132, 0, 1]>],Snew);
    return Vf;
end function;