
// Make newform 381.2.i.a in Magma, downloaded from the LMFDB on 04 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_381_i();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_381_2_i_a();".
// 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_381_i();"
function MakeCharacter_381_i()
    N := 381;
    order := 7;
    char_gens := [128, 130];
    v := [7, 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_381_i_Hecke(Kf)
    return MakeCharacter_381_i();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_381_2_i_a();".
// 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_381_2_i_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_381_i();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![241081, 3758605, 38790902, 249844654, 1101211037, 3035256895, 7369004658, 26028708617, 98594404594, 73325192333, 246455676879, 175512857364, 279689194705, 101304311633, 461507730010, -365586241513, 1062494956561, -1079136836949, 1690996802183, -1596870708664, 1927770577772, -1687553479747, 1700041329762, -1309841515825, 1150562441704, -831366640598, 666008498082, -449734089237, 346516171864, -226984321548, 167929709631, -107685002862, 77494130264, -47580549344, 30665195558, -16780425327, 9550296100, -4781803989, 2544007950, -1215853567, 622484976, -288675896, 143539978, -64279065, 30880244, -13287521, 5967937, -2385876, 982702, -366756, 145766, -52496, 20286, -7104, 2667, -889, 313, -96, 28, -6, 1]>],Snew);
    return Vf;
end function;