
// Make newform 3100.3.d.h in Magma, downloaded from the LMFDB on 25 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_3100_d();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_3100_3_d_h();".
// 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_3100_d();"
function MakeCharacter_3100_d()
    N := 3100;
    order := 2;
    char_gens := [1551, 2977, 1801];
    v := [2, 2, 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_3100_d_Hecke(Kf)
    return MakeCharacter_3100_d();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_3100_3_d_h();".
// 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_3100_3_d_h( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_3100_d();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<3,R![40000, 0, 120100, 0, 72440, 0, 15804, 0, 1524, 0, 65, 0, 1]>,<7,R![3158315776, 0, -1657490800, 0, 182348816, 0, -5740296, 0, 76356, 0, -455, 0, 1]>],Snew);
    return Vf;
end function;