
// Make newform 378.2.w.b in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_378_w();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_378_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_378_w();"
function MakeCharacter_378_w()
    N := 378;
    order := 9;
    char_gens := [29, 325];
    v := [5, 6];
    // 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_w_Hecke(Kf)
    return MakeCharacter_378_w();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_378_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_378_2_w_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_378_w();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![2678994081, -610584256602, 62040419151354, -1791831089998503, 23751425586749463, -27867572896319343, 296304794722237320, -99922780862088138, 412734672190806615, 1252555404257264346, -3258493210271396880, -7797690034444260198, 73037231506301292531, -287619916478573240127, 840915635776447976028, -1836670589475462702855, 3082686061464679497201, -4206471989422076360334, 4756100868724791430620, -4255697460589636800852, 2813108621329993470282, -1198812212066265517737, 42748095794673514509, 454376690818097488317, -293113338893221703949, -146770351916692569336, 348633275844477830130, -256695437202966601461, 121571306152484248548, -38148730483855212234, -4135002777101786112, 7002211421692383417, 4630724665432196778, -5403881723097197340, 1648638695142496890, -155632200141457818, -298865860350313851, 164407046434208793, 116297660960942049, -57823676578684782, -5957298730260531, 60360733409229, -140796568547007, 1405499424785109, 596180626187598, -366893239643529, -19814498761593, 40587920951070, -1101638122940, 1873832114565, 3391286901339, -550613980582, -320070605811, 68276357262, 13812529921, -3840911349, 4096190967, 412324007, -263882943, 34301607, 16253077, -939135, 1442979, 66992, -85170, 10056, 4291, -531, 246, 41, -15, 0, 1]>],Snew);
    return Vf;
end function;