
// Make newform 189.2.v.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_189_v();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_189_2_v_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_189_v();"
function MakeCharacter_189_v()
    N := 189;
    order := 9;
    char_gens := [29, 136];
    v := [7, 9];
    // 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_189_v_Hecke(Kf)
    return MakeCharacter_189_v();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_189_2_v_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_189_2_v_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_189_v();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![729, -6561, 104976, -888651, 7018083, 3300183, 67450725, 179520624, -2028766176, -845763444, 23940434358, -54860230881, 58498460901, -34005747564, 8511132591, 13364522019, -18471601989, -6122042856, 33160184271, -25426610208, 7037497971, 3158848854, 1201657599, -5691287691, 8716351032, -2245963707, -95898249, 434738799, 561003651, -119824029, 384642162, -46332243, -55368522, 20904210, 3313980, -2427651, 13634181, -711450, -77058, 629919, -101034, 23976, 107883, -12726, 2295, 4353, -648, 117, 612, -27, 0, 21, 0, 0, 1]>],Snew);
    return Vf;
end function;