
// Make newform 77.4.f.a in Magma, downloaded from the LMFDB on 03 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_77_f();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_77_4_f_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_77_f();"
function MakeCharacter_77_f()
    N := 77;
    order := 5;
    char_gens := [45, 57];
    v := [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_77_f_Hecke(Kf)
    return MakeCharacter_77_f();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_77_4_f_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_77_4_f_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_77_f();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![113714630656, -22423515136, 243200916480, -104629211648, 1276502506752, 2409600411520, 5223346168384, 6149284050752, 7146705166896, 5522071500864, 4546891106584, 1734714303826, 502301176447, 81342254157, 154296270031, 19577394108, 22159371180, 1546613553, 2114839884, 182415679, 199747542, 17525909, 16633672, 1458300, 968145, 59773, 42220, 1896, 1724, 50, 58, 2, 1]>],Snew);
    return Vf;
end function;