
// Make newform 546.2.bz.a in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_546_bz();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_bz_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_bz();"
function MakeCharacter_546_bz()
    N := 546;
    order := 12;
    char_gens := [365, 157, 379];
    v := [12, 2, 9];
    // 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_bz_Hecke(Kf)
    return MakeCharacter_546_bz();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_bz_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_bz_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_546_bz();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![252047376, -7105335552, 61552141056, -217890207360, 1886986552032, -5661269209152, 1371879014400, 12138312116352, -5749974378608, -10135491329024, 864463721312, 1803837330528, 5200719153256, 2642294166944, -958727975040, -213778177984, -549314983440, -180604090096, 158981413984, -56636277440, 79447005712, -15429346368, 8919384408, -1861791352, -401377055, 60586680, -120319840, 25667224, 2088994, 100576, 1395656, -210664, 23115, -4080, -6768, 592, -102, 24, 24, 0, 1]>],Snew);
    return Vf;
end function;