
// Make newform 76.2.f.a in Magma, downloaded from the LMFDB on 23 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_76_f();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_76_f_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_76_2_f_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_76_2_f_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 := [256, -384, 384, -288, 192, -72, 12, 12, -10, 6, 3, -9, 12, -9, 6, -3, 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], [-5056, 15616, -29216, 17312, -4308, 1304, -730, -1340, -183, 625, -428, 419, -666, 335, -397, -26], [32128, -86528, 46496, -2064, -472, -1972, -4412, -1522, 2974, -1475, 965, -1716, 629, -1114, -341, 79], [62912, 34816, 8880, 48288, -13740, 31896, -270, 7288, 5325, 109, 1552, -37, -2, 1363, -269, 130], [45056, 174400, 17216, -24656, 37120, -2468, 1712, 8742, 6764, 10699, 3285, -1594, -2119, 1416, 2061, 339], [51840, -4544, 4832, -29168, -6968, 13596, -1948, -7234, 2638, -8251, -5251, -1268, -883, -666, -845, -425], [-52928, 640, -20656, -26512, -6508, -1280, 7986, -9924, 1781, -1791, -1404, 367, 290, -949, -97, -230], [-147968, -960, 90176, -122128, 22208, -39828, 5808, 4302, -7988, 7023, 97, -1506, 1525, -5608, 2473, -537], [-95168, 36864, -44048, 10176, -14652, 3300, 10938, -11082, -1559, 934, -3225, 2921, -1671, 835, -550, -361], [273536, -153536, 141536, -21296, 7832, 10916, 18316, 16498, 4874, 759, 5903, -4660, 4223, 114, -431, 885], [352896, -308736, 299616, -160096, 96520, -7180, -11356, 14522, -5790, -607, 5725, -9892, 9309, -5566, 2879, -621], [-384, 384, -288, 192, -72, 12, 12, -10, 6, 3, -9, 12, -9, 6, -3, 1], [125952, 175424, -26496, 54288, -41344, 62516, 18096, 4898, 3420, 3345, 2391, 522, -1949, 2720, 1063, 1441], [-6656, 15040, -25600, 36704, -22304, 6180, -1616, 418, 1600, 27, -703, 662, -731, 900, -491, 475], [-249664, 232000, -164848, 127856, -79964, 25216, -9158, -6044, 2561, 821, -3172, 7867, -6350, 3471, -2357, 1346]];
    Rf_basisdens := [1, 1, 40768, 81536, 81536, 163072, 163072, 81536, 163072, 81536, 163072, 81536, 128, 163072, 40768, 81536];
    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_76_f();"
