
// Make newform 105.2.q.a in Magma, downloaded from the LMFDB on 20 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_105_q();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_105_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_105_2_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_105_2_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 := [1, -8, 32, -188, 734, -800, 584, -630, 291, 64, -40, 38, -14, -4, 2, -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, 0, 0, 0, 0], [-33746305280705, -321416591346, 1191125364091, -7455199259279, 27207219807940, -17131346947484, 14111475820386, -12780049004340, -2230952782978, 1093318205564, -939694854143, 642956778028, 131873366880, -56685616158, 46999484762, -38414168495], [31632456480199, 1212926356606, -4494960282621, 28133974246241, -102672086774396, 64651815055380, -53280290889126, 48225232348268, 8418948255726, -4097251614084, 3549177780569, -2426061321940, -520543533819, 213949914242, -177522986678, 145306983361], [-575089767434, 3861979127591, 246128680839936, 90642215592396, -306079675769764, 60835212617387, -266716860192172, 259493064521626, 27229891583895, -6663971281019, 18515621292532, -13114010371696, -1979665829518, 311805690170, -826140524550, 760172030748], [29672440598565, -9164323089196, 34074325119351, -678461323755244, 778126373623118, -505106942012337, 677606774159518, -351285551153804, -63733593693012, 36484081923634, -41638199149391, 17082017216494, 4132499467647, -1790860341485, 2123382923210, -1159675947687], [1695440450074, -11385720733444, -682424450829525, -267226659358818, 902375388086909, -179383356485812, 786254645863424, -764989544114834, -80280420418569, 19684393272760, -54581263789178, 38651783264660, 5836557871079, -921260080696, 2440547176294, -2241001108620], [-16137847630635, 34395735205495, -388309099007712, 2557823285973472, -2940884698505042, 2037822081506248, -2395065444113876, 1214849064761822, 238760344218351, -142164152788000, 146411669575112, -58946431470254, -15184509679358, 7059730047127, -7568755097298, 4058097157982], [17015828908, -69083699784, 240744226192, -1585945295448, 1863977222846, -1259913976952, 1484105110236, -774495170890, -151013347873, 87843289680, -91091321784, 37669504970, 9614611682, -4379029892, 4699915310, -2575730834], [-8602022998880, 34379925210470, -202118395383557, 788555489457606, -855730190069746, 625167345362715, -673674444501418, 308749841689177, 68369173152460, -42811945511246, 40596196036702, -14845214238260, -4270022226214, 2140603616666, -2138087245431, 1063280569755], [-29172119880252, 201383747371308, -701766532319694, 4623119858303861, -5466340585268175, 3669645519916604, -4324366285850692, 2255188372760505, 441714091122816, -255814696983230, 265404776190093, -109693802936905, -28102531513444, 12758334474904, -13694199839130, 7502690467678], [54263991142284, -220236155839242, 767408313770491, -5055851615402594, 5932582107617908, -4004669271289776, 4723682477021618, -2459380223502305, -480196298050966, 279305469940010, -289853173711402, 119598143979065, 30578923581156, -13922497684986, 14956739476040, -8183751109447], [61766681609962, -251085559700414, 806110661364879, -5764590891006364, 6816437052589699, -4540481060164001, 5435608190228966, -2861708932288753, -552101744717173, 317763568748586, -334146095435292, 139295605560736, 35235059970569, -15830728042254, 17203785936492, -9494932205673], [-62361843284805, 83988991866438, -312154621077708, 5858692599566580, -7128621954756198, 4610113536311955, -5891738412332556, 3234466606384584, 583962180212718, -327711794585876, 364596213484152, -157985234866350, -37702760224023, 16212768119001, -18562866254784, 10583106332007], [-32056382963606, 84659440952318, -314639249925878, 5874244137453899, -7185374813558250, 4645853676172177, -5921218860713121, 3261120405274960, 588615808979414, -329946311402856, 366561272531474, -159325975568434, -37987756392193, 16331067749359, -18661163594876, 10663789073454], [-62916861144830, 258809517955596, -325284547851464, 5945875322191156, -7428596404129227, 4662151485398775, -5969041910613310, 3380695061332005, 606561527884963, -331091511310624, 371177338020356, -165523626304128, -39194391629605, 16454339422594, -18856066985592, 11015276267169], [-46488804269431, 106398295849754, -395429090524619, 7367017819324544, -9030367022903148, 5838337123809904, -7433685405000834, 4098887977021204, 739757034059786, -414511080319944, 460259833552415, -200273669782708, -47737126077397, 20519536606234, -23430444102746, 13399447651346]];
    Rf_basisdens := [1, 11431248166457, 11431248166457, 11431248166457, 11431248166457, 11431248166457, 11431248166457, 7008735847, 1633035452351, 11431248166457, 11431248166457, 11431248166457, 11431248166457, 11431248166457, 11431248166457, 11431248166457];
    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_105_q();"
