
// Make newform 72.7.b.c in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_72_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_72_b_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_72_7_b_c();".
// 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_72_7_b_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 ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [767595744, -69390432, -19274256, -6850848, 7695616, -6345392, 1952056, -174032, 7702, -1286, 31, -2, 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, 0, 0], [-149217275697110424790424736, -29113080881816710822100496, -5234636509570794983450208, 5285383212018047497565552, -6588583421956646665585744, 2390674341286811773059064, -217529252471444660145968, 8910226370245629232408, -1643477500663486229130, 36994551472628440335, -1890624475709988630, 1285082917482048335], [-43555938697776742433561540640, 583668691617802232345412912, 84441689783996677153898784, -109139570542777865812939088, 131551461836220495575559664, -50777302039665582174648424, 5334917436238447189764752, -180501747991284588672712, 37310502765817944495294, -1232448389620631060733, -6593536281446547294, -31961894259811100093], [56137996643440283010436936896, -70144857400931362300347618000, 237696009070072560298544640, -1809123702784181394406096336, 482057787919482016750935648, 77307192346649582571430680, -8734807597542776114818624, -58017181726018684596936, -89813287555513596114516, 564998998002435238595, 242905447032957120384, 70626272810635536315], [-8018350463679460518585848688, 971376602761130875809963600, 3728939858314921830374061648, -233176917557525739694423408, -112143437618162789236176184, 70083033837084676833437288, -7595529833666443516217656, 210161896298577899927816, -55883738789247465085063, 1324099414029991513973, 7605743307928403693, 46175578837881495377], [1230196644572409238967228352, 222108153846629231113653744, -17095897433509027004502528, 92554988539804055254614768, -23397934435092191584032800, -5728955300479622263648392, 835039042678818639532736, -1561992031111110451944, 6601242719019840778076, -171168548833027470065, -24378284416871178880, -6015069576893425433], [-6658582393440985250468746608, -10104541618876161178761756528, 3404396541555075299938171344, 930870650276170756034332112, -507553444392642696065673080, 111973154248118253465319240, -10446092476740120081813592, 504810747308127373920040, -66587003974202241753143, 2512863311032391690057, -138396608497045319603, 55454897745252935557], [4043961749920762401585546768, -33274682672774978251417713984, 16156280328127388128642773264, -2571022085520250959119419392, -70750418038951079003044856, 162870816703918969668593952, -18595495828751295501494104, 491406150067157483925408, -134784463503842853813295, 3471852143138694363052, 128359901578966132073, 122720613344609680336], [107590920937098747225123909888, 21910108098776874539589816432, -1591211916899939062379914944, 9160329274190797113697198192, -2316978680800749252537978752, -548099496969394488598868296, 77217973404636251262730208, -113821234727960000179240, 631821181965845551871664, -14307094370735994274953, -2197595895695342113836, -562415764256047602977], [-37330082508753192383784489456, 1309401280930854603597495216, -6271919244975757407184615344, 2313381539434589531072820976, -195661772519139816605539960, 247139169902439424596806296, -31805793959893421991312696, 506252235287392742303416, -221503447214629917555759, 8130962289941898291659, 467343699441859647789, 192977346926815901399], [7929102577766124872348692416, 2895351607681279844278155408, 505942171013267148414975360, -527961408310085146951494768, 654966515833405303192795872, -239796048459582397055821368, 22323262024335299599655808, -886398404277744902638680, 166189853711179699599708, -4041758344432054942503, 156443272846597444056, -132104433981033397983], [-254076777412170612990246504480, -13329257423079772774287174768, 4590445802298569902130672544, 8466984416451796470852142352, -1577981706790703850534460944, 1774718124508086401603397576, -223361198611641702357576112, 4171468853136674976365736, -1542763935319594556306178, 56324152195068748633673, 2959943252833203680970, 1371570619306136278041]];
    Rf_basisdens := [1, 39790099041380889641582592, 756011881786236903190069248, 756011881786236903190069248, 378005940893118451595034624, 39790099041380889641582592, 189002970446559225797517312, 378005940893118451595034624, 756011881786236903190069248, 189002970446559225797517312, 126001980297706150531678208, 756011881786236903190069248];
    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_72_b();"
