
// Make newform 1078.2.c.c in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1078_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1078_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_1078_2_c_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_1078_2_c_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 := [1048576, 0, 1310720, 0, 819200, 0, 72448, 0, -1087, 0, -2272, 0, 512, 0, -32, 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], [-481919500288, 0, 1011889152, 0, 474538112, 0, -133787245, 0, -46669984, 0, -6919680, 0, 668960, 0, -32173, 0], [115772308922368, 0, 35129391631360, 0, 4403763700640, 0, -905783138901, 0, 73242356320, 0, 4404178432, 0, -500615872, 0, 21649515, 0], [167526400000, 0, 194978259968, 0, 13417758552, 0, 491616713, 0, -662732768, 0, 129966848, 0, -7913160, 0, 240905, 0], [30704009216, 0, 35772670976, 0, 2634257152, 0, 119589033, 0, -119264224, 0, 23098880, 0, -1400096, 0, 42729, 0], [0, 298669982056448, 0, 114707998022656, 0, 10664594701728, 0, -1703395919255, 0, -28654574560, 0, 46096726528, 0, -3358638720, 0, 116266153], [8620523487232, 0, -11825933968384, 0, -2009136336864, 0, -267579354193, 0, 111831131872, 0, -16598608384, 0, 933827904, 0, -26548369, 0], [849802264576, 0, 743042069504, 0, 101561457888, 0, -5141852845, 0, -2062231712, 0, 519454208, 0, -33066624, 0, 1040915, 0], [-49543323222016, 0, -84320719473664, 0, -12255806975456, 0, -107080965789, 0, 410096159072, 0, -76278327808, 0, 4561306816, 0, -135220701, 0], [0, -723250826477568, 0, -279805449960448, 0, -27621977981728, 0, 3864561461317, 0, 66556609440, 0, -104813186560, 0, 7568932160, 0, -263077499], [0, -13167578624000, 0, 13433955225472, 0, 997736067176, 0, 42003795807, 0, -45705450272, 0, 8514025600, 0, -510774904, 0, 15339039], [0, 289533980278784, 0, 107128611381248, 0, 7821020117440, 0, 381384242511, 0, -349822477600, 0, 70457976320, 0, -4312976672, 0, 133618959], [0, -4233948004352, 0, -7459200822272, 0, -851122418272, 0, -17555552883, 0, 30984053920, 0, -5954700800, 0, 359824640, 0, -10897203], [0, 34935425286144, 0, 64498714624768, 0, 4585099534888, 0, 178889617223, 0, -219318324768, 0, 42111652864, 0, -2548789688, 0, 77172743], [0, -303112411742208, 0, -257651828076544, 0, -18179529719584, 0, -760912344947, 0, 861452174496, 0, -170792382976, 0, 10421936192, 0, -319597619], [0, -10214744358912, 0, -17995089961984, 0, -2043398985376, 0, -37801257875, 0, 75544371360, 0, -14336292352, 0, 863194304, 0, -25933907]];
    Rf_basisdens := [1, 341451177984, 28937987334144, 149937758208, 19295207424, 308671864897536, 9645995778048, 256088383488, 28937987334144, 308671864897536, 14468993667072, 115751949336576, 8194828271616, 28937987334144, 115751949336576, 8194828271616];
    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_1078_c();"
