
// Make newform 666.2.g.c in Magma, downloaded from the LMFDB on 08 December 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_666_g();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_666_2_g_c();".
// 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_666_g();"
function MakeCharacter_666_g()
    N := 666;
    order := 3;
    char_gens := [371, 631];
    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_666_g_Hecke( : Kf := Kf)
    return MakeCharacter_666_g();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_666_2_g_c();".
// 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_666_2_g_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_666_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![5143824, 47029248, 363030336, 1276863912, 4466809800, 6610056192, 23597772633, 23736231198, 83990660400, 18687954636, 140478517317, 8190574716, 152462579740, -10666701557, 109969867483, -14755457510, 58328154757, -10121004251, 22951393948, -4166444741, 6886634641, -1232280181, 1609148600, -268943110, 296292584, -45444529, 43310906, -5907457, 4999823, -598702, 451900, -45461, 31036, -2555, 1564, -92, 52, -2, 1]>],Snew);
    return Vf;
end function;