
// Make newform 1680.3.bd.b in Magma, downloaded from the LMFDB on 13 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_1680_bd();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1680_bd_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_bd_b();".
// 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_bd_b();".
// 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 := [3839661225, 0, 1131190758, 0, 203608845, 0, 23190492, 0, 1866070, 0, 102922, 0, 3876, 0, 88, 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], [648661629583820097909, 0, 164573173831945222323, 0, 24927134642650563432, 0, 2178808884540756332, 0, 123974067663126407, 0, 4272091016644632, 0, 83638291569392, 0, 672001001684, 0], [-794559645154337067549, 0, -201602403573332067189, 0, -29131419888738608316, 0, -2594192598074382740, 0, -149653330607213921, 0, -5379199494309408, 0, -111533330833976, 0, -1035398609612, 0], [0, 16824872697243836939649, 0, -868324354542205414983, 0, -363262564130722362285, 0, -38877036874215059939, 0, -2518744893744884417, 0, -83130180585664890, 0, -1243791055410533, 0, 1601518644256], [-79739766948019948578, 0, 1996888738264010496, 0, 647412056032704486, 0, 168279695108599388, 0, 15207683162139494, 0, 1060452003667296, 0, 36700472608334, 0, 634484072336, 0], [770744626057716884280, 0, -245160610606893679623, 0, -75038762295166027026, 0, -11033910504298438969, 0, -876318284088716878, 0, -43360793116252413, 0, -1180449492355747, 0, -15533455683352, 0], [0, -7503372377553771177561, 0, -2291825204891570440035, 0, -285311025541968291384, 0, -25920757833965915885, 0, -1547919464755800134, 0, -63571822352800752, 0, -1546569916694156, 0, -19154198883257], [-468117452921951691963540, 94872323246581515223278, -120358275007032580434300, 14469794400468971075976, -17956389117864022789140, 1893639344756747339244, -1636638493005145024740, 145437176981878050283, -96651721305214940160, 8076844319021149333, -3655926417831848100, 230861652459815112, -81389302077257010, 2955992805288202, -860461496592840, -17963615837495], [-468117452921951691963540, -94872323246581515223278, -120358275007032580434300, -14469794400468971075976, -17956389117864022789140, -1893639344756747339244, -1636638493005145024740, -145437176981878050283, -96651721305214940160, -8076844319021149333, -3655926417831848100, -230861652459815112, -81389302077257010, -2955992805288202, -860461496592840, 17963615837495], [815634568981543791999285, -132666874311026007414567, 206681271810133078548108, -20494949904502212421080, 30391105263446609513181, -2046329506496564444148, 2985424552488776600304, -51003137021880397040, 197796238645556772333, 3993917644882916062, 8678455106638696983, 484549998061732161, 220158916758918432, 17964341304450163, 2692351748830482, 301208776387831], [-815634568981543791999285, -132666874311026007414567, -206681271810133078548108, -20494949904502212421080, -30391105263446609513181, -2046329506496564444148, -2985424552488776600304, -51003137021880397040, -197796238645556772333, 3993917644882916062, -8678455106638696983, 484549998061732161, -220158916758918432, 17964341304450163, -2692351748830482, 301208776387831], [0, -146125807930456620557193, 0, -16248590176217896584090, 0, -927977383114080548367, 0, 99792849989394910415, 0, 16259996506215883748, 0, 1119825456728871999, 0, 36027573534021182, 0, 543284346539459], [0, -1361172757295722803669, 0, -58084626671359859160, 0, 18229971398551841859, 0, 5937613883562567575, 0, 594128216156992664, 0, 34912939321992477, 0, 1053651000795026, 0, 15307198600907], [0, 633345717488885596886931, 0, 172645003170269350584165, 0, 24782231535664543169664, 0, 2371557898051849791385, 0, 152661950788010040184, 0, 6675329225471977392, 0, 170623655058950176, 0, 2145495653153737], [532329752913369234384780, 353101895277362051846949, 191664716523042803725440, 110767274631181060603326, 31603720753251597368025, 17777828841796776235098, 3358421919737873820360, 1767072461067558411118, 222193009401277106475, 111874806596610825592, 9461525208149991060, 4561024066476113049, 231578769083234895, 108027505159304863, 2778962112319995, 1235084031225187], [532329752913369234384780, -353101895277362051846949, 191664716523042803725440, -110767274631181060603326, 31603720753251597368025, -17777828841796776235098, 3358421919737873820360, -1767072461067558411118, 222193009401277106475, -111874806596610825592, 9461525208149991060, -4561024066476113049, 231578769083234895, -108027505159304863, 2778962112319995, -1235084031225187]];
    Rf_basisdens := [1, 9275630741049654234, 9275630741049654234, 3547928758451492744505, 4637815370524827117, 23189076852624135585, 7095857516902985489010, 7095857516902985489010, 7095857516902985489010, 21287572550708956467030, 21287572550708956467030, 21287572550708956467030, 495059826760673406210, 21287572550708956467030, 7095857516902985489010, 7095857516902985489010];
    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_bd();"
