
// Make newform 546.2.z.b in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_546_z();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_z_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_z();"
function MakeCharacter_546_z()
    N := 546;
    order := 6;
    char_gens := [365, 157, 379];
    v := [3, 5, 6];
    // 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_z_Hecke(Kf)
    return MakeCharacter_546_z();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_z_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_z_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_546_z();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![567011344, -1240319456, 5621271680, -297574912, 17264364000, 1840921424, 31945718432, 10242858352, 35245764540, 11213425256, 25155570152, 7862722576, 12718654048, 3490824448, 4593154124, 1111389676, 1238254837, 247871516, 247061142, 40036844, 37936073, 4756364, 4456192, 411024, 406986, 25532, 28007, 1028, 1438, 24, 49, 0, 1]>],Snew);
    return Vf;
end function;