function MakeCharacter_1078_c()
    N := 1078;
    order := 2;
    char_gens := [199, 981];
    v := [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_1078_c_Hecke();"
function MakeCharacter_1078_c_Hecke(Kf)
    N := 1078;
    order := 2;
    char_gens := [199, 981];
    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]];
    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, -1, 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, 0, 0, 0, 0, 0, -1, 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, 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, -1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -2, -1, -1, -2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, -3], [-1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, -1, -4, 0, 0, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -1, 0, 0, 0, -2, -1, 1, 0, 0, -1, 0], [-5, 2, 1, 0, 0, 0, 1, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -1, 0, 0], [1, 0, -1, 2, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0], [2, -1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0], [0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, 1, 0, -3], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 4, 1, 11], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, -3, -1, -5], [0, 0, 0, 0, 0, -5, 0, 0, 0, 4, 3, 1, 0, 0, 3, 0], [0, 0, 0, 0, 0, 6, 0, 0, 0, -5, 1, 2, 0, 0, 1, 0], [8, -8, -2, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [6, -12, 0, 0, 0, 0, 0, -3, -3, 0, 0, 0, 0, 0, 0, 0], [-2, 0, 2, 2, 12, 0, -2, 2, -2, 0, 0, 0, 0, 0, 0, 0], [-3, 0, 3, -6, -2, 0, -3, -4, 4, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, -1, -11], [0, 0, 0, 0, 0, 7, 0, 0, 0, -4, -4, -4, 0, 0, -4, 0], [-1, 0, 1, -14, 4, 0, -1, -3, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 7, 0, 0, 0, 2, 1, 3, 0, 0, 1, 0], [0, 0, 0, 6, -8, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 0], [-9, -1, 5, 0, 0, 0, 5, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 13, 0, 0, 0, 12, -1, 1, 0, 0, -1, 0], [0, 17, -2, 0, 0, 0, -2, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 0, 0, 2, 3, -5, 0, 0, 3, 0], [-13, -3, 1, 0, 0, 0, 1, -2, -2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, 4, 1, 3, 0], [0, 0, 0, 0, 0, 7, 0, 0, 0, 4, 3, -6, 0, 0, 3, 0], [-10, -7, 0, 0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0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 16, 0, 0, 0, -1, -5, 0, 0, 0, -5, 0], [4, 0, -4, 2, 2, 0, 4, 6, -6, 0, 0, 0, 0, 0, 0, 0], [-4, -1, -2, 0, 0, 0, -2, -3, -3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 0, 0, 13, 4, -1, 0, 0, 4, 0], [0, 0, 0, 0, 0, -10, 0, 0, 0, 3, 2, 5, 0, 0, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 11, -4, -3, 3], [2, 0, -2, -20, -2, 0, 2, -3, 3, 0, 0, 0, 0, 0, 0, 0], [-3, 0, 3, -6, 16, 0, -3, -1, 1, 0, 0, 0, 0, 0, 0, 0], [-7, 5, -3, 0, 0, 0, -3, -4, -4, 0, 0, 0, 0, 0, 0, 0], [10, -5, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -4, -3, -1, 4], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 12, -1, -2, -4], [0, 0, 0, 0, 0, 10, 0, 0, 0, -3, 2, 1, 0, 0, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 17, 7, -2, -7], [0, 0, 0, 0, 0, -7, 0, 0, 0, 2, 3, -9, 0, 0, 3, 0], [-4, 0, 4, -14, 8, 0, -4, -1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, -1, -1, 6, -3], [7, 0, -7, -4, 0, 0, 7, -1, 1, 0, 0, 0, 0, 0, 0, 0], [1, -16, 1, 0, 0, 0, 1, 5, 5, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 1, -8, 26, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 11, 0, 0, 0, -4, 3, 1, 0, 0, 3, 0], [0, 0, 0, 0, 0, -12, 0, 0, 0, 15, 4, 3, 0, 0, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 8, -1, -23], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 9, 0, -12], [0, 0, 0, 0, 0, -18, 0, 0, 0, 1, -4, 2, 0, 0, -4, 0], [22, -10, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 0, 2, -22, -14, 0, -2, -2, 2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 9, 0, 0, 0, -6, -1, 8, 0, 0, -1, 0], [15, 12, -5, 0, 0, 0, -5, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 14, 4, -2, 8], [10, 9, -2, 0, 0, 0, -2, -7, -7, 0, 0, 0, 0, 0, 0, 0], [-31, -9, -3, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 0, 2, 20, 16, 0, -2, -2, 2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 0, 0, -13, 6, 0, 0, 0, 6, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 24, -1, -2, 8], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, -8, -3, 9], [15, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, -1, -16, -14, 0, 1, -5, 5, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 1, 22, -10, 0, -1, 5, -5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 0, 0, -19, -4, -2, 0, 0, -4, 0], [4, 3, 0, 0, 0, 0, 0, -6, -6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 2, -1, -13, 0, 0, -1, 0], [-15, 5, -3, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, 3, 6, 3, -15], [-2, 0, 2, -22, 4, 0, -2, -5, 5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 0, 0, 0, 4, -3, -5, 0, 0, -3, 0], [-1, 0, 1, -2, 18, 0, -1, 1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 0, 0, 9, 0, 11, 0, 0, 0, 0], [-6, 0, 6, 0, 8, 0, -6, 4, -4, 0, 0, 0, 0, 0, 0, 0], [5, 0, -5, -8, -2, 0, 5, -6, 6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -24, 0, 0, 0, -5, 0, 3, 0, 0, 0, 0], [0, 0, 0, 0, 0, 25, 0, 0, 0, -4, -1, 2, 0, 0, -1, 0], [1, 0, -1, 8, -6, 0, 1, 5, -5, 0, 0, 0, 0, 0, 0, 0], [13, -18, 3, 0, 0, 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, -8, -10, 2, 22], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 11, 4, 1, 11], [-5, 14, 3, 0, 0, 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, -15, -1, -2, -19], [14, 15, -4, 0, 0, 0, -4, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, -14, 5, -4, 10], [-9, 2, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -15, 0, 0, 0, 2, -3, -1, 0, 0, -3, 0], [4, 0, -4, 2, 6, 0, 4, 2, -2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -15, 0, 0, 0, 12, 1, -4, 0, 0, 1, 0], [1, 0, -1, 20, -10, 0, 1, 6, -6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, -4, 0, 2, 10], [0, 0, 0, 0, 0, -6, 0, 0, 0, -3, 2, -14, 0, 0, 2, 0], [9, 0, -9, -6, -2, 0, 9, -1, 1, 0, 0, 0, 0, 0, 0, 0], [-4, 9, -8, 0, 0, 0, -8, 3, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -18, 0, 0, 0, -15, -4, 11, 0, 0, -4, 0], [7, 0, -7, -16, -16, 0, 7, -3, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 10, 0, 0, 0, 13, -5, -6, 0, 0, -5, 0], [2, 0, -2, -2, 2, 0, 2, -4, 4, 0, 0, 0, 0, 0, 0, 0], [-4, 8, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, 34, -5, 3, 6], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, -8, 2, 4], [-3, 0, 3, 12, 0, 0, -3, -3, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 14, 6, 2, -2], [0, 0, 0, 0, 0, 13, 0, 0, 0, 18, 1, 1, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 14, 1, -5, -4], [0, 0, 0, 0, 0, -2, 0, 0, 0, -3, -7, 4, 0, 0, -7, 0], [0, 0, 0, 0, 0, -5, 0, 0, 0, 4, 3, 9, 0, 0, 3, 0], [0, 0, 0, 0, 0, -6, 0, 0, 0, -1, 6, -3, 0, 0, 6, 0], [8, 0, -8, 16, 6, 0, 8, 7, -7, 0, 0, 0, 0, 0, 0, 0], [-4, 0, 4, -14, -12, 0, -4, 1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 12, 0, 0, 0, -29, -7, -10, 0, 0, -7, 0], [-8, 0, 8, 14, 10, 0, -8, -2, 2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 4, -5, 3, 0, 0, -5, 0], [-18, -16, 2, 0, 0, 0, 2, 6, 6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -3, 0, 0, 0, 4, 9, 4, 0, 0, 9, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 6, 2, 4, -16], [0, 0, 0, 0, 0, -7, 0, 0, 0, -18, 3, 2, 0, 0, 3, 0], [2, 0, -2, 28, -24, 0, 2, -2, 2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 6, 1, 5, -14], [-23, 3, -3, 0, 0, 0, -3, 6, 6, 0, 0, 0, 0, 0, 0, 0], [-16, -15, -2, 0, 0, 0, -2, 1, 1, 0, 0, 0, 0, 0, 0, 0], [7, 0, -7, -16, -6, 0, 7, 5, -5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 10, -2, -4], [-2, 3, 2, 0, 0, 0, 2, -1, -1, 0, 0, 0, 0, 0, 0, 0], [26, 0, -2, 0, 0, 0, -2, 4, 4, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, -17, -5, -6, 9], [4, 0, -4, 14, 20, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 10, 0, 0, 0, -23, 1, 0, 0, 0, 1, 0], [-26, 8, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0, 6, 6, 6], [3, 0, -3, 6, -22, 0, 3, -2, 2, 0, 0, 0, 0, 0, 0, 0], [-4, -12, -2, 0, 0, 0, -2, -2, -2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, -23, -1, 5, -11], [8, 0, -8, 16, 4, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -12, -2, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 6, 0, 0, 0, -1, -8, -12, 0, 0, -8, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, -12, 4, 2, 16], [0, 0, 0, 0, 0, 9, 0, 0, 0, -14, -1, 0, 0, 0, -1, 0], [5, 0, -5, -8, 18, 0, 5, 1, -1, 0, 0, 0, 0, 0, 0, 0], [5, 15, 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 13, 0, 0, 0, -10, -1, 5, 0, 0, -1, 0], [-53, 1, 1, 0, 0, 0, 1, -3, -3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -27, -7, 1, 11], [0, 0, 0, 0, 0, 12, 0, 0, 0, -19, 0, 3, 0, 0, 0, 0], [0, -23, 2, 0, 0, 0, 2, -7, -7, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -11, 0, 6], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 12, -10, -2, 8], [0, 0, 0, 0, 0, 4, 0, 0, 0, 5, 0, -13, 0, 0, 0, 0], [0, 0, 0, 0, 0, 16, 0, 0, 0, 13, -6, 4, 0, 0, -6, 0], [-12, 0, 12, 12, 16, 0, -12, 5, -5, 0, 0, 0, 0, 0, 0, 0], [-6, 0, 6, -36, 6, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0], [10, 0, -10, 2, 4, 0, 10, 4, -4, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 12, 5, -2, -34], [-23, -9, -3, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -10, 0, 0, 0, 3, -1, -4, 0, 0, -1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 11, 4, -5, -1], [-6, 0, 6, -42, -2, 0, -6, 2, -2, 0, 0, 0, 0, 0, 0, 0], [27, -6, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 3, -13, 7, 5], [0, 0, 0, 0, 0, -10, 0, 0, 0, 25, 0, -3, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, -14, 9, 4, -22], [-5, 0, 5, 14, 8, 0, -5, 3, -3, 0, 0, 0, 0, 0, 0, 0], [2, 0, -2, 16, -20, 0, 2, -3, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, -16, -1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, -5, -4, -7, 19], [0, 0, 0, 0, 0, 6, 0, 0, 0, 19, 3, 4, 0, 0, 3, 0], [0, 0, 0, 0, 0, -8, 0, 0, 0, 3, 6, 10, 0, 0, 6, 0], [-10, -13, -4, 0, 0, 0, -4, 3, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -20, 0, 0, 0, -19, -3, 4, 0, 0, -3, 0], [-5, 0, 5, 8, 0, 0, -5, 5, -5, 0, 0, 0, 0, 0, 0, 0], [3, 0, -3, 0, -14, 0, 3, 5, -5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -8, 0, 0, 0, 9, 0, 13, 0, 0, 0, 0], [-1, -33, -3, 0, 0, 0, -3, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 0, 0, -6, -6, 0, 0, 0, -6, 0], [3, 0, -3, 6, -40, 0, 3, 1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 34, -9, 4, -4], [0, 0, 0, 0, 0, -20, 0, 0, 0, 21, 4, 7, 0, 0, 4, 0], [10, -24, -4, 0, 0, 0, -4, 9, 9, 0, 0, 0, 0, 0, 0, 0], [-4, 0, 4, 10, 2, 0, -4, 8, -8, 0, 0, 0, 0, 0, 0, 0], [-4, 0, 4, 22, 22, 0, -4, 3, -3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, -9, -15, 3, 9], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, -14, 0, 6], [-21, -19, 3, 0, 0, 0, 3, 6, 6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, -16, 12, -4, -2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 1, 8, 5, -35], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 33, -13, 4, 11], [-27, 5, 5, 0, 0, 0, 5, -6, -6, 0, 0, 0, 0, 0, 0, 0], [2, 35, -2, 0, 0, 0, -2, 3, 3, 0, 0, 0, 0, 0, 0, 0], [-9, 0, 9, -12, 16, 0, -9, 5, -5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 28, 0, 0, 0, -29, -2, -5, 0, 0, -2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 28, -5, -3, 12], [-24, 7, 6, 0, 0, 0, 6, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 21, 0, 0, 0, -2, -8, 10, 0, 0, -8, 0], [1, 0, -1, 2, -14, 0, 1, -5, 5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, 19, -5, 3, 15], [-5, 0, 5, -4, 24, 0, -5, -1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, -7, -8, 7, 11], [0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, -11, 0, 0, 3, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, -30, -5, -1, 0, 0, -5, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, -5, 0, 27], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 3, 7, 2, -23], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, -26, -3, 7, -4], [4, 0, -4, 26, 8, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 0, 2, 32, -26, 0, -2, 4, -4, 0, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1078_c_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1078_2_c_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_1078_2_c_c(:prec:=16)
    chi := MakeCharacter_1078_c();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(1999) - 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_1078_2_c_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_1078_2_c_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1078_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![2, 0, 4, 0, 1]>],Snew);
    return Vf;
end function;