function MakeCharacter_105_q()
    N := 105;
    order := 6;
    char_gens := [71, 22, 31];
    v := [6, 3, 4];
    // 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_105_q_Hecke();"
function MakeCharacter_105_q_Hecke(Kf)
    N := 105;
    order := 6;
    char_gens := [71, 22, 31];
    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, 1, 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 := 2;
    raw_aps := [[0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [-1, 0, 1, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [-2, 0, 2, 0, 0, 0, 0, 1, 1, -2, 1, 0, 0, 0, 1, 0], [0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, -1], [0, 0, 0, -1, 0, -1, 0, 0, 0, 0, 0, -2, 0, 0, -2, 0], [-3, 1, 0, 0, 0, 0, 0, 4, 0, -1, 1, 0, 0, 0, 0, 0], [2, 0, -2, 0, 0, 3, -5, 0, -2, 0, 0, 0, -2, -2, 2, 3], [2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 2, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -2, 0, 0, 0, 0, 0], [1, 0, -1, 0, 1, 0, 6, 0, -1, 0, 0, -1, 0, -1, 0, 0], [-1, -3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0], [-1, 0, 1, 2, -3, 0, 2, 0, 0, 0, 0, 0, -2, 1, 0, -2], [-1, 0, 1, 0, 0, 0, -2, 0, 1, 0, 0, 0, 1, 1, -1, 0], [0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, -2, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0], [4, -3, -2, 0, 0, 0, 0, -5, -2, 5, -3, 0, 2, -2, -2, 0], [0, 0, 0, 0, 0, -1, 0, 0, -2, 0, 0, -4, 0, 0, -2, 0], [0, 5, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 2, 0, 0], [0, 0, 0, -4, 0, -4, 0, 0, 1, 0, 0, 3, 0, 0, 2, 0], [-3, 3, 4, 0, 0, 0, 0, 2, 4, -1, 3, 0, -4, 4, 4, 0], [2, 0, -2, -1, 2, 0, -1, 0, 0, 0, 0, 0, 0, -2, 0, -1], [-3, -3, 1, 0, 0, 0, 0, -1, 1, -6, -3, 0, -1, 1, 1, 0], [1, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1], [4, 0, -4, 0, 0, 0, 0, -7, 0, 4, 3, 0, 0, 0, 0, 0], [-1, 0, 1, 0, 1, 6, -6, 0, 1, 0, 0, -1, 2, 1, -2, 6], [-1, 0, 1, 0, -2, 1, 3, 0, 1, 0, 0, 2, -1, 1, 1, 1], [-3, 0, 3, 0, 0, 0, 0, -2, -2, -3, -5, 0, 0, 0, -2, 0], [2, 0, -2, 4, 2, 0, 4, 0, 0, 0, 0, 0, 0, -2, 0, 4], [0, 0, 0, -10, 2, 0, -10, 0, 0, 0, 0, 0, 2, 0, 0, -1], [-3, -6, -5, 0, 0, 0, 0, 2, -5, 4, -6, 0, 5, -5, -5, 0], [0, 0, 0, 3, 0, 1, 0, 0, 3, 0, 0, 0, 0, 0, -3, 0], [12, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 2, 0, 0], [3, 2, -1, 0, 0, 0, 0, 0, -1, 6, 2, 0, 1, -1, -1, 0], [1, 0, -1, 0, 0, 0, 0, 1, -4, 1, -3, 0, 0, 0, -4, 0], [0, 0, 0, 8, 0, 2, 0, 0, -2, 0, 0, 0, 0, 0, 2, 0], [-2, 0, 2, 0, 2, -6, 6, 0, 2, 0, 0, -2, 4, 2, -4, -6], [3, 0, -3, 3, 0, 0, 3, 0, 0, 0, 0, 0, -3, -3, 0, 5], [-3, 0, 3, 0, -6, -4, -6, 0, 3, 0, 0, 6, -3, 3, 3, -4], [0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 6, 0, 0, 0, 0, 0], [-6, -3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, -4, 0, 0], [-12, 0, 2, 0, 0, 0, 0, 10, 2, -6, 0, 0, -2, 2, 2, 0], [0, 0, 0, 0, 0, 8, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0], [5, 0, -5, -3, 10, 0, -3, 0, 0, 0, 0, 0, 5, -5, 0, -5], [3, 0, -3, 0, 0, 0, 0, -5, 4, 3, 3, 0, 0, 0, 4, 0], [7, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 2, 0, 0], [2, 0, -2, -14, -4, 0, -14, 0, 0, 0, 0, 0, -6, -2, 0, 2], [0, 0, 0, 13, 0, -3, 0, 0, 3, 0, 0, 8, 0, 0, 5, 0], [-1, 2, 2, 0, 0, 0, 0, 1, 2, -2, 2, 0, -2, 2, 2, 0], [-5, 0, 5, 0, -2, -4, 0, 0, 5, 0, 0, 2, 3, 5, -3, -4], [-5, -2, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0], [-7, 0, 7, 0, 0, 0, 0, 9, 6, -7, 5, 0, 0, 0, 6, 0], [5, 11, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 5, 0, 0], [3, 0, -3, 0, 2, 5, -7, 0, -3, 0, 0, -2, -1, -3, 1, 5], [0, 0, 0, -12, 0, -4, 0, 0, -3, 0, 0, -4, 0, 0, -1, 0], [2, 0, -2, 0, 0, 0, 0, 14, -3, 2, -6, 0, 0, 0, -3, 0], [-2, -3, 4, 0, 0, 0, 0, -5, 4, -13, -3, 0, -4, 4, 4, 0], [0, 0, 0, 6, 0, -12, 0, 0, 7, 0, 0, 11, 0, 0, 4, 0], [-5, -6, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, -5, 0, 0], [0, 0, 0, 0, 0, -4, 0, 0, 5, 0, 0, 7, 0, 0, 2, 0], [-9, 0, 9, -6, -8, 0, -6, 0, 0, 0, 0, 0, 1, 9, 0, -2], [-2, 0, 2, 18, -2, 0, 18, 0, 0, 0, 0, 0, 0, 2, 0, -13], [-2, 0, 2, 0, 0, 0, 0, -9, -4, -2, 1, 0, 0, 0, -4, 0], [7, 0, -7, 0, 9, 8, -4, 0, -7, 0, 0, -9, 2, -7, -2, 8], [2, 0, -2, 0, -2, 11, 1, 0, -2, 0, 0, 2, -4, -2, 4, 11], [13, 8, 0, 0, 0, 0, 0, -5, 0, -4, 8, 0, 0, 0, 0, 0], [-6, 0, 6, -6, -10, 0, -6, 0, 0, 0, 0, 0, -4, 6, 0, 1], [0, 0, 0, -2, 0, 4, 0, 0, 2, 0, 0, 6, 0, 0, 4, 0], [-10, -12, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, -8, 0, 0], [0, 0, 0, 13, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0], [2, 1, 2, 0, 0, 0, 0, -3, 2, 12, 1, 0, -2, 2, 2, 0], [0, 0, 0, -16, 0, -9, 0, 0, 4, 0, 0, -4, 0, 0, -8, 0], [8, 0, -8, 0, 2, 7, -20, 0, -8, 0, 0, -2, -6, -8, 6, 7], [3, -10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0], [4, 0, -4, 0, 10, -8, -6, 0, -4, 0, 0, -10, 6, -4, -6, -8], [-4, 0, 4, 0, 0, 0, 0, -19, -2, -4, -5, 0, 0, 0, -2, 0], [5, 0, -5, 0, 1, 4, -6, 0, -5, 0, 0, -1, -4, -5, 4, 4], [-18, -8, -2, 0, 0, 0, 0, 12, -2, -4, -8, 0, 2, -2, -2, 0], [12, 0, -12, 0, 0, 0, 0, -3, -4, 12, -2, 0, 0, 0, -4, 0], [8, -4, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0], [-8, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 4, 0, 0], [18, 0, -18, 0, 0, 0, 0, -6, -7, 18, -2, 0, 0, 0, -7, 0], [-2, 0, 2, 0, 4, 0, 0, 0, 0, 0, 0, 0, 6, 2, 0, 1], [-8, -3, 2, 0, 0, 0, 0, 3, 2, 1, -3, 0, -2, 2, 2, 0], [1, 0, -1, 0, -6, -6, 4, 0, -1, 0, 0, 6, -7, -1, 7, -6], [4, 2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, -6, 0, 0], [-4, 0, 4, 0, 10, -9, 18, 0, 4, 0, 0, -10, 14, 4, -14, -9], [-1, -7, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, -9, 0, 0], [-2, 0, 2, 8, 0, 0, 8, 0, 0, 0, 0, 0, 2, 2, 0, -5], [-2, 0, 2, 0, 0, -4, 26, 0, 2, 0, 0, 0, 2, 2, -2, -4], [-6, 0, 6, 0, 0, 0, 0, 0, 3, -6, -2, 0, 0, 0, 3, 0], [0, 0, 0, -8, 0, 3, 0, 0, -10, 0, 0, -6, 0, 0, 4, 0], [-3, -4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 5, 0, 0], [9, -4, -10, 0, 0, 0, 0, -3, -10, 12, -4, 0, 10, -10, -10, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10], [10, 14, 0, 0, 0, 0, 0, 4, 0, 2, 14, 0, 0, 0, 0, 0], [2, 0, -2, 0, 0, 0, 0, -20, 4, 2, 4, 0, 0, 0, 4, 0], [-10, 0, 10, 0, -16, -5, -12, 0, 10, 0, 0, 16, -6, 10, 6, -5], [9, 14, 0, 0, 0, 0, 0, 5, 0, 4, 14, 0, 0, 0, 0, 0], [-2, 0, 2, 10, -4, 0, 10, 0, 0, 0, 0, 0, -2, 2, 0, 10], [0, 0, 0, 16, 0, 4, 0, 0, -3, 0, 0, -10, 0, 0, -7, 0], [0, 0, 0, 4, 0, 6, 0, 0, -4, 0, 0, -8, 0, 0, -4, 0], [5, -13, -1, 0, 0, 0, 0, -17, -1, 0, -13, 0, 1, -1, -1, 0], [-5, 0, 5, 0, 0, 0, 0, 8, 6, -5, 13, 0, 0, 0, 6, 0], [0, 0, 0, -4, 0, 9, 0, 0, -4, 0, 0, 4, 0, 0, 8, 0], [5, 0, -5, 1, 4, 0, 1, 0, 0, 0, 0, 0, -1, -5, 0, 1], [-3, 0, 3, 0, -10, 7, -13, 0, 3, 0, 0, 10, -7, 3, 7, 7], [-8, 0, 8, 0, 0, 0, 0, 2, 13, -8, 8, 0, 0, 0, 13, 0], [2, -11, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, -4, 0, 0], [0, 0, 0, 0, -4, 9, 6, 0, 0, 0, 0, 4, -4, 0, 4, 9], [0, 0, 0, -20, 0, -9, 0, 0, 3, 0, 0, 1, 0, 0, -2, 0], [-6, 0, 6, 16, 0, 0, 16, 0, 0, 0, 0, 0, 6, 6, 0, -6], [4, 0, -4, 0, 0, 0, 0, -17, 2, 4, 2, 0, 0, 0, 2, 0], [-22, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, -8, 0, 0], [-8, 0, 8, 0, 0, 0, 0, 9, -5, -8, -9, 0, 0, 0, -5, 0], [4, 0, -4, -2, 2, 0, -2, 0, 0, 0, 0, 0, -2, -4, 0, 13], [0, 0, 0, 1, 0, 15, 0, 0, -5, 0, 0, -2, 0, 0, 3, 0], [-4, 0, 4, 0, 4, -1, -3, 0, 4, 0, 0, -4, 8, 4, -8, -1], [-16, 2, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0], [-11, 0, 11, 0, 0, 0, 0, 0, 2, -11, -7, 0, 0, 0, 2, 0], [-8, 0, 8, 14, 2, 0, 14, 0, 0, 0, 0, 0, 10, 8, 0, -11], [4, 0, -4, 0, 2, -3, 15, 0, -4, 0, 0, -2, -2, -4, 2, -3], [0, 0, 0, -1, 0, 15, 0, 0, -13, 0, 0, -10, 0, 0, 3, 0], [-13, 14, 10, 0, 0, 0, 0, 17, 10, -2, 14, 0, -10, 10, 10, 0], [13, -1, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, -5, 0, 0], [10, -13, -6, 0, 0, 0, 0, -17, -6, 9, -13, 0, 6, -6, -6, 0], [3, 10, 9, 0, 0, 0, 0, -2, 9, -4, 10, 0, -9, 9, 9, 0], [3, 0, -3, 20, 1, 0, 20, 0, 0, 0, 0, 0, -2, -3, 0, -10], [6, 0, -6, 0, 8, -15, 4, 0, -6, 0, 0, -8, 2, -6, -2, -15], [17, 0, -17, 0, 0, 0, 0, -6, -10, 17, -9, 0, 0, 0, -10, 0], [-1, 0, 1, -9, -6, 0, -9, 0, 0, 0, 0, 0, -5, 1, 0, -5], [-9, -8, -2, 0, 0, 0, 0, 3, -2, 2, -8, 0, 2, -2, -2, 0], [-2, 0, 2, -14, -16, 0, -14, 0, 0, 0, 0, 0, -14, 2, 0, 8], [10, 5, 2, 0, 0, 0, 0, -7, 2, 10, 5, 0, -2, 2, 2, 0], [22, 13, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 4, 0, 0], [0, 0, 0, -17, 0, -19, 0, 0, 14, 0, 0, 10, 0, 0, -4, 0], [0, 0, 0, 8, 0, 4, 0, 0, 2, 0, 0, 14, 0, 0, 12, 0], [-5, 0, 5, -5, 6, 0, -5, 0, 0, 0, 0, 0, 11, 5, 0, -7], [2, 0, -2, 0, 0, 0, 0, -24, -11, 2, -8, 0, 0, 0, -11, 0], [-15, -1, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0], [-3, 1, 3, 0, 0, 0, 0, 1, 3, 12, 1, 0, -3, 3, 3, 0], [0, 0, 0, -4, 0, -3, 0, 0, -3, 0, 0, -7, 0, 0, -4, 0], [-9, 0, 9, -6, -18, 0, -6, 0, 0, 0, 0, 0, -9, 9, 0, -2], [-15, 0, 15, 0, 0, 0, 0, 4, -4, -15, -13, 0, 0, 0, -4, 0], [-4, 11, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6, 6, 0, 0], [1, 0, -1, -16, 7, 0, -16, 0, 0, 0, 0, 0, 6, -1, 0, -2], [0, 0, 0, -23, 0, -13, 0, 0, -1, 0, 0, 8, 0, 0, 9, 0], [-24, -15, -2, 0, 0, 0, 0, 11, -2, -7, -15, 0, 2, -2, -2, 0], [15, 0, -15, 0, 22, 10, 18, 0, -15, 0, 0, -22, 7, -15, -7, 10], [-2, 0, 2, 0, -4, -12, 18, 0, 2, 0, 0, 4, -2, 2, 2, -12], [-1, -6, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0], [-3, 0, 3, -6, -1, 0, -6, 0, 0, 0, 0, 0, 2, 3, 0, 14], [-1, 0, 1, 0, -8, 5, -13, 0, 1, 0, 0, 8, -7, 1, 7, 5], [0, 0, 0, -12, 0, -14, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0], [-3, -15, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, -5, 0, 0], [-17, 12, 14, 0, 0, 0, 0, 15, 14, -6, 12, 0, -14, 14, 14, 0], [17, 9, 7, 0, 0, 0, 0, -15, 7, -2, 9, 0, -7, 7, 7, 0], [7, 0, -7, -20, 15, 0, -20, 0, 0, 0, 0, 0, 8, -7, 0, -12], [16, 0, -16, 0, 0, 0, 0, -13, -12, 16, -13, 0, 0, 0, -12, 0], [1, 0, -1, 0, 6, 11, -37, 0, -1, 0, 0, -6, 5, -1, -5, 11], [6, 0, -6, -24, -6, 0, -24, 0, 0, 0, 0, 0, -12, -6, 0, 10], [5, 0, -5, 20, 21, 0, 20, 0, 0, 0, 0, 0, 16, -5, 0, -6], [-33, -2, 3, 0, 0, 0, 0, 28, 3, 6, -2, 0, -3, 3, 3, 0], [0, 0, 0, 21, 0, 3, 0, 0, -6, 0, 0, 2, 0, 0, 8, 0], [0, 0, 0, -3, 0, 3, 0, 0, -9, 0, 0, -24, 0, 0, -15, 0], [-9, 0, 9, 0, 0, 0, 0, -12, -4, -9, 5, 0, 0, 0, -4, 0], [0, 0, 0, -28, 0, -18, 0, 0, 17, 0, 0, 7, 0, 0, -10, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_105_q_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_105_2_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_105_2_q_a(:prec:=16)
    chi := MakeCharacter_105_q();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_105_2_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_105_2_q_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_105_q();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;