
// Make newform 1859.4.a.p in Magma, downloaded from the LMFDB on 18 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1859_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_1859_4_a_p();".
// 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_1859_a();"
function MakeCharacter_1859_a()
    N := 1859;
    order := 1;
    char_gens := [508, 1354];
    v := [1, 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_1859_a_Hecke(Kf)
    return MakeCharacter_1859_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_1859_4_a_p();".
// 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_1859_4_a_p( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1859_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![-10461972063347277824, -203253971684432019456, 431016448083481198592, 8981590649096188755968, -16672027594250339942400, -58920762389903163883520, 76142968431071022579712, 171570583572220867520512, -157008654675314025754624, -285498754798751105456128, 188715223620089262039552, 305657473234842781767424, -148153882276068613663680, -225775705923230128765504, 81112527095216123290944, 120552352293370466895968, -32323868008831714780816, -48110437487165782120064, 9662227909417708592896, 14713022006544546943984, -2214544980842923740756, -3514158064321104129044, 395542733197614894884, 665138844771792873726, -55710726945723973571, -100862590851709502158, 6238329916719426704, 12351148371277235617, -558107582892733026, -1227704777664726832, 39964619941663686, 99316510738200201, -2287394911698653, -6538769635603485, 104126822853748, 349390883437315, -3735110349228, -15061100863392, 103999316468, 518516311572, -2195795737, -14037207084, 33886652, 291850819, -359566, -4492292, 2338, 48173, -7, -321, 0, 1]>],Snew);
    return Vf;
end function;