
// Make newform 546.2.cg.b in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_546_cg();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_cg_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_546_cg();"
function MakeCharacter_546_cg()
    N := 546;
    order := 12;
    char_gens := [365, 157, 379];
    v := [12, 10, 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_546_cg_Hecke(Kf)
    return MakeCharacter_546_cg();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_cg_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_546_2_cg_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_546_cg();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![14841086976, -73784411136, 410533795584, -663279611904, -1198835295264, 2136929558400, 2606859684216, -958938592008, -3338117825951, -3935907454984, -1141287542290, 3078410239380, 5275776927280, 5605429466104, 4204000456584, 2093713020448, 644521343319, -65606683772, -195344567606, -88880751604, -22304144084, 3901784832, 6153231174, 1171102612, 601910644, 22293036, -117817552, -6748672, -6554768, -752596, 1446062, -132044, 108147, -5592, -4680, 128, -348, 12, 12, 0, 1]>],Snew);
    return Vf;
end function;