
// Make newform 510.2.l.g in Magma, downloaded from the LMFDB on 15 November 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_510_l();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_510_2_l_g();".
// 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_510_l();"
function MakeCharacter_510_l()
    N := 510;
    order := 4;
    char_gens := [341, 307, 241];
    v := [2, 1, 4];
    // 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_510_l_Hecke(Kf)
    return MakeCharacter_510_l();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_510_2_l_g();".
// 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_510_2_l_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_510_l();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<7,R![2420000, -2244000, 1040400, 98240, 287592, -225352, 87316, -2672, 1584, -1408, 632, -8, 2, -2, 1]>,<23,R![959512576, 0, 0, 0, 1840597770496, 0, 0, 0, 1969317828224, 0, 0, 0, 309746053520, 0, 0, 0, 2956073312, 0, 0, 0, 7875112, 0, 0, 0, 5392, 0, 0, 0, 1]>],Snew);
    return Vf;
end function;