
// Make newform 378.2.u.d in Magma, downloaded from the LMFDB on 18 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_378_u();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_378_2_u_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_378_u();"
function MakeCharacter_378_u()
    N := 378;
    order := 9;
    char_gens := [29, 325];
    v := [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_378_u_Hecke(Kf)
    return MakeCharacter_378_u();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_378_2_u_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_378_2_u_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_378_u();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![185761, 1393854, 12533844, 46554560, 98682471, -19153161, 243235656, 167757147, -28213191, 654415521, 658904040, -203769405, -96304488, 85680162, 8196759, 9815364, 5151051, -9666297, 2858250, -587880, 338166, -44418, 2925, -9945, 3834, -333, -81, 53, -6, -3, 1]>],Snew);
    return Vf;
end function;