
// Make newform 847.2.f.z in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_847_f();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_847_2_f_z();".
// 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_f();"
function MakeCharacter_847_f()
    N := 847;
    order := 5;
    char_gens := [122, 365];
    v := [5, 2];
    // 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_f_Hecke(Kf)
    return MakeCharacter_847_f();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_847_2_f_z();".
// 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_f_z( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_847_f();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![1, -8, 68, -564, 4688, 640, 6895, 3392, 10312, -4376, 10368, -4924, 7889, -3032, 3916, -1656, 1856, -1112, 687, -304, 164, -52, 16, -4, 1]>,<3,R![256, -2304, 19136, -156544, 1278480, -1150240, 1632652, -1551956, 1601637, -315012, 584211, -77534, 243744, -67166, 57101, -15620, 10879, -1976, 1365, -254, 164, -32, 15, -2, 1]>,<13,R![65536, -131072, 409600, -819200, 2048000, -1310720, 4058112, -2916352, 11676416, -13670400, 15177664, -12965632, 12905408, -5654432, 2711988, -1049368, 373741, -35252, 16771, -1744, 989, -144, 35, -4, 1]>],Snew);
    return Vf;
end function;