
// Make newform 1339.2.a.g in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1339_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_1339_2_a_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_1339_a();"
function MakeCharacter_1339_a()
    N := 1339;
    order := 1;
    char_gens := [1237, 417];
    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_1339_a_Hecke(Kf)
    return MakeCharacter_1339_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_1339_2_a_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_1339_2_a_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1339_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-5184, 704, 110944, -26548, -911469, 218438, 3874828, -787299, -9660118, 1566088, 15232337, -1890106, -15976948, 1456485, 11526802, -738655, -5842683, 250430, 2104138, -56846, -539295, 8500, 97454, -801, -12112, 43, 984, -1, -47, 0, 1]>,<3,R![-2048, -64512, -341504, 3027200, 8222112, -32985552, -55082792, 149965524, 146606303, -320706163, -191047808, 379962612, 137218583, -276143422, -56203500, 130694031, 11986695, -41644162, -411103, 9067151, -464705, -1347477, 131520, 134063, -17860, -8520, 1371, 312, -57, -5, 1]>],Snew);
    return Vf;
end function;