
// Make newform 630.3.h.e in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_630_h();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_630_h_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_630_3_h_e();".
// 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_630_3_h_e();".
// 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 := [33750, -202500, 619650, -1183860, 1591101, -1570812, 1208164, -722060, 362298, -141436, 49526, -12864, 3236, -532, 96, -8, 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, 0, 0, 0, 0], [-4356184500, 16813521450, -34800176715, 43054452627, -40470416522, 26309358626, -15050254839, 6032169442, -2348797795, 607061937, -168847606, 26989816, -5428353, 429254, -61322, 0], [198141750, -737754300, 1510941810, -1848683128, 1732937308, -1122676764, 641689796, -256866688, 99991030, -25829968, 7183684, -1148024, 230892, -18256, 2608, 0], [-14271525, 52505910, -106932015, 129995121, -121536126, 78463393, -44790412, 17893811, -6961130, 1796001, -499338, 79733, -16034, 1267, -181, 0], [575687250, -2020897980, 2854944621, -2711291745, 1154379162, -304752040, -259430001, 233442698, -142860075, 58997141, -18170922, 4997626, -892047, 171958, -14880, 1984], [-200352316500, 1143288079650, -3000039760455, 4875031263099, -5417408634332, 4569918940190, -2869994011087, 1529887949640, -608926339653, 223952035489, -58317525310, 15373400596, -2502572345, 475369020, -38724810, 5163308], [-48079812922875, 210440868002100, -481015167707145, 682314131611746, -704845162247500, 538836358944747, -327898999545549, 160768010451529, -63614767314464, 21593702764136, -5698324120742, 1379313175425, -231784568841, 39809532293, -3427703899, 399728914], [-16014851920125, 30555343699200, -14002064235165, -74756402522688, 134875076277512, -169214780706043, 116580706899693, -76145779518861, 30671013312184, -13082276658338, 3331119827068, -1000987616561, 155694952029, -33793213677, 2568229811, -399728914], [-27118230861375, 133431969127950, -330359822998215, 507632737721937, -550515081942494, 448287901742858, -279021438726355, 144656309564376, -57534505613712, 20631957152977, -5398872205078, 1387056367957, -228052000574, 42073363272, -3483298596, 447494447], [5890964889375, -57903995250000, 177871284272175, -323942441246295, 379071089785232, -337841799571937, 216005057687986, -119500311883419, 47750119577067, -18108495871075, 4697341630102, -1275063927496, 205531523111, -40294099863, 3229118109, -447494447], [21472387601625, -123640459408350, 326697174195345, -532857064795086, 593939025308073, -501506314001410, 315263632646343, -168101562328660, 66931017082167, -24618050055196, 6411443031015, -1690195150544, 275154595755, -52266459230, 4257849840, -567713312], [53163415249875, -258298432768800, 630185273249535, -954127232794023, 1023621407018139, -824347792956905, 510444488303149, -262285196856855, 104136934094681, -37041568233853, 9698152824195, -2471007994192, 407289941690, -74430945615, 6191755645, -785739041], [36667642356000, -197589647714850, 506583224778645, -803936857355271, 883274307797217, -733810944092454, 458792125489460, -241670045297138, 96120876322486, -34975312463791, 9123854082189, -2379381641451, 388867038037, -72976247986, 5983941698, -785739041], [-56954262763125, 302197871360250, -765704845680075, 1204683444700185, -1318392265732044, 1090651975806169, -680969930375392, 357702043010303, -142225168653269, 51634595604495, -13473032026674, 3506125623632, -573407815907, 107361432781, -8813843083, 1154058879], [-32182844707125, 207779843745900, -574645179613905, 974123016762939, -1103451322671288, 952406364501896, -602150482364495, 326274236023012, -130006171709434, 48485640413619, -12597785646336, 3366475077289, -545327879638, 105143811914, -8497040102, 1154058879], [-60825320086500, 349444728687150, -922236594213180, 1504329493275894, -1677188563265542, 1416778515061015, -891085669944347, 475281158498115, -189316460062893, 69645833921534, -18144032327960, 4783649577701, -778938507295, 147968387895, -12056440485, 1607525398]];
    Rf_basisdens := [1, 15136875, 560625, 26325, 85899825, 1213801875, 83752329375, 83752329375, 83752329375, 83752329375, 83752329375, 83752329375, 83752329375, 83752329375, 83752329375, 83752329375];
    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_630_h();"
