
// Make newform 768.2.n.a in Magma, downloaded from the LMFDB on 29 October 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_768_n();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_768_2_n_a();".
// 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_768_n();"
function MakeCharacter_768_n()
    N := 768;
    order := 8;
    char_gens := [511, 517, 257];
    v := [8, 5, 8];
    // 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_768_n_Hecke( : Kf := Kf)
    return MakeCharacter_768_n();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_768_2_n_a();".
// 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_768_2_n_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_768_n();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<7,R![1195499776, 7059036160, 20840652800, -40369174528, 39292022784, 8425397248, 46372995072, -92169613312, 88705161472, -10587135488, 9040271360, -19222802944, 21542736896, -2310927104, 346710016, -918034432, 1458295392, -63516544, 7321088, -20145792, 33081600, -1036992, 56320, -154368, 284304, -7328, 128, -352, 960, -16, 0, 0, 1]>],Snew);
    return Vf;
end function;