
// Make newform 432.7.q.a in Magma, downloaded from the LMFDB on 01 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_432_q();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_432_q_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_432_7_q_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_432_7_q_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 ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [1982464, -1272832, 870720, -174032, 66932, -2412, 4610, -2, 75, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-7632930609728512, -4823026922581312, -174379314561008, 466232516863180, -7513625691252, 5332957236702, -265266893774, 88893251653, -2553045007, -237483745], [798806124416192, -46994351236096, 31138486250944, -2997650194676, 2079826256340, -34883662914, 28795204174, -1146370163, 460307201, -4480309], [-4325413623528448, 2960661889116224, -309769419173840, 228122766558052, -8289398823516, 15759840319002, -4959213290, 258824546191, -4504997485, 3461507741], [-1290909474646528, 1661345105836480, 22565017435472, 39684958384188, 129295522044, -1737813847050, -43384613414, -28321882423, 325325413, -616498581], [-405548755940793344, 277054240308773440, -41043324284890960, 21180857311690244, -748445103980604, 1402805061934506, -1034501083834, 23041276017575, -403310379317, 304943719717], [-92595430022047744, -6988655598691456, -9361646938914488, -6645361171760492, -1744478638992072, -395031803258358, -30747762465548, -5964228234521, -357175151353, -76279967689], [310889182203269120, -145948698534608128, 68721029153101648, -6232031730939068, 2351692699086996, -888025282102710, 27258609427486, -15147738294065, 578302501715, -227142042571], [-2036374544132369408, 752411720604422464, -383239676636670544, 25457501676339860, -16648274210752332, 3668351532338898, -227714368032466, 64497613313027, -3915009601193, 949975118761], [1472190263095346432, -805332137700505600, 314060070699038944, -47934778347664292, 8191608895062036, -4933672285241034, 80407013762206, -82074515849855, 2091940389269, -1182537518497]];
    Rf_basisdens := [1, 1479313287226368, 8405189131968, 4437939861679104, 246552214537728, 4437939861679104, 184914160903296, 369828321806592, 1479313287226368, 1109484965419776];
    Rf_basisnums := ChangeUniverse([[z : z in elt] : elt in Rf_num], Kf);
    Rfbasis := [Rf_basisnums[i]/Rf_basisdens[i] : i in [1..Degree(Kf)]];
    inp_vec := Vector(Rfbasis)*ChangeRing(Transpose(Matrix([[elt : elt in row] : row in input])),Kf);
    return Eltseq(inp_vec);
end function;


// To make the character of type GrpDrchElt, type "MakeCharacter_432_q();"
function MakeCharacter_432_q()
    N := 432;
    order := 6;
    char_gens := [271, 325, 353];
    v := [6, 6, 5];
    // 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_432_q_Hecke();"
