
// Make newform 680.2.bd.b in Magma, downloaded from the LMFDB on 06 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_680_bd();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_680_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_680_2_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_680_2_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 := [16, 0, 1104, 0, 19972, 0, 70784, 0, 99328, 0, 66452, 0, 24072, 0, 5004, 0, 597, 0, 38, 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, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-4, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-3314328, 0, -119492428, 0, -490327936, 0, -720431776, 0, -494568676, 0, -182598508, 0, -38543794, 0, -4657907, 0, -299792, 0, -7967, 0], [446824920, 946050992, 15295766924, 11318799528, 55255999680, 32595787952, 76100237688, 39602426912, 50112040988, 24337184192, 17946889580, 8366562408, 3699523438, 1680254780, 438515595, 195676630, 27765188, 12234752, 727367, 317550], [-446824920, 946050992, -15295766924, 11318799528, -55255999680, 32595787952, -76100237688, 39602426912, -50112040988, 24337184192, -17946889580, 8366562408, -3699523438, 1680254780, -438515595, 195676630, -27765188, 12234752, -727367, 317550], [-5080800, 446824920, 595475792, 15295766924, 4976690928, 55255999680, 10118328752, 76100237688, 8060820512, 50112040988, 3235351592, 17946889580, 722498808, 3699523438, 91234580, 438515595, 6099280, 27765188, 167852, 727367], [5080800, 446824920, -595475792, 15295766924, -4976690928, 55255999680, -10118328752, 76100237688, -8060820512, 50112040988, -3235351592, 17946889580, -722498808, 3699523438, -91234580, 438515595, -6099280, 27765188, -167852, 727367], [-4527664, 0, -2216513184, 0, -11087168284, 0, -18146107362, 0, -13057631134, 0, -4926908906, 0, -1050806639, 0, -127554672, 0, -8217913, 0, -218122, 0], [-267545480, 0, -14673095892, 0, -56465703816, 0, -80290139884, 0, -53880084316, 0, -19541793548, 0, -4065060976, 0, -485157135, 0, -30883886, 0, -812611, 0], [887830904, 1889561584, 30413439724, 22935336952, 110896395960, 67679921368, 154085502352, 84264018200, 102150246132, 52704778640, 36782303712, 18350800612, 7617902454, 3721758964, 906920675, 436970550, 57669124, 27519144, 1517355, 719026], [640790584, -468714896, 23662747180, 14179040424, 95664466392, 56951578976, 142079187576, 80495735936, 97485820860, 53539678844, 35760371240, 19268302908, 7484328818, 3982716356, 896405019, 472886756, 57193856, 29978496, 1507459, 786184], [640790584, 468714896, 23662747180, -14179040424, 95664466392, -56951578976, 142079187576, -80495735936, 97485820860, -53539678844, 35760371240, -19268302908, 7484328818, -3982716356, 896405019, -472886756, 57193856, -29978496, 1507459, -786184], [47255720, -2826443064, -1794381836, -73940060812, -24792140544, -279180720416, -52087608136, -399861039752, -40783190444, -269420866900, -15903024636, -97834194468, -3432376166, -20348435854, -417484283, -2427002263, -26814652, -154387652, -707575, -4059835], [-47255720, -2826443064, 1794381836, -73940060812, 24792140544, -279180720416, 52087608136, -399861039752, 40783190444, -269420866900, 15903024636, -97834194468, 3432376166, -20348435854, 417484283, -2427002263, 26814652, -154387652, 707575, -4059835], [0, -218392408, 0, -7293563980, 0, -27884310592, 0, -40161559096, 0, -27165268516, 0, -9895725364, 0, -2063796350, 0, -246732143, 0, -15727124, 0, -414291], [792712296, 1524842168, 32402410292, 92417046988, 126936382032, 363117114144, 186047380464, 525345093000, 127086080572, 355518311360, 46559393988, 129465503064, 9744057406, 26987697622, 1167525405, 3224946733, 74530072, 205478316, 1965289, 5410853], [792712296, -1524842168, 32402410292, -92417046988, 126936382032, -363117114144, 186047380464, -525345093000, 127086080572, -355518311360, 46559393988, -129465503064, 9744057406, -26987697622, 1167525405, -3224946733, 74530072, -205478316, 1965289, -5410853], [142981496, 9804831472, -2183559300, 324104795432, -7287831600, 1234535112144, -11836148088, 1777190197104, -9088478436, 1202128474880, -3651155916, 437940012760, -819933738, 91337445492, -103725177, 10919620302, -6907244, 696017112, -188293, 18334022], [1590505392, -9331119288, 64209344792, -299571695996, 248896073136, -1143292165920, 361976432176, -1652696536008, 246111340632, -1120823973988, 89883436384, -408983734116, 18765616004, -85391281438, 2243816230, -10216685755, 142960864, -651590556, 3762726, -17171471]];
    Rf_basisdens := [1, 1, 1, 4470176, 151985984, 151985984, 151985984, 151985984, 18998248, 37996496, 75992992, 75992992, 75992992, 151985984, 151985984, 8940352, 75992992, 75992992, 151985984, 151985984];
    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_680_bd();"
