
// Make newform 336.2.w.b in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_336_w();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_336_2_w_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_336_w();"
function MakeCharacter_336_w()
    N := 336;
    order := 4;
    char_gens := [127, 85, 113, 241];
    v := [4, 1, 4, 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_336_w_Hecke(Kf)
    return MakeCharacter_336_w();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_336_2_w_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_336_2_w_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_336_w();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![12845056, -42205184, 69337088, 1235714048, 4377186304, 8063197184, 9317556224, 6967326720, 3585180160, 1636224512, 1158057984, 842992384, 404937232, 99047488, 24014976, 16251712, 9658432, 1865824, 170496, 103872, 103880, 13392, 288, 144, 560, 24, 0, 0, 1]>],Snew);
    return Vf;
end function;