
// Make newform 105.3.c.a in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_105_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_105_c_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_3_c_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_3_c_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 := [576, 0, 15680, 0, 60809, 0, 71486, 0, 32831, 0, 7252, 0, 823, 0, 46, 0, 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], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1400928, 328536, -16640728, 7881413, -19319222, 5855246, -5356966, 1667083, -172404, 199188, 96196, 6979, 11114, -314, 346, -19], [884592, 3163664, 4003172, 7361646, 4040059, 3811631, 1044327, 703126, 936, 24310, -26756, -6822, -2851, -749, -87, -22], [-480768, 5755144, -1164668, 13937181, 315822, 13831052, -1385434, 6908345, -883956, 1782656, -173056, 235239, -13434, 14860, -362, 355], [357696, 5755144, 2361972, 13937181, 2390046, 13831052, -1576670, 6908345, -1143564, 1782656, -222000, 235239, -17010, 14860, -454, 355], [1054080, -5906280, 6841676, -2062147, 8395940, 7443556, 703220, 4021041, -882084, 720276, -226568, 51355, -19136, 1136, -536, -9], [780032, 0, 2637324, 0, 3968375, 0, 2620631, 0, 791734, 0, 114130, 0, 7587, 0, 187, 0], [311360, 0, 2559212, 0, 3968375, 0, 2620631, 0, 791734, 0, 114130, 0, 7587, 0, 187, 0], [0, -3269960, 0, -18482577, 0, -23042624, 0, -10668555, 0, -2352364, 0, -265971, 0, -14812, 0, -321], [-455520, -8320424, -14503832, -26992363, -28644464, -26446439, -17945092, -9843186, -5011884, -1650778, -680212, -130499, -43396, -4519, -1040, -48], [1400928, 602280, 16640728, 7473859, 19319222, 17955004, 5356966, 14056703, 172404, 4551216, -96196, 677801, -11114, 45836, -346, 1141], [-225744, 11118040, -7738030, 44727856, -9817522, 53028927, -1985766, 24214099, 355776, 5278382, 134626, 589430, 12274, 32427, 354, 695], [-225744, 3599760, -7738030, 23366665, -9817522, 30959846, -1985766, 15909817, 355776, 3935832, 134626, 494231, 12274, 29986, 354, 695], [1631712, 18251624, -12555680, 110530943, -30319692, 143530734, -18986740, 66456433, -5104704, 14396428, -664816, 1587409, -40980, 86142, -956, 1823], [884592, 4671320, 4003172, 22147396, 4040059, 29074142, 1044327, 14253143, 936, 3318976, -26756, 393902, -2851, 22834, -87, 511]];
    Rf_basisdens := [1, 1, 468672, 117168, 468672, 468672, 234336, 78112, 78112, 234336, 234336, 468672, 234336, 234336, 468672, 117168];
    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_c();"
