
// Make newform 650.2.t.g in Magma, downloaded from the LMFDB on 19 December 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_650_t();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_650_t_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_650_2_t_g();".
// 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_650_2_t_g();".
// 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 := [4096, -1024, 128, -2080, -2812, 1696, 192, 760, 2208, 80, 8, 16, -48, -4, 0, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-16628864598016, 7097999986688, -1670918027776, -90847784423236, -1826716185040, -5283856068144, -10415738723016, -79214106400, -29269595144, -36693742968, 199268795464, 11354140000, 4089687260, -928390744, -4146468380, -590814673], [-1698553709056, -9767935909888, 2208138097664, 9591494753540, 2510988293024, 7317759717504, 14466282723576, 71206342688, 35999704720, 59406833544, -323441465840, -17408263760, 1417547900, 920962592, 6776112136, -238350271], [953416704, 2969694208, -850918912, -113153212, -769014768, -2133581824, -26627160, -96010096, -19363096, 45902632, 1523816, 1784920, 201412, -981520, 44468, -42599], [-17112277705216, -170659974504448, -359630171247376, 110084124927812, 49092933699296, 85856872417632, 257951685319032, 36949418734592, 1764350055088, 1936904356776, -5193262349936, -1059059762912, -44571751012, -929509456, 112830647620, 12187170977], [-38434909738112, -22516417908608, 7050453741040, -17973151399292, 36768367556944, 12943988393412, -3201472688760, -1812058232894, -774748798816, -380049099228, 15527888726, 49666391246, 22313466160, 5432135497, -1178805226, -1265139977], [-4170710020480, 32037605904512, -8792425857040, 33755922012548, 22634771616224, -26143148159448, 2485938268080, -3663273601234, -1140357774056, 587092648872, -70376022734, 78329121796, 22733755088, -13423970953, 2114100244, -1638690067], [-12832193536, 3522852736, -1484014832, 457887420, 10113423712, 285274272, 1091654344, 2133257152, -109124848, 1353304, 7757456, -45497056, 201796, -177872, 170396, 931071], [-27683541191168, -129599682228224, -96269892921920, 156465164147860, 30008228870704, 122087056714848, 63577459405944, -20417839645112, 8436720848, -1873373497464, -1811927081248, 396996647936, 39990919804, 47979745276, 28705092392, -9852329051], [-4094491643392, 2695803388928, 41087591326484, 19411871526044, -2833160330548, 14854472191068, -30910736399856, -14389637183506, -422742308156, -819826388034, 460600090348, 345665726062, 23302404986, 11969268317, -12865387787, -5879837650], [-12479663080448, -1158153656192, -43054983097376, -83570213903804, 36088612428784, 7105872930576, 20879233897512, 62172358844128, 2510036304344, 197344094232, 459851747240, -1347064271392, -118518889004, 1044233224, -232377364, 28207661905], [6777896482304, -141987626500096, 5316554174960, -801552820204, 48819093324608, 6546737141184, 99810274704216, 85856534490896, 3320585983600, 1504274515008, -882470407088, -1962435314384, -159419819020, -14862048280, 34463647156, 38410768049], [165237149091328, 61918405394560, -35245016865296, -50792859550460, 6442915735264, 61465587062400, 34020882945768, 82927272526384, 5254165166480, -765142016064, 445585688672, -1817356748560, -190478280212, 27774368104, 1001037668, 38453963605], [-138661529586688, 45513422684288, -30476282485264, -66409813215484, 10693184362208, 73217169224496, 32330881100952, 83485861676672, 5364323808592, -1018565368008, 473902889680, -1825885905320, -197381780260, 33462609488, -43195556, 38686340969], [7461651612160, -1552448688128, -6593097761156, -33147629186564, 3471088962400, -23666868397332, -18846312820728, 21113684077720, 693383776244, 256332661716, 769274901224, -434972084266, -43717796048, -7887648452, -12016563769, 10245718021]];
    Rf_basisdens := [1, 1, 104859315460224, 24672780108288, 3150915456, 419437261840896, 26214828865056, 26214828865056, 12603661824, 104859315460224, 26214828865056, 104859315460224, 104859315460224, 104859315460224, 104859315460224, 26214828865056];
    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_650_t();"
function MakeCharacter_650_t()
    N := 650;
    order := 12;
    char_gens := [27, 301];
    v := [3, 11];
    // 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_650_t_Hecke();"
function MakeCharacter_650_t_Hecke( : Kf := false)
    N := 650;
    order := 12;
    char_gens := [27, 301];
    char_values := [[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    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, -1, 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, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [-1, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, 0, 0, 0, -1, 0], [1, 0, -2, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0], [0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0], [0, 0, 2, 0, 0, 0, 0, -1, 0, 0, 1, -2, 0, 0, 0, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, -1, 1, 0], [0, 0, -1, 0, 0, 0, 1, 1, 0, -1, 1, 0, 0, 2, 1, -2], [4, -1, 1, 2, 1, -1, 0, 2, 4, 0, 0, 0, 0, 2, 2, 0], [-4, 0, 0, 3, 0, -4, 1, -1, -1, 1, 0, 0, -1, 1, -1, 0], [0, 1, 0, 0, 1, 0, -1, -1, 0, -1, 1, 1, 1, 0, -1, -1], [-4, 0, 0, 0, 0, 0, 1, -1, 0, -2, 2, 0, 1, 0, 0, -1], [0, 0, 0, 0, -1, -3, 1, 1, -3, 1, -1, 0, -2, 0, -1, 0], [-4, 1, 0, 0, 1, 4, 1, -2, 0, 0, 1, 3, 2, 1, -1, 1], [0, 0, 1, 1, 1, 1, 0, -1, 0, -1, -1, -1, -1, 1, 0, -1], [0, -1, -1, 0, 2, -4, -2, 0, 0, 0, 0, -1, 0, 0, -2, 0], [0, -1, 0, 0, -1, 0, 0, -1, 0, 1, 2, 1, 1, -1, -2, 0], [0, 3, -3, -1, -3, 0, 1, 1, 0, 0, 0, 3, 0, 1, 1, 0], [0, -1, -1, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 1, 1, 0], [4, 1, -1, -4, 1, 8, 0, 0, 0, 0, 0, -1, 1, -1, 1, 1], [1, 1, -1, 4, -2, 1, 1, 1, 5, -1, 0, 1, 1, -1, 1, -2], [0, 1, 1, -4, -2, 4, 0, -1, 0, 0, -3, -2, 0, -1, 0, 3], [-1, 3, 3, 0, -1, 0, 1, 1, 1, 0, 1, -2, 1, -1, 2, 1], [0, 2, -1, 0, -1, 0, 3, 2, 0, -3, 2, 0, 2, 0, 0, 0], [4, 1, 0, -4, -2, 4, 2, 1, 0, 1, 0, 0, 1, 1, 1, -1], [5, 0, 0, -5, 2, 4, 0, 0, 4, 0, 0, 0, -1, 1, -1, 1], [1, 0, 4, 1, 0, 0, -1, 1, 1, -1, 0, -2, 1, -2, 0, 1], [0, 2, 0, 0, 0, 0, -2, 0, 0, 1, -2, 0, -2, -1, 2, -1], [4, -1, 0, 0, 0, 0, -1, 1, 0, -2, 2, 1, 2, 2, -2, 0], [0, -1, -1, 0, 0, 0, -2, 0, -3, -1, -2, 0, -1, -2, -2, -2], [8, 0, -1, 4, 1, -4, -1, 1, 4, -1, -2, 1, 1, 0, 1, 2], [-1, -3, -2, -4, 3, 3, -1, 1, -4, 1, 0, 1, 1, 0, 0, 1], [0, 0, -1, 0, -2, 0, 0, 2, 0, 0, -2, 2, 1, 0, 3, 0], [-1, -2, 2, -1, 1, 1, 0, 2, -1, 0, 2, 0, 0, -1, 2, 1], [0, 0, 1, 0, -1, 0, -2, 4, 0, -2, 2, -1, 2, 2, 2, -2], [8, 0, 0, 8, 2, -4, -1, -2, 8, -1, -1, 2, 0, -2, -1, 0], [-4, 2, 0, 5, 2, -1, 1, 2, -5, 0, -2, -1, -2, 1, 2, 1], [0, 1, -1, 0, -2, 0, 0, 0, 0, -2, 0, -1, 2, 0, 0, -2], [8, -1, -1, 3, -1, 0, 1, 1, 16, 0, 0, -1, -3, 3, 3, 3], [0, 1, 1, 4, 0, 4, -1, 2, -4, 1, 0, 0, 1, -3, -1, 0], [-7, 1, 1, 0, -2, 4, -1, -1, 7, 2, -1, 1, 1, 1, -2, 1], [0, 2, 2, 0, -1, 0, 2, 2, 0, 0, 3, -1, 3, -2, 4, 3], [0, 1, 2, 4, 1, 4, -2, -4, -8, 0, 2, -1, 0, 2, -2, 2], [0, -3, 3, 0, 1, 0, -3, -2, 0, 0, -2, -2, -2, -2, 1, 2], [8, -1, 1, 0, 0, 0, 1, 0, 8, 0, -4, -1, -4, 0, -1, 4], [0, -2, 2, 8, 0, -8, 1, 3, 0, 3, 1, 0, -3, 4, -1, -1], [-5, -2, 4, -5, 1, 4, -2, 2, -4, 2, 2, 0, 4, -2, -2, 2], [-1, -4, 1, -1, 2, -4, -2, 0, 4, 2, 0, 0, -3, 0, 3, 0], [12, 0, -1, -12, -4, 8, -1, 1, 8, -1, -1, 2, -2, -2, -1, -2], [-9, 0, 4, -8, 0, -1, -2, -2, -8, 1, -1, -2, -2, -1, -1, 2], [0, 3, -3, 4, 0, -4, -3, 4, 0, -2, 2, 0, 2, 1, 3, -2], [-4, 4, 2, -1, 0, 4, 4, -2, -3, -1, 0, 2, 2, 1, -2, 3], [0, -1, 1, -4, 0, 0, 1, -2, 4, 0, -2, 1, 0, 0, 0, 1], [0, -1, 3, 4, -2, -4, 3, 0, 0, 0, 3, -2, 0, 3, -3, -3], [-4, 4, 0, -4, 0, 4, 0, 0, 0, 2, -2, 0, -2, -2, 2, 2], [7, -2, -2, -4, 2, 11, -3, -3, -4, 1, -3, 1, -3, -2, -3, 3], [1, 0, -1, -1, 3, 1, 4, 3, 1, 4, -3, 2, -2, 2, 1, 2], [0, -2, 2, -4, 4, 0, 1, 1, -4, 3, -3, -2, -2, 3, -2, 2], [-8, 2, -1, -3, -1, 3, 1, -4, -4, 1, -2, -1, -1, -3, -1, 2], [-8, 0, -4, 4, 4, -8, 2, -2, 0, -2, 2, 0, 1, -1, 1, -1], [0, -1, -4, -4, -4, 0, -2, -2, 0, 0, 0, -1, 4, -5, -5, -4], [1, 0, 1, -1, 1, 0, -3, -5, 0, -3, 5, -2, 5, -4, 0, -4], [0, 1, -3, -5, -3, 0, 4, 4, 0, -2, -2, 1, -3, 3, 3, 1], [8, 0, 0, 0, 0, -8, 2, 1, 0, -3, -4, 2, -1, 5, 4, 2], [0, 0, 2, 0, -3, -5, 2, 5, -5, 2, -5, -4, 0, 2, 5, 2], [12, 1, 0, -4, 1, -8, -3, -1, 4, -5, 1, 0, 1, 2, -1, -3], [-5, 1, 0, 12, -2, -5, 1, -1, 7, 1, 1, 0, 0, 1, 0, 0], [0, 0, 0, 6, -1, -3, -1, -4, 0, 0, 4, -1, 4, -4, -3, -4], [0, -4, 0, 0, 2, -8, 2, -6, 8, -2, -6, 0, -5, -1, -1, 1], [4, -1, -1, 4, 2, 4, -3, -4, 8, 2, -1, 1, -5, 2, -5, 5], [-3, 3, 2, -4, -3, 1, -4, -3, -4, 1, -1, -1, -3, -3, -1, 4], [0, -3, -2, 4, 0, 0, -1, -5, -4, 3, 0, -2, 5, -3, -5, 2], [0, 5, 2, 0, -3, 0, -4, -2, -4, -5, 1, 3, -5, -2, -4, 1], [-3, 1, 5, 4, -5, -8, 1, -1, 0, 2, -2, -1, 4, -4, 4, 6], [0, 1, 5, 0, 4, 0, 1, -1, 0, 4, 3, -4, 4, 2, 1, 3], [-8, 1, 1, -7, 0, 8, 5, 0, -1, -5, 0, 1, 0, 5, 0, 0], [-11, 1, 2, -3, -1, -8, 0, -5, -3, 2, -3, -1, -5, 2, -3, 0], [4, 0, 0, 0, -4, 4, -5, 2, -4, -1, 2, 4, 1, -2, -3, 1], [3, 0, 3, 3, 0, 5, -4, 3, -5, 4, 3, 0, 2, -1, 1, 1], [0, 2, 1, 12, -4, 0, 0, 3, 12, 4, -1, -1, 2, 4, 2, 4], [5, -2, 0, 3, -2, -8, -3, -1, -3, -1, 0, -4, 1, -2, 0, -3], [4, 5, -5, 0, -3, 0, 1, 6, 4, 1, 0, 2, -1, 6, 5, 1], [0, 0, 0, 0, 4, -8, -1, 5, -8, -1, -5, 0, -2, 3, 3, 3], [-4, 2, 0, -1, 2, 5, -4, 2, 1, -5, 0, -4, -2, 1, 0, -4], [1, -2, -2, 0, 3, 4, 3, -5, -1, 3, -4, -1, -1, 5, -2, -1], [7, -1, 0, -7, -1, 0, -2, -1, 7, -1, -1, 8, 1, -1, 1, -2], [4, 0, -2, 16, -2, 0, -2, -2, 8, 4, 4, 0, 4, -3, -3, 0], [-4, 0, 2, 4, -6, -4, -4, -2, -4, -4, 2, -4, -1, 3, -3, 3], [-8, -3, 0, 12, 6, -8, 3, 5, 4, 4, -2, 0, 3, 4, 3, 1], [-8, -3, 2, 12, 1, -12, -4, -4, -4, 0, -1, 1, 0, -8, 4, 1], [0, 2, 2, 0, -1, 4, -3, 4, 0, 2, -2, -1, 0, -4, 1, 0], [8, 0, 1, -8, -3, 12, 1, -1, 12, 1, 1, -2, 2, 2, 1, 2], [0, 2, -4, 0, -2, 0, 0, 3, 0, 5, -5, 2, 3, 5, -5, 0], [5, 4, -6, 5, 0, -5, -2, -2, 0, -3, -2, -6, 0, 3, 0, -5], [-4, -2, 3, 3, -3, -6, 1, -1, 0, 5, -5, 2, 0, -5, 5, 5], [0, -4, 4, -4, 0, 0, -2, -5, 4, -1, -2, 4, 3, 1, -3, -3], [-4, 0, 1, 4, 4, 7, -2, -5, 7, -2, 5, -2, 3, -4, -2, -4], [-4, -2, -3, -4, 1, 0, 0, -2, 0, 0, -2, 0, 1, 1, -3, -1], [12, 3, -3, -2, -5, 1, 0, 2, 12, 3, 1, -2, -2, 2, 2, 2], [-4, -3, 0, -4, -3, 8, 1, -2, 4, -2, 1, -1, 2, 3, -1, 1], [4, -1, 1, 8, 4, -4, -1, 0, 4, -3, -7, 3, -4, 0, 1, 4], [4, -1, 0, -4, 0, 0, 2, 2, 8, 1, 1, -1, -5, 1, 1, 6], [-8, 1, 2, -3, 2, 0, 3, 3, -16, 4, 4, 1, 4, 1, 1, 0], [0, -7, -7, 0, 2, 0, -3, 6, 0, 0, -3, 5, -3, -6, 3, -3], [3, 0, 2, 4, 2, 0, 4, 4, 6, -5, -5, 0, 0, 3, 3, -5], [-8, -4, 5, 4, 5, 0, -1, -1, -16, -1, -1, -4, 0, -1, -1, -1], [1, 6, -6, 8, 0, -4, 5, 4, 1, -4, -5, 6, -1, 4, -1, 1], [8, -1, 0, 0, -1, -8, 4, 3, 0, 3, 1, 9, -3, 1, -1, 4], [-5, 6, -6, 0, -7, 0, 5, 9, -5, 1, 1, -1, 0, 9, 4, 0], [-18, 2, -6, -4, 4, 4, 3, -3, -9, -1, 0, 4, 1, 0, -3, 0], [4, -2, -4, 4, 1, 0, -2, 1, 0, 2, 1, 0, 1, 7, 0, -7], [8, -2, 4, 4, 2, 4, 6, 3, 4, -7, 4, -2, 3, -1, 4, -6], [-6, -4, 8, 4, -4, -4, 1, -4, -3, 3, -2, -4, -3, -3, -1, 2], [0, 7, 5, -4, -2, -4, 7, 2, 0, 0, 1, 2, 0, 5, 7, 1], [-4, -5, -1, 8, 0, 4, -2, 5, -12, 1, 7, -1, 2, -1, -2, -1], [1, -1, 2, -8, 0, -1, -2, -1, 9, 3, 3, 2, 4, -3, -4, 1], [8, 2, -2, 0, 0, 0, -2, -3, 4, -2, 5, 0, 2, -5, 2, -5], [-7, 6, 1, -15, 0, 7, -1, -1, 8, 2, 1, 1, 2, -2, -2, 1], [8, -5, -5, 5, 10, 8, -5, 0, 13, 1, 1, 5, 1, 1, 1, 6], [1, -10, 1, 1, 5, -4, 4, 0, 4, -4, 0, 0, -5, 1, 5, -1], [-16, 0, 0, -12, 0, 12, 0, -3, -8, -3, 0, 0, 3, -3, 0, 0], [8, 1, 0, -12, -2, 8, 1, 0, -4, 3, 1, 0, 1, 3, 1, 2], [-8, -5, 4, -4, 4, 0, 4, 4, -16, -6, -6, -5, -2, 0, 0, -4], [-3, 4, 0, 7, 4, -4, 3, 2, -7, -2, 0, 3, -2, 5, 0, 3], [0, 5, -4, 0, -9, 0, 2, 3, 4, 1, 0, 9, 1, -1, 2, 0], [16, 0, 2, -16, -2, 8, -1, 0, 8, -1, 0, -4, 3, -4, 3, -4], [-5, 1, -2, 4, 2, -8, 1, -1, 0, 1, -1, -1, -3, 0, 0, -2], [8, -6, 3, -8, 12, 8, -3, 2, 0, -5, -3, -3, -1, -5, -1, -2], [-4, -4, 4, 16, -4, -8, 2, 0, -4, -1, 3, -8, 4, 0, -2, -4], [-8, 4, 4, 0, -10, -8, 7, -5, 8, 1, -1, 6, 0, 5, 2, 0], [-3, 3, 2, 12, -6, -3, -2, -2, 9, -1, -4, -2, -6, -1, -6, 1], [0, -9, -2, 5, 9, -5, 0, 4, 5, 4, 7, 1, 4, 4, 7, 0], [-1, 4, -2, 4, 0, 1, 2, 4, -5, 3, -1, -2, -5, -3, 5, 5], [0, 2, -1, -4, -3, -4, 0, 0, -4, -5, -8, 3, -5, 0, 0, -8], [0, 1, 1, 4, 0, 4, -5, -3, 8, 3, -1, 0, 3, -2, -5, -1], [0, -5, -2, 9, 5, -9, -2, -1, 9, 10, -1, 1, -1, 8, -1, 2], [-4, -8, -8, 0, 2, -9, 1, -5, 4, -7, 4, 6, -3, 5, -4, -3], [-4, 6, -4, -4, -3, -4, 1, -8, 4, -1, -8, 0, -5, 1, -3, -1], [-3, -6, -5, 12, 12, -3, 4, -1, 9, 1, 2, 5, 1, 1, 1, -3], [12, 0, 0, -8, 0, -4, 0, -2, 8, 2, -1, 2, 2, -2, 1, 0], [4, 3, -2, -8, 2, 16, -1, 1, 0, -3, 3, -3, 8, -5, 5, 5], [0, 3, -3, -2, 2, 1, 6, -1, 0, -2, 4, 5, 6, -1, -7, -6], [-12, -4, 0, -4, -4, 16, -4, -4, 4, 3, 1, -5, 4, -7, -1, -4], [-8, -4, 3, 13, 3, 0, -5, -5, -16, -2, -2, -4, 1, -2, -2, -3], [-12, 0, 2, 12, 1, -3, -4, -9, -3, -4, 9, -4, 3, 3, -6, 3], [0, -1, 5, 0, 5, 0, -4, -4, 0, 7, 7, -1, 5, -3, -3, 2], [12, -6, 1, -12, -1, 24, -6, 6, 0, -2, 2, 6, 0, -5, 5, -2], [-6, -6, -4, -12, 10, 12, 2, 1, -3, -3, -1, 10, 3, 3, -2, 1], [8, -9, -9, 0, 4, -1, -2, -2, -8, 4, -8, 5, -4, 2, -4, -4], [8, -2, 6, 8, 1, -8, -6, 0, 8, 6, 0, 0, -2, -4, 2, 4], [4, 5, -5, -8, -10, 4, -4, -1, -4, -9, -1, 5, -2, -9, -2, -5], [8, 9, 2, 0, 0, -8, -2, 2, 8, 0, 0, 2, -2, 0, 2, -2], [8, 4, 6, -4, -6, 8, -1, 1, 0, 1, -1, -4, 0, 3, -3, 1], [0, -9, 6, 0, 3, 0, -6, 4, 0, 4, -2, 3, -4, -2, 6, 2], [11, -4, -4, -9, 4, 20, -6, 4, -9, 4, 3, 2, 4, -2, 3, 6], [-7, 2, 1, -7, -1, -13, 7, 4, 13, -7, 4, 0, 2, 10, 2, -10], [-5, 2, 3, -5, -1, 12, -4, 0, -12, 4, 0, 0, -1, 3, 1, -3], [0, -4, 4, -16, 3, 8, -5, -2, 0, -4, -7, -1, -3, -2, 3, 3], [-20, 0, 0, -5, 0, 25, 4, 2, 5, -1, -3, -1, -2, 5, 3, 4], [0, -2, 3, -16, 3, 0, 3, 3, 0, -4, -4, -2, -1, -3, -3, -3], [0, -9, -3, -8, 6, -8, 0, 3, -12, -2, 2, -6, -2, -3, 0, 2], [0, -4, -4, 0, 8, 3, 4, -3, 0, -2, 4, -4, 2, 3, 1, 2], [4, 4, -2, 12, -2, 0, -1, -1, 8, 10, 10, 4, 11, -2, -2, -1], [0, -2, 2, 32, 2, -16, 5, -4, 0, 4, 5, 0, 1, -4, -9, -1], [-5, 0, 0, 9, 0, -4, -4, 0, -9, 1, 1, -11, 0, -5, -1, -4]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_650_t_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_650_2_t_g();".
// 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_650_2_t_g(:prec:=16)
    chi := MakeCharacter_650_t();
    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_650_2_t_g();".
// 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_650_2_t_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_650_t();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![4096, -1024, 128, -2080, -2812, 1696, 192, 760, 2208, 80, 8, 16, -48, -4, 0, 0, 1]>],Snew);
    return Vf;
end function;