
// Make newform 546.2.cg.a in Magma, downloaded from the LMFDB on 25 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_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_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_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_546_2_cg_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_546_cg();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![9409, 22504, 1166390, 1395756, 45629800, 79305464, 108153456, 424154960, 249114615, -712101460, -369473630, 363097660, 73174804, 96007200, 3023502, -144115372, 81425836, -37875516, 18608144, -2379392, -353168, 458644, -362770, 29756, 15291, -1896, 3096, -584, -156, 36, -12, 0, 1]>],Snew);
    return Vf;
end function;