
// Make newform 4017.2.a.j in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4017_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4017_2_a_j();".
// 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_4017_a();"
function MakeCharacter_4017_a()
    N := 4017;
    order := 1;
    char_gens := [1340, 1237, 1756];
    v := [1, 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_4017_a_Hecke(Kf)
    return MakeCharacter_4017_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4017_2_a_j();".
// 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_4017_2_a_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4017_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-4, 75, 5710, 19591, -49833, -162221, 176070, 473648, -362287, -696938, 473679, 587112, -398614, -297794, 216897, 90923, -76373, -15486, 17185, 983, -2375, 103, 183, -21, -6, 1]>,<23,R![-51544992512, -178443364048, 440637883148, 1204298447164, -428184465822, -2483708493011, -1117256978422, 1190421544090, 1005133055703, -108199784155, -271799872680, -17084181125, 39521642793, 4110238342, -3778592497, -314107969, 252863698, 6570388, -11260840, 498204, 277305, -33531, -1729, 578, -41, 1]>],Snew);
    return Vf;
end function;