
// Make newform 840.2.j.e in Magma, downloaded from the LMFDB on 17 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_840_j();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_840_2_j_e();".
// 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_840_j();"
function MakeCharacter_840_j()
    N := 840;
    order := 2;
    char_gens := [631, 421, 281, 337, 241];
    v := [2, 1, 2, 1, 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_840_j_Hecke( : Kf := Kf)
    return MakeCharacter_840_j();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_840_2_j_e();".
// 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_840_2_j_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_840_j();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<11,R![1677721600, 0, 6667668291584, 0, 29353610051584, 0, 55000694784000, 0, 57539234627584, 0, 37198885421056, 0, 15618474590208, 0, 4384561938432, 0, 839453564928, 0, 111189544960, 0, 10278237440, 0, 664089984, 0, 29739664, 0, 901760, 0, 17624, 0, 200, 0, 1]>,<13,R![-262144, -655360, 1769472, 7946240, 9414656, 2158592, -3813376, -3010560, -487040, 279040, 123232, 6112, -5072, -888, 24, 16, 1]>],Snew);
    return Vf;
end function;