
// Make newform 1680.3.l.a in Magma, downloaded from the LMFDB on 27 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1680_l();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1680_l_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_1680_3_l_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_1680_3_l_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, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1400928, -797208, -16640728, -7881413, -19319222, -5855246, -5356966, -1667083, -172404, -199188, 96196, -6979, 11114, 314, 346, 19], [480768, 5755144, 1164668, 13937181, -315822, 13831052, 1385434, 6908345, 883956, 1782656, 173056, 235239, 13434, 14860, 362, 355], [357696, -6223816, 2361972, -13937181, 2390046, -13831052, -1576670, -6908345, -1143564, -1782656, -222000, -235239, -17010, -14860, -454, -355], [1054080, 5671944, 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], [-1769184, 2823032, -8006344, -3759285, -8080118, -15419362, -2088654, -9262303, -1872, -2303744, 53512, -279615, 5702, -16310, 174, -365], [-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, 4554152, -4003172, 22147396, -4040059, 29074142, -1044327, 14253143, -936, 3318976, 26756, 393902, 2851, 22834, 87, 511]];
    Rf_basisdens := [1, 1, 468672, 468672, 468672, 234336, 78112, 78112, 234336, 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_1680_l();"
function MakeCharacter_1680_l()
    N := 1680;
    order := 2;
    char_gens := [1471, 421, 1121, 337, 241];
    v := [2, 2, 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_1680_l_Hecke();"
function MakeCharacter_1680_l_Hecke(Kf)
    N := 1680;
    order := 2;
    char_gens := [1471, 421, 1121, 337, 241];
    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], [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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 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, 0], [1, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, -2, 2, 0, 0, 0], [1, 0, 1, 1, 0, 0, -1, 0, 0, 0, 1, -1, -1, 0, -1, -1], [2, -1, 1, 0, 0, -2, 1, 0, -3, 0, 1, -2, 1, 3, -1, -1], [0, 0, 0, -1, 0, -2, 0, -1, 1, 2, 1, -2, 0, -1, 1, 1], [-1, -1, -2, -1, 0, 0, 2, 0, -3, 0, 2, 1, 0, -1, -2, 2], [1, 1, 4, 2, 0, 1, -2, 0, -2, -3, -2, 2, -2, 2, 2, 2], [4, 1, 1, -1, 2, 1, 1, 0, -3, -2, 3, 1, -1, 4, 1, 0], [3, 0, 0, 7, 0, -1, -7, 9, 1, -1, 0, 1, 0, 1, 0, -2], [0, -3, 5, -3, 0, -3, -1, 0, 1, -2, -1, 1, 1, 2, 1, -2], [-15, 0, 2, 5, 0, -3, 1, 5, 1, 1, 4, -3, -2, 1, 0, -2], [-2, -8, -2, -1, 0, 1, -2, 0, -12, 2, -2, -1, -2, -1, 2, -3], [3, -5, 0, -1, 0, -4, 0, 0, -7, 2, 0, -7, 6, 1, 0, -6], [10, 9, 7, 9, 0, -1, -1, 0, 9, -4, -1, -5, 3, 8, 1, 2], [2, -5, 3, -2, -10, 1, -5, -15, -6, -8, 8, 5, -3, 13, 2, -5], [13, -8, 0, -1, -16, 3, -3, 1, 1, -5, -4, 5, 0, 1, -4, -6], [-2, -7, -2, -2, 0, 0, 0, 0, -2, -2, 0, 0, -14, 12, 0, 2], [-14, -2, 5, -5, -4, 3, 5, 10, -3, -2, 5, -3, -5, 2, -5, -4], [19, -8, -3, 0, -16, -1, -6, 0, 0, -6, -2, 9, 3, 7, 4, -3], [-8, -7, 7, -13, 0, -5, -1, 0, -13, -6, -1, 9, -5, 2, 1, 0], [0, 1, 9, 7, 0, 7, 1, 0, 5, -6, 1, 17, 1, -8, -1, 14], [43, 3, -2, -4, 6, 5, -6, 12, -1, 0, -6, 2, 2, -4, -2, 3], [6, 4, 10, 6, 0, 0, 0, 0, -20, 2, 0, 4, 2, 4, 0, -2], [3, 5, 3, -13, 10, 2, -5, -6, -6, 2, 7, -5, -3, 2, 1, 5], [11, 7, 20, 11, 0, 0, -6, 0, 23, 8, -6, 3, -10, 21, 6, -14], [-17, 8, -3, -12, 16, 7, -6, 16, -4, 2, -6, 1, 3, -5, 0, 9], [-5, 5, -2, -5, 0, 0, -6, 0, -23, -8, -6, -3, 4, -9, 6, 2], [-14, 8, -8, 12, 16, -4, 0, -14, 10, 10, -14, -2, 8, -16, 2, 8], [6, 17, 13, 13, 0, 7, -7, 0, -17, 0, -7, 7, -7, 6, 7, 0], [3, -3, 16, 5, 0, 2, -10, 0, 21, 6, -10, 5, -2, 3, 10, -14], [-36, -6, 2, 1, -12, 10, -4, 1, -3, -10, -5, 8, -2, 3, -9, -9], [18, 25, 11, 16, 0, -2, 10, 0, 24, 7, 10, 1, -5, 25, -10, 1], [41, 4, 7, -2, 8, 5, -22, 10, -2, 2, 4, -9, -7, -5, -10, -3], [-14, -3, -10, -8, -6, -2, 10, 12, 14, 12, -22, -2, 10, -24, -2, 8], [39, -2, 6, -11, -4, 1, -31, -13, -5, -1, 10, -5, -6, 5, -2, -2], [6, 26, 30, 5, 0, -1, -2, 0, 20, 2, -2, 21, 2, 5, 2, -5], [-15, -9, -3, -17, 0, -2, -3, 0, 30, 6, -3, 7, -15, 2, 3, -11], [6, 4, 11, -8, 0, -14, 6, 0, -28, -1, 6, -3, -21, 41, -6, -7], [-14, 17, -3, 10, 34, -3, 3, -15, 8, 16, -8, -13, 3, -21, -2, 11], [9, 5, 13, 8, 0, -1, -8, 0, -36, 6, -8, -5, 11, -1, 8, -15], [138, -4, 4, 36, -8, -10, -20, -50, 4, -6, 10, 2, -4, 12, 2, -14], [9, 31, -14, 13, 0, 4, -4, 0, -49, 0, -4, -23, 12, -7, 4, 0], [-72, 17, -13, -33, 34, 15, 19, -14, -3, 10, -25, 3, 13, -22, 1, 26], [81, -6, 3, 38, -12, -5, -34, 40, 18, 4, -10, -7, -3, -17, -16, -17], [83, -17, 3, 17, -34, -6, -5, 16, -8, -22, 17, 19, -3, 36, 11, -17], [1, -8, -8, 8, 0, 7, 4, 0, -1, -16, 4, 2, 0, -6, -4, 27], [-78, -5, 5, -26, -10, 9, -21, 45, -8, -4, 4, -1, -5, 3, -6, -1], [1, 9, 32, 5, 0, 4, -4, 0, 57, -8, -4, 31, -2, -1, 4, 8], [7, -1, -39, 10, 0, 3, 16, 0, 10, -2, 16, -27, 3, 1, -16, 21], [-46, -18, -4, -28, -36, 0, -28, -28, -4, -8, 0, 12, 4, 12, 8, 0], [-18, -43, -1, -19, 0, -1, -11, 0, 39, -18, -11, 5, -13, -4, 11, 6], [7, 18, -10, 7, 0, 0, 2, 0, 9, -2, 2, -15, -38, 45, -2, 4], [25, 21, -16, 51, 0, 26, 12, 0, -21, 22, 12, -3, -6, 5, -12, 16], [2, -10, 14, -14, 0, -16, 8, 0, -54, -16, 8, 4, 10, 8, -8, 8], [-88, -7, 7, -37, -14, 9, 41, -24, -21, -14, 19, 7, -7, 26, 5, 0], [-11, -6, 16, 9, -12, -11, -25, -17, 3, 5, 24, -21, -16, 3, -8, -14], [11, -38, 5, -8, 0, -19, -6, 0, -28, -4, -6, -31, -1, 31, 6, -21], [35, -30, -8, 16, -60, -27, -30, 32, 17, -2, 2, 10, 8, 12, 18, -11], [1, -3, 45, 25, 0, 24, -23, 0, 18, 26, -23, 45, -35, 12, 23, -25], [105, -12, -12, -28, -24, 7, 4, -12, 13, 8, -32, 4, 12, -28, -8, 7], [-38, -4, -26, -42, 0, -4, 6, 0, 32, -4, 6, 14, -2, -32, -6, 6], [-29, -19, 2, -40, -38, -11, 22, -52, -1, 4, 14, -6, -2, 8, 10, 3], [-21, 21, 16, -9, 0, 12, -10, 0, 95, -8, -10, 39, -22, -11, 10, 10], [-88, 0, 4, -64, 0, 2, 10, -28, -16, 6, 18, -10, -4, 8, 10, 18], [-32, 22, 10, 52, 44, 2, 6, 16, 6, 6, 2, -16, -10, -14, -18, -10], [-11, 13, 64, 13, 0, 24, -42, 0, -5, -14, -42, 57, -14, -21, 42, -4], [4, 3, -5, 32, 6, -25, 19, 7, 10, 8, 10, -3, 5, 7, 20, 3], [8, 9, -31, 22, 0, 14, 5, 0, -89, -24, 5, -20, -11, 5, -5, 43], [-18, 13, -54, -30, 0, -12, 16, 0, 30, 6, 16, -32, -34, 28, -16, -2], [9, -15, 23, -7, -30, 24, 35, 60, -22, -30, 21, 7, -23, 28, -25, -31], [-7, 12, 36, 9, 24, 9, 13, -101, -35, -21, 62, -15, -36, 47, -10, -22], [26, 28, 12, 2, 56, 0, -36, 18, -22, 0, 34, -12, -12, 22, 10, 10], [-29, -21, -51, -30, 0, -1, -11, 0, -34, -4, -11, -34, 21, -49, 11, -8], [45, 3, 28, 76, 0, 31, -14, 0, 20, 23, -14, 0, -10, 24, 14, -6], [209, -38, -15, 55, -76, 4, 17, 58, 12, -38, -31, 53, 15, 22, -1, -35], [-69, -50, -17, -54, 0, 15, -16, 0, 14, -8, -16, 51, -55, -29, 16, 7], [198, 10, 20, 44, 20, -10, -22, 46, -18, -16, 48, -4, -20, 44, 8, -18], [28, 59, -11, 27, 0, -1, 27, 0, 59, 30, 27, -13, 9, 20, -27, -4], [-217, 10, -25, 36, 20, -23, 48, 50, 36, 30, -38, -5, 25, -43, 12, 19], [-5, -23, -73, -32, 0, -27, 28, 0, -104, -22, 28, -67, 17, 5, -28, 23], [-190, 28, -47, -21, 56, 3, 29, 18, 25, 34, -75, 13, 47, -62, 19, 56], [170, 19, 1, 49, 38, -25, 37, 42, 5, 10, 21, -11, -1, 10, 19, 4], [-3, -11, 54, -3, 0, 0, -2, 0, -43, -22, -2, 55, -4, 1, 2, 20], [-1, -8, -21, -40, 0, -39, 28, 0, -52, -18, 28, -31, -3, 41, -28, 7], [-332, 10, -26, -64, 20, 16, 74, -10, 10, 24, -52, 2, 26, -50, 0, 40], [-2, 58, 6, 22, 0, 24, 6, 0, -54, 8, 6, 38, -34, 8, -6, 22], [110, 28, -10, -70, 56, -16, 64, 24, 6, 50, 0, -40, 10, -40, 20, 54], [27, -22, 14, 40, 0, 13, 2, 0, -21, 44, 2, 2, -34, 48, -2, -29], [-22, -20, 0, -14, 0, 8, 6, 0, 14, -48, 6, 36, 4, -34, -6, 62], [158, 12, -22, -10, 24, -12, 30, 80, 28, 36, -38, -14, 22, -52, 6, 30], [19, -30, -28, 8, 0, -11, 14, 0, -168, -15, 14, -44, 2, 28, -14, 18], [-213, -30, -37, -16, -60, -15, 52, -106, 32, 10, -54, 27, 37, -27, 20, 15], [-32, -2, -4, 13, 0, 45, -8, 0, 88, 30, -8, 65, -68, -9, 8, 7], [-6, 24, 12, -10, 0, -4, 20, 0, 98, 2, 20, 34, -8, 6, -20, 14], [-16, 69, -57, 11, 0, 27, 11, 0, 87, 22, 11, -3, -25, -18, -11, 16], [130, -37, -37, -15, -74, -9, 5, 136, 49, 20, -77, 17, 37, -60, -3, 8], [225, 46, 3, 86, 92, -21, -18, -24, -2, 8, 26, -11, -3, 15, 20, 7], [131, 12, -6, 45, 24, -3, -85, 55, 33, 25, -36, -19, 6, -55, -24, -2], [-55, -75, -74, -45, 0, 10, -22, 0, 83, 16, -22, -31, -20, -45, 22, -28], [2, 65, 19, 5, 0, 3, 7, 0, -87, -42, 7, 27, -17, 16, -7, 52], [-22, 22, -116, -10, 0, 12, 32, 0, 34, -12, 32, -50, -8, -26, -32, 56], [82, 32, 4, -38, 64, 28, 16, -122, -38, -12, 14, 8, -4, 22, 6, 22], [135, -37, -12, -42, -74, 31, 24, -52, 1, -24, -44, 36, 12, -8, -20, -13], [28, 37, -33, -21, 0, -49, -5, 0, 7, -30, -5, -115, 43, 34, 5, -24], [32, 29, 81, 18, 0, -14, -19, 0, 111, 20, -19, 16, -11, 57, 19, -53], [-17, 3, -31, 12, 0, 29, -20, 0, -156, 12, -20, -5, -21, -25, 20, -3], [246, -34, 18, 6, -68, -20, -32, -18, 12, 0, 26, -18, -18, 8, -10, -30], [-549, 3, 9, -17, 6, -4, -19, 44, -6, 6, 19, -15, -9, 4, 1, 3], [29, -2, 26, 43, -4, -39, -9, 49, -1, 5, 66, -31, -26, 35, 14, -20], [25, 21, 38, 73, 0, 48, -22, 0, 47, 44, -22, 39, -100, 77, 22, -18], [76, -26, -2, -3, -52, -6, -108, 13, 5, -10, -1, 12, 2, 11, 3, -13], [-9, 42, 29, 12, 84, -19, -14, -146, -56, -16, 104, -13, -29, 91, 46, 11], [28, 28, 26, -12, 0, -40, 0, 0, 52, 22, 0, -42, 58, 10, 0, -62], [291, 60, -28, 22, 120, 13, 10, 90, 15, 34, -56, -6, 28, -62, 0, 47], [-25, 97, -67, 18, 0, 43, 9, 0, 50, 28, 9, 10, -15, -53, -9, 24], [51, -39, 16, -1, 0, -52, 26, 0, -125, -40, 26, -61, 66, 37, -26, 14], [31, 36, 36, 30, 0, -1, -12, 0, -86, 23, -12, -8, -6, 38, 12, -36], [-178, -25, -49, -16, -50, 25, 79, 79, 32, -4, -106, 53, 49, -53, -8, 13], [100, 56, -30, 82, 112, -30, -36, -30, 34, 44, -34, -14, 30, -48, 26, 40], [-65, -55, 21, -59, 0, 6, -35, 0, -92, -2, -35, 57, 69, -140, 35, -27], [-17, -55, -44, -23, 0, -6, 18, 0, -175, 70, 18, -15, -34, 23, -18, -58], [182, 26, 28, 103, 52, 16, 0, -61, -9, -22, 21, -6, -28, 15, -35, -41], [119, 47, 80, 106, 0, -13, -6, 0, 82, 31, -6, -58, 38, 94, 6, -50], [91, -68, -9, 2, -136, -33, -56, 90, 22, -16, 2, 25, 9, 27, 20, -29], [-28, -78, -88, -56, 0, -28, 58, 0, -108, -60, 58, -30, 4, -4, -58, 90], [-240, 84, 58, 16, 168, 18, 98, -42, -72, -8, 112, -50, -58, 62, -4, 6], [-359, -30, -89, -57, -60, -50, 23, -20, 96, 82, -135, 7, 89, -128, 43, 75], [-353, -14, -19, -100, -28, 5, -42, 126, 4, 20, -28, -1, 19, -29, 10, 35], [5, 1, 42, 29, 0, 24, -32, 0, 147, 72, -32, 29, 4, -23, 32, -80], [-227, -28, -47, -176, -56, -11, 16, 40, 12, 40, -48, 7, 47, -41, 46, 75], [297, -22, 28, -131, -44, 1, 13, 27, -3, 35, 30, -63, -28, -33, -26, 10], [20, 11, -91, 99, 0, 79, 19, 0, -139, 50, 19, -13, -95, 36, -19, 48], [162, 10, 10, -44, 20, 32, -104, 120, -6, 8, -16, -18, -10, -34, -36, 4], [-49, -35, 11, -33, 0, 16, 39, 0, 6, -26, 39, 115, -17, -48, -39, 81], [289, 26, 12, -50, 52, 63, -32, -54, -41, -24, -10, 12, -12, 2, -34, 5], [33, -31, -21, -9, 0, -42, -25, 0, -140, -54, -25, -121, 95, -20, 25, -13], [-99, -78, -65, -122, 0, -23, 10, 0, 194, -26, 10, 21, -51, -25, -10, 13], [-248, 30, 58, -43, 60, 2, -32, -27, -43, 10, 99, -68, -58, 31, -17, -5], [-21, -47, -20, -82, 0, -61, 26, 0, 270, -17, 26, -34, 114, -74, -26, -18], [304, 22, 6, 202, 44, -56, -80, 234, 92, 60, -30, -66, -6, -96, -42, -38], [-41, -19, 100, 37, 0, 78, -60, 0, 15, -44, -60, 159, -102, -17, 60, 62], [142, -65, 39, -148, -130, 51, 29, -59, -54, -52, 42, 13, -39, 55, -36, -37], [-28, -30, 42, -70, 0, -42, 36, 0, -26, 52, 36, 64, -106, 120, -36, -58], [-182, -9, 58, -122, -18, 6, 54, -50, -104, -52, 156, -6, -58, 150, 40, -6], [-71, 64, -26, -103, 0, -32, 2, 0, -25, -50, 2, 15, 78, -117, -2, 20], [218, -66, -22, -53, -132, 22, 2, -103, -25, -66, -19, 88, 22, 69, 25, -19], [-21, 73, -128, 7, 0, 28, 20, 0, 133, -54, 20, -59, -10, -39, -20, 102], [-339, -46, 30, -125, -92, 33, -117, -35, -53, -43, 50, 13, -30, 63, -10, -20], [-68, 47, 83, -35, 0, 33, -89, 0, 71, -10, -89, 95, -45, -56, 89, -46], [-509, 6, -52, 139, 12, -41, -3, -17, 59, 13, -70, 39, 52, -31, 34, 6], [15, 83, 49, 98, 0, 83, -47, 0, -82, -84, -47, 70, -47, -21, 47, 120], [69, 24, -34, 1, 48, 7, 191, 91, 67, 69, -108, -35, 34, -143, -40, 36], [50, -11, 144, 42, 0, -8, 4, 0, -42, 4, 4, 90, 36, 22, -4, -8], [-15, -46, 1, 74, -92, -33, -180, 108, 10, -34, 24, 33, -1, 57, 22, -45], [18, -71, 15, -59, 0, -77, 21, 0, -395, -2, 21, -59, 27, 68, -21, -54], [297, 13, 10, -106, 26, 19, 18, 154, -53, -12, 44, 2, -10, 46, 24, 31], [58, -86, 98, 8, 0, -50, 24, 0, -24, -90, 24, 14, 34, 74, -24, 64], [-53, 117, -6, -39, 0, 14, -58, 0, 35, 26, -58, 3, -64, -3, 58, -70], [-103, -111, -8, -145, 0, -42, -6, 0, -91, 32, -6, 47, -34, -27, 6, -80], [-230, -34, 44, -64, -68, 40, 74, 2, -52, -52, 56, 8, -44, 64, -32, -44], [38, -13, 203, 15, 0, -23, -39, 0, -33, -34, -39, 103, 39, 22, 39, -28], [93, 27, 138, 67, 0, -26, -32, 0, 115, -100, -32, -13, -8, 127, 32, 42], [6, 78, 42, 31, 0, 25, -10, 0, 320, 18, -10, 51, 30, -49, 10, -3], [218, 76, -8, 138, 152, -60, 64, -50, 66, 88, -14, -80, 8, -94, 2, 30], [-433, -18, -17, 173, -36, -28, 31, 114, 40, -26, -29, 43, 17, 14, 5, -49], [-331, -2, 19, -190, -4, 31, -78, -4, -22, 36, 10, -55, -19, -45, -28, 39], [36, 122, 22, 22, 0, -14, -38, 0, 56, -112, -38, -66, -10, 60, 38, 60], [76, 30, 129, 122, 0, 46, 14, 0, 10, 89, 14, 113, 13, 17, -14, -29], [400, -17, -39, 222, -34, -19, -111, -137, 48, -44, -68, 83, 39, 15, 10, -53], [-11, 53, -119, -26, 0, -15, 52, 0, 194, -100, 52, -71, 15, -11, -52, 137], [-268, 74, 72, -30, 148, 64, -12, 144, -68, -6, 76, -66, -72, 10, -68, -10], [-250, -89, 75, -169, -178, 15, 1, -332, -131, -114, 191, 39, -75, 230, 41, -58], [44, 57, -5, 101, 0, 57, 23, 0, -25, 46, 23, 31, -77, 64, -23, 34], [23, -2, -39, 10, -4, 37, 18, 160, 46, 16, -122, 23, 39, -99, -44, 9], [69, -3, -2, 80, 0, 11, 10, 0, -60, 13, 10, -50, 40, 18, -10, 8], [292, 40, -18, -100, 80, 42, -34, -42, -8, 32, -52, -14, 18, -66, -16, 58], [254, -43, 23, 104, -86, -23, -193, -229, 4, -44, 42, 21, -23, 63, -4, -71], [558, 30, -70, 234, 60, -64, 24, -180, 110, 50, -116, 20, 70, -96, 24, 10], [104, 17, 63, 133, 0, 29, -63, 0, -117, -8, -63, -75, 55, 20, 63, -26], [53, 58, -12, 63, 116, 47, 101, -133, -65, -67, 6, 79, 12, 85, 30, 10], [37, -6, 80, 51, 0, 14, 4, 0, 157, 46, 4, 61, -72, 95, -4, -28], [61, -141, 92, -79, 0, -140, 28, 0, -303, -48, 28, -81, 54, 147, -28, -64], [-114, 100, -140, -120, 0, -6, 10, 0, -228, -44, 10, -22, 136, -244, -10, 48], [-207, 94, -64, 39, 188, -5, 11, 135, 121, 151, -180, -87, 64, -267, -52, 94], [-91, -36, 66, -206, -72, 29, -84, -152, -131, -74, 168, 8, -66, 176, 36, -9], [309, 56, -13, -198, 112, 9, 178, 158, -42, 54, 20, -41, 13, -21, 46, 109], [42, 38, 234, 68, 0, 26, 6, 0, 28, -36, 6, 224, 10, 6, -6, 68], [-118, 74, -51, -95, 148, 39, -51, 56, 7, 58, -97, -7, 51, -104, 5, 102], [5, -111, 144, -51, 0, -56, 2, 0, -39, -12, 2, 85, -18, 79, -2, -42], [97, 18, 1, -156, 36, 67, -28, -258, -12, 30, -54, -31, -1, -85, -56, 41], [42, 68, 98, 140, 0, 98, -16, 0, -74, -56, -16, 138, 70, -126, 16, 138], [-7, -129, 40, 47, 0, 54, -26, 0, -197, 10, -26, 75, -26, -35, 26, 18], [-130, -153, -117, -170, 0, -40, 39, 0, -113, -84, 39, 12, -57, -33, -39, 83], [-87, -64, 25, -200, -128, 13, -56, -144, -16, 12, 28, -37, -25, -9, -22, 3], [393, 32, 82, -193, 64, 93, -59, -79, -127, -45, 116, -37, -82, 79, -48, 0], [52, -61, 143, 50, 0, -2, -1, 0, -19, -88, -1, 88, 11, 43, 1, 85], [-10, 138, 82, -37, 0, -27, -66, 0, -240, -2, -66, -1, -26, 43, 66, -91], [12, -111, 129, -82, 0, -94, -18, 0, -74, 77, -18, 5, -43, 149, 18, -189], [-466, 45, -31, -63, 90, 29, -61, 36, -33, -2, -27, 33, 31, 6, 35, 62], [648, -71, 30, 86, -142, 24, 52, 226, -8, -82, 14, 52, -30, 66, -46, -104], [-518, -88, -8, 94, -176, -38, -62, 344, -8, -88, 38, 96, 8, 134, 54, -72], [-148, -133, -95, -145, 0, 3, -31, 0, -49, -34, -31, 25, -111, -40, 31, 6], [123, 131, 297, 167, 0, 44, -51, 0, -60, 42, -51, 167, 21, 58, 51, -49], [198, 19, -23, 23, 38, -29, 21, 360, 79, 86, -73, -63, 23, -136, -27, 30], [17, 57, 72, -15, 0, -32, 68, 0, 197, -48, 68, 91, 62, -13, -68, 84], [208, 10, 94, 218, 0, 10, 22, 0, 118, 44, 22, -82, 110, 88, -22, -12], [430, -60, -24, -73, -120, 76, 108, -65, -9, -58, -91, 82, 24, -9, -43, -25], [-262, -62, -52, -172, -124, 80, -162, 84, 14, -14, -146, 66, 52, -80, -42, 24], [22, -68, -200, -28, 0, -50, 142, 0, -168, 40, 142, -130, 44, 28, -142, 52], [-176, -12, -106, 34, -24, 16, 212, 150, 100, 40, -222, 66, 106, -156, -10, 46], [-9, -48, -138, -54, 0, -45, 58, 0, 7, 96, 58, -116, 186, -150, -58, -83], [-28, -118, 44, 46, 0, 74, 28, 0, 92, 84, 28, 174, -84, -18, -28, 18], [-4, 12, 60, -88, 24, 40, -294, -314, -100, -56, 120, -4, -60, 116, 0, -16], [472, 14, -20, 248, 28, 12, -162, 332, 42, -42, -74, 62, 20, -12, -34, -64], [-34, -109, 157, -1, 0, 33, -81, 0, -301, -74, -81, 143, 9, -76, 81, 26], [55, 167, 120, 5, 0, -50, -24, 0, 281, 14, -24, -9, -74, 179, 24, -88], [63, 235, 92, 49, 0, -14, -44, 0, -89, -12, -44, -29, 42, 35, 44, -46], [188, -10, -38, -142, -20, -36, 124, -276, 26, 66, -28, -28, 38, -56, 48, 78], [238, 19, -3, 227, 38, -15, 203, 30, 73, 14, -61, -11, 3, -72, -55, -56], [159, 192, 305, 54, 0, -105, -28, 0, 74, -90, -28, 13, 75, 189, 28, -43], [-24, -54, 52, 206, -108, 26, -120, 24, 2, -94, 24, 42, -52, 66, -80, -148], [-57, -118, -186, -116, 0, -59, -22, 0, 159, -24, -22, -210, 46, -44, 22, -57], [-716, -18, -46, -122, -36, 64, 8, -128, 14, 6, -124, 40, 46, -84, -32, 38], [38, -71, -35, -8, 0, -46, -47, 0, -131, -52, -47, -166, 201, -117, 47, -41], [25, 209, 25, 52, 0, 27, -56, 0, -8, -70, -56, -29, 23, -25, 56, 41], [-63, 3, 41, -199, 6, 18, -255, -86, -74, 2, 97, -43, -41, 54, 15, 35], [-54, -44, -109, 26, 0, 80, -84, 0, 30, -19, -84, -59, 187, -321, 84, 15], [-559, -46, 28, 97, -92, 13, -87, 171, 101, 43, -86, -71, -28, -157, -142, -86], [-244, -24, 132, -7, -48, 22, -20, 277, -81, -58, 191, -74, -132, 117, -73, -109], [418, 34, 142, -80, 68, 38, -142, -478, -156, -72, 260, -70, -142, 190, -24, -58], [-99, -58, 41, 10, 0, 109, -84, 0, 90, -64, -84, 165, -113, -95, 84, 89], [-15, -64, 34, -202, -128, -39, -70, -196, -57, -8, 130, -26, -34, 104, 62, 15], [-132, 62, 18, 23, 0, 155, -14, 0, 314, -30, -14, 291, -170, -117, 14, 171], [148, -18, -34, 218, -36, -24, -58, 228, 80, -8, -90, 42, 34, -48, -22, -54], [27, 51, -178, 109, 0, 82, 78, 0, 65, 148, 78, -45, 112, -167, -78, 12], [97, 258, 196, 208, 0, 111, -74, 0, 244, -25, -74, 136, 14, -28, 74, 62], [26, 114, 64, 10, 0, -16, 46, 0, -258, -36, 46, 68, 28, 14, -46, 66], [-19, -63, 60, 37, 0, 56, 68, 0, 229, 96, 68, 203, 34, -109, -68, 28], [174, -124, 58, 165, -248, -10, -78, -61, 17, -98, 51, 40, -58, 91, -65, -173], [9, -123, 49, 7, -246, 18, -223, 60, 24, -50, 7, 1, -49, 8, -91, -123], [46, 8, 72, 172, 16, -96, -52, -148, 64, 68, 104, -140, -72, -36, -40, -68], [-54, 53, -101, -60, 0, -6, 7, 0, -177, -8, 7, -46, -245, 197, -7, 9], [90, -196, -110, -30, 0, -120, 74, 0, -132, -84, 74, -246, 250, -40, -74, 38], [-56, -2, 42, 160, -4, -14, -182, 126, 16, -20, 40, -22, -42, 18, -44, -78], [-160, 73, 17, -163, 0, -3, -93, 0, -235, -96, -93, 81, 1, -158, 93, 0], [-929, 62, -29, -30, 124, 41, 140, 192, -26, 2, -44, 27, 29, -17, 14, 57], [-147, -17, -86, -135, 0, 12, -50, 0, 465, 34, -50, 23, -56, -103, 50, -72], [91, -44, 38, -155, -88, -57, -31, -329, -55, -1, 150, -37, -38, 113, 74, 16], [100, -173, -97, 31, 0, -69, 87, 0, -205, 46, 87, -179, 71, 98, -87, -28], [89, 151, -88, 105, 0, 16, 48, 0, -185, 6, 48, -113, 162, -89, -48, 58], [-388, 170, 108, -44, 340, 36, 278, -86, -104, 48, 176, -156, -108, 20, -40, 44], [-114, -48, 94, -60, 0, 54, -122, 0, 62, 120, -122, 140, 34, -202, 122, -188], [-49, -20, 66, -78, 0, -29, 38, 0, 266, -23, 38, 124, 40, -60, -38, 32], [-492, 102, -58, 182, 204, -84, 124, 312, 130, 146, -104, -88, 58, -192, 12, 74], [-102, 23, -59, -61, 46, -15, 307, 280, 87, 108, -131, -49, 59, -180, -13, 80], [161, 179, 49, 89, 0, -72, 1, 0, 274, 54, 1, -183, 197, 36, -1, -125], [-229, -9, 40, 44, -18, -145, 20, 22, 51, 92, 134, -132, -40, 2, 54, 1], [664, 90, 118, 110, 180, 20, -90, 2, -10, 46, 108, -164, -118, -56, -128, -62], [49, 85, 28, 53, 0, 4, 34, 0, 19, 114, 34, 17, 262, -217, -34, -76], [642, 85, -37, -236, 170, 63, 65, -235, -18, 84, -82, -47, 37, -129, -8, 139], [-121, -34, -13, -297, -68, 48, -75, 296, -16, 40, -45, -27, 13, -72, -19, 69], [-149, -54, -106, -157, 0, -8, 70, 0, 105, -114, 70, 105, -150, 9, -70, 176], [640, -22, 54, -145, -44, 62, 168, 79, -137, -106, 129, 52, -54, 181, 21, -23], [-117, -235, -92, 14, 0, 131, -42, 0, -538, -65, -42, 114, 10, -258, 42, 154], [-52, -333, -151, -91, 0, -39, -3, 0, 385, 46, -3, -141, -7, -6, 3, -88], [625, 68, -4, -13, 136, -125, -51, 93, 9, 99, 112, -95, 4, 17, 120, 94], [71, -181, 58, 51, 0, -20, -26, 0, -65, 70, -26, -59, 28, 63, 26, -116], [-726, -113, 67, -98, -226, 11, -107, 303, -112, -136, 168, 69, -67, 237, 34, -91], [559, 18, 48, -513, 36, 105, 47, 89, -187, -23, 130, -25, -48, 105, 34, 116], [-105, -13, 32, -308, -26, 59, 356, 122, -117, -32, 90, 0, -32, 90, 26, 53], [-2, 96, 132, 352, 192, -88, -120, -4, -8, 12, 228, -144, -132, 84, -36, -112], [-862, 60, -79, 59, 120, -69, 377, 350, 137, 154, -147, -75, 79, -222, 11, 96], [21, -31, -53, -313, -62, 24, 107, -454, 28, 86, -105, -33, 53, -138, 1, 111], [-197, -101, -184, -217, 0, -20, 100, 0, 323, 60, 100, 93, -94, -83, -100, 20], [-714, 204, 44, -56, 408, 160, 316, -248, -140, -24, 24, -20, -44, 4, -64, 72], [603, -154, -125, 28, -308, -71, -88, 70, 104, -26, -158, 151, 125, -7, 92, -5], [-152, -3, -139, -3, 0, 149, -17, 0, 245, -116, -17, 145, -35, -266, 17, 248], [-168, 82, 10, -95, 0, 73, -46, 0, -474, -58, -46, 205, -10, -231, 46, 85], [-179, -48, 27, 240, -96, -111, -278, -200, 84, 18, 54, -45, -27, 9, 0, -93], [15, -233, 187, 32, 0, 17, -37, 0, -24, -112, -37, 152, 191, -193, 37, 92], [488, 109, 17, -124, 218, 35, 251, -97, -36, 72, 18, -89, -17, -71, -16, 91], [83, 74, 90, -102, 148, 43, 124, 36, -141, -42, 188, -48, -90, 140, 8, 9], [-5, -185, 45, -6, 0, -1, 36, 0, 242, 70, 36, 85, -145, 141, -36, -35], [370, 80, 220, 144, 160, 20, -100, -596, -256, -184, 456, -36, -220, 420, 16, -148], [-221, -1, -214, -169, 0, 52, 46, 0, 331, -22, 46, 105, -52, -221, -46, 120], [-388, -95, -159, 37, -190, 37, -27, 670, 123, -18, -319, 177, 159, -142, -1, 18], [-34, -275, -1, -111, 0, -77, 37, 0, -343, -26, 37, -7, -13, 56, -37, -14], [-29, -181, -18, -86, 0, -57, -10, 0, -358, 105, -10, -56, 28, 0, 10, -172], [23, -52, 182, 14, 0, -9, -74, 0, -81, -56, -74, 76, -150, 182, 74, -27], [-175, -259, -232, -103, 0, 72, -88, 0, 131, -94, -88, -73, 66, -313, 88, 78], [2, 117, -177, 137, 0, 135, 39, 0, 125, -84, 39, -5, 91, -224, -39, 258], [421, -176, -114, 159, -352, -91, -109, 489, 203, 25, -226, 89, 114, -137, 2, -64], [78, 284, -94, -2, 0, -80, 106, 0, 196, 146, 106, -146, 118, 40, -106, -120], [434, -123, 99, 217, -246, -31, -285, -140, -3, -114, 133, 15, -99, 148, -65, -210], [-117, 41, -383, -41, 0, 76, 89, 0, 84, 122, 89, -101, 305, -498, -89, 43], [-148, -255, -115, -263, 0, -115, -31, 0, -81, -74, -31, -113, 5, -38, 31, -72], [-963, -34, -60, 98, -68, -1, 348, 218, -13, -88, -46, 148, 60, 102, 74, -15], [831, 199, -24, -260, 398, -29, 264, -278, -41, 180, 46, -156, 24, -110, 94, 245], [289, 221, 256, 415, 0, 126, -48, 0, 405, 76, -48, 45, 18, 145, 48, 2], [1019, -144, -33, -222, -288, -33, 12, 146, 14, -8, -14, 41, 33, 27, 52, 11]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1680_l_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1680_3_l_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_1680_3_l_a(:prec:=16)
    chi := MakeCharacter_1680_l();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    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_1680_3_l_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_1680_3_l_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1680_l();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![124123023810072576, 0, 8381985541134336, 0, 238332652195072, 0, 3726118349952, 0, 35000873568, 0, 201895536, 0, 695913, 0, 1302, 0, 1]>],Snew);
    return Vf;
end function;