function MakeCharacter_76_f()
    N := 76;
    order := 6;
    char_gens := [39, 21];
    v := [3, 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_76_f_Hecke();"
function MakeCharacter_76_f_Hecke(Kf)
    N := 76;
    order := 6;
    char_gens := [39, 21];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, -1, 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 := 2;
    raw_aps := [[0, -1, 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, 0, 1], [0, -1, 0, -2, 1, 1, 1, 1, 0, 0, 0, 0, -1, -2, 1, 0], [-1, 1, 0, 1, -1, -1, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0], [1, 1, 0, 1, 0, 1, -1, 1, -2, 0, 0, 0, 0, 1, 0, 0], [-1, 2, -1, 3, -1, -1, -1, 0, 0, 0, 0, 0, 1, 2, -1, 0], [0, -1, 1, -2, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0], [2, -3, -1, -1, 2, 1, 0, 1, 2, 0, -1, 1, 0, -1, 0, -1], [0, -3, 0, -5, 2, 2, 2, 0, 4, 4, -1, 4, 0, -4, 4, -2], [-2, 6, -2, 8, -2, -2, 1, -6, 0, 0, 0, -3, 2, 4, -2, 0], [-3, -1, 2, -3, -1, -1, 2, -1, 0, 0, 0, 1, -2, 0, -2, 0], [-1, -1, 2, 0, -2, 1, -1, 1, 0, 0, 0, 2, 1, 1, -1, 0], [-2, -1, 1, -1, 2, -1, -2, 2, 0, 0, 0, 1, 0, -1, 0, 0], [-2, -1, 1, 2, -1, -1, 1, -1, 0, 0, -2, 0, 1, 0, 1, -1], [0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, -2, 0, -2, 2], [1, -2, 1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 2, -1, 0], [0, 7, 0, 5, -2, -1, -2, 0, -4, -2, 0, -3, 4, 3, 2, 1], [-4, 0, 4, 0, 0, 0, 3, 0, 0, 0, 0, -3, 0, 0, 0, 0], [0, -3, 0, 0, 1, -1, 1, 0, 2, -2, 1, 0, 1, 0, -1, 0], [0, 3, -1, 2, -1, -1, -1, -1, 0, 0, 0, -2, 1, 0, 1, -1], [0, 1, 1, 3, 0, 1, 0, 2, 0, 0, 0, 1, 2, -1, -2, 0], [0, 1, 1, -2, 1, 1, 1, 1, 0, 0, 0, 2, 3, 0, 3, -1], [1, 1, 0, 4, -1, 1, -2, 1, -4, 0, 0, -1, -1, 2, -1, 0], [1, -3, 1, -5, 2, 2, 2, 0, 0, 0, 0, 0, -2, -4, 2, 0], [2, -2, -1, 0, 2, -2, -2, 2, 0, 0, 0, 0, 2, 0, -2, 0], [-2, 2, 2, -2, 0, 0, -1, 0, 0, 0, 0, 1, -4, 0, 4, 0], [0, 0, 0, -2, 0, 0, 0, 0, 0, 0, -4, 0, -2, 0, -2, -4], [6, 2, -4, -2, 2, 2, -4, 2, 0, 0, 0, -2, -4, 0, -4, 0], [-6, 0, 3, -3, 2, 1, -2, 2, 0, 0, 0, 3, -3, -3, 3, 0], [-2, -4, 4, -6, 1, 4, 5, 4, 0, 0, 0, -1, -2, -5, 2, 0], [-3, 0, 1, 2, -2, -2, 1, -2, 0, 0, 5, -1, 0, 0, 0, 0], [-8, 2, 4, -2, -4, -6, 4, -4, 0, -4, 2, -2, 0, 2, -4, 1], [1, -4, -1, 2, -2, 2, -4, 0, 0, 0, 0, 6, 6, 0, -6, 0], [2, 1, -2, 0, 1, 1, -1, 0, 2, 2, -1, 0, 1, -2, 3, -2], [0, 7, -8, 12, -1, -3, -1, -5, 0, 0, 0, -2, 5, 4, -5, 0], [-3, -1, 2, 1, -1, -1, 2, -1, 0, 0, -6, 1, 2, 0, 2, -6], [0, 0, -3, -1, 2, 1, 2, 0, 0, 0, 0, -1, -1, -3, 1, 0], [3, -1, 0, -7, 4, 3, 1, 3, 2, 0, 4, 4, 2, -1, 2, -4], [3, 4, -1, 0, 0, 4, -3, 2, -4, 4, -1, 1, -2, 0, 2, 0], [-6, -2, 3, 3, -4, 1, 4, -4, 0, 0, 0, -3, 5, 3, -5, 0], [3, -3, -2, -8, 3, 5, 0, 1, 4, 8, 4, 5, -5, -6, 3, 4], [2, -12, 2, -18, 6, 6, -1, 14, 0, 0, 0, 7, -6, -12, 6, 0], [2, -14, 0, -8, 6, 2, 4, 2, 8, 0, 2, 6, -2, -4, -2, -2], [-10, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0], [1, 1, 0, -4, 4, 1, -3, 7, 0, 0, 0, 4, -5, -5, 5, 0], [3, 8, -3, 10, -2, -2, -5, 0, -4, -4, 3, -7, 4, 4, 0, 6], [0, -2, -1, -3, 1, 0, 1, -1, 4, 2, 0, 1, -1, -3, 1, 3], [0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 7], [-9, -3, 6, -2, -3, -3, 6, -3, 0, 0, 4, 3, 1, 0, 1, 4], [2, 6, 0, 0, 2, 2, 0, 2, 0, 0, 0, 2, -6, -4, 6, 0], [0, 1, 11, 3, -4, -3, -4, -2, 0, 0, 0, 1, 2, 7, -2, 0], [4, -8, 0, -2, 4, 4, 0, 4, 0, 0, -4, 4, -2, 0, -2, 4], [5, 1, 5, -4, 5, 5, 5, 0, 0, 0, 0, 0, -5, -10, 5, 0], [6, 4, -6, 2, 2, 2, -4, 0, 4, 4, -3, -2, 2, -4, 6, -6], [-1, 7, -1, 12, -5, -5, -5, 0, 0, 0, 0, 0, 5, 10, -5, 0], [0, -1, 0, 6, 0, -4, 0, 0, 0, -8, -2, -4, 5, 4, -3, -1], [6, 4, -3, 3, 0, -3, 0, 0, 0, 0, 0, -3, -1, 3, 1, 0], [4, -3, -2, 6, 2, 2, -2, 2, 0, 0, -2, 0, 3, 0, 3, -1], [-7, -3, 0, 2, -4, 1, 5, -9, 0, 0, 0, -4, 5, 3, -5, 0], [-1, -3, -1, -2, -1, -1, -1, 0, 0, 0, 0, 0, 1, 2, -1, 0], [4, 2, -2, -8, 2, 6, -2, 2, 0, 8, 10, 4, -6, -4, 2, 5], [-13, -1, 26, -6, 0, 1, 1, 1, 0, 0, 0, 0, -5, -1, 5, 0], [0, -3, 2, 1, 0, 1, 0, 2, -4, -2, 0, 1, -2, 3, -4, 5], [-1, 1, 0, 1, -1, -1, 0, -1, 0, 0, -2, -1, 0, 0, 0, 2], [3, -3, -3, 6, 3, -3, -11, 0, 0, 0, 0, 8, 9, 0, -9, 0], [-5, -4, -5, -3, -1, -1, -1, 0, 0, 0, 0, 0, 1, 2, -1, 0], [-9, -3, 6, -4, -3, -3, 6, -3, 0, 0, 0, 3, -1, 0, -1, 0], [6, -2, -3, -2, 0, 2, 0, 0, 0, 0, 0, 2, 0, -2, 0, 0], [-4, 1, 2, -7, -2, 3, 2, -2, 0, 10, -6, 5, -6, -5, 4, -3], [10, -2, 0, 0, -2, 2, 4, -6, 0, 0, 0, -2, 2, 0, -2, 0], [-4, 12, 0, 14, -7, -2, 5, -12, 0, 0, 0, -7, 2, 9, -2, 0], [-8, -3, 4, 10, -4, -8, 4, -4, 0, -8, -2, -4, 7, 4, -1, -1], [4, 15, -4, 19, -4, -4, -8, 0, -8, -8, -3, -12, 10, 8, 2, -6], [2, -2, -4, -6, 4, 2, 6, 2, 0, 0, 0, -4, -4, -6, 4, 0], [6, 8, -4, 5, -1, -4, -7, 2, -6, -12, 10, -11, -3, 9, -15, 10], [0, -17, 2, -14, 6, 4, 6, 2, 8, 4, 0, 10, -7, -6, -3, 5], [-11, 0, 11, -5, -5, 5, 3, 0, 0, 0, 0, 2, -5, 0, 5, 0], [0, 13, -2, 20, -5, -11, -5, -17, 0, 0, 0, -6, 7, 16, -7, 0], [-2, 10, 1, 2, 0, -2, 0, 0, 0, 0, 0, -2, -8, 2, 8, 0], [5, -11, 5, -12, 1, 1, -1, 4, 0, 0, 0, 2, -1, -2, 1, 0], [-4, 12, 0, -6, -2, -4, 2, -4, 4, 0, -2, -2, 6, -2, 6, 2], [16, 5, -8, -4, 9, -5, -9, 9, 0, 0, 0, 4, -9, -4, 9, 0], [9, -2, -3, -4, 6, 6, -3, 6, 0, 0, 9, 3, 0, 0, 0, 0], [-9, 17, -9, 21, -4, -4, 0, -8, 0, 0, 0, -4, 4, 8, -4, 0], [0, 3, -2, 14, -6, -4, -6, -2, -8, -4, 0, -10, -7, 6, -11, 1], [4, 16, -4, 22, -6, -6, -10, 0, -12, -12, 1, -16, 6, 12, -6, 2], [0, 8, 0, 11, 4, -8, -4, -8, 0, 0, 0, -4, 3, 4, -3, 0], [-12, -2, 0, -3, 2, 0, -2, 4, 0, 0, 0, 2, -1, -2, 1, 0], [0, -2, -3, -9, 4, -1, 4, -6, 0, 0, 0, -5, -7, -3, 7, 0], [2, 18, 0, 12, -6, 2, -8, 2, -16, 0, 0, -6, 2, 8, 2, 0], [-5, 3, 0, 9, -6, -5, -1, -5, -2, 0, 4, -6, -2, 1, -2, -4], [-7, -22, 7, -28, 6, 6, 13, 0, 12, 12, 3, 19, -12, -12, 0, 6], [15, -3, -10, -5, 9, 13, -6, 5, 8, 16, -2, 7, -2, -12, 14, -2], [6, 3, -3, -4, 3, 1, -3, 3, 0, -4, -6, -2, -1, 2, -5, -3], [4, -2, -2, 4, 2, 2, -2, 2, 0, 0, -10, 0, 2, 0, 2, -5], [-6, -7, 6, -7, 0, 0, 6, 0, 0, 0, 3, 6, -2, 0, -2, 6], [5, -12, 5, -19, 7, 7, -3, 20, 0, 0, 0, 10, -7, -14, 7, 0], [18, 6, -36, 22, -1, -6, -7, -6, 0, 0, 0, 1, 16, 7, -16, 0], [-9, 0, 3, -6, -2, -10, 7, -6, 8, -8, 3, -3, 4, 0, -4, 0], [-1, -8, 1, 9, 1, -1, 5, 0, 0, 0, 0, -6, 17, 0, -17, 0], [3, -14, -1, 12, 2, 2, -1, 2, 0, 0, 1, 1, 0, 0, 0, 0], [5, -6, -5, -3, -9, 9, 7, 0, 0, 0, 0, 2, 3, 0, -3, 0], [-3, 3, 2, 16, -3, -5, 0, -1, -4, -8, -4, -5, 13, 6, 5, -4], [2, -2, -4, 1, -11, 2, -9, 2, 0, 0, 0, 11, 3, 9, -3, 0], [5, 5, 0, 14, -3, 5, -8, 5, -16, 0, -2, -3, -3, 8, -3, 2], [-18, 2, 0, 0, -1, 4, 5, -6, 0, 0, 0, -1, -2, -3, 2, 0], [10, -5, -5, 12, 5, 3, -5, 5, 0, -4, 10, -2, 7, 2, 3, 5], [-3, 7, 3, -8, -1, 1, 11, 0, 0, 0, 0, -10, -15, 0, 15, 0], [-6, -9, 2, -5, 2, -10, 8, -4, 12, -12, -1, -2, 6, 0, -6, 0], [-6, -2, 12, 11, 0, 2, 2, 2, 0, 0, 0, 0, 13, -2, -13, 0], [-3, -5, 2, -21, 1, 3, 4, -1, 4, 8, -10, 7, -16, -6, -8, -10], [0, 14, -19, 25, -8, -11, -8, -14, 0, 0, 0, -3, 11, 19, -11, 0], [-13, 8, 13, -10, -2, 2, 6, 0, 0, 0, 0, -4, -18, 0, 18, 0], [0, 0, 0, -6, 2, 0, 2, 0, 4, 0, -2, 2, 2, -2, 2, 2], [-2, -7, 2, -7, 0, 0, 2, 0, 0, 0, -3, 2, -10, 0, -10, -6], [14, -9, -7, -11, 8, 3, -8, 8, 0, 0, 0, 11, -2, -11, 2, 0], [12, 0, -6, -2, 6, 8, -6, 6, 0, 4, -2, 2, -2, -2, 2, -1], [-4, 20, 0, -4, -4, -4, 0, -4, 0, 0, 2, -4, 8, 0, 8, -2], [22, -2, 0, 0, 0, -2, -2, 2, 0, 0, 0, 0, 2, 2, -2, 0], [-9, 14, 3, -2, -8, -4, 1, -6, -4, 4, 3, -3, -2, 0, 2, 0], [10, -6, 10, -8, 2, 2, -3, 10, 0, 0, 0, 5, -2, -4, 2, 0], [6, 2, -12, -7, 5, -2, 3, -2, 0, 0, 0, -5, -9, -3, 9, 0], [12, 6, -24, 10, 0, -6, -6, -6, 0, 0, 0, 0, 4, 6, -4, 0], [6, -6, -4, -8, 6, 10, 0, 2, 8, 16, -2, 10, -2, -12, 14, -2], [2, 6, 0, -12, 4, 2, 2, 2, 4, 0, 2, 4, 6, -2, 6, -2], [0, 19, -14, 32, -3, -9, -3, -15, 0, 0, 0, -6, 13, 12, -13, 0], [2, -8, -2, 0, -8, 8, 13, 0, 0, 0, 0, -5, 8, 0, -8, 0], [6, 3, -3, 0, 3, -3, -3, 3, 0, -12, 10, -6, 3, 6, -9, 5], [-6, 3, 3, -8, -3, -1, 3, -3, 0, 4, 10, 2, -5, -2, -1, 5], [-9, -5, 0, -2, 0, -1, -1, 1, 0, 0, 0, 0, 3, 1, -3, 0], [0, -1, 0, -3, 0, 5, 0, 0, 0, 10, -14, 5, -4, -5, 6, -7], [0, 1, -2, 4, -2, -2, -2, -2, 0, 0, 0, -4, -3, 0, -3, 3], [-9, 14, 3, -2, -8, -4, 1, -6, -4, 4, -7, -3, -2, 0, 2, 0], [0, -20, -1, -39, 12, 13, 12, 14, 0, 0, 0, 1, -19, -25, 19, 0], [-10, -18, 0, -22, 9, 8, -1, 10, 0, 0, 0, 9, -4, -17, 4, 0], [7, -7, -7, 7, 0, 0, 4, 0, 0, 0, 0, -4, 14, 0, -14, 0], [6, -18, 6, -26, 8, 8, 5, 6, 0, 0, 0, 3, -8, -16, 8, 0], [3, 13, -2, 18, -5, -11, -8, 1, -12, -24, 8, -19, 5, 18, -19, 8], [-7, -11, 14, -24, 4, 11, 15, 11, 0, 0, 0, -4, -13, -15, 13, 0], [8, -8, 0, -15, 10, 2, -8, 18, 0, 0, 0, 10, -7, -12, 7, 0], [-9, -12, 3, 18, -6, -6, 3, -6, 0, 0, -5, -3, 0, 0, 0, 0], [-1, 4, 1, -9, -5, 5, -5, 0, 0, 0, 0, 10, -13, 0, 13, 0], [-13, -6, 13, -2, -4, -4, 9, 0, -8, -8, 7, 5, 2, 8, -6, 14], [12, -14, -4, 0, 10, 6, -2, 8, 4, -4, -3, 4, 2, 0, -2, 0], [-8, -4, 16, -8, -6, 4, -2, 4, 0, 0, 0, 6, -4, 2, 4, 0], [0, 1, 6, 8, -2, 2, -2, 6, -16, -8, 0, 0, 1, 12, -7, -9], [0, -16, 17, -25, -2, 5, -2, 12, 0, 0, 0, 7, -9, -3, 9, 0], [10, 0, -5, 2, 4, -6, -4, 4, 0, 0, 0, -2, 2, 2, -2, 0], [6, -6, -6, -12, 6, 6, 0, 0, 12, 12, -9, 6, -6, -12, 6, -18], [-15, -5, 10, -3, -5, -5, 10, -5, 0, 0, 12, 5, 2, 0, 2, 12], [20, -23, -10, -16, 5, 11, -5, 5, 0, 0, 0, 16, 7, -16, -7, 0], [-24, -16, 0, -19, 8, 6, -2, 10, 0, 0, 0, 8, -3, -14, 3, 0], [4, 22, -4, 28, -6, -6, -10, 0, -12, -12, 1, -16, 18, 12, 6, 2], [15, 0, -5, -10, 10, 10, -5, 10, 0, 0, -9, 5, 0, 0, 0, 0], [0, -25, -2, -31, 12, 5, 12, -2, 28, 14, 0, 17, -8, -21, 6, -11], [9, -1, -6, 5, 5, 7, -4, 3, 4, 8, 2, 3, 6, -6, 14, 2], [4, -20, 0, -20, 12, 4, 8, 4, 16, 0, 2, 12, 0, -8, 0, -2], [0, 14, 3, 20, -2, -10, -2, -18, 0, 0, 0, -8, 6, 12, -6, 0], [-11, -5, 11, 0, -5, 5, -3, 0, 0, 0, 0, 8, 5, 0, -5, 0], [3, 8, 3, 23, -15, -15, -5, -20, 0, 0, 0, -10, 15, 30, -15, 0], [-18, 1, 9, 0, -9, -11, 9, -9, 0, -4, 6, -2, 1, 2, -3, 3], [-42, -1, 21, -3, 0, 3, 0, 0, 0, 0, 0, 3, -2, -3, 2, 0], [-6, 5, 3, -2, -3, -11, 3, -3, 0, -16, 14, -8, 3, 8, -13, 7], [0, 13, -2, 9, -4, -3, -4, -2, -4, -2, 0, -7, 6, 3, 4, 5], [14, 0, -28, 8, -7, 0, -7, 0, 0, 0, 0, 7, 8, 7, -8, 0], [0, -1, 5, 10, -3, 1, -3, 5, -16, -8, 0, -2, -3, 12, -11, -1], [0, 15, 1, 28, -11, -5, -11, 1, -24, -12, 0, -16, -1, 18, -13, 15], [14, -6, -14, 6, 0, 0, -7, 0, 0, 0, 0, 7, 12, 0, -12, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_76_f_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


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