function MakeCharacter_432_q_Hecke(Kf)
    N := 432;
    order := 6;
    char_gens := [271, 325, 353];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 1, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..(prec+1)]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 7;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [15, 0, -1, -15, 0, 1, 0, -1, 0, 0], [0, -2, 0, -25, -5, -1, 2, 3, 0, 1], [68, -2, -10, 34, 4, -5, -10, -4, -8, -4], [-191, 22, 14, -191, -22, 14, -16, -8, 5, 5], [-1636, 3, 14, -3272, -7, 28, 4, 1, 3, 6], [-675, 136, 27, 0, 63, 0, -7, 17, 10, 0], [3563, 49, 14, -3563, 49, -14, 0, -51, 14, -14], [10594, 285, 336, 5297, 13, 168, 6, -13, -26, -13], [4927, 99, -206, 4927, -99, -206, -10, -5, -70, -70], [1272, 203, -297, 0, -9, 0, 253, -32, 221, 0], [-15417, 732, -189, 15417, 732, 189, 0, -733, -71, 71], [0, -419, 0, -18870, -973, 416, 423, 711, 0, 135], [-19594, 380, 922, -9797, 99, 461, -812, -99, -198, -99], [22516, 41, -237, 45032, -49, -474, 735, 694, 41, 82], [-65946, -1452, -14, 65946, -1452, 14, 0, -725, 117, -117], [0, 3845, 0, 13989, 7117, -152, 606, 639, 0, 573], [-30092, -3432, 1165, -30092, 3432, 1165, -340, -170, 284, 284], [-134956, 95, -1523, -269912, -3417, -3046, 1751, 1656, 95, 190], [95822, -6117, -2214, 0, -3051, 0, 240, -255, -15, 0], [0, 2107, 0, 95917, 3090, -5674, 1501, 1878, 0, 1124], [404886, -5668, 378, 202443, 1303, 189, 48, -1303, -2606, -1303], [152076, 223, 1681, 304152, -15571, 3362, 809, 586, 223, 446], [0, -3505, 0, -66363, -8021, -8993, 3597, 6183, 0, 1011], [-207898, -13368, 2774, -103949, 1880, 1387, -6007, -1880, -3760, -1880], [-239059, 2273, 3913, -239059, -2273, 3913, 4396, 2198, 4753, 4753], [-140507, 3008, 3849, -281014, -8431, 7698, 6459, 3451, 3008, 6016], [32838, 16823, -4023, 0, 11385, 0, 1363, -7310, -5947, 0], [180665, 22222, -5821, -180665, 22222, 5821, 0, 6259, -446, 446], [-350208, 12736, -19440, 0, 8568, 0, 6266, -10666, -4400, 0], [194319, 45027, -1645, -194319, 45027, 1645, 0, 11548, -3593, 3593], [-329370, 76423, -21162, -164685, -1267, -10581, 23007, 1267, 2534, 1267], [351970, 26178, 26236, 351970, -26178, 26236, 8474, 4237, -1837, -1837], [984595, 13568, -5190, -984595, 13568, 5190, 0, -4206, -10317, 10317], [0, 32089, 0, 2078239, 53490, -20608, 13483, 16278, 0, 10688], [91107, -31690, 25499, 91107, 31690, 25499, 26742, 13371, 13008, 13008], [-880770, -34304, 19278, 0, -16110, 0, 13976, -16060, -2084, 0], [-639859, -97739, -15155, 639859, -97739, 15155, 0, -8346, -5129, 5129], [-4804894, 6016, 30178, -2402447, 6358, 15089, -4709, -6358, -12716, -6358], [-785326, -1264, -27392, -1570652, -26802, -54784, -13420, -12156, -1264, -2528], [2272512, 47453, 30699, 0, 28989, 0, 4141, -14666, -10525, 0], [-47346, -11038, 87738, -23673, 10273, 43869, 5472, -10273, -20546, -10273], [-3414069, -10600, -63055, -3414069, 10600, -63055, -3186, -1593, 5211, 5211], [887660, 5084, 18568, 1775320, -78660, 37136, 18452, 13368, 5084, 10168], [4208244, 106393, 46089, 0, 58977, 0, -22069, 10508, -11561, 0], [-2523849, -94601, -64442, -2523849, 94601, -64442, 117318, 58659, 19200, 19200], [0, 48472, 0, -6131509, 36985, 179, 5870, -48219, 0, 59959], [-7981040, 5468, -40282, -3990520, 10172, -20141, 26546, -10172, -20344, -10172], [4614331, 87334, -42313, 4614331, -87334, -42313, 163166, 81583, 24614, 24614], [-468748, -24414, -27169, -937496, -82, -54338, -89831, -65417, -24414, -48828], [4167203, 57373, -10144, -4167203, 57373, 10144, 0, -96885, 8048, -8048], [0, 90206, 0, 1311953, 175092, 97528, 10280, 15240, 0, 5320], [7279795, 37642, -36133, 14559590, -157287, -72266, 114745, 77103, 37642, 75284], [-3047493, -94584, -55614, 3047493, -94584, 55614, 0, -5218, -2762, 2762], [-14458970, 51033, -57332, -7229485, 17740, -28666, 58207, -17740, -35480, -17740], [-2929524, 6957, -18393, -5859048, -314169, -36786, 171591, 164634, 6957, 13914], [2078662, 272856, -132084, 0, 146070, 0, 22074, -41358, -19284, 0], [0, -193066, 0, 7760671, -383386, 223903, -43805, -84864, 0, -2746], [-4042582, 221803, 215032, -2021291, -49325, 107516, 8542, 49325, 98650, 49325], [-9265921, -3505, -129443, -9265921, 3505, -129443, 196108, 98054, -9221, -9221], [2567909, 224902, -85295, -2567909, 224902, 85295, 0, -80843, 51402, -51402], [11126773, -56460, 347841, 0, -19953, 0, -67965, 51411, -16554, 0], [5333035, -41779, -65964, -5333035, -41779, 65964, 0, 81599, 32110, -32110], [0, 116798, 0, -14764509, 347350, -286922, -117798, -121842, 0, -113754], [-1333298, -161705, -161812, -666649, 13065, -80906, -193612, -13065, -26130, -13065], [0, -325055, 0, -19123267, -604964, 126008, -144589, -244032, 0, -45146], [7852189, -432560, 371534, 7852189, 432560, 371534, -262300, -131150, -27496, -27496], [12802952, -706724, -91309, -12802952, -706724, 91309, 0, -5286, 78014, -78014], [0, -357202, 0, 13845629, -791916, -368555, 206909, 336306, 0, 77512], [-16443970, -819025, -387114, -8221985, -87879, -193557, 289479, 87879, 175758, 87879], [2484674, 43686, -15652, 4969348, -950308, -31304, -154664, -198350, 43686, 87372], [0, 267889, 0, 29888605, 632916, -82096, 139435, 376008, 0, -97138], [19339509, -408622, 26696, 19339509, 408622, 26696, -403452, -201726, -233145, -233145], [2113035, -1525667, 201474, 0, -755802, 0, -141148, 127085, -14063, 0], [6962845, -309487, 254659, -6962845, -309487, -254659, 0, 337472, 49589, -49589], [-26502174, 538176, 19906, -13251087, -46446, 9953, 90631, 46446, 92892, 46446], [14619444, 817625, 82917, 0, 355473, 0, 3595, 103084, 106679, 0], [5487501, -476742, 41761, -5487501, -476742, -41761, 0, 63749, 199829, -199829], [-12238915, -123804, -6778, -12238915, 123804, -6778, -505268, -252634, 81772, 81772], [15153251, 709933, -57876, -15153251, 709933, 57876, 0, -374937, 4320, -4320], [0, 29489, 0, -43368189, 71431, 340360, 362850, 738153, 0, -12453], [24227758, 44462, 49956, 48455516, 1422920, 99912, -417864, -462326, 44462, 88924], [19125426, -1070671, -826848, 0, -483741, 0, -247526, 144337, -103189, 0], [0, -616547, 0, 3376689, -1003372, -740818, -5655, 218412, 0, -229722], [-45493676, -298981, 489704, -22746838, -202831, 244852, 897173, 202831, 405662, 202831], [41968620, -116095, 104642, 83937240, -111833, 209284, -847184, -731089, -116095, -232190], [0, -521947, 0, 6410867, -704469, -200489, 108677, 556779, 0, -339425], [-74900018, 437991, 1289580, -37450009, 152029, 644790, -1106136, -152029, -304058, -152029], [-25567349, 84555, 1161208, -25567349, -84555, 1161208, -504838, -252419, 107030, 107030], [7523473, -46364, 913613, 15046946, -805635, 1827226, -521261, -474897, -46364, -92728], [31469038, 2112381, 549604, 15734519, 100588, 274802, -685541, -100588, -201176, -100588], [37982772, -2081438, -627804, 0, -866070, 0, -211246, -138052, -349298, 0], [-6547066, -3252560, 10270, 6547066, -3252560, -10270, 0, -22389, -27797, 27797], [46648030, 123882, -1047344, 46648030, -123882, -1047344, 1393994, 696997, 386195, 386195], [-1287340, -9847, -714443, -2574680, -689991, -1428886, 221399, 231246, -9847, -19694], [88853949, -2080170, 170446, -88853949, -2080170, -170446, 0, -192538, -28117, 28117], [65230050, 365302, -70667, 130460100, 893444, -141334, 910823, 545521, 365302, 730604], [-84249998, -383619, 1210005, 0, -82161, 0, -827745, 608448, -219297, 0], [-47629968, -612454, 1444986, 0, 164988, 0, -524654, -417776, -942430, 0], [0, 668806, 0, 20402496, 1328018, 924659, -297846, -605286, 0, 9594], [8906632, -32861, -790333, 17813264, -124047, -1580666, 1776163, 1809024, -32861, -65722], [9512610, 2035218, 97757, -9512610, 2035218, -97757, 0, 498652, 423916, -423916], [-192612474, 2127874, 1272996, -96306237, -239878, 636498, -910686, 239878, 479756, 239878], [-16319588, -1191600, -3054833, -16319588, 1191600, -3054833, -155872, -77936, -435922, -435922], [80426132, -2855823, 1550880, 0, -1796067, 0, 691566, 44745, 736311, 0], [-189292080, 2003011, -3489248, -94646040, 218699, -1744624, 622717, -218699, -437398, -218699], [21056536, 782261, 268779, 42113072, -2006833, 537558, 1969983, 1187722, 782261, 1564522], [38485433, -3728111, 167893, -38485433, -3728111, -167893, 0, 1230006, -348497, 348497], [0, -139741, 0, -88533875, -486301, 1730179, -449363, -1105545, 0, 206819], [111117923, 844523, 523687, 111117923, -844523, 523687, 837568, 418784, -586685, -586685], [-139349296, 4773747, -357237, 0, 2606283, 0, 685365, -1124184, -438819, 0], [-52964267, 1042094, -1125587, 52964267, 1042094, 1125587, 0, -2616291, -59315, 59315], [0, -198782, 0, 7936004, -1732478, -634351, 1275800, 1216686, 0, 1334914], [-213199926, -4703096, -467262, 0, -2298582, 0, 429872, -535804, -105932, 0], [54838058, -3411786, -848692, 27419029, -14596, -424346, 1377290, 14596, 29192, 14596], [-42570640, 3033716, 1273633, -42570640, -3033716, 1273633, 593428, 296714, 622270, 622270], [147596866, -46738, 88452, 295193732, -630916, 176904, 1156008, 1202746, -46738, -93476], [65143445, 2604442, -463159, -65143445, 2604442, 463159, 0, 2737873, -246074, 246074], [-81358522, -1818017, 1288412, -40679261, 475774, 644206, 139787, -475774, -951548, -475774], [-221241007, 2213676, -293287, -221241007, -2213676, -293287, 4739458, 2369729, 526816, 526816], [0, -1548199, 0, 98831549, -3532371, -3341498, 224288, 12603, 0, 435973], [84820370, 4879736, 2226630, 42410185, 808266, 1113315, -776211, -808266, -1616532, -808266], [11231211, 300116, 2129831, 22462422, -7312637, 4259662, -734315, -1034431, 300116, 600232], [0, 2724826, 0, -23756139, 5786573, 309053, -1688916, -3040911, 0, -336921], [36049834, -1289581, 279501, 72099668, -5090569, 559002, 6909, 1296490, -1289581, -2579162], [0, 1176302, 0, -44413583, 2399636, -3641291, 2391745, 4830522, 0, -47032], [-81160648, -28726, -1126712, -162321296, 2838042, -2253424, 1771088, 1799814, -28726, -57452], [0, -490229, 0, -41858281, -1962224, -407218, 1089605, 1197444, 0, 981766], [141029543, 2120700, 145826, 141029543, -2120700, 145826, 2320744, 1160372, 326143, 326143], [-150412281, 2655853, -5007744, 0, 1974330, 0, -145894, -1146913, -1292807, 0], [-96636361, -2537681, 276591, 96636361, -2537681, -276591, 0, 1733412, -103851, 103851], [57498279, -2651333, -2945459, 57498279, 2651333, -2945459, 613476, 306738, 629631, 629631], [-4553194, -4809252, -4656636, 0, -2101896, 0, -658068, 52608, -605460, 0], [-54952695, 114450, 4413440, 54952695, 114450, -4413440, 0, -1101400, -317511, 317511], [-289571765, 625390, 1783625, -289571765, -625390, 1783625, -2874046, -1437023, 1475828, 1475828], [48993294, 28703, 359909, 97986588, -10261577, 719818, 390469, 361766, 28703, 57406], [-178921209, -4926581, 3480481, -178921209, 4926581, 3480481, 147756, 73878, -1212621, -1212621], [-155418697, -9832340, -2963166, 155418697, -9832340, 2963166, 0, 57058, -223651, 223651], [103627134, 920547, -2692944, 207254268, 2455263, -5385888, 1713222, 792675, 920547, 1841094], [151492221, -9900278, -114183, 0, -5733279, 0, 1160831, 405449, 1566280, 0], [9892674, 12105639, -1171340, 4946337, 1401243, -585670, -3186104, -1401243, -2802486, -1401243], [218249579, 3541415, -1614452, 218249579, -3541415, -1614452, -271190, -135595, 700330, 700330], [252560634, -483362, -1820138, 505121268, 766556, -3640276, 164198, 647560, -483362, -966724], [-151049802, -7621603, -772227, 0, -3152637, 0, 398011, -1714340, -1316329, 0], [-82513990, 685236, 6031158, -41256995, -648715, 3015579, -2416434, 648715, 1297430, 648715], [0, -1269967, 0, -204469033, -2657541, -3360458, 658016, 1198425, 0, 117607], [504211098, -1767457, 1406336, 252105549, -1613669, 703168, 4552934, 1613669, 3227338, 1613669], [-343182042, -5580314, 5971975, -343182042, 5580314, 5971975, -7175064, -3587532, -2414028, -2414028], [-207709244, 247328, 2829054, -415418488, -4878400, 5658108, 36270, -211058, 247328, 494656], [-165471809, 7225936, -247162, -165471809, -7225936, -247162, -3565192, -1782596, -920611, -920611], [-179686372, 851055, -2078179, -359372744, 155117, -4156358, 1562029, 710974, 851055, 1702110], [-18509973, -4915802, -779571, 0, -1722753, 0, 337019, -1807315, -1470296, 0], [154562197, -5842897, -2120662, -154562197, -5842897, 2120662, 0, 2029097, 426912, -426912], [0, -5057753, 0, 358068468, -10981981, 5491424, 270783, -324909, 0, 866475], [381802802, -10129903, -1685540, 190901401, -488154, -842770, 4069747, 488154, 976308, 488154], [302475388, 10760232, 5274828, 0, 6151896, 0, -6495222, 4951662, -1543560, 0], [-122563422, -7199049, -6236312, -61281711, -808425, -3118156, 345634, 808425, 1616850, 808425], [224638782, -15735049, -2769309, 0, -9692415, 0, 2771581, 878200, 3649781, 0], [121924449, 3172878, -5878703, -121924449, 3172878, 5878703, 0, 1113713, 1208144, -1208144], [120231172, 3889384, 2483490, 60115586, -237990, 1241745, -8609460, 237990, 475980, 237990], [158827006, 180111, 5691298, 317654012, -4103357, 11382596, -9114772, -9294883, 180111, 360222], [-333835879, 667673, -5642012, -333835879, -667673, -5642012, 2316706, 1158353, -1931666, -1931666], [-167025082, 2151781, -3289131, -334050164, 5776879, -6578262, -581961, -2733742, 2151781, 4303562], [-251229747, 898614, 2222774, 251229747, 898614, -2222774, 0, 4216778, 2993328, -2993328], [1080913674, -6948525, -8810092, 540456837, 96732, -4405046, 6840527, -96732, -193464, -96732], [-8906018, -27329298, -332586, 0, -15483852, 0, 1657356, 1981050, 3638406, 0], [0, -4884382, 0, 270173245, -8966104, 8429557, 1392589, 3587838, 0, -802660]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_432_q_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_432_7_q_a();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_432_7_q_a(:prec:=10)
    chi := MakeCharacter_432_q();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 7));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 1;
    while true do
        trunc_vec := Vector(Kf, [0] cat [f_vec[i]: i in [1..prec]]);
        B := Basis(S, prec + 1);
        S_basismat := Matrix([AbsEltseq(g): g in B]);
        if Rank(S_basismat) eq Min(NumberOfRows(S_basismat), NumberOfColumns(S_basismat)) then
            S_basismat := ChangeRing(S_basismat,Kf);
            f_lincom := Solution(S_basismat,trunc_vec);
            f := &+[f_lincom[i]*Basis(S)[i] : i in [1..#Basis(S)]];
            return f;
        end if;
        error if prec eq maxprec, "Unable to distinguish newform within newspace";
        prec := Min(Ceiling(1.25 * prec), maxprec);
    end while;
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_432_7_q_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_432_7_q_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_432_q();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,7,sign)));
    Vf := Kernel([<5,R![573210021546168750000, -9967474437367500000, -37672459588687500, 1659712524075000, 4382316489375, -202244434875, 501307200, 7729605, -19308, -219, 1]>],Snew);
    return Vf;
end function;