function MakeCharacter_1680_bd()
    N := 1680;
    order := 2;
    char_gens := [1471, 421, 1121, 337, 241];
    v := [2, 2, 2, 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_1680_bd_Hecke();"
function MakeCharacter_1680_bd_Hecke( : Kf := false)
    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 := ISA(Type(Kf), Fld), 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]];
    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], [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, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0], [2, 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, -1, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, -3, 0, 0, 1, 1, -2, -2, 1, 0, 0], [0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 1, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0], [-4, -2, 2, 0, -3, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 3, 0, -1, 1], [-2, -2, 0, 0, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 1, 1], [0, 0, 0, 2, 0, 0, 0, -1, 1, 0, 0, 1, -1, 0, -1, 1], [0, 0, -2, 0, 0, 1, 0, 0, 0, 2, -2, 0, 0, 0, -1, -1], [0, 0, 0, 0, 0, 0, 7, 0, 0, -1, -1, -3, -3, 1, 0, 0], [-1, -1, -1, 0, 0, 1, 0, 0, 0, -3, 3, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -3, 3, 0, 0, -6, 6, 0, -1, 1], [0, 0, 0, -1, 0, 0, 0, -2, 2, 0, 0, -5, 5, 0, 1, -1], [2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-12, -6, 6, 0, -2, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -22, 0, 0, 2, 2, -9, -9, -2, 0, 0], [0, 6, -6, 0, 4, 0, 0, -2, -2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -4, 0, 0, 8, 8, -4, -4, -4, 0, 0], [0, 0, 0, -2, 0, 0, 0, 5, -5, 0, 0, -5, 5, 0, -1, 1], [0, 0, 0, 0, 0, 0, 20, 0, 0, -2, -2, 1, 1, -4, 0, 0], [0, 0, 0, -2, 0, 0, 0, -2, 2, 0, 0, -1, 1, 0, -2, 2], [0, 0, 0, 0, 0, 0, -30, 0, 0, 5, 5, -8, -8, 2, 0, 0], [7, 7, 7, 0, 0, 1, 0, 0, 0, -7, 7, 0, 0, 0, 0, 0], [24, 2, -2, 0, 12, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 0], [7, 7, 3, 0, 0, 3, 0, 0, 0, 1, -1, 0, 0, 0, -2, -2], [-10, -10, -10, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0], [0, 0, 0, -2, 0, 0, 0, 1, -1, 0, 0, -2, 2, 0, 1, -1], [1, 1, -3, 0, 0, 5, 0, 0, 0, 3, -3, 0, 0, 0, -2, -2], [0, 0, 0, 1, 0, 0, 0, -6, 6, 0, 0, 10, -10, 0, -2, 2], [68, -6, 6, 0, 7, 0, 0, 11, 11, 0, 0, 0, 0, 0, 0, 0], [34, -4, 4, 0, -4, 0, 0, -6, -6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 8, 0, 0, -13, -13, 7, 7, -12, 0, 0], [14, 14, 12, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [0, 0, 0, 0, 0, 0, 1, 0, 0, -17, -17, 13, 13, -1, 0, 0], [0, 0, 0, 0, 0, 0, 46, 0, 0, 10, 10, -11, -11, 4, 0, 0], [-10, 12, -12, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -5, 0, 0, 0, -6, 6, 0, 0, -13, 13, 0, 3, -3], [-88, 18, -18, 0, 6, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0], [2, 2, 6, 0, 0, 2, 0, 0, 0, 12, -12, 0, 0, 0, 2, 2], [5, 5, 9, 0, 0, 3, 0, 0, 0, 5, -5, 0, 0, 0, 2, 2], [0, 0, 0, 0, 0, 0, 0, -8, 8, 0, 0, -7, 7, 0, 1, -1], [-72, -10, 10, 0, 8, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -34, 0, 0, -13, -13, -12, -12, -6, 0, 0], [0, 0, 0, 0, 0, 0, -36, 0, 0, -16, -16, -6, -6, -8, 0, 0], [0, 0, 0, -1, 0, 0, 0, 10, -10, 0, 0, -5, 5, 0, 3, -3], [-19, -19, -19, 0, 0, -3, 0, 0, 0, 7, -7, 0, 0, 0, 0, 0], [56, -26, 26, 0, -4, 0, 0, -15, -15, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 6, 0, 0, 0, -10, 10, 0, 0, 6, -6, 0, -2, 2], [0, 0, 0, -6, 0, 0, 0, -1, 1, 0, 0, -10, 10, 0, -5, 5], [0, 0, 0, 0, 0, 0, -35, 0, 0, 1, 1, 10, 10, 1, 0, 0], [11, 11, 11, 0, 0, -5, 0, 0, 0, 15, -15, 0, 0, 0, 0, 0], [0, 0, 0, 6, 0, 0, 0, 4, -4, 0, 0, -25, 25, 0, 0, 0], [0, 0, 0, -2, 0, 0, 0, -4, 4, 0, 0, -15, 15, 0, 3, -3], [-4, -4, -6, 0, 0, -7, 0, 0, 0, -15, 15, 0, 0, 0, -1, -1], [146, -4, 4, 0, -8, 0, 0, -16, -16, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 160, 0, 0, -10, -10, 8, 8, -8, 0, 0], [0, 0, 0, 0, 0, 0, -110, 0, 0, -8, -8, -5, -5, -8, 0, 0], [0, 0, 0, 0, 0, 0, -84, 0, 0, 22, 22, -66, -66, -4, 0, 0], [0, 0, 0, 8, 0, 0, 0, -4, 4, 0, 0, 18, -18, 0, -6, 6], [0, 0, 0, 0, 0, 0, 86, 0, 0, 2, 2, 15, 15, -2, 0, 0], [-19, -19, -23, 0, 0, -11, 0, 0, 0, 21, -21, 0, 0, 0, -2, -2], [-166, 16, -16, 0, 18, 0, 0, -4, -4, 0, 0, 0, 0, 0, 0, 0], [-2, -2, 2, 0, 0, 4, 0, 0, 0, -20, 20, 0, 0, 0, 2, 2], [15, 15, 3, 0, 0, 3, 0, 0, 0, -27, 27, 0, 0, 0, -6, -6], [0, 0, 0, 11, 0, 0, 0, -2, 2, 0, 0, -37, 37, 0, -7, 7], [0, 0, 0, 0, 0, 0, -41, 0, 0, -17, -17, 46, 46, 7, 0, 0], [204, 18, -18, 0, -14, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -116, 0, 0, 21, 21, 4, 4, -12, 0, 0], [-16, -16, -18, 0, 0, -1, 0, 0, 0, -3, 3, 0, 0, 0, -1, -1], [88, -34, 34, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -59, 0, 0, -3, -3, 53, 53, 3, 0, 0], [4, 10, -10, 0, -11, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 24, 0, 0, -17, -17, 21, 21, 12, 0, 0], [154, 0, 0, 0, 12, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -8, 0, 0, 0, 4, -4, 0, 0, 42, -42, 0, 4, -4], [0, 0, 0, 0, 0, 0, 0, 21, -21, 0, 0, 8, -8, 0, 1, -1], [304, 6, -6, 0, 6, 0, 0, -2, -2, 0, 0, 0, 0, 0, 0, 0], [144, 6, -6, 0, -36, 0, 0, -19, -19, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -12, 0, 0, 4, 4, 43, 43, -16, 0, 0], [0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 5, -5, 0, 9, -9], [5, 5, 9, 0, 0, -15, 0, 0, 0, 39, -39, 0, 0, 0, 2, 2], [-34, -16, 16, 0, 2, 0, 0, -10, -10, 0, 0, 0, 0, 0, 0, 0], [-14, -14, -6, 0, 0, 10, 0, 0, 0, -12, 12, 0, 0, 0, 4, 4], [0, 0, 0, 2, 0, 0, 0, -8, 8, 0, 0, 31, -31, 0, -10, 10], [-30, -30, -18, 0, 0, -22, 0, 0, 0, -11, 11, 0, 0, 0, 6, 6], [0, 0, 0, 0, 0, 0, 10, 0, 0, -46, -46, 16, 16, 18, 0, 0], [0, 0, 0, 12, 0, 0, 0, 10, -10, 0, 0, 32, -32, 0, 8, -8], [0, 0, 20, 0, 0, -24, 0, 0, 0, 7, -7, 0, 0, 0, 10, 10], [-126, -28, 28, 0, -17, 0, 0, -28, -28, 0, 0, 0, 0, 0, 0, 0], [-2, -4, 4, 0, 2, 0, 0, 24, 24, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 35, 0, 0, 47, 47, 21, 21, 25, 0, 0], [0, 0, 0, -12, 0, 0, 0, -4, 4, 0, 0, 15, -15, 0, 6, -6], [0, 0, 0, 6, 0, 0, 0, -13, 13, 0, 0, -21, 21, 0, 3, -3], [0, 0, 0, 0, 0, 0, -244, 0, 0, 18, 18, -30, -30, -8, 0, 0], [-8, -14, 14, 0, 6, 0, 0, -14, -14, 0, 0, 0, 0, 0, 0, 0], [-18, -18, -4, 0, 0, 1, 0, 0, 0, 30, -30, 0, 0, 0, 7, 7], [11, 11, 19, 0, 0, -13, 0, 0, 0, 61, -61, 0, 0, 0, 4, 4], [0, 0, 0, 0, 0, 0, 412, 0, 0, 24, 24, 20, 20, 0, 0, 0], [-122, -8, 8, 0, -16, 0, 0, -24, -24, 0, 0, 0, 0, 0, 0, 0], [140, 14, -14, 0, 26, 0, 0, -16, -16, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -166, 0, 0, 16, 16, -109, -109, -14, 0, 0], [0, 0, 0, 0, 0, 0, 118, 0, 0, -54, -54, 42, 42, -10, 0, 0], [0, 0, 0, 0, 0, 0, 231, 0, 0, -1, -1, 32, 32, -29, 0, 0], [-160, -26, 26, 0, -50, 0, 0, -3, -3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -2, 2, 0, 0, -40, 40, 0, 18, -18], [0, 0, 0, 0, 0, 0, -58, 0, 0, 21, 21, -10, -10, 2, 0, 0], [0, 0, 14, 0, 0, 15, 0, 0, 0, -51, 51, 0, 0, 0, 7, 7], [-45, -45, -41, 0, 0, -1, 0, 0, 0, 13, -13, 0, 0, 0, 2, 2], [0, 0, 0, -19, 0, 0, 0, 42, -42, 0, 0, -58, 58, 0, 6, -6], [-346, -20, 20, 0, -28, 0, 0, -28, -28, 0, 0, 0, 0, 0, 0, 0], [26, 68, -68, 0, 2, 0, 0, 20, 20, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -96, 0, 0, -48, -48, -66, -66, -8, 0, 0], [0, 0, 0, 0, 0, 0, -293, 0, 0, 3, 3, -53, -53, 13, 0, 0], [19, 19, 31, 0, 0, -9, 0, 0, 0, -13, 13, 0, 0, 0, 6, 6], [-234, 4, -4, 0, 23, 0, 0, 38, 38, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -3, 0, 0, 0, -10, 10, 0, 0, 107, -107, 0, 9, -9], [-46, -46, -14, 0, 0, 20, 0, 0, 0, 6, -6, 0, 0, 0, 16, 16], [0, 0, 0, 0, 0, 0, -162, 0, 0, 40, 40, 9, 9, 32, 0, 0], [15, 15, -5, 0, 0, 1, 0, 0, 0, 17, -17, 0, 0, 0, -10, -10], [0, 0, 0, -3, 0, 0, 0, -36, 36, 0, 0, -8, 8, 0, -10, 10], [204, -38, 38, 0, -7, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0], [158, 52, -52, 0, 2, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -4, 0, 0, 0, 24, -24, 0, 0, 16, -16, 0, -10, 10], [0, 0, 0, 0, 0, 0, -90, 0, 0, 23, 23, -46, -46, -2, 0, 0], [0, 0, 0, 0, 0, 0, 388, 0, 0, 45, 45, -7, -7, 12, 0, 0], [-128, 34, -34, 0, 26, 0, 0, 48, 48, 0, 0, 0, 0, 0, 0, 0], [-11, -11, 5, 0, 0, 17, 0, 0, 0, 3, -3, 0, 0, 0, 8, 8], [248, -46, 46, 0, 20, 0, 0, -28, -28, 0, 0, 0, 0, 0, 0, 0], [-62, -62, -60, 0, 0, -33, 0, 0, 0, 21, -21, 0, 0, 0, 1, 1], [0, 0, 0, 22, 0, 0, 0, -15, 15, 0, 0, 63, -63, 0, -9, 9], [0, 0, 0, -28, 0, 0, 0, -14, 14, 0, 0, -78, 78, 0, 28, -28], [0, 0, 0, 0, 0, 0, -530, 0, 0, 32, 32, 1, 1, -4, 0, 0], [0, 0, 0, 0, 0, 0, -56, 0, 0, 30, 30, 82, 82, -36, 0, 0], [0, 0, 0, 0, 0, 0, 92, 0, 0, -4, -4, 7, 7, -10, 0, 0], [-578, -4, 4, 0, -46, 0, 0, -30, -30, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -15, 0, 0, 0, -14, 14, 0, 0, 112, -112, 0, -8, 8], [44, 26, -26, 0, -39, 0, 0, -31, -31, 0, 0, 0, 0, 0, 0, 0], [14, 14, 6, 0, 0, 24, 0, 0, 0, -69, 69, 0, 0, 0, -4, -4], [21, 21, -27, 0, 0, -19, 0, 0, 0, -17, 17, 0, 0, 0, -24, -24], [0, 0, 0, -3, 0, 0, 0, -6, 6, 0, 0, 95, -95, 0, 3, -3], [0, 0, 0, -8, 0, 0, 0, -18, 18, 0, 0, -122, 122, 0, 14, -14], [0, 0, 0, 0, 0, 0, 88, 0, 0, -75, -75, 159, 159, -4, 0, 0], [0, 0, 0, 0, 0, 0, 257, 0, 0, 33, 33, 42, 42, 25, 0, 0], [0, 0, 0, 3, 0, 0, 0, 22, -22, 0, 0, -20, 20, 0, -14, 14], [-55, -55, -63, 0, 0, 1, 0, 0, 0, 37, -37, 0, 0, 0, -4, -4], [64, 64, 50, 0, 0, 21, 0, 0, 0, -7, 7, 0, 0, 0, -7, -7], [0, 0, 0, -30, 0, 0, 0, -15, 15, 0, 0, 19, -19, 0, 3, -3], [-16, -16, -6, 0, 0, 45, 0, 0, 0, -40, 40, 0, 0, 0, 5, 5], [0, 0, 0, 0, 0, 0, 171, 0, 0, -59, -59, 67, 67, -7, 0, 0], [16, 16, -10, 0, 0, -5, 0, 0, 0, 16, -16, 0, 0, 0, -13, -13], [120, -6, 6, 0, 22, 0, 0, -7, -7, 0, 0, 0, 0, 0, 0, 0], [16, -66, 66, 0, -60, 0, 0, -12, -12, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -2, 0, 0, 0, 5, -5, 0, 0, -9, 9, 0, -33, 33], [0, 0, 0, 0, 0, 0, 360, 0, 0, 62, 62, 27, 27, -20, 0, 0], [0, 0, 0, -34, 0, 0, 0, 6, -6, 0, 0, -71, 71, 0, 16, -16], [-55, -55, -7, 0, 0, 27, 0, 0, 0, 3, -3, 0, 0, 0, 24, 24], [-61, -61, -45, 0, 0, 15, 0, 0, 0, 29, -29, 0, 0, 0, 8, 8], [2, 2, -26, 0, 0, -44, 0, 0, 0, 63, -63, 0, 0, 0, -14, -14], [0, 0, 0, 14, 0, 0, 0, -1, 1, 0, 0, 42, -42, 0, -15, 15], [75, 75, 59, 0, 0, 23, 0, 0, 0, 5, -5, 0, 0, 0, -8, -8], [0, 0, 0, 0, 0, 0, 545, 0, 0, 37, 37, -77, -77, -1, 0, 0], [56, -10, 10, 0, -40, 0, 0, -28, -28, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 120, 0, 0, 31, 31, -161, -161, 44, 0, 0], [226, 24, -24, 0, 114, 0, 0, 94, 94, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 518, 0, 0, -66, -66, -33, -33, 4, 0, 0], [-226, 48, -48, 0, 21, 0, 0, 54, 54, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 23, 0, 0, 0, -38, 38, 0, 0, -131, 131, 0, -37, 37], [-236, -46, 46, 0, -50, 0, 0, -5, -5, 0, 0, 0, 0, 0, 0, 0], [88, 88, 84, 0, 0, -8, 0, 0, 0, 42, -42, 0, 0, 0, -2, -2], [0, 0, 0, 8, 0, 0, 0, -32, 32, 0, 0, 73, -73, 0, -7, 7], [0, 0, 0, 14, 0, 0, 0, -9, 9, 0, 0, -53, 53, 0, -13, 13], [274, 56, -56, 0, 28, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0], [68, -2, 2, 0, 53, 0, 0, -43, -43, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -66, 0, 0, 59, 59, -62, -62, -34, 0, 0], [0, 0, 0, -49, 0, 0, 0, 34, -34, 0, 0, -23, 23, 0, -1, 1], [-30, -30, -46, 0, 0, -10, 0, 0, 0, 17, -17, 0, 0, 0, -8, -8], [0, 0, 0, -16, 0, 0, 0, -37, 37, 0, 0, -82, 82, 0, 27, -27], [-80, -80, -90, 0, 0, 21, 0, 0, 0, -33, 33, 0, 0, 0, -5, -5], [0, 0, 0, 0, 0, 0, -565, 0, 0, -21, -21, -106, -106, -1, 0, 0], [25, 25, 17, 0, 0, -35, 0, 0, 0, 95, -95, 0, 0, 0, -4, -4], [0, 0, 0, 20, 0, 0, 0, 50, -50, 0, 0, -49, 49, 0, -8, 8], [10, 10, -32, 0, 0, 21, 0, 0, 0, 27, -27, 0, 0, 0, -21, -21], [0, 0, 0, 0, 0, 0, 604, 0, 0, 4, 4, -54, -54, 8, 0, 0], [594, -92, 92, 0, -30, 0, 0, -46, -46, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 8, 0, 0, 0, 4, -4, 0, 0, 62, -62, 0, -18, 18], [0, 0, 0, 0, 0, 0, 660, 0, 0, -56, -56, -65, -65, 44, 0, 0], [-27, -27, 9, 0, 0, -13, 0, 0, 0, 83, -83, 0, 0, 0, 18, 18], [68, -114, 114, 0, -8, 0, 0, -52, -52, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -34, 0, 0, 0, -4, 4, 0, 0, 23, -23, 0, 14, -14], [45, 45, -7, 0, 0, -33, 0, 0, 0, 27, -27, 0, 0, 0, -26, -26], [0, 0, 0, 0, 0, 0, -455, 0, 0, 25, 25, 72, 72, 5, 0, 0], [472, 138, -138, 0, 130, 0, 0, 40, 40, 0, 0, 0, 0, 0, 0, 0], [36, 36, -18, 0, 0, -29, 0, 0, 0, -61, 61, 0, 0, 0, -27, -27], [0, 0, 0, 0, 0, 0, 425, 0, 0, -143, -143, 84, 84, 17, 0, 0], [0, 0, 0, 0, 0, 0, -317, 0, 0, 67, 67, -61, -61, 61, 0, 0], [-648, 66, -66, 0, 119, 0, 0, 67, 67, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 38, 0, 0, 0, -4, 4, 0, 0, -43, 43, 0, -31, 31], [0, 0, 0, 0, 0, 0, -628, 0, 0, 77, 77, -39, -39, 28, 0, 0], [0, 0, 0, -16, 0, 0, 0, 18, -18, 0, 0, 68, -68, 0, -8, 8], [0, 0, 0, 42, 0, 0, 0, -17, 17, 0, 0, -6, 6, 0, -39, 39], [0, 0, 0, 0, 0, 0, 356, 0, 0, 18, 18, 43, 43, -66, 0, 0], [0, 0, 0, -36, 0, 0, 0, -56, 56, 0, 0, -45, 45, 0, -5, 5], [11, 11, 11, 0, 0, 15, 0, 0, 0, 37, -37, 0, 0, 0, 0, 0], [978, -8, 8, 0, -38, 0, 0, 58, 58, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -19, 0, 0, 0, -24, 24, 0, 0, -28, 28, 0, -12, 12], [-24, -24, -20, 0, 0, -6, 0, 0, 0, 48, -48, 0, 0, 0, 2, 2], [0, 0, 0, 38, 0, 0, 0, -30, 30, 0, 0, -61, 61, 0, 22, -22], [12, 12, -8, 0, 0, -2, 0, 0, 0, 49, -49, 0, 0, 0, -10, -10], [0, 0, 0, 0, 0, 0, -230, 0, 0, 6, 6, -138, -138, -10, 0, 0], [0, 0, 0, -20, 0, 0, 0, -48, 48, 0, 0, -24, 24, 0, 8, -8], [0, 0, 0, 20, 0, 0, 0, -36, 36, 0, 0, 6, -6, 0, -6, 6], [12, 12, 32, 0, 0, 88, 0, 0, 0, -23, 23, 0, 0, 0, 10, 10], [0, 0, 0, 2, 0, 0, 0, -47, 47, 0, 0, -75, 75, 0, -29, 29], [35, 35, -45, 0, 0, 7, 0, 0, 0, 25, -25, 0, 0, 0, -40, -40], [-47, -47, 33, 0, 0, 29, 0, 0, 0, 59, -59, 0, 0, 0, 40, 40], [-198, -36, 36, 0, -74, 0, 0, -58, -58, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -6, 0, 0, 0, -60, 60, 0, 0, -73, 73, 0, -7, 7], [-822, -144, 144, 0, -96, 0, 0, -2, -2, 0, 0, 0, 0, 0, 0, 0], [52, 52, 52, 0, 0, 8, 0, 0, 0, 77, -77, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 52, 0, 0, -36, -36, 52, 52, -32, 0, 0], [14, -84, 84, 0, -150, 0, 0, -18, -18, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 539, 0, 0, 127, 127, 10, 10, 7, 0, 0], [44, 110, -110, 0, 86, 0, 0, -45, -45, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -156, 0, 0, 45, 45, 14, 14, -88, 0, 0], [-898, -80, 80, 0, -67, 0, 0, -60, -60, 0, 0, 0, 0, 0, 0, 0], [2, 2, -72, 0, 0, -35, 0, 0, 0, 31, -31, 0, 0, 0, -37, -37], [0, 0, 0, -19, 0, 0, 0, -18, 18, 0, 0, 36, -36, 0, 6, -6], [468, -62, 62, 0, -56, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0, 0], [-58, 64, -64, 0, -76, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 284, 0, 0, -152, -152, 92, 92, 12, 0, 0], [0, 0, 0, 0, 0, 0, -139, 0, 0, 11, 11, 87, 87, -53, 0, 0], [0, 0, 0, 6, 0, 0, 0, 60, -60, 0, 0, -58, 58, 0, -4, 4], [-1, -1, 51, 0, 0, 9, 0, 0, 0, 59, -59, 0, 0, 0, 26, 26], [-1010, 36, -36, 0, 53, 0, 0, 82, 82, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -56, 0, 0, 0, 66, -66, 0, 0, -28, 28, 0, -8, 8], [-7, -7, 61, 0, 0, 51, 0, 0, 0, -29, 29, 0, 0, 0, 34, 34], [0, 0, 0, 23, 0, 0, 0, 4, -4, 0, 0, -18, 18, 0, 8, -8], [0, 0, 0, 0, 0, 0, 296, 0, 0, -75, -75, -78, -78, -80, 0, 0], [1614, 56, -56, 0, 50, 0, 0, 26, 26, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -85, 0, 0, 175, 175, 30, 30, -61, 0, 0], [0, 0, 0, 36, 0, 0, 0, -100, 100, 0, 0, 142, -142, 0, -8, 8], [0, 0, 0, 0, 0, 0, 402, 0, 0, -49, -49, 128, 128, -38, 0, 0], [0, 0, 0, 38, 0, 0, 0, 19, -19, 0, 0, -152, 152, 0, -7, 7], [-984, -114, 114, 0, -130, 0, 0, -92, -92, 0, 0, 0, 0, 0, 0, 0], [-67, -67, -91, 0, 0, 13, 0, 0, 0, -7, 7, 0, 0, 0, -12, -12], [-10, -10, -76, 0, 0, 45, 0, 0, 0, -57, 57, 0, 0, 0, -33, -33], [0, 0, 0, 34, 0, 0, 0, 1, -1, 0, 0, -63, 63, 0, -21, 21], [19, 19, 27, 0, 0, -37, 0, 0, 0, 27, -27, 0, 0, 0, 4, 4], [0, 0, 0, 52, 0, 0, 0, 48, -48, 0, 0, 64, -64, 0, -10, 10], [0, 0, 0, 0, 0, 0, -724, 0, 0, 0, 0, 163, 163, -90, 0, 0], [1646, 32, -32, 0, -81, 0, 0, -12, -12, 0, 0, 0, 0, 0, 0, 0], [706, -116, 116, 0, -104, 0, 0, -116, -116, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -272, 0, 0, -158, -158, 50, 50, 96, 0, 0], [0, 0, 0, 0, 0, 0, 284, 0, 0, -120, -120, 13, 13, 18, 0, 0], [0, 0, 0, 0, 0, 0, -368, 0, 0, 124, 124, 41, 41, 28, 0, 0], [38, 38, 6, 0, 0, -32, 0, 0, 0, -57, 57, 0, 0, 0, -16, -16], [-93, -93, -105, 0, 0, -85, 0, 0, 0, 77, -77, 0, 0, 0, -6, -6], [0, 0, 0, 15, 0, 0, 0, 22, -22, 0, 0, 185, -185, 0, -27, 27], [0, 0, 0, 0, 0, 0, -360, 0, 0, -111, -111, -55, -55, 12, 0, 0], [0, 0, 0, 0, 0, 0, 63, 0, 0, -193, -193, -106, -106, 55, 0, 0], [0, 0, 0, 65, 0, 0, 0, 68, -68, 0, 0, 22, -22, 0, 20, -20], [1076, -74, 74, 0, 7, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -2, 0, 0, 0, 1, -1, 0, 0, 81, -81, 0, 17, -17], [-66, -66, -88, 0, 0, -37, 0, 0, 0, -106, 106, 0, 0, 0, -11, -11], [-107, -107, -47, 0, 0, 15, 0, 0, 0, 125, -125, 0, 0, 0, 30, 30], [0, 0, 0, -9, 0, 0, 0, 90, -90, 0, 0, 5, -5, 0, -13, 13], [36, 36, -10, 0, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, -23, -23], [0, 0, 0, 0, 0, 0, -994, 0, 0, -12, -12, -115, -115, -6, 0, 0], [-990, 60, -60, 0, -28, 0, 0, -86, -86, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 306, 0, 0, -56, -56, -89, -89, 14, 0, 0], [0, 0, 0, 0, 0, 0, -40, 0, 0, 21, 21, 10, 10, 132, 0, 0], [-33, -33, 67, 0, 0, -19, 0, 0, 0, -27, 27, 0, 0, 0, 50, 50], [-236, -106, 106, 0, -60, 0, 0, -32, -32, 0, 0, 0, 0, 0, 0, 0], [158, -148, 148, 0, 32, 0, 0, 42, 42, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -40, 0, 0, 0, 37, -37, 0, 0, 220, -220, 0, 39, -39], [0, 0, 0, 0, 0, 0, 761, 0, 0, -69, -69, 195, 195, -25, 0, 0], [124, -78, 78, 0, -108, 0, 0, -66, -66, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 649, 0, 0, 57, 57, 37, 37, 43, 0, 0], [0, 0, 0, -15, 0, 0, 0, -6, 6, 0, 0, 163, -163, 0, -19, 19], [0, 0, 0, 0, 0, 0, -356, 0, 0, -106, -106, 236, 236, 40, 0, 0], [-384, 114, -114, 0, -42, 0, 0, 71, 71, 0, 0, 0, 0, 0, 0, 0], [54, 54, 54, 0, 0, 50, 0, 0, 0, -190, 190, 0, 0, 0, 0, 0], [-21, -21, 87, 0, 0, -43, 0, 0, 0, -105, 105, 0, 0, 0, 54, 54], [0, 0, 0, 66, 0, 0, 0, -68, 68, 0, 0, 105, -105, 0, -53, 53], [0, 0, 0, 30, 0, 0, 0, 13, -13, 0, 0, -57, 57, 0, -57, 57], [824, -90, 90, 0, -43, 0, 0, 77, 77, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 6, 0, 0, -22, -22, 232, 232, 54, 0, 0], [-191, -191, -183, 0, 0, 1, 0, 0, 0, 19, -19, 0, 0, 0, 4, 4], [0, 0, 0, -18, 0, 0, 0, 7, -7, 0, 0, 238, -238, 0, 45, -45], [108, 108, 54, 0, 0, 65, 0, 0, 0, 25, -25, 0, 0, 0, -27, -27], [0, 0, 0, -44, 0, 0, 0, -94, 94, 0, 0, -91, 91, 0, 6, -6], [0, 0, 0, -18, 0, 0, 0, 24, -24, 0, 0, -51, 51, 0, -31, 31], [0, 0, 0, 0, 0, 0, -420, 0, 0, 172, 172, -139, -139, 90, 0, 0], [0, 0, 0, -14, 0, 0, 0, 87, -87, 0, 0, 150, -150, 0, 23, -23], [0, 0, 0, 0, 0, 0, 44, 0, 0, 34, 34, -134, -134, 112, 0, 0], [0, 0, 0, 0, 0, 0, 632, 0, 0, -14, -14, 171, 171, -60, 0, 0], [-11, -11, -39, 0, 0, 65, 0, 0, 0, -199, 199, 0, 0, 0, -14, -14], [-430, 144, -144, 0, -4, 0, 0, 80, 80, 0, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1680_bd_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1680_3_bd_b();".
// 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_bd_b(:prec:=16)
    chi := MakeCharacter_1680_bd();
    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_bd_b();".
// 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_bd_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1680_bd();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![-1904, -1296, -248, -6, 1]>],Snew);
    return Vf;
end function;