function MakeCharacter_630_h()
    N := 630;
    order := 2;
    char_gens := [281, 127, 451];
    v := [2, 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_630_h_Hecke();"
function MakeCharacter_630_h_Hecke(Kf)
    N := 630;
    order := 2;
    char_gens := [281, 127, 451];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 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 := 3;
    raw_aps := [[0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, -1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [-6, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0], [0, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0], [0, 2, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1, 2, 1, -1, 1, -1, -2, 0, 0, 0, 0, -2], [1, 0, 1, 0, 0, -6, 0, 0, 0, 0, 0, -1, -1, 2, 2, 0], [-4, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -2, 2, 2, -2, 0], [0, 0, 0, 0, -9, 4, 2, -2, -1, 1, -4, 0, 0, 0, 0, 2], [1, 0, 1, 0, 0, -12, -4, 4, 0, 0, 0, -1, -1, 3, 3, 0], [0, 0, 0, 0, -2, -2, -1, 1, 0, 0, 2, 0, 0, 0, 0, -1], [0, 0, 0, 0, 0, -8, 6, -6, 0, 0, 0, 0, 0, 2, 2, 0], [0, 2, 5, 0, 0, 0, -5, -5, -4, -4, 0, 0, 0, 0, 0, 0], [-5, 0, -5, 0, 0, 9, 4, -4, 0, 0, 0, 5, 5, 4, 4, 0], [0, 0, 0, 0, -18, 8, 4, -4, 4, -4, -8, 0, 0, 0, 0, -2], [0, 0, 0, 0, 0, 0, 0, 0, 6, -6, 0, 0, 0, 0, 0, 6], [4, 0, 4, 0, 0, 10, -7, 7, 0, 0, 0, -4, -4, 2, 2, 0], [24, 0, -4, -3, 0, 0, 0, 0, 0, 0, 0, -3, 3, 4, -4, 0], [0, -7, 9, 0, 0, 0, 7, 7, -7, -7, 0, 0, 0, 0, 0, 0], [-38, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 2, -2, -2, 2, 0], [0, -10, 11, 0, 0, 0, 3, 3, -4, -4, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -12, -6, 6, 1, -1, 12, 0, 0, 0, 0, -6], [0, -5, -13, 0, 0, 0, 5, 5, 3, 3, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 26, 14, 7, -7, 0, 0, -14, 0, 0, 0, 0, 7], [0, 4, 4, 0, 0, 0, -6, -6, 12, 12, 0, 0, 0, 0, 0, 0], [7, 0, 7, 0, 0, -22, -8, 8, 0, 0, 0, -7, -7, -10, -10, 0], [-7, 0, -7, -2, 0, 0, 0, 0, 0, 0, 0, 3, -3, 7, -7, 0], [11, 0, 11, 0, 0, 25, -8, 8, 0, 0, 0, -11, -11, -4, -4, 0], [-8, 0, -8, 0, 0, 16, 10, -10, 0, 0, 0, 8, 8, 12, 12, 0], [0, 0, 0, 0, -26, 4, 2, -2, 8, -8, -4, 0, 0, 0, 0, 14], [-7, 0, -7, 0, 0, -43, 16, -16, 0, 0, 0, 7, 7, -2, -2, 0], [0, 0, 0, 0, -17, 24, 12, -12, -25, 25, -24, 0, 0, 0, 0, -6], [22, 0, 4, 12, 0, 0, 0, 0, 0, 0, 0, -12, 12, -4, 4, 0], [30, 0, 6, -22, 0, 0, 0, 0, 0, 0, 0, -12, 12, -6, 6, 0], [0, -7, 13, 0, 0, 0, 5, 5, 11, 11, 0, 0, 0, 0, 0, 0], [10, 0, 10, 0, 0, 20, 6, -6, 0, 0, 0, -10, -10, 6, 6, 0], [0, 4, 22, 0, 0, 0, -4, -4, 0, 0, 0, 0, 0, 0, 0, 0], [0, -4, -4, 0, 0, 0, 0, 0, 17, 17, 0, 0, 0, 0, 0, 0], [-16, 0, 12, -21, 0, 0, 0, 0, 0, 0, 0, 3, -3, -12, 12, 0], [0, 0, 0, 0, -4, -4, -2, 2, 6, -6, 4, 0, 0, 0, 0, 16], [128, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, -3, 3, 0, 0, 0], [5, 0, 5, 0, 0, -92, -6, 6, 0, 0, 0, -5, -5, -9, -9, 0], [7, 0, 7, 0, 0, 95, -4, 4, 0, 0, 0, -7, -7, -2, -2, 0], [0, 0, 0, 0, -29, 34, 17, -17, 13, -13, -34, 0, 0, 0, 0, 2], [-102, 0, 14, -26, 0, 0, 0, 0, 0, 0, 0, -8, 8, -14, 14, 0], [0, -2, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, -22, -53, 0, 0, 0, 25, 25, 8, 8, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 108, -16, -8, 8, 4, -4, 16, 0, 0, 0, 0, -2], [-17, 0, -17, 0, 0, -81, 8, -8, 0, 0, 0, 17, 17, -6, -6, 0], [88, 0, 12, -33, 0, 0, 0, 0, 0, 0, 0, -1, 1, -12, 12, 0], [0, 0, 0, 0, -8, 12, 6, -6, -8, 8, -12, 0, 0, 0, 0, 30], [0, 0, 0, 0, -14, 36, 18, -18, 0, 0, -36, 0, 0, 0, 0, 6], [0, -22, 20, 0, 0, 0, 0, 0, 29, 29, 0, 0, 0, 0, 0, 0], [5, 0, 5, 0, 0, 138, 14, -14, 0, 0, 0, -5, -5, -10, -10, 0], [0, 0, 0, 0, -2, 26, 13, -13, 0, 0, -26, 0, 0, 0, 0, 1], [0, 0, 0, 0, -45, -16, -8, 8, 27, -27, 16, 0, 0, 0, 0, 22], [-7, 0, -7, 0, 0, -2, 24, -24, 0, 0, 0, 7, 7, -15, -15, 0], [-62, 0, 4, -44, 0, 0, 0, 0, 0, 0, 0, 16, -16, -4, 4, 0], [0, 22, -82, 0, 0, 0, 5, 5, 12, 12, 0, 0, 0, 0, 0, 0], [0, 14, -70, 0, 0, 0, -6, -6, -7, -7, 0, 0, 0, 0, 0, 0], [0, 2, -44, 0, 0, 0, -11, -11, -16, -16, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -10, 48, 24, -24, -26, 26, -48, 0, 0, 0, 0, 24], [0, -13, 27, 0, 0, 0, 13, 13, 17, 17, 0, 0, 0, 0, 0, 0], [-17, 0, -17, 0, 0, 53, 12, -12, 0, 0, 0, 17, 17, 12, 12, 0], [74, 0, -2, -54, 0, 0, 0, 0, 0, 0, 0, 4, -4, 2, -2, 0], [-14, 0, -14, 0, 0, 134, -4, 4, 0, 0, 0, 14, 14, -32, -32, 0], [15, 0, 15, 0, 0, -54, -30, 30, 0, 0, 0, -15, -15, 18, 18, 0], [0, 0, 0, 0, -96, -20, -10, 10, 36, -36, 20, 0, 0, 0, 0, -4], [0, 68, 50, 0, 0, 0, -6, -6, -13, -13, 0, 0, 0, 0, 0, 0], [-282, 0, -16, 39, 0, 0, 0, 0, 0, 0, 0, -15, 15, 16, -16, 0], [0, -42, 136, 0, 0, 0, 27, 27, -44, -44, 0, 0, 0, 0, 0, 0], [-16, 0, -16, 0, 0, -68, -6, 6, 0, 0, 0, 16, 16, -12, -12, 0], [70, 0, -30, -18, 0, 0, 0, 0, 0, 0, 0, -4, 4, 30, -30, 0], [0, 36, -30, 0, 0, 0, -24, -24, 4, 4, 0, 0, 0, 0, 0, 0], [256, 0, -18, 52, 0, 0, 0, 0, 0, 0, 0, -18, 18, 18, -18, 0], [0, 19, 47, 0, 0, 0, -17, -17, -39, -39, 0, 0, 0, 0, 0, 0], [212, 0, -6, -48, 0, 0, 0, 0, 0, 0, 0, -18, 18, 6, -6, 0], [0, 0, 0, 0, 184, -20, -10, 10, -44, 44, 20, 0, 0, 0, 0, -22], [0, 0, 0, 0, 108, 16, 8, -8, 34, -34, -16, 0, 0, 0, 0, 2], [-85, 0, -47, 34, 0, 0, 0, 0, 0, 0, 0, -1, 1, 47, -47, 0], [-298, 0, -28, 41, 0, 0, 0, 0, 0, 0, 0, -5, 5, 28, -28, 0], [0, 19, 75, 0, 0, 0, 5, 5, 21, 21, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 165, 6, 3, -3, 31, -31, -6, 0, 0, 0, 0, -6], [11, 0, 11, 0, 0, -198, -34, 34, 0, 0, 0, -11, -11, 14, 14, 0], [60, 0, -14, 24, 0, 0, 0, 0, 0, 0, 0, 50, -50, 14, -14, 0], [-38, 0, -38, 0, 0, 218, 36, -36, 0, 0, 0, 38, 38, 12, 12, 0], [0, 0, 0, 0, -144, 8, 4, -4, 49, -49, -8, 0, 0, 0, 0, 28], [36, 0, 36, 0, 0, 96, -38, 38, 0, 0, 0, -36, -36, -28, -28, 0], [0, -58, 123, 0, 0, 0, -1, -1, -40, -40, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -70, 96, 48, -48, -14, 14, -96, 0, 0, 0, 0, -48], [6, 0, 6, 0, 0, -276, 10, -10, 0, 0, 0, -6, -6, 32, 32, 0], [30, 0, 8, 53, 0, 0, 0, 0, 0, 0, 0, -1, 1, -8, 8, 0], [-150, 0, 18, 26, 0, 0, 0, 0, 0, 0, 0, -12, 12, -18, 18, 0], [0, 44, -30, 0, 0, 0, -20, -20, 44, 44, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -310, -2, -1, 1, 4, -4, 2, 0, 0, 0, 0, 23], [0, 0, 0, 0, 14, 22, 11, -11, 40, -40, -22, 0, 0, 0, 0, -25], [0, 24, 118, 0, 0, 0, -8, -8, -32, -32, 0, 0, 0, 0, 0, 0], [131, 0, -23, 26, 0, 0, 0, 0, 0, 0, 0, -9, 9, 23, -23, 0], [60, 0, 60, 0, 0, 258, -3, 3, 0, 0, 0, -60, -60, -6, -6, 0], [-17, 0, -17, 0, 0, 121, 36, -36, 0, 0, 0, 17, 17, -32, -32, 0], [0, 12, 54, 0, 0, 0, 18, 18, -44, -44, 0, 0, 0, 0, 0, 0], [-228, 0, 30, -48, 0, 0, 0, 0, 0, 0, 0, 46, -46, -30, 30, 0], [-270, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, -22, 22, -34, 34, 0], [0, 13, 57, 0, 0, 0, 27, 27, -9, -9, 0, 0, 0, 0, 0, 0], [0, -36, -38, 0, 0, 0, -14, -14, 16, 16, 0, 0, 0, 0, 0, 0], [0, 76, -138, 0, 0, 0, -46, -46, -21, -21, 0, 0, 0, 0, 0, 0], [-36, 0, -24, -31, 0, 0, 0, 0, 0, 0, 0, 45, -45, 24, -24, 0], [0, 0, 0, 0, 164, 28, 14, -14, 30, -30, -28, 0, 0, 0, 0, 2], [0, -54, -94, 0, 0, 0, -19, -19, 28, 28, 0, 0, 0, 0, 0, 0], [12, 0, 12, 0, 0, 208, -2, 2, 0, 0, 0, -12, -12, 28, 28, 0], [27, 0, 27, 0, 0, 187, 32, -32, 0, 0, 0, -27, -27, -42, -42, 0], [0, 0, 0, 0, 65, 56, 28, -28, -91, 91, -56, 0, 0, 0, 0, -38], [-186, 0, 34, -68, 0, 0, 0, 0, 0, 0, 0, -18, 18, -34, 34, 0], [-594, 0, 16, 36, 0, 0, 0, 0, 0, 0, 0, -64, 64, -16, 16, 0], [0, -18, -126, 0, 0, 0, -17, -17, 64, 64, 0, 0, 0, 0, 0, 0], [0, 72, -46, 0, 0, 0, 2, 2, 40, 40, 0, 0, 0, 0, 0, 0], [-13, 0, -13, 0, 0, -33, -8, 8, 0, 0, 0, 13, 13, -18, -18, 0], [-92, 0, 8, 101, 0, 0, 0, 0, 0, 0, 0, -63, 63, -8, 8, 0], [0, 0, 0, 0, 40, 56, 28, -28, -14, 14, -56, 0, 0, 0, 0, -26], [-37, 0, -37, 0, 0, 120, 2, -2, 0, 0, 0, 37, 37, -43, -43, 0], [0, -10, -14, 0, 0, 0, -14, -14, -37, -37, 0, 0, 0, 0, 0, 0], [39, 0, 39, 0, 0, -106, 6, -6, 0, 0, 0, -39, -39, -14, -14, 0], [0, 0, 0, 0, -183, 52, 26, -26, 1, -1, -52, 0, 0, 0, 0, -46], [-6, 0, 20, -40, 0, 0, 0, 0, 0, 0, 0, 20, -20, -20, 20, 0], [-56, 0, 42, -84, 0, 0, 0, 0, 0, 0, 0, -10, 10, -42, 42, 0], [0, 0, 0, 0, -266, -24, -12, 12, -86, 86, 24, 0, 0, 0, 0, 12], [0, -80, 132, 0, 0, 0, 38, 38, 72, 72, 0, 0, 0, 0, 0, 0], [0, 57, -51, 0, 0, 0, -87, -87, -11, -11, 0, 0, 0, 0, 0, 0], [306, 0, -6, 72, 0, 0, 0, 0, 0, 0, 0, -38, 38, 6, -6, 0], [-53, 0, -53, 0, 0, -22, -6, 6, 0, 0, 0, 53, 53, -6, -6, 0], [294, 0, 22, 18, 0, 0, 0, 0, 0, 0, 0, 20, -20, -22, 22, 0], [-26, 0, -26, 0, 0, 330, -14, 14, 0, 0, 0, 26, 26, 40, 40, 0], [0, 0, 0, 0, 220, -80, -40, 40, 65, -65, 80, 0, 0, 0, 0, -4], [0, 0, 0, 0, -84, -36, -18, 18, 74, -74, 36, 0, 0, 0, 0, -6], [0, -56, 72, 0, 0, 0, 48, 48, 93, 93, 0, 0, 0, 0, 0, 0], [0, 36, -56, 0, 0, 0, 18, 18, -32, -32, 0, 0, 0, 0, 0, 0], [0, 88, -76, 0, 0, 0, -48, -48, 57, 57, 0, 0, 0, 0, 0, 0], [672, 0, 6, 32, 0, 0, 0, 0, 0, 0, 0, 30, -30, -6, 6, 0], [0, 0, 0, 0, 91, -128, -64, 64, 47, -47, 128, 0, 0, 0, 0, -82], [284, 0, 58, -88, 0, 0, 0, 0, 0, 0, 0, -42, 42, -58, 58, 0], [28, 0, 28, 0, 0, 48, -26, 26, 0, 0, 0, -28, -28, -68, -68, 0], [-3, 0, -3, 0, 0, 150, -46, 46, 0, 0, 0, 3, 3, -38, -38, 0], [0, 0, 0, 0, -156, 48, 24, -24, 80, -80, -48, 0, 0, 0, 0, 90], [0, 0, 0, 0, 128, 76, 38, -38, -12, 12, -76, 0, 0, 0, 0, -40], [0, 99, -149, 0, 0, 0, -29, -29, 61, 61, 0, 0, 0, 0, 0, 0], [0, -60, 10, 0, 0, 0, -26, -26, -65, -65, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 313, -26, -13, 13, -1, 1, 26, 0, 0, 0, 0, 74], [41, 0, 41, 0, 0, 274, 26, -26, 0, 0, 0, -41, -41, -14, -14, 0], [40, 0, 40, 0, 0, -52, 22, -22, 0, 0, 0, -40, -40, 20, 20, 0], [0, 0, 0, 0, 168, -84, -42, 42, -25, 25, 84, 0, 0, 0, 0, -102], [-2, 0, -2, 0, 0, -118, 83, -83, 0, 0, 0, 2, 2, 70, 70, 0], [0, -26, 39, 0, 0, 0, 17, 17, 96, 96, 0, 0, 0, 0, 0, 0], [2, 0, 2, 0, 0, -626, -11, 11, 0, 0, 0, -2, -2, 2, 2, 0], [90, 0, -28, 105, 0, 0, 0, 0, 0, 0, 0, -105, 105, 28, -28, 0], [-670, 0, -18, 18, 0, 0, 0, 0, 0, 0, 0, -48, 48, 18, -18, 0], [0, 0, 0, 0, -336, 92, 46, -46, 21, -21, -92, 0, 0, 0, 0, -74], [0, 71, 127, 0, 0, 0, -95, -95, 17, 17, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 44, -116, -58, 58, 7, -7, 116, 0, 0, 0, 0, -118], [47, 0, 47, 0, 0, 214, -90, 90, 0, 0, 0, -47, -47, -6, -6, 0], [7, 0, 7, 0, 0, -97, -76, 76, 0, 0, 0, -7, -7, -26, -26, 0], [22, 0, 22, 0, 0, 722, 3, -3, 0, 0, 0, -22, -22, 48, 48, 0], [0, 0, 0, 0, -352, 72, 36, -36, 118, -118, -72, 0, 0, 0, 0, 30], [-81, 0, -81, 0, 0, -165, 20, -20, 0, 0, 0, 81, 81, 46, 46, 0], [0, -74, 203, 0, 0, 0, -55, -55, -120, -120, 0, 0, 0, 0, 0, 0], [-498, 0, -74, 186, 0, 0, 0, 0, 0, 0, 0, -52, 52, 74, -74, 0], [0, -83, -63, 0, 0, 0, -79, -79, -33, -33, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_630_h_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_630_3_h_e();".
// 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_630_3_h_e(:prec:=16)
    chi := MakeCharacter_630_h();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    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_630_3_h_e();".
// 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_630_3_h_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_630_h();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![-4844, -1776, 28, 24, 1]>,<13,R![586802176, 0, -31875456, 0, 313732, 0, -1044, 0, 1]>],Snew);
    return Vf;
end function;