
// Make newform 539.2.q.f in Magma, downloaded from the LMFDB on 23 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_539_q();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_539_2_q_f();".
// 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_539_q();"
function MakeCharacter_539_q()
    N := 539;
    order := 15;
    char_gens := [199, 442];
    v := [10, 6];
    // 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_539_q_Hecke(Kf)
    return MakeCharacter_539_q();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_539_2_q_f();".
// 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_539_2_q_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_539_q();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![625, -5000, 22500, -93750, 258750, 35000, -792625, 1052375, 254500, -1243500, 1094250, -1232125, 928775, -59500, 175350, -403550, 95925, 15325, 5420, 14130, 11570, -19805, 4375, 210, 156, 328, -125, -77, 14, 22, -5, -3, 1]>,<3,R![65536, -32768, -983040, 6823936, 7659520, -46272512, 123142144, -438679040, 683738368, 579908736, 78207168, 25613632, -34861104, -135013072, 1967068, 23755248, 12609261, -724842, -1899947, -1042822, -9459, 222742, 30888, -22174, -2647, 1740, 234, -32, 20, -24, -10, 2, 1]>],Snew);
    return Vf;
end function;