function MakeCharacter_105_c()
    N := 105;
    order := 2;
    char_gens := [71, 22, 31];
    v := [1, 2, 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_105_c_Hecke();"
function MakeCharacter_105_c_Hecke(Kf)
    N := 105;
    order := 2;
    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, 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, 1, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0], [-1, 2, 0, -1, 0, 0, 1, 0, 0, -1, 0, 2, 2, 0, 0, 0], [1, 0, 1, 0, -1, 0, 0, -1, 0, 0, 1, -1, 1, 0, -1, 1], [2, 0, 1, 0, 0, 0, -2, 1, 0, -3, 1, -2, -1, -3, -1, 1], [0, -1, 0, 2, -1, 0, 2, 0, -1, 1, -1, 2, 0, -1, -1, 1], [1, -2, 2, 0, -1, 0, 0, -2, 0, 3, -2, -1, 0, -1, 2, 2], [1, 2, 4, 3, -2, 0, 1, -2, 0, 1, -2, 2, 2, -2, 2, -2], [-4, 0, -1, -2, -1, -2, -1, -1, 0, 1, -3, -1, -1, 4, -1, 0], [3, -4, 0, 1, -7, 0, -1, -7, -9, 2, 0, 1, 0, -1, 0, 2], [0, 4, 5, 2, 3, 0, -3, -1, 0, 3, -1, 1, -1, -2, 1, 2], [15, 2, -2, 1, 5, 0, 3, -1, 5, 0, -4, 3, -2, 1, 0, -2], [2, -14, 2, 2, -1, 0, -1, 2, 0, 14, 2, 1, -2, -1, -2, -3], [3, 2, 0, -2, 1, 0, -4, 0, 0, -9, 0, -7, -6, -1, 0, 6], [-10, 14, -7, -4, 9, 0, 1, 1, 0, -13, 1, 5, 3, 8, -1, 2], [2, -9, 3, 8, 2, -10, 1, -5, 15, 2, 8, 5, 3, -13, 2, 5], [-13, 8, 0, -5, -1, 16, -3, 3, 1, -6, 4, -5, 0, 1, 4, -6], [2, -12, 2, -2, -2, 0, 0, 0, 0, 0, 0, 0, -14, 12, 0, 2], [-14, 2, 5, 2, 5, -4, 3, 5, -10, -1, 5, -3, 5, -2, -5, 4], [-19, 13, 3, -6, 0, 16, 1, 6, 0, -6, 2, -9, 3, 7, -4, -3], [8, -10, -7, -6, -13, 0, 5, 1, 0, 7, 1, -9, -5, 2, -1, 0], [0, 22, 9, 6, -7, 0, 7, 1, 0, 11, 1, 17, -1, 8, -1, -14], [43, 6, -2, 0, 4, 6, 5, -6, -12, -1, -6, 2, -2, 4, -2, -3], [6, 2, 10, -2, -6, 0, 0, 0, 0, -22, 0, 4, -2, -4, 0, 2], [-3, -12, -3, 2, -13, -10, -2, 5, -6, 8, -7, 5, -3, 2, -1, 5], [-11, 0, -20, 8, 11, 0, 0, 6, 0, -15, 6, -3, -10, 21, -6, -14], [-17, 15, -3, -2, 12, 16, 7, -6, -16, -6, -6, 1, -3, 5, 0, -9], [-5, -18, -2, 8, 5, 0, 0, -6, 0, -15, -6, -3, -4, 9, 6, -2], [14, -6, 8, 10, 12, -16, 4, 0, -14, 0, 14, 2, 8, -16, -2, 8], [-6, 14, -13, 0, 13, 0, -7, 7, 0, 17, 7, -7, -7, 6, -7, 0], [3, 16, 16, -6, -5, 0, 2, -10, 0, 15, -10, 5, 2, -3, 10, 14], [36, 7, -2, -10, 1, 12, -10, 4, 1, -7, 5, -8, -2, 3, 9, -9], [18, -33, 11, -7, -16, 0, -2, 10, 0, 17, 10, 1, 5, -25, -10, -1], [-41, -11, -7, 2, -2, -8, -5, 22, 10, 4, -4, 9, -7, -5, 10, -3], [-14, 8, -10, -12, 8, -6, -2, 10, -12, 2, -22, -2, -10, 24, -2, -8], [-39, -4, -6, -1, -11, 4, -1, 31, -13, 4, -10, 5, -6, 5, 2, -2], [-6, 26, -30, 2, 5, 0, 1, 2, 0, -18, 2, -21, 2, 5, -2, -5], [-15, 8, -3, -6, 17, 0, -2, -3, 0, 24, -3, 7, 15, -2, 3, 11], [-6, 19, -11, -1, -8, 0, 14, -6, 0, 27, -6, 3, -21, 41, 6, -7], [-14, 21, -3, -16, -10, 34, -3, 3, 15, -8, -8, -13, -3, 21, -2, -11], [-9, 7, -13, 6, 8, 0, 1, 8, 0, 42, 8, 5, 11, -1, -8, -15], [138, -26, 4, 6, -36, -8, -10, -20, 50, 10, 10, 2, 4, -12, 2, 14], [9, -72, -14, 0, -13, 0, 4, -4, 0, -49, -4, -23, -12, 7, 4, 0], [72, -38, 13, 10, -33, -34, -15, -19, -14, 13, 25, -3, 13, -22, -1, 26], [-81, 15, -3, 4, 38, 12, 5, 34, 40, -14, 10, 7, -3, -17, 16, -17], [-83, 42, -3, -22, 17, 34, 6, 5, 16, -14, -17, -19, -3, 36, -11, -17], [-1, -26, 8, -16, 8, 0, -7, -4, 0, -15, -4, -2, 0, -6, 4, 27], [-78, 9, 5, 4, 26, -10, 9, -21, -45, -4, 4, -1, 5, -3, -6, 1], [1, 18, 32, 8, -5, 0, 4, -4, 0, 65, -4, 31, 2, 1, 4, -8], [-7, 15, 39, -2, 10, 0, -3, -16, 0, -12, -16, 27, 3, 1, 16, 21], [-46, -12, -4, 8, 28, -36, 0, -28, 28, 4, 0, 12, -4, -12, 8, 0], [18, -72, 1, -18, -19, 0, 1, 11, 0, -57, 11, -5, -13, -4, -11, 6], [7, -44, -10, 2, -7, 0, 0, 2, 0, 11, 2, -15, 38, -45, -2, -4], [-25, -6, 16, 22, 51, 0, -26, -12, 0, 43, -12, 3, -6, 5, 12, 16], [2, 10, 14, 16, 14, 0, -16, 8, 0, -38, 8, 4, -10, -8, -8, -8], [88, -2, -7, -14, -37, 14, -9, -41, -24, 7, -19, -7, -7, 26, -5, 0], [-11, -4, 16, -5, -9, -12, -11, -25, 17, -2, 24, -21, 16, -3, -8, 14], [11, 37, 5, 4, 8, 0, -19, -6, 0, -24, -6, -31, 1, -31, 6, 21], [-35, 48, 8, -2, 16, 60, 27, 30, 32, -19, -2, -10, 8, 12, -18, -11], [1, 76, 45, -26, -25, 0, 24, -23, 0, -8, -23, 45, 35, -12, 23, 25], [-105, -10, 12, 8, -28, 24, -7, -4, -12, -5, 32, -4, 12, -28, 8, 7], [38, 20, 26, -4, -42, 0, 4, -6, 0, -36, -6, -14, -2, -32, 6, 6], [-29, -2, 2, -4, 40, -38, -11, 22, 52, -5, 14, -6, 2, -8, 10, -3], [-21, -12, 16, 8, 9, 0, 12, -10, 0, 103, -10, 39, 22, 11, 10, -10], [88, -30, -4, 6, -64, 0, -2, -10, -28, 22, -18, 10, -4, 8, -10, 18], [-32, 8, 10, -6, -52, 44, 2, 6, -16, 0, 2, -16, 10, 14, -18, 10], [11, -44, -64, -14, 13, 0, -24, 42, 0, -9, 42, -57, -14, -21, -42, -4], [4, -19, -5, -8, -32, 6, -25, 19, -7, 2, 10, -3, -5, -7, 20, -3], [8, -16, -31, 24, -22, 0, 14, 5, 0, -65, 5, -20, 11, -5, -5, -43], [18, 88, 54, 6, -30, 0, 12, -16, 0, -24, -16, 32, -34, 28, 16, -2], [-9, 14, -23, -30, -7, 30, -24, -35, 60, -8, -21, -7, -23, 28, 25, -31], [-7, 2, 36, 21, -9, 24, 9, 13, 101, -14, 62, -15, 36, -47, -10, 22], [-26, -22, -12, 0, 2, -56, 0, 36, 18, 22, -34, 12, -12, 22, -10, 10], [29, 22, 51, -4, -30, 0, 1, 11, 0, 30, 11, 34, 21, -49, -11, -8], [45, 70, 28, -23, -76, 0, 31, -14, 0, -3, -14, 0, 10, -24, 14, 6], [209, -84, -15, 38, -55, -76, 4, 17, -58, 50, -31, 53, -15, -22, -1, 35], [-69, 97, -17, 8, 54, 0, 15, -16, 0, 22, -16, 51, 55, 29, 16, -7], [198, -24, 20, 16, -44, 20, -10, -22, -46, -2, 48, -4, 20, -44, 8, 18], [-28, 104, 11, 30, 27, 0, 1, -27, 0, -29, -27, 13, 9, 20, 27, -4], [-217, 1, -25, -30, -36, 20, -23, 48, -50, 6, -38, -5, -25, 43, 12, -19], [5, 53, 73, -22, -32, 0, 27, -28, 0, 82, -28, 67, 17, 5, 28, 23], [-190, 46, -47, -34, 21, 56, 3, 29, -18, -9, -75, 13, -47, 62, 19, -56], [-170, 10, -1, 10, 49, -38, 25, -37, 42, 5, -21, 11, -1, 10, -19, 4], [3, -74, -54, -22, -3, 0, 0, 2, 0, 21, 2, -55, -4, 1, -2, 20], [-1, -55, -21, 18, 40, 0, -39, 28, 0, -34, 28, -31, 3, -41, -28, -7], [-332, 54, -26, -24, 64, 20, 16, 74, 10, -14, -52, 2, -26, 50, 0, -40], [-2, -56, 6, -8, -22, 0, 24, 6, 0, -62, 6, 38, 34, -8, -6, -22], [-110, -78, 10, 50, -70, -56, 16, -64, 24, 44, 0, 40, 10, -40, -20, 54], [-27, -86, -14, 44, 40, 0, -13, -2, 0, 65, -2, -2, -34, 48, 2, -29], [22, -62, 0, -48, -14, 0, -8, -6, 0, -62, -6, -36, 4, -34, 6, 62], [-158, -32, 22, 36, -10, -24, 12, -30, 80, 8, 38, 14, 22, -52, -6, 30], [-19, -24, 28, -15, 8, 0, 11, -14, 0, 153, -14, 44, 2, 28, 14, 18], [213, 27, 37, 10, -16, 60, 15, -52, -106, -22, 54, -27, 37, -27, -20, 15], [32, -82, 4, 30, 13, 0, -45, 8, 0, -58, 8, -65, -68, -9, -8, 7], [-6, -24, 12, -2, 10, 0, -4, 20, 0, 96, 20, 34, 8, -6, -20, -14], [-16, -130, -57, -22, -11, 0, 27, 11, 0, 65, 11, -3, 25, 18, -11, -16], [-130, 18, 37, 20, -15, 74, 9, -5, 136, -29, 77, -17, 37, -60, 3, 8], [225, -3, 3, -8, -86, 92, -21, -18, 24, -10, 26, -11, 3, -15, 20, -7], [-131, -14, 6, 25, 45, -24, 3, 85, 55, -8, 36, 19, 6, -55, 24, -2], [-55, 74, -74, -16, 45, 0, 10, -22, 0, 67, -22, -31, 20, 45, 22, 28], [-2, 98, -19, -42, 5, 0, -3, -7, 0, 45, -7, -27, -17, 16, 7, 52], [-22, -104, -116, 12, 10, 0, 12, 32, 0, 46, 32, -50, 8, 26, -32, -56], [-82, -42, -4, -12, -38, -64, -28, -16, -122, 26, -14, -8, -4, 22, -6, 22], [135, -18, -12, 24, 42, -74, 31, 24, 52, 25, -44, 36, -12, 8, -20, 13], [-28, 210, 33, -30, -21, 0, 49, 5, 0, -37, 5, 115, 43, 34, -5, -24], [32, -24, 81, -20, -18, 0, -14, -19, 0, 91, -19, 16, 11, -57, 19, 53], [17, -1, 31, 12, 12, 0, -29, 20, 0, 168, 20, 5, -21, -25, -20, -3], [246, -32, 18, 0, -6, -68, -20, -32, 18, 12, 26, -18, 18, -8, -10, 30], [549, -14, -9, 6, -17, -6, 4, 19, 44, 12, -19, 15, -9, 4, -1, 3], [29, -28, 26, -5, -43, -4, -39, -9, -49, -6, 66, -31, 26, -35, 14, 20], [25, 70, 38, -44, -73, 0, 48, -22, 0, 3, -22, 39, 100, -77, 22, 18], [-76, 31, 2, -10, -3, 52, 6, 108, 13, -15, 1, -12, 2, 11, -3, -13], [9, -5, -29, -16, 12, -84, 19, 14, -146, 40, -104, 13, -29, 91, -46, 11], [28, -110, 26, -22, 12, 0, -40, 0, 0, 30, 0, -42, -58, -10, 0, 62], [-291, -66, 28, 34, 22, -120, -13, -10, 90, 19, 56, 6, 28, -62, 0, 47], [25, 166, 67, 28, 18, 0, -43, -9, 0, -22, -9, -10, -15, -53, 9, 24], [51, 16, 16, 40, 1, 0, -52, 26, 0, -85, 26, -61, -66, -37, -26, -14], [-31, 50, -36, 23, 30, 0, 1, 12, 0, 109, 12, 8, -6, 38, -12, -36], [-178, -15, -49, 4, 16, -50, 25, 79, -79, 36, -106, 53, -49, 53, -8, -13], [100, 24, -30, -44, -82, 112, -30, -36, 30, -10, -34, -14, -30, 48, 26, -40], [-65, 108, 21, 2, 59, 0, 6, -35, 0, -90, -35, 57, -69, 140, 35, 27], [17, -72, 44, 70, -23, 0, 6, -18, 0, 245, -18, 15, -34, 23, 18, -58], [-182, 19, -28, -22, 103, -52, -16, 0, -61, -13, -21, 6, -28, 15, 35, -41], [119, -46, 80, -31, -106, 0, -13, -6, 0, 51, -6, -58, -38, -94, 6, 50], [91, -87, -9, 16, -2, -136, -33, -56, -90, 38, 2, 25, -9, -27, 20, 29], [28, -70, 88, -60, -56, 0, 28, -58, 0, 48, -58, 30, 4, -4, 58, 90], [240, -74, -58, -8, 16, -168, -18, -98, -42, 64, -112, 50, -58, 62, 4, 6], [-359, 18, -89, -82, 57, -60, -50, 23, 20, 14, -135, 7, -89, 128, 43, -75], [353, -41, 19, 20, -100, 28, -5, 42, 126, 16, 28, 1, 19, -29, -10, 35], [-5, -56, -42, 72, 29, 0, -24, 32, 0, -75, 32, -29, 4, -23, -32, -80], [227, -57, 47, 40, -176, 56, 11, -16, 40, 28, 48, -7, 47, -41, -46, 75], [297, 74, 28, -35, 131, -44, 1, 13, -27, -38, 30, -63, 28, 33, -26, -10], [20, 64, -91, -50, -99, 0, 79, 19, 0, -189, 19, -13, 95, -36, -19, -48], [162, 54, 10, -8, 44, 20, 32, -104, -120, -14, -16, -18, 10, 34, -36, -4], [-49, 152, 11, 26, 33, 0, 16, 39, 0, 32, 39, 115, 17, 48, -39, -81], [-289, -56, -12, -24, -50, -52, -63, 32, -54, 17, 10, -12, -12, 2, 34, 5], [33, -68, -21, 54, 9, 0, -42, -25, 0, -86, -25, -121, -95, 20, 25, 13], [-99, 55, -65, 26, 122, 0, -23, 10, 0, 220, 10, 21, 51, 25, -10, -13], [248, -65, -58, 10, -43, -60, -2, 32, -27, 53, -99, 68, -58, 31, 17, -5], [-21, -22, -20, 17, 82, 0, -61, 26, 0, 287, 26, -34, -114, 74, -26, 18], [-304, 28, -6, 60, 202, -44, 56, 80, 234, -32, 30, 66, -6, -96, 42, -38], [41, -234, -100, -44, 37, 0, -78, 60, 0, -59, 60, -159, -102, -17, -60, 62], [142, 1, 39, 52, 148, -130, 51, 29, 59, -2, 42, 13, 39, -55, -36, 37], [28, -54, -42, 52, -70, 0, 42, -36, 0, 78, -36, -64, -106, 120, 36, -58], [-182, 6, 58, 52, 122, -18, 6, 54, 50, -52, 156, -6, 58, -150, 40, 6], [-71, -216, -26, 50, 103, 0, -32, 2, 0, 25, 2, 15, -78, 117, -2, -20], [-218, 85, 22, -66, -53, 132, -22, -2, -103, -41, 19, -88, 22, 69, -25, -19], [21, 198, 128, -54, 7, 0, -28, -20, 0, -187, -20, 59, -10, -39, 20, 102], [-339, 0, 30, 43, 125, -92, 33, -117, 35, -10, 50, 13, 30, -63, -10, 20], [-68, -34, 83, 10, 35, 0, 33, -89, 0, 81, -89, 95, 45, 56, 89, 46], [509, 74, 52, 13, 139, -12, 41, 3, -17, -46, 70, -39, 52, -31, -34, 6], [-15, -2, -49, -84, 98, 0, -83, 47, 0, -2, 47, -70, -47, -21, -47, 120], [-69, -78, 34, 69, 1, -48, -7, -191, 91, 2, 108, 35, 34, -143, 40, 36], [-50, -154, -144, 4, 42, 0, 8, -4, 0, 46, -4, -90, 36, 22, 4, -8], [15, 111, -1, -34, 74, 92, 33, 180, 108, -44, -24, -33, -1, 57, -22, -45], [18, 24, 15, 2, 59, 0, -77, 21, 0, -393, 21, -59, -27, -68, -21, 54], [297, 48, 10, 12, 106, 26, 19, 18, -154, -41, 44, 2, 10, -46, 24, -31], [58, 194, 98, 90, -8, 0, -50, 24, 0, 66, 24, 14, -34, -74, -24, -64], [53, 270, 6, 26, -39, 0, -14, 58, 0, -9, 58, -3, -64, -3, -58, -70], [-103, 124, -8, -32, 145, 0, -42, -6, 0, -123, -6, 47, 34, 27, 6, 80], [230, 12, -44, -52, -64, 68, -40, -74, 2, 0, -56, -8, -44, 64, 32, -44], [-38, -144, -203, -34, 15, 0, 23, 39, 0, -1, 39, -103, 39, 22, -39, -28], [93, 0, 138, 100, -67, 0, -26, -32, 0, 215, -32, -13, 8, -127, 32, -42], [-6, 74, -42, 18, 31, 0, -25, 10, 0, -302, 10, -51, 30, -49, -10, -3], [-218, -50, 8, 88, 138, -152, 60, -64, -50, 22, 14, 80, 8, -94, -2, 30], [-433, -120, -17, 26, -173, -36, -28, 31, -114, 66, -29, 43, -17, -14, 5, 49]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_105_c_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_105_3_c_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_3_c_a(:prec:=16)
    chi := MakeCharacter_105_c();
    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_105_3_c_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_3_c_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_105_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;