
// Make newform 558.2.g.a in Magma, downloaded from the LMFDB on 20 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_558_g();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_558_2_g_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_558_g();"
function MakeCharacter_558_g()
    N := 558;
    order := 3;
    char_gens := [497, 127];
    v := [1, 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_558_g_Hecke( : Kf := Kf)
    return MakeCharacter_558_g();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_558_2_g_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_558_2_g_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_558_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![123201, -1655316, 14267340, -76301028, 304759935, -862268301, 1929788172, -3265278471, 4713362373, -5485963221, 6160618606, -5628414734, 5158826303, -3359733054, 2419993968, -1074126305, 777146676, -238071663, 179689319, -33598474, 31331516, -3317944, 4111472, -171550, 408734, -3213, 29379, 448, 1530, 27, 50, 1, 1]>],Snew);
    return Vf;
end function;