
// Make newform 847.2.r.d in Magma, downloaded from the LMFDB on 05 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_847_r();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_847_2_r_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_847_r();"
function MakeCharacter_847_r()
    N := 847;
    order := 30;
    char_gens := [122, 365];
    v := [25, 21];
    // 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_847_r_Hecke(Kf)
    return MakeCharacter_847_r();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_847_2_r_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_847_2_r_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_847_r();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![1, -40, 386, -57180, 1644129, 5387200, 15622120, 34912260, 63125897, 103707630, 128558792, 128015895, -82239301, 201668785, 59010065, -368022875, 851319666, -1233254405, 1456271006, -1583936750, 1490236705, -1337321925, 1115553531, -872470015, 639536770, -437278290, 277854897, -161173175, 87029268, -40993235, 17212739, -6265085, 1447336, -10815, -309848, 260405, -152303, 76060, -31718, 11210, -2375, 50, 502, -360, 162, -65, 18, -5, 1]>],Snew);
    return Vf;
end function;