
// Make newform 58.4.d.b in Magma, downloaded from the LMFDB on 16 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_58_d();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_58_4_d_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_58_d();"
function MakeCharacter_58_d()
    N := 58;
    order := 7;
    char_gens := [31];
    v := [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_58_d_Hecke( : Kf := Kf)
    return MakeCharacter_58_d();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_58_4_d_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_58_4_d_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_58_d();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![100462613794816, 111565005633536, 47510571702272, 133016598481088, 308319901375136, 222270645213260, 112352914930005, -4299865618387, 14323928093420, -8671418968180, 3210516732027, -787737100173, 176315501752, -17719059741, 3174361164, -173021585, 15609284, -1306289, 555872, -60041, 9883, -302, 80, -5, 1]>],Snew);
    return Vf;
end function;