function MakeCharacter_72_b()
    N := 72;
    order := 2;
    char_gens := [55, 37, 65];
    v := [1, 1, 2];
    // 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_72_b_Hecke();"
function MakeCharacter_72_b_Hecke(Kf)
    N := 72;
    order := 2;
    char_gens := [55, 37, 65];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 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 := [[-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 3, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0], [2, 9, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0], [-212, 82, 0, 2, -2, -4, -2, 0, 0, 0, 0, 0], [-5, -72, 0, 4, 5, -5, 3, 2, -2, 3, 4, 1], [393, -71, -17, -9, -8, -17, -8, -6, -10, -2, 6, 0], [310, -117, 5, -4, -2, -10, -18, 12, 20, -4, 4, 8], [28, 218, -24, 8, -46, -6, 16, -16, 16, 18, 16, 0], [-121, -469, 84, -4, 39, 173, -58, -20, 20, 6, -80, -6], [-176, -907, 74, 2, -37, 93, -40, -28, 28, 19, -92, 44], [213, 1110, -72, 92, 39, 49, 67, -78, 78, 131, 116, -79], [3961, -3115, 187, -133, -96, -405, -192, 66, 110, -26, 30, 48], [-4102, 701, 47, -96, -130, -230, -178, -60, -100, -44, 108, 24], [-562, -3260, 98, 170, 66, 764, 32, 100, -100, 138, 180, -156], [285, 4785, -28, -452, -763, 1055, -198, 132, -132, -6, -320, 150], [73996, 689, 145, -28, -424, -1556, -136, -120, -200, 104, -168, -144], [1103, 10198, -416, -772, -1019, 251, -115, 350, -350, -435, -132, 143], [133148, 15215, 1319, 684, 48, 60, 336, 72, 120, 168, -360, -144], [-1398, -340, 726, -466, -794, 2596, -784, -212, 212, -354, -1028, -132], [39370, -37516, 1168, -1204, 260, -200, 148, 0, 0, -56, 112, 56], [-5332, -31403, 262, 1150, -1433, 1941, 576, 428, -428, 191, 1052, -212], [-204976, 21654, 2488, 226, -214, 608, -694, -24, -40, -248, 504, 240], [-36872, -41414, -4458, -634, 112, -1930, 1264, -252, -420, 492, -900, -576], [-103156, -36854, -5282, -1962, -888, -2226, -2328, 180, 300, -660, 1260, 720], [11009, 48525, -1920, 24, 4349, -2429, 1138, 332, -332, 2418, 1944, -474], [-4466, -49061, 640, 3216, 3083, -6997, 1416, -1200, 1200, 1019, 1120, 552], [685464, 39733, 865, 1236, 1356, 6584, -564, 960, 1600, -640, 960, 960], [10839, 65476, -2312, -1508, -423, -6625, 235, -1694, 1694, -149, -556, 457], [-87268, -27150, 2758, -722, 1240, 3606, -1160, 1572, 2620, -676, 828, 1200], [-30996, -161145, 6834, 4362, -4971, 15519, -1864, -1292, 1292, 45, -2508, -612], [-643528, 48763, -8941, 2368, 2088, 8632, 3048, -720, -1200, 240, -240, -480], [-123485, -9445, -10907, -1675, 4080, 19893, 528, -834, -1390, -2054, 4386, 1776], [-44692, 147807, 11679, 3876, 4024, 21068, -680, 1608, 2680, -1816, 3096, 2352], [22213, 118255, 1456, -1104, 11029, -229, -2496, -4896, 4896, 5952, -5024, 96], [-3406, -95023, 7688, 824, 27721, -15151, -2936, 5088, -5088, -4263, -2768, 824], [10435, 44826, -2832, 1228, 12185, -6377, 1621, 2542, -2542, -3627, 7420, -6617], [385142, 29585, 14759, 312, 2378, 10006, 2810, -1284, -2140, -212, 852, -216], [4840, -53564, -4592, 4752, 5092, -32236, 6704, 256, -256, 2436, 5536, 5232], [-5821, 21873, 1772, -7028, -1385, 8661, -5072, 5432, -5432, -12816, -2024, -4392], [444748, 70965, 16637, 2636, -1184, -4756, -3584, 3240, 5400, -120, -840, 1200], [-3015, 50132, 4496, -4308, -4737, 30129, -6035, -514, 514, 45, -6052, -3249], [-18226, 69034, 110, -18490, -45156, 49202, -8688, 8220, -8220, -10188, -11604, 4140], [1999322, -244164, -93336, -11388, -1116, 5328, -588, -7920, -13200, -2376, 7392, -264], [-22995, -177219, 1484, 6772, 1589, 19991, 4726, 8828, -8828, 6966, 9952, -1062], [58482, 265431, -5052, 4132, 37251, -20713, 2408, -7080, 7080, 9667, 6472, -8432], [-5786412, 8327, -12369, 7492, -4272, -30924, -2000, 7896, 13160, 3768, -10168, -1136], [8780, 99767, -1558, 15122, 6757, 62567, 3984, -8876, 8876, 22701, 16516, -21244], [3755248, -416528, 11694, -17986, -6730, -29984, -1642, -6888, -11480, 248, 1800, -2544], [-115451, -829168, 40496, 31916, 49211, 12885, -6491, -6258, 6258, 7909, -10436, -457], [-4581816, 308010, -143010, 19734, -13912, -53394, 2312, -396, -660, 7980, -15828, -8112], [-33794, -194026, 21830, 19806, 13984, 47918, -6624, -23316, 23316, 27384, -14116, -3732], [-1099564, 396626, -126646, 24270, 6652, 26306, -9428, 18780, 31300, -1780, -2700, 8040], [-3431076, -339526, -36016, -16710, -12442, -43284, 1382, -14400, -24000, 2112, 576, -6912], [-2271590, 559812, 203468, 3164, -19632, -46836, -35184, 8328, 13880, -5000, 7224, 7776], [54410, 553210, -23358, -38390, -39464, -20910, -7824, 13380, -13380, -47424, -1036, -7404], [-11613, -128585, 29640, 8080, 61007, 53561, -15242, -1996, 1996, 15222, -14632, -9534], [52128, 599875, -16706, -58890, -76995, 61635, -16112, 30140, -30140, -24747, -22004, 15852], [-113659, -583692, -4656, 24572, -45581, -10627, 14105, -3514, 3514, -22311, 26732, -13645], [12574142, 87812, -247212, -4196, 26264, 144740, 20216, -21768, -36280, -10280, 27816, 3024], [3911952, 240669, 90493, -5168, 34112, 160912, 3648, -1056, -1760, -15584, 31520, 15232], [-210683, -1629439, 50316, 46340, 67637, -105321, 3170, 7876, -7876, -23646, -6416, 19902], [-2700356, 443607, 26159, -25300, -50544, -99876, -61264, -20856, -34760, -12312, 31576, 5360], [204658, 870430, -55998, 26506, 34044, -111818, 43344, -31740, 31740, 67236, 46580, 948], [-10202266, 768676, 410968, 22236, 43260, 152688, 81516, -28944, -48240, 9480, -9312, -19128], [60239, 168367, 5928, -40352, 58963, -10539, -12614, 56396, -56396, -17862, -10936, 19374], [-370248, -562421, -55609, -5756, 53916, 173400, 35740, 7104, 11840, -6720, 11072, 9088], [-7622818, 1079940, -518088, 45372, 42812, 227728, 23468, -5712, -9520, -11576, 25056, 9672], [19230304, -2680, -201722, 1742, 9814, 57296, -33866, 22968, 38280, -14184, 20712, 21840], [-76885, -528658, 27848, 42196, -5135, 30711, 2129, -44922, 44922, 53393, -20484, 12523], [-12968216, 587302, 481314, 12122, 20520, 61938, 49416, -17268, -28780, 8692, -11628, -14448], [-290670, -1577740, 40654, 5158, -94714, -83428, -13312, -452, 452, -77442, -44820, 40380], [24104, -840291, -6318, 62154, 170347, -348587, 47176, -556, 556, 5731, 42036, 31020], [221677, 1314314, -62704, -88028, -97009, -235391, 1871, 3498, -3498, -40113, -50892, 81829], [-15481910, 468407, 27493, 46508, -136054, -592310, -51302, 22932, 38220, 50020, -107684, -42376], [78238, 479802, 100366, -21370, 176732, 112722, -82976, -45700, 45700, 31188, -123220, -3972], [441893, 2175983, -134980, 17148, 53369, -166973, 81352, -17176, 17176, 82056, 124376, -32448], [413283, 2895862, 34648, -95804, 144537, 281855, -92943, -28762, 28762, 59377, -103780, -44597], [2236903, 334411, 337869, 4613, -65272, -269747, 10376, -27282, -45470, 28730, -48366, -37824], [-32188264, -780542, 403510, -78882, 49880, 256966, -78472, 26436, 44060, -55364, 101916, 64176], [-38156224, -552380, 121826, -8690, -13002, -93776, -75114, 63864, 106440, -9768, -1752, 31056], [551381, 2867348, -520, -89436, 348955, -27971, -55303, 39382, -39382, 6073, -27844, -49149], [31902, 1049160, -9878, -116302, -196082, 7408, -58096, -10412, 10412, -102762, -107068, 39204], [-17754230, -6434612, -339924, -220108, -170824, -804644, 17176, -113976, -189960, 56008, -74024, -94000], [-426250, -1314705, -26160, 54528, -522497, 421423, 38296, -72304, 72304, 92815, 12480, 21720], [48170248, 3477512, 128902, 157190, -50970, -206664, -56826, 83496, 139160, 24904, -77640, 2928], [-7841343, -4531647, 246807, -88305, -2392, -295401, 64232, 25002, 41670, 41646, -91626, -33312], [30695804, -18994, -103510, -37230, -86312, -261574, 112120, -161796, -269660, 45284, -36636, -99216], [455975, 3080301, 36116, -116108, 273043, -49791, -115344, -41592, 41592, -97872, -115352, -78456], [-109496, -1074721, 159062, 28926, 505673, -226585, -102664, -6788, 6788, -189583, -61732, -116124], [-59742432, 381448, 326590, 124422, -21650, -355760, 88654, 72984, 121640, 79480, -183288, -55152], [-609592, -4350938, 150580, 238788, 102914, 263398, 39232, -60760, 60760, 195282, 37192, -7704], [-1292322, -3744663, 294420, -186076, -833427, 1261681, -275616, 14248, -14248, -209155, -395512, 49160], [42137332, 3449623, 614955, 96752, -4884, 35508, 216972, -148920, -248200, 61288, -72936, -110928], [-33815104, 1693905, -586527, 13200, 105616, 613952, 17680, -40512, -67520, -57472, 128448, 43968], [996642, 6326492, -151570, -98490, 71214, 446628, 5472, -30660, 30660, 248550, 64556, -101220], [-564581, -1339749, 40460, -28508, -420261, 316273, -66278, -49516, 49516, -195750, -54896, -74970], [-45184395, 11587993, 588175, 185463, -86024, 356719, -160904, -104838, -174730, -72386, 179718, 37440], [63912626, -3726401, -382019, -51660, -170518, -889358, -68806, 46020, 76700, 66196, -147732, -50856], [-1126581, -3223116, 171576, 9580, -837243, 1782611, -112209, 12026, -12026, 144367, -87548, -87083], [-84816670, -527919, 172395, -162048, 12758, 348034, -223258, 84, 140, -117980, 235932, 118008], [-926541, -8924091, 172960, 278192, 459547, -1239227, 117596, 57256, -57256, -135972, 32528, 215028], [-42966044, -1101632, 760170, -109114, 183002, 764500, 169946, -111936, -186560, -43840, 124992, 6528], [-491759, -9136291, 237283, -111757, 142544, -126989, 101936, 196530, 327550, 45206, -155922, 20304], [96206516, -2375719, 552533, 28056, 419764, 1290164, 317524, 75624, 126040, -25912, 26616, 51120], [-7040258, 7316036, 1405408, 179708, -279516, -910008, -29644, -93216, -155360, 93864, -156656, -124936], [61609972, 5791635, 1362071, 333536, 314396, 959284, 47804, 318984, 531640, -26968, -52392, 133296], [18616012, 1880162, -1884266, 297086, 199704, 481830, 533688, -95100, -158500, 135292, -238884, -166992], [1389472, 8790666, -79516, -638636, -109578, -185558, -229824, 162312, -162312, -84282, -496280, 365928], [14478062, 1611440, -1727572, 5712, 272540, 1388932, 115724, -94488, -157480, -109904, 251304, 78408], [1681456, 11658747, -560394, -407170, -671947, -919821, 85000, -133284, 133284, -190403, 3164, 98612], [-1927059, -7816158, 661368, -305300, -320745, 1048865, -530761, 154986, -154986, -608585, -716828, 91213], [65451718, 1434556, 2697084, 67268, 529784, 1797292, 434648, 18600, 31000, -41368, 76536, 47568], [59881064, -4609635, -2444379, 81216, 41272, -241432, 211576, 39696, 66160, 98384, -210000, -85152], [2444814, 13953241, -414620, -380620, 471597, -172031, 24640, 139272, -139272, 132029, 157992, -118072], [-30084239, -5223311, -3708273, -65665, -34736, -154177, 118192, -120582, -200970, 36270, -32346, -76464], [-141871078, 4063865, 1121435, 186096, 310510, 1084346, 469054, -106428, -177380, 43796, -52116, -79272], [3013404, 16722402, -865400, -460792, 120778, -2052974, 255008, 68560, -68560, -301590, 367760, -7344], [101455, -477143, 79308, -44900, 881211, 611089, -42284, 506384, -506384, -167532, 342536, -345180], [-157124812, 4748943, 950323, -69824, -136004, 24948, -511652, 93192, 155320, -156760, 282456, 187824], [-1299095, -8078786, 159952, -5980, 36683, 434757, -177, 534442, -534442, -333617, 202932, -37531], [23462310, 20722416, 4484536, 530128, 39592, 611336, 53576, 3600, 6000, 8192, -17584, -6992], [1048829, 9077899, 184440, -489176, 295837, -39717, -469516, -250520, 250520, -392076, -658720, -76212], [211914240, -13544346, 2314584, -753342, -504166, -1907952, -388294, -221112, -368520, -15768, 105240, -57936], [-59743986, -20729515, -608901, -368048, 576650, 1045486, 643962, 68172, 113620, 56380, -135484, -33656], [-2522709, -10178789, 489560, 135536, -1435697, 2118985, -230062, -232388, 232388, 190290, -480312, 144150], [-720607, -4393168, 247208, 138228, -124601, -484415, -87887, -332026, 332026, 2161, -374212, 219531], [1470408, 16273562, -267812, -756212, -1410994, 1346810, -363744, -312264, 312264, -110466, -561576, -41256], [1239818, 7363133, 1017656, -474616, 2125525, 503309, -966856, -330208, 330208, -79035, -1381040, -27256], [-4034393, -15937224, 369480, 51196, -2202319, 3089527, -167169, 330362, -330362, -458049, 28132, -211355], [-123181412, -32723, 180657, 4184, -874260, -3430884, -862516, 295800, 493000, 104472, -307544, -5872], [-1858952, -5837344, 447608, 126552, -366056, 2944016, -288496, 118288, -118288, -67176, 53168, -597600], [-444332, 6461769, -104538, -545826, -2270533, 1324937, -333856, -433364, 433364, -346285, -648228, 87948], [-2409783, -12960464, -677552, 951484, -2073897, -599527, 869833, -338330, 338330, 65929, 1180076, -199613], [-77824369, -8369905, 3474009, -362015, 170776, 262425, 360664, -184458, -307430, 33458, -5430, -94944], [-92438826, -14325792, 366676, -838688, -595596, -1951140, -652220, -210408, -350680, -98448, 267032, 28312], [-4087767, -16539743, 929088, -119192, -1282675, 2841395, -621058, 171220, -171220, -706050, -683224, -131670], [-25003926, 1892015, -544083, -323492, 200282, 1792618, -801942, 183444, 305740, -439964, 818780, 501112], [-3241913, -19207791, 1468088, 259144, 704151, 2580385, -666180, 55320, -55320, 365628, -1030208, 240612], [180507999, 42159263, 1679345, 1477137, -642112, -1717119, -281824, 205254, 342090, 248562, -565542, -180144], [82532038, 30131995, -5038299, 905468, -171986, 864902, -393186, -12372, -20620, -114724, 233572, 110600], [5640821, 30137845, -1526040, -1090928, 748081, -2454921, 427806, 940260, -940260, -499170, 954872, -106566], [-972086, -7946607, -903624, 305528, -1913119, -1059399, 904720, 440208, -440208, 186145, 1049072, 455936], [423502360, -32084995, -7106855, -323836, 376636, -348232, 992188, -28800, -48000, 298176, -586752, -307776], [1879575, 16361988, -71640, -947572, -1380567, 2831935, -413749, 64898, -64898, 801227, -859468, 494153], [-3851806, -27461920, 1046758, 287230, 171754, -1464456, -223248, 152652, -152652, -379422, -919908, 1009692], [1607957, 20279118, 15024, -1272044, -1235873, 3031761, -806517, 70418, -70418, -391285, -890684, -241799], [-202392187, -30033111, 872455, -1535801, 488448, 2183959, 235296, -655542, -1092570, -345090, 908694, 126576], [24008462, 27960737, 7835951, 1719672, 337554, -467154, 1041666, 671724, 1119540, 575964, -1375836, -352056], [1058202, 15184758, -526806, -2288526, -3219636, 94830, -597936, 1053012, -1053012, -1424556, -1274556, 1242468], [3064687, 12989470, -281816, -478236, 3119789, -3478309, -137659, 560062, -560062, -1434619, 442540, -659097], [199230046, 10752416, -649712, 739712, 1934128, 7048592, 1947760, -200160, -333600, -59904, 186528, -6816], [-111781754, -4401471, -2836321, 501296, 878994, 2103270, 1924034, -395652, -659420, 390636, -649388, -522520], [-1858646, -2824006, -223390, 713706, -2488328, 426578, 194992, -1471996, 1471996, 109920, 12212, -364332], [415816286, -840987, -7833381, 510096, 878394, 3033150, 491946, 331884, 553140, -82596, 54564, 193224], [-11354746, -74813594, 2812622, 2584358, 2797752, 1456622, -225424, 237724, -237724, -533616, 232044, -680052], [-1977018, -14362827, -895308, 1553380, -765783, -1711795, 1242768, -371512, 371512, 80857, 2040328, -760712], [-242381089, -38855725, -864171, -601187, 842520, 710677, 2359896, -682146, -1136910, 531306, -835230, -758688], [-510750250, 5937048, 960456, 994152, 1530848, 4238728, 2316896, -84048, -140080, 365008, -702000, -393024], [2752303, 2859013, -1752420, -148292, -448269, -10042775, 1306272, 69048, -69048, -977952, 664760, 1649928], [-295750148, 64816593, 6403577, 2620604, 1697184, 6651036, 2460096, -174264, -290440, 323368, -588648, -381456], [-391267203, 61777681, 892183, 2258943, -646536, -1378825, -680712, 662442, 1104070, 203726, -628266, 17088], [-5322014, -20881025, 2793100, 317020, 263147, 7845127, -1728336, -824776, 824776, 875067, -2320264, -388664], [477486808, -23203894, 10874716, -841558, 1612458, 4781736, 820362, 299352, 498920, -296264, 492744, 396048], [-213177353, 36576123, 3738605, 409781, 60888, 2715117, -1565160, 423534, 705890, -671846, 1202514, 813024], [-9948070, -52769014, 2032754, 708090, 11672, 3603010, -748144, 1127908, -1127908, -2065536, -25132, -894636], [809496, -20318667, 667386, 2920226, 7403427, -8133707, 879760, -1517964, 1517964, 610475, 1228196, -841756], [6289637, 19936618, -2788016, 680100, 1534231, -4624487, 2270663, 1194298, -1194298, 1216519, 3589204, -245331]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_72_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_72_7_b_c();".
// 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_72_7_b_c(:prec:=12)
    chi := MakeCharacter_72_b();
    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_72_7_b_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_72_7_b_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_72_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,7,sign)));
    Vf := Kernel([<5,R![5757443062907342400000000, 0, 3095950792825440000000, 0, 661414738278240000, 0, 71113492512000, 0, 3991016688, 0, 107352, 0, 1]>],Snew);
    return Vf;
end function;