
// Make newform 729.2.g.b in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_729_g();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_729_2_g_b();".
// 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_729_g();"
function MakeCharacter_729_g()
    N := 729;
    order := 27;
    char_gens := [2];
    v := [22];
    // 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_729_g_Hecke(Kf)
    return MakeCharacter_729_g();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_729_2_g_b();".
// 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_729_2_g_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_729_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![13966276041, 191861597457, 2095643223198, 18422905756140, 119317100794371, 468775186039962, 2264523477536547, 1662639327384147, -7401547610966790, -162358718421763791, -426090775536788139, -2038991353079101542, -5772526011677414484, 54770121460339097832, 110361694881728333106, -316703305315248098256, 490061236130046612855, -382852081537015110804, -2755375538891172905709, -62387227331000052555168, 229254527451838352408451, -130654669912039050672789, -11784565374647411184966, -963243241087682640151179, 2278900117977494674693563, -1742998226147885457360612, 3125402641490875715022912, -9548595571525412675550273, 12653944439556369488252094, -9924612138352291814202762, 12431471727888231978533832, -22024342501661906771476293, 44216640608102408944427715, -14836746317519776953596724, -62623771589417715495317925, -106627650460709621309191755, 84523998634025338241117604, 112483961051180009246530884, -28105920865939977148140522, 77354140207482430015481379, 328027738754927224524415275, 424327118665966191970329762, -96068564178707278928695266, 141590144062827313946809866, 1092331405140503422690359351, 1174758195709023238938172869, 627212443166808421300567614, 539837366157255743035076988, 997784129806273523955642966, 749832648805214958028477446, 372906605252516102884191141, 637023724313943975898478733, 471538935546957018528335613, 233641120260558304091306727, 600493894002922666783737357, 633318919284658565269492803, 304172967327817492092051288, 261261539383099140808301664, 221045406940349575677287766, 108449490093385658212847835, 131995221543455443197578271, 158429919195189564144299910, 152108413926180828367333473, 158202341670004002737938944, 154258988013493031019270906, 135650273312283918059201787, 115649304058336955587453107, 93845025126542981764114668, 69138172069853759321800221, 47135307681256756274792775, 30278675610049197566094552, 18525765361167431711581734, 10942653860172466241734242, 5957038138986313767622575, 2983750934320585584088857, 1471154215714731337036689, 619298334512280592906644, 197017407761805535294440, 53421121436569341549345, 902590968320613834417, 1087364770810705466766, 12942820257668918651646, 13199715613654813997640, 11670175822704329170413, 11262680674062955870995, 9495664143462538765812, 6475888072883740321962, 3581618035083671704248, 1608707985363736990902, 574779690323051485743, 118553082094033013511, -50045618453590011825, -81008934048358691094, -60120637953900213978, -32792644164816859581, -13085405262337476366, -2614143314499842718, 755060264846865558, 913007201849645868, 401770093786017957, 67581547853322276, -32177114815798440, -17747142769869237, 8106928461795456, 14109494414958360, 8349787335713427, 2675274564886704, 272835399063888, -212375322483273, -194277629730897, -109277147696688, -34247291894397, 1215868615488, 5131956363084, 1579398522984, -77621591412, -181814055651, -63278385579, -26756105868, -21575767797, -9168065208, 1254190041, 3571384905, 1869242166, 511029918, 84808647, 8143800, -5358582, -7546878, -3754107, -459054, 358074, 222291, 71928, 24705, 12471, 5841, 1413, -141, -144, 45, 75, 36, 9, 1]>],Snew);
    return Vf;
end function;