function MakeCharacter_680_bd()
    N := 680;
    order := 4;
    char_gens := [511, 341, 137, 241];
    v := [4, 4, 4, 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_680_bd_Hecke();"
function MakeCharacter_680_bd_Hecke( : Kf := false)
    N := 680;
    order := 4;
    char_gens := [511, 341, 137, 241];
    char_values := [[1, 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, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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]];
    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 := 2;
    raw_aps := [[0, 0, 0, 0, 0, 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, 0, -1, 0, 0, 0, 0, 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, -1, 0, 0, 0, 0, -1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1], [0, 0, 0, 2, 0, 0, 1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0], [1, 0, 1, 0, 0, -1, 1, 0, 1, -1, 0, 0, 0, -1, 0, -1, -1, 0, 0, 0], [0, -1, 0, 0, 1, -1, 0, 0, 0, 0, -1, 0, 2, 1, 0, -1, 0, -1, -1, 0], [0, 1, 0, 1, 1, -1, 0, 0, 0, 0, -1, 1, 1, 1, -1, 0, -1, 0, 0, 0], [1, 0, 1, 1, -1, 0, 1, -1, 1, -1, 0, 0, 1, 0, 1, 0, -1, -1, 0, 1], [0, 0, 0, 1, 0, 0, 1, -2, 0, -1, -1, 0, 1, 0, 0, 0, -1, -2, 0, 1], [0, -1, 0, 0, 0, 0, -1, 2, 0, 1, -1, 0, 1, 0, 0, 0, 1, 1, 0, -1], [1, 0, 0, 1, 1, -1, -1, 0, 2, -1, -1, 2, 1, -1, -1, -1, -2, 0, -2, -1], [0, 2, 0, 0, 1, 1, 2, -1, 0, 0, -2, 0, 0, 2, 0, 0, 0, -1, 2, 3], [0, 0, 0, 2, -1, 1, 0, 0, -1, 1, 0, -1, -1, -1, 1, 0, 0, 0, 0, 0], [0, -1, 0, 0, 1, 1, -1, -1, 0, 0, -1, 0, 0, 1, 0, 3, 0, 1, 1, 0], [0, 1, 0, 0, 1, 3, 0, 0, 0, 0, 1, -2, 0, 1, 2, -1, 2, -1, 1, 0], [-1, 2, 1, 2, 1, 4, 1, 0, -1, 0, -1, 1, 1, 2, -1, 0, 0, 0, 2, 0], [-4, 0, -2, -1, 2, -2, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0], [-2, 1, -1, -1, -3, 2, 0, 2, 1, 0, 1, -2, -3, 0, 1, 3, 2, 3, 2, 0], [-2, 2, 0, -2, -3, -1, 0, -1, -1, 0, 0, 1, 1, 0, -1, 1, -1, -1, -1, 0], [-1, -3, -1, -2, 1, -2, 0, 0, 0, -1, -1, 2, 1, 1, -1, -1, 0, 0, -1, -1], [0, -2, 0, 0, 4, 2, 0, -1, 0, 0, 0, 1, 1, -1, -1, 0, -1, -2, -2, 1], [0, 0, -1, -2, -2, 2, -1, 1, -2, 0, 0, -1, -1, 0, 0, 0, 1, 1, 0, 0], [0, -2, 0, 0, 0, -2, -2, 1, -2, 2, 0, 2, 1, 0, -2, -2, 0, 0, -2, -2], [2, 0, 3, 3, 3, -3, 0, 0, -1, 0, 0, 1, 1, 0, 0, 0, -1, -1, 0, 0], [2, 0, 0, -3, 0, 0, -4, 4, 0, 3, 0, 1, 1, 1, -1, 0, 2, 2, 0, 0], [-3, 0, -2, -2, -5, 1, -2, 2, -1, 2, 1, -1, -2, 0, -1, 2, 3, 2, 1, -2], [1, 1, -2, -1, 2, 2, -1, 0, -2, 2, -2, -1, 2, 4, -2, 3, 2, 0, 0, 2], [2, -2, 0, 0, -2, -2, -1, 0, -1, -2, 2, -2, -2, -1, 2, 3, 2, 0, 1, -2], [0, 1, 0, 0, 0, 4, 1, 2, 0, 0, 1, -1, -3, -1, 0, -1, 2, 2, 3, -1], [-2, 1, -3, -1, 0, 1, 0, -1, -2, 0, 2, -1, -1, 0, -2, 0, 1, 1, 1, 0], [2, 0, 2, 3, -3, 3, 1, -1, 0, 1, 0, -1, -1, 0, 0, 0, -1, -1, 0, 0], [-2, -1, 1, 2, -2, -1, 1, -5, 0, -1, 1, 1, 0, 0, 0, 2, -2, -4, -1, 1], [-2, 0, 0, -2, 2, -2, -4, 4, -4, 4, 0, 4, 4, 2, -2, 0, 1, 1, 0, 0], [0, 0, 0, 0, 7, 7, -2, 2, 0, 0, 0, -2, 2, 1, 1, 2, 3, 1, 0, -4], [-6, 0, -4, -6, 0, 0, 0, 0, -2, 2, 0, -1, -1, 2, -2, 0, 2, 2, 0, 0], [-3, 0, -2, -3, 1, -1, 3, 0, -2, 3, -1, 1, 1, 3, -1, -1, 0, 0, 0, 3], [-2, 1, -2, -3, -3, -1, -2, 0, -3, 2, -1, 1, 2, 0, -3, -1, 1, 4, -1, -2], [0, -2, 2, 5, -1, 1, 3, -6, 3, -3, 0, -1, -2, 0, 3, 3, -2, -3, 1, 3], [0, 4, 0, 0, -1, 1, -1, 1, 0, 0, 0, -1, -1, 1, 1, 4, 4, 0, 2, -2], [2, -3, 1, -4, 2, -5, 1, 0, 3, 1, -2, 2, 2, -1, -2, -1, 0, 0, -2, 1], [4, 0, 2, 0, -4, 4, -2, 2, 2, 0, 0, 0, 0, -2, 2, 0, 1, 1, 0, 0], [-5, 1, -2, 0, 0, -4, -1, 0, -3, 1, 0, -3, 0, 3, 0, -2, 3, 0, 1, 1], [-2, 1, 0, 1, -3, 5, -2, 0, 0, 0, 3, -4, -3, -3, 3, -2, 1, 0, 0, 0], [-2, 3, 1, 0, 7, 2, 3, -2, 3, -3, -2, -2, -4, 0, 3, 5, -1, 0, 2, 3], [-6, 1, -2, -3, 0, 4, -3, 0, -2, 4, 0, 3, 0, 2, 0, -4, -1, 0, 0, 4], [0, 1, 0, 0, -4, 0, -1, -4, 0, 0, 3, 0, -4, -1, 2, -3, -2, 0, 1, 3], [0, 2, 0, 3, 0, -12, 2, 0, 1, -1, 0, 3, 0, -1, 0, -1, -1, 0, -1, -1], [0, 5, 0, 0, 7, 4, 1, 1, 0, 0, -1, 0, 3, -1, -2, -7, -2, 0, -2, 0], [2, -2, 2, 3, -2, 0, 1, -5, 2, -1, 0, 0, -1, 0, 2, 0, -1, -4, 0, 1], [6, 0, 4, 4, 0, 0, 3, -3, 2, -4, 0, 3, 3, -2, 2, 0, -2, -2, 0, 0], [1, -1, 1, 0, -1, -2, -1, -2, -1, 1, 0, 2, 2, 0, -1, -2, -1, -3, -2, -1], [4, 0, -2, 0, -6, 6, -3, 3, 0, 4, 0, 1, 1, 2, -2, 0, 3, 3, 0, 0], [0, -4, 0, 0, -1, 3, 2, 3, 0, 0, 2, -1, -3, 0, 2, 2, 0, 3, 2, -1], [0, 1, 0, 0, 4, 6, -3, -4, 0, 0, 1, -3, 1, 1, 2, 7, 0, 0, 1, 1], [1, 1, -2, -1, 4, 0, 0, 3, -2, 0, 0, 0, -1, 0, -2, -3, 0, 0, 0, 0], [8, 0, 6, 4, 3, -3, 6, -6, 6, -6, 0, 0, 0, -3, 3, 0, -3, -3, 0, 0], [-2, 2, 0, -1, -12, 0, 1, -4, 0, -1, -2, 0, 2, 0, 0, 2, -1, -4, 0, 1], [0, 1, 0, 0, -4, -2, 6, 2, 0, 0, -1, 0, -2, 4, 3, 3, -2, 1, 3, 4], [-2, 0, -4, -2, 0, -2, 1, 0, -5, 2, 0, -1, 0, 5, 0, 3, -2, 0, 1, 2], [10, 0, 6, -1, -2, 2, 7, -7, 7, -6, 0, -2, -2, -5, 5, 0, -3, -3, 0, 0], [-4, 0, -2, 3, -3, 3, 3, -3, 0, -3, 0, -6, -6, -2, 2, 0, -1, -1, 0, 0], [3, -3, 1, 5, -6, -3, 2, -7, -2, -2, -2, 3, 1, 0, -2, -5, -5, -3, -3, 2], [-7, -1, 0, -1, 0, 4, 4, 0, -3, 0, 0, -5, 0, 3, 0, -4, 2, 0, 3, 0], [-6, 0, -4, 0, 2, -12, 0, 0, -2, 0, -2, 2, 2, 4, -2, -4, -4, 0, -2, 0], [0, 1, 0, 0, 2, -2, 8, 4, 0, 0, -1, 2, 2, 0, -1, -1, -5, -2, -3, 4], [4, -4, 4, 6, 4, -6, 2, -7, -2, -2, 0, 6, 5, 0, -2, -6, -8, -6, -6, 2], [-2, -2, 2, -4, 0, 8, -3, 0, -3, 2, 0, -3, 0, 3, 0, 1, 6, 0, 5, 2], [0, -2, 0, 0, -2, -2, 3, -3, 0, 0, -2, 3, -3, 2, 0, 2, -1, -3, 2, 6], [12, 0, 4, -2, 7, -7, -4, 4, 6, 0, 0, 2, 2, -1, 1, 0, -1, -1, 0, 0], [0, 0, 0, 0, -3, -5, -2, 0, 0, 0, 2, 0, 2, -3, -1, -4, -2, 0, -4, -2], [2, -1, -2, -1, -1, -7, -2, 0, 1, 0, 1, 4, -1, -2, 1, 1, -5, 0, -3, 0], [4, 0, 2, 7, 12, -12, 2, -2, 2, -1, 0, 2, 2, 1, -1, 0, -2, -2, 0, 0], [4, -3, 2, 3, -4, 0, 0, -3, 2, 0, -2, 0, 5, 0, 2, -2, 0, -3, 0, 0], [0, 3, 0, 0, -15, -9, -1, -2, 0, 0, 5, 0, -6, -2, 3, 9, -1, 1, 1, 1], [0, 1, 0, 0, 4, -3, 1, -3, 0, 0, -5, 4, 3, 2, -3, -9, -6, 0, -2, 4], [-4, -4, -2, -6, -2, -6, 0, 0, -4, 2, 2, 2, -2, 2, 2, 0, 2, 0, 2, 2], [-1, 4, -1, 6, -2, 9, -4, 0, 0, -2, 2, -7, -2, -2, 2, -1, 1, 0, -1, -2], [-4, 0, -8, -5, -8, 8, -5, 5, -7, 6, 0, -2, -2, 3, -3, 0, 5, 5, 0, 0], [-2, -5, 0, -5, -2, -12, -1, 0, 4, 0, 2, 3, -2, -6, 2, -6, 1, 0, -4, 0], [2, 0, 3, 3, 3, -3, 10, -10, 3, -6, 0, -1, -1, -2, 2, 0, -4, -4, 0, 0], [3, 3, 5, 2, 1, -4, 6, 0, 2, 1, -1, 4, 1, -1, -1, 1, -2, 0, 3, 1], [0, 0, 0, 0, 9, 3, -4, -3, 0, 0, -4, 5, 1, 0, -4, 6, -4, 3, -2, -1], [5, -2, 4, 0, -9, -1, -2, 1, 3, 2, -1, 1, -2, 0, 3, -2, 1, 1, -1, -2], [-12, 0, -2, -1, -4, 4, 0, 0, -6, 1, 0, -3, -3, 1, -1, 0, 0, 0, 0, 0], [7, -1, 1, 0, -4, 7, 3, 0, -1, -1, 4, -4, -4, -3, 4, 8, 0, 0, 2, -1], [0, 2, 0, 0, 5, 5, -2, -5, 0, 0, -2, -3, 3, 4, 2, 0, 4, -5, 2, 3], [0, 4, 0, 0, 8, 0, 5, 3, 0, 0, -4, 1, 7, 0, -4, -8, -5, -1, -4, 2], [-4, 0, -8, -6, -3, 3, 0, 0, -3, 5, 0, -4, -4, -1, 1, 0, 6, 6, 0, 0], [0, -2, 0, 0, 1, 5, -4, -5, 0, 0, 4, 0, -4, -2, 2, 12, 0, -1, 0, 1], [8, 4, 0, -7, -4, 4, -3, 8, 4, 3, -1, -4, -3, 0, 4, -4, 7, 6, 4, -3], [2, 0, 0, -4, 2, -2, 4, 0, -2, 4, -2, -1, 2, 4, -2, 4, 2, 0, 2, 4], [0, 7, 0, 0, 8, 12, -1, -1, 0, 0, 5, 1, -5, -6, -1, -3, -2, 1, -1, 0], [0, 2, 2, 2, 1, -15, 7, 0, -1, 0, -1, 2, 1, 2, -1, 1, -2, 0, 3, 0], [2, -1, 4, 2, -1, -3, 9, 0, 1, -3, 1, 0, -1, -2, 1, 1, 2, 0, 3, -3], [2, 0, 0, 2, 7, -7, -2, 2, 2, 4, 0, 4, 4, -1, 1, 0, 1, 1, 0, 0], [1, 2, 1, -2, -2, -5, 8, 0, -4, 4, 2, 1, -2, 2, 2, 5, 3, 0, 5, 4], [4, 0, -4, -1, -12, 12, -4, 4, -2, -1, 0, -4, -4, -1, 1, 0, 2, 2, 0, 0], [2, 0, -2, -1, 4, 4, -1, -8, 2, 1, -1, -4, -7, 0, 2, 0, 5, 3, 4, -1], [2, 4, 2, -1, 0, 0, 3, -9, 2, -3, -2, 0, -2, 0, 2, 0, -3, -2, 0, 3], [-4, 0, -6, -8, 4, -4, -1, 1, -3, -1, 0, -6, -6, -2, 2, 0, 3, 3, 0, 0], [0, -2, 0, 0, 1, -11, -9, -2, 0, 0, -6, 6, 6, 0, -6, -6, 2, -1, -6, -7], [0, -3, 0, 0, 1, 13, 5, 1, 0, 0, 5, -9, -3, -1, 4, -9, 2, 1, 7, 4], [2, -1, 1, -5, 8, -5, -7, 0, -2, 4, -8, 6, 8, 10, -8, 4, 2, 0, 3, 4], [4, 0, 2, -9, 14, -14, -2, 2, 2, 3, 0, 0, 0, 1, -1, 0, 4, 4, 0, 0], [0, -2, 0, 0, 0, -8, -3, 0, 0, 0, 0, 6, 2, -3, -3, -4, -3, -2, -8, -3], [0, 8, 0, 0, -4, 0, -2, 4, 0, 0, 4, 1, -5, -4, 0, 12, 0, 6, 0, -6], [-18, 0, -2, 4, -8, 8, -1, 1, -8, 4, 0, 1, 1, 4, -4, 0, -1, -1, 0, 0], [1, 0, 5, 1, 1, -8, 3, 0, 4, -1, -1, 5, 1, -3, -1, -3, -1, 0, 1, -1], [-6, 0, -2, 2, 11, -3, 2, -2, -5, -2, 0, 3, -1, 0, -5, 1, -5, -1, -3, 2], [-14, 0, -4, 3, -8, 8, -3, 3, -3, 0, 0, 0, 0, 1, -1, 0, 3, 3, 0, 0], [0, -2, 0, 2, -13, -3, 0, -3, -3, 0, 0, 3, -1, 0, -3, -3, -3, -1, -3, 0], [4, -6, -1, -7, 4, -5, 0, 0, 5, 1, -4, 3, 4, -1, -4, -1, -3, 0, -6, 1], [0, 6, 0, 0, -5, 3, 2, 2, 0, 0, 2, -2, -6, 1, 3, 12, 5, 1, 6, 0], [7, -2, 1, 3, -10, -3, 1, 0, -2, -1, -1, 3, 5, 0, -2, -9, -4, -5, -3, 1], [-1, -4, -4, 2, -3, 1, -2, 10, -3, 2, 3, -1, -4, 0, -3, -2, 3, 4, 1, -2], [-12, 0, -10, -2, 3, -3, -2, 2, -7, 3, 0, 1, 1, 7, -7, 0, 2, 2, 0, 0], [-10, 1, 6, -2, 1, 1, 5, 0, 2, 3, -1, 2, 1, -1, -1, -12, 0, 0, 4, 3], [-18, 0, 0, -3, -10, 10, 4, -4, -1, 0, 0, 1, 1, 1, -1, 0, -1, -1, 0, 0], [0, 2, 0, 0, -4, 4, -1, -5, 0, 0, 6, 1, -9, -6, 0, 6, -3, 1, 2, 4], [10, 4, 2, 6, -4, 14, 9, 0, 3, -2, 4, -4, -4, -7, 4, 7, -2, 0, -1, -2], [6, 1, 4, 0, 7, -1, 1, 0, 3, -1, -1, 1, 5, 0, 3, -3, -2, 2, -1, 1], [-6, 6, -4, -11, 2, 4, -5, 3, 0, 5, 4, -4, -10, 0, 0, 6, 9, 8, 4, -5], [4, 4, -2, 7, -4, 6, -4, 0, -3, -3, 4, -8, -4, -1, 4, 7, 2, 0, 1, -3], [4, 0, -5, -5, -4, 4, -11, 11, -7, 2, 0, 0, 0, 3, -3, 0, 3, 3, 0, 0], [-11, 1, -2, -6, -4, -4, -5, 3, -6, 5, -1, 4, 6, 0, -6, 5, 1, 5, -4, -5], [6, -4, -4, 0, -6, 2, -4, 6, -2, 4, 2, -2, -2, 0, -2, -8, 6, 7, 2, -4], [-4, 0, -2, -12, -4, 4, -4, 4, -9, 7, 0, 0, 0, 2, -2, 0, 5, 5, 0, 0], [0, 10, 0, 0, 5, 7, -4, -4, 0, 0, 2, -2, 0, -3, -1, -2, -3, 3, 0, 0], [0, -7, 0, 0, -14, 0, -2, 4, 0, 0, 7, -8, -6, -2, 5, -7, 9, 4, 7, -6], [8, -2, 0, 0, 7, 3, -2, 0, 3, 2, 4, -3, -1, 0, 3, -5, 5, 1, 3, -2], [2, -1, 5, 5, -9, -2, 4, -6, 3, -4, 1, 2, 1, 0, 3, 1, -6, -15, -2, 4], [0, 3, 0, 0, -2, 2, -4, -3, 0, 0, 3, -1, -3, 1, 4, 5, 0, 2, 1, -1], [6, 0, -3, 3, 5, -5, 2, -2, -1, 0, 0, -1, -1, -2, 2, 0, 1, 1, 0, 0], [-6, 0, 3, 0, 1, -1, -1, 1, 4, 0, 0, -3, -3, -5, 5, 0, 2, 2, 0, 0], [0, -4, 0, 0, 10, 12, -9, -2, 0, 0, 2, 0, -2, -1, 1, 8, 7, 0, 0, -7], [-4, -2, 4, 4, -1, 3, 2, 1, 7, -2, 0, -3, -2, 0, 7, 11, 1, -1, 3, 2], [0, 6, 0, 0, -6, -2, 2, -6, 0, 0, -2, -6, 2, 6, 4, 8, 0, -2, 6, 8], [-7, 4, -2, -4, 6, 4, -6, 0, -4, 8, -6, 6, 6, 10, -6, -3, -2, 0, 2, 8], [14, 1, 3, 2, 10, -3, 3, -1, 0, -3, -3, 3, 2, 0, 0, -14, -6, 2, -3, 3], [-3, 2, -1, 4, -17, 10, 6, -3, 9, -6, 1, -10, -10, 0, 9, 12, 4, 2, 10, 6], [0, -5, 0, -10, 7, -1, 3, 0, 6, 5, -7, 5, 7, 1, -7, -6, -4, 0, -6, 5], [3, 8, 4, 12, -1, 3, 8, 0, -1, -4, 1, 0, -1, 0, 1, 4, 3, 0, 5, -4], [-14, 0, 6, -4, 6, -6, 0, 0, 4, -4, 0, 0, 0, -2, 2, 0, -2, -2, 0, 0], [6, -5, -5, -5, 5, -8, 4, 0, -1, 0, -5, 2, 5, 6, -5, 7, -3, 0, -4, 0], [0, -3, 4, 0, -2, -2, -3, 4, 2, 3, -3, 2, 11, 0, 2, 2, 1, 1, -2, -3], [-4, -4, -6, -10, 2, -8, -5, 0, -5, 6, -2, 4, 2, 7, -2, 1, -2, 0, -1, 6], [0, -3, 0, 0, 5, -1, 3, 5, 0, 0, -3, 1, 5, -1, -4, -7, -5, 4, -3, -2], [2, 0, 2, -9, 1, -1, 0, 0, 0, 1, 0, 6, 6, 0, 0, 0, -5, -5, 0, 0], [4, -3, 0, -2, 3, 19, -9, 0, 1, -1, -3, -1, 3, 2, -3, 3, 2, 0, -1, -1], [11, -2, -1, 1, 4, 1, -1, 0, 0, 1, 3, -1, -1, 0, 0, -11, 2, 9, 1, -1], [-6, 0, 8, 9, -4, 4, 1, -1, 2, -3, 0, 6, 6, -3, 3, 0, -6, -6, 0, 0], [4, 6, -2, -3, -3, 1, 3, -4, -1, -3, -2, -1, -3, 0, -1, -5, -2, 1, 1, 3], [0, -8, 0, -3, 0, -20, -6, 0, 5, -5, 0, -1, 0, -5, 0, -5, -1, 0, -5, -5], [-7, 6, -4, 6, 3, -13, -3, 0, -1, 0, -3, 8, 3, 4, -3, -6, -8, 0, -3, 0], [12, 0, -6, 2, 10, -10, -2, 2, -8, 4, 0, 4, 4, 6, -6, 0, -1, -1, 0, 0], [-3, 0, 6, 3, -3, -3, 1, 0, -2, -3, 3, -8, -3, -1, 3, -1, 2, 0, 8, -3], [0, 0, 0, 0, 5, 15, 5, -1, 0, 0, 4, -6, -4, 3, 7, -2, 1, -1, 6, 6], [-9, 1, -4, -6, 3, 7, 0, 0, -6, 7, -3, -1, 3, 9, -3, -3, -2, 0, 2, 7], [2, 6, 0, -5, 3, 5, 1, 5, 5, -1, 2, -5, -4, 0, 5, 3, 4, 3, 5, 1], [-4, 0, 6, 5, -2, 2, 5, -5, 4, -5, 0, 1, 1, -3, 3, 0, -6, -6, 0, 0], [0, 8, 0, 0, 10, 10, 1, -6, 0, 0, 0, -1, 1, 1, 1, 0, -3, -4, 0, 7], [0, 1, 0, 0, -12, -12, -1, 5, 0, 0, 7, 5, -5, -8, -1, 1, -4, 3, -7, -6], [0, -4, 0, 0, 7, 11, 7, 5, 0, 0, 2, -2, -2, -1, 1, -2, -1, 1, 2, 2], [14, -6, 10, 11, -2, -2, 5, 2, 8, -5, -2, 2, 9, 0, 8, -6, -7, -14, -2, 5], [0, -2, 6, 2, 18, 0, 0, -8, 6, 0, 2, 0, -2, 0, 6, 6, 0, -3, 0, 0], [4, -1, -2, -6, -1, 7, -9, 0, -6, 5, 1, 4, -1, 5, 1, 10, 0, 0, 4, 5]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_680_bd_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_680_2_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_680_2_bd_b(:prec:=20)
    chi := MakeCharacter_680_bd();
    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_680_2_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_680_2_bd_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_680_bd();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![16, -224, 1568, -4464, 3780, 16016, 28064, 456, 8624, 27248, 32040, 15000, 3944, 948, 1016, 496, 125, 8, 8, 4, 1]>],Snew);
    return Vf;
end function;