
// Make newform 345.2.m.d in Magma, downloaded from the LMFDB on 04 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_345_m();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_345_2_m_d();".
// 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_345_m();"
function MakeCharacter_345_m()
    N := 345;
    order := 11;
    char_gens := [116, 277, 166];
    v := [11, 11, 4];
    // 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_345_m_Hecke( : Kf := Kf)
    return MakeCharacter_345_m();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_345_2_m_d();".
// 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_345_2_m_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_345_m();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![529, 17825, 425111, -12648410, 143051457, -882410271, 3614526643, -8465435200, 15620159788, -28439182873, 43984444551, -43795430208, 37156455153, -26294277943, -1714153888, 8721394998, 574489147, 6462580352, 16918035555, 1517136981, 9676019423, 2966602625, 3619040593, 464971684, 1538079142, -567848110, 400271359, -228816965, 80207391, -69586352, 44958937, -5006067, 7122764, 977262, 1068864, -872443, 430451, -203496, 143274, -64784, 29596, -10587, 5824, -1633, 731, -195, 100, -20, 9, -2, 1]>],Snew);
    return Vf;
end function;