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


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_546_2_q_j();".
// 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_q_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_546_q();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![4, 0, 141, 0, 861, 0, 1442, 0, 366, 0, 33, 0, 1]>,<11,R![36864, -82944, 145152, -111744, 74304, -20736, 10464, -2160, 1080, -96, 36, 0, 1]>,<17,R![102627966736, 0, 197535033516, 0, 266911702005, 0, 180214153639, 0, 87372493479, 0, 16041014910, 0, 2020732761, 0, 156438945, 0, 8816949, 0, 322054, 0, 8355, 0, 111, 0, 1]>],Snew);
    return Vf;
end function;