
// Make newform 546.2.bi.e in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_546_bi();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_bi_e();".
// 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_bi();"
function MakeCharacter_546_bi()
    N := 546;
    order := 6;
    char_gens := [365, 157, 379];
    v := [3, 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_546_bi_Hecke(Kf)
    return MakeCharacter_546_bi();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_bi_e();".
// 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_bi_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_546_bi();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![3270763083, 20997409461, 51885957901, 44638970124, -38492559526, -93732114042, -439013472, 111362033196, 49496707143, -72810204549, -53535398844, 33168119847, 35852408112, -9008789877, -15985729585, 1176675570, 5315188447, 264077631, -1305032778, -173123175, 246076879, 49725264, -34473685, -8992971, 3657921, 1182456, -271152, -110490, 13479, 7575, -234, -333, -10, 9, 1]>],Snew);
    return Vf;
end function;