
// Make newform 960.3.l.j in Magma, downloaded from the LMFDB on 23 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_960_l();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_960_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_960_3_l_j();".
// 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_960_3_l_j();".
// 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 := [20736, 25344, 22080, -97600, 64024, -39536, 42772, -15060, -5879, 1164, 5452, -3652, 1094, -252, 56, -8, 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], [-219855865256640, 79102524876192, -4821416354400, 61515846591008, 15056300199704, -44484736653028, -5806041972976, 18201626058604, -639742489323, -2548177422345, 474613304305, -49086984965, 23583208255, 1401383345, 942387, 265120597], [75251029162752, 305717048465472, -283982134939536, 170570503443016, -189838434339752, 132847932873724, -4783747131134, -22747577303665, -13528608519354, 20579384485884, -9102684804970, 2453365747430, -566220766030, 109021438216, -15286379448, 1388522339], [20673942144192, -53596515079584, 112713741559584, -76130303986624, 46974061102584, -26079192921292, 6083732187264, 2640699196336, 3471163007573, -5696660018879, 2774270333757, -757312464791, 175567630407, -34906315777, 4979134639, -505236429], [-1809374112, 23496792480, -64548897240, 61910332048, -36351856388, 28286792176, -9023272175, -2322071872, 320376327, 3906813126, -2747251177, 843073652, -190330699, 43546246, -6113400, 815120], [-13495915113408, 6483143119968, 52845911615088, -41010538226504, 14645490513600, -25024105501664, 12921360743286, 3072229607225, -2556353203277, -2805502329259, 2416339281171, -761071384117, 174012166641, -40881356273, 5835652835, -798796512], [66289229426880, 110027655717984, -219987819107112, 77556324860368, -94875776113004, 91088336879464, -19715265361865, -15280788194728, -2356345733685, 11794006077933, -6226029855523, 1734325986665, -408200868067, 82872054007, -11984663208, 1237882115], [3345747297984, -23853082568352, 1144642961056, 6085363602560, 7352027732392, 5091833560196, -7729491804616, 435302218040, 2734680760327, -240939896141, -612508005025, 235966807483, -52668235763, 14855155525, -2121631763, 364118865], [-11609626651776, -19574644394304, -25368703235472, 21814552257304, -41504631832, 3020785905748, -6743045317870, 1116407321501, 1084864250156, 603250657906, -745469493164, 242402461184, -55261425500, 13581507538, -1960713902, 289826899], [-24853781473920, -240939827503200, 121136142659304, 33420745579472, 37130753454692, 4415142727856, -33366749620267, 3063681912700, 15037802021562, -2270472657744, -2722348964984, 1092247683292, -244437213062, 70944100568, -10199009661, 1800067744], [-37610128370880, -15986684646432, 42966251413392, -40022412577624, 22772555764952, -17574822135376, 4863267971270, 2204342895583, -341714336808, -2686929542796, 1890725793160, -582108991226, 131275899592, -30075895252, 4214896266, -562185629], [-8951407210368, -121857601480704, 253699981662384, -185862178865912, 113221214769864, -100728387519980, 32231169622818, 12234397174895, 102727111432, -13867014600736, 8700548675700, -2575743277690, 591401105904, -129698062940, 18447021626, -2262094677], [-53395813114272, 125413640805888, 178677070972800, -140099557664864, 88438960046440, -134392025542280, 64427265086812, 23367049560524, -16962661053285, -13348001972103, 11910654837647, -3716683796203, 864444965729, -200800728677, 29080303089, -3877174285], [-83338409891520, 136155276435744, -471751746360000, 451857005790416, -150709076210824, 232358610102932, -139605532067020, -9392641929242, 22705296840783, 26806167012297, -24420961756685, 7809900580657, -1764447726707, 422583847199, -59838095547, 8508808957], [-3906025371936, -308931716107008, 17428691721984, 172246515880288, -32291422181048, 83230916271256, -74846244646436, -5225655376876, 26055884793639, 4298002420341, -9795050415421, 3400584183545, -768982727755, 198651799903, -28375958595, 4423480295], [-32776379136, 430946648640, -1185313524720, 1133246792600, -662475798640, 518172613580, -166977133630, -40339333115, 2272237365, 75091501575, -52189422659, 15999837805, -3605829305, 824284025, -115517595, 15402346]];
    Rf_basisdens := [1, 24362570035008, 24362570035008, 8120856678336, 11502629856, 8120856678336, 12181285017504, 2706952226112, 2030214169584, 12181285017504, 3045321254376, 8120856678336, 12181285017504, 24362570035008, 12181285017504, 41716729512];
    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_960_l();"
function MakeCharacter_960_l()
    N := 960;
    order := 2;
    char_gens := [511, 901, 641, 577];
    v := [2, 2, 1, 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_960_l_Hecke();"
function MakeCharacter_960_l_Hecke(Kf)
    N := 960;
    order := 2;
    char_gens := [511, 901, 641, 577];
    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]];
    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], [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, 0, 0, 0], [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1], [0, -2, -1, -2, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -1, 1, 0, -1, 0, 0, 0, 0, 0, -1, 0, 2, 0, 0], [-1, 0, 0, 0, -4, 0, -1, 0, 0, -1, 0, 0, 0, 0, 1, -1], [0, 4, -1, 0, 0, 1, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0], [-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 1], [-1, 0, 0, 0, -6, 0, -3, 0, 0, 1, 0, 0, 0, 0, 1, -2], [0, -3, -1, -4, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0], [0, -2, -3, 1, 0, 3, 0, -2, 0, 0, 0, -3, 0, 2, 0, 0], [2, 0, 0, 0, -6, 0, 4, 0, 0, 0, 0, 0, 0, 0, -2, 1], [0, 1, 1, 0, 0, 3, 0, 1, 0, 0, 0, -2, 0, -5, 0, 0], [-7, 0, 0, 0, -2, 0, 3, 0, 0, 1, 2, 0, 0, 0, 1, 1], [0, 1, -5, -6, 0, -2, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0], [0, 4, -4, 8, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0], [-4, 0, 0, 0, 4, 0, -6, 0, 0, -2, -2, 0, 4, 0, -2, -1], [0, 2, -5, -2, 0, -9, 0, -3, 3, 0, 0, 0, 0, 0, 0, 0], [0, 7, -1, 8, 0, -2, 0, 7, 0, 0, 0, 0, 0, -4, 0, 0], [2, 0, 0, 0, -20, 0, 2, 0, 0, 2, 0, 0, 0, 0, -2, 2], [-10, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 4, 0, 0, -1], [-1, 0, 0, 0, -28, 0, -7, 0, 0, 5, 0, 0, 0, 0, 1, 1], [0, 5, -4, -10, 0, 13, 0, 6, 2, 0, 0, 0, 0, 0, 0, 0], [0, -3, -11, 8, 0, 2, 0, -3, 0, 0, 0, 8, 0, 12, 0, 0], [17, 0, 0, 0, 2, 0, -3, 0, 0, -1, 6, 0, -2, 0, -1, 3], [0, 0, 0, 0, -16, 0, 3, 0, 0, -3, 0, 0, 0, 0, 0, -2], [0, -21, 4, -4, 0, -1, 0, 8, -6, 0, 0, 0, 0, 0, 0, 0], [0, -1, -5, 4, 0, -1, 0, -1, 0, 0, 0, -6, 0, 7, 0, 0], [-2, 0, 0, 0, -40, 0, -7, 0, 0, 3, 0, 0, 0, 0, 2, 4], [0, -10, -5, 2, 0, -29, 0, -7, -8, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -30, 0, -2, 0, 0, 2, 0, 0, 0, 0, 0, 0], [0, 12, 1, -10, 0, 35, 0, 11, 5, 0, 0, 0, 0, 0, 0, 0], [75, 0, 0, 0, -4, 0, 6, 0, 0, 2, 6, 0, -1, 0, 2, 3], [0, 19, 7, 2, 0, 36, 0, 5, -6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, -1, 0, 13, 0, 0, 0, 0, 0, -9, 0, -14, 0, 0], [0, 0, 0, 0, -30, 0, 6, 0, 0, -6, 0, 0, 0, 0, 0, -4], [0, -11, -9, -2, 0, 21, 0, -11, 0, 0, 0, -18, 0, -1, 0, 0], [52, 0, 0, 0, -4, 0, 6, 0, 0, 2, 4, 0, 0, 0, 2, 2], [0, -2, 10, -12, 0, -4, 0, -2, 0, 0, 0, 4, 0, -4, 0, 0], [-32, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, 0, -6, 0, 0, -5], [-2, 0, 0, 0, -78, 0, -2, 0, 0, -2, 0, 0, 0, 0, 2, -15], [0, -22, -23, -8, 0, -75, 0, -15, 3, 0, 0, 0, 0, 0, 0, 0], [0, 16, -5, -10, 0, 21, 0, 5, -2, 0, 0, 0, 0, 0, 0, 0], [0, 7, 24, 24, 0, 31, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0], [0, 9, -1, 10, 0, -12, 0, 9, 0, 0, 0, 22, 0, 4, 0, 0], [-120, 0, 0, 0, -8, 0, 12, 0, 0, 4, 4, 0, -2, 0, 4, 2], [8, 0, 0, 0, -52, 0, 21, 0, 0, -5, 0, 0, 0, 0, -8, 11], [0, -20, -4, -16, 0, 10, 0, -20, 0, 0, 0, 6, 0, 14, 0, 0], [-15, 0, 0, 0, -2, 0, 3, 0, 0, 1, 8, 0, -8, 0, 1, 4], [0, 9, 33, -24, 0, -25, 0, 9, 0, 0, 0, 4, 0, -17, 0, 0], [4, 0, 0, 0, -8, 0, 5, 0, 0, 3, 0, 0, 0, 0, -4, 10], [0, 0, -13, 13, 0, -5, 0, 0, 0, 0, 0, 11, 0, 18, 0, 0], [8, 0, 0, 0, -26, 0, 10, 0, 0, 6, 0, 0, 0, 0, -8, -10], [0, 8, 17, 26, 0, 7, 0, -9, 1, 0, 0, 0, 0, 0, 0, 0], [117, 0, 0, 0, 4, 0, -6, 0, 0, -2, -14, 0, -11, 0, -2, -7], [1, 0, 0, 0, -102, 0, 9, 0, 0, -7, 0, 0, 0, 0, -1, -14], [0, -21, 41, 28, 0, 46, 0, 13, 4, 0, 0, 0, 0, 0, 0, 0], [-4, 0, 0, 0, -42, 0, -14, 0, 0, 6, 0, 0, 0, 0, 4, -4], [0, -5, -7, -22, 0, 18, 0, 15, 10, 0, 0, 0, 0, 0, 0, 0], [0, 18, 24, -6, 0, -52, 0, 18, 0, 0, 0, -14, 0, 10, 0, 0], [-102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, -4, 0, 0, 10], [-2, 0, 0, 0, -10, 0, -18, 0, 0, 14, 0, 0, 0, 0, 2, -21], [0, -16, 31, 18, 0, 41, 0, 13, -2, 0, 0, 0, 0, 0, 0, 0], [34, 0, 0, 0, 12, 0, -18, 0, 0, -6, 8, 0, 6, 0, -6, 4], [0, 3, 39, -36, 0, -26, 0, 3, 0, 0, 0, 4, 0, -16, 0, 0], [-218, 0, 0, 0, 4, 0, -6, 0, 0, -2, -24, 0, 14, 0, -2, -12], [-2, 0, 0, 0, -20, 0, -31, 0, 0, 27, 0, 0, 0, 0, 2, -6], [0, -36, -42, 6, 0, 64, 0, -36, 0, 0, 0, 6, 0, 14, 0, 0], [0, 13, 34, 36, 0, 43, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0], [-107, 0, 0, 0, -8, 0, 12, 0, 0, 4, -2, 0, -5, 0, 4, -1], [0, -46, -5, 22, 0, -105, 0, -27, 2, 0, 0, 0, 0, 0, 0, 0], [0, 18, 35, -17, 0, -55, 0, 18, 0, 0, 0, -1, 0, 2, 0, 0], [-6, 0, 0, 0, -110, 0, 2, 0, 0, -14, 0, 0, 0, 0, 6, 2], [61, 0, 0, 0, -4, 0, 6, 0, 0, 2, 0, 0, 29, 0, 2, 0], [4, 0, 0, 0, 92, 0, 10, 0, 0, -2, 0, 0, 0, 0, -4, -26], [-187, 0, 0, 0, 6, 0, -9, 0, 0, -3, 0, 0, -12, 0, -3, 0], [0, -25, -29, 4, 0, 63, 0, -25, 0, 0, 0, 16, 0, -9, 0, 0], [-47, 0, 0, 0, 6, 0, -9, 0, 0, -3, -34, 0, -4, 0, -3, -17], [0, -34, -22, -12, 0, 34, 0, -34, 0, 0, 0, 6, 0, 22, 0, 0], [14, 0, 0, 0, -16, 0, 24, 0, 0, 8, 2, 0, -4, 0, 8, 1], [0, -50, -47, -32, 0, -127, 0, -15, -3, 0, 0, 0, 0, 0, 0, 0], [0, -21, -7, -14, 0, -12, 0, -21, 0, 0, 0, -2, 0, 40, 0, 0], [5, 0, 0, 0, -2, 0, -5, 0, 0, 15, 0, 0, 0, 0, -5, 28], [18, 0, 0, 0, -4, 0, 6, 0, 0, 2, 48, 0, 18, 0, 2, 24], [9, 0, 0, 0, 56, 0, 5, 0, 0, 13, 0, 0, 0, 0, -9, 21], [0, -33, 12, -14, 0, 31, 0, 26, -4, 0, 0, 0, 0, 0, 0, 0], [0, 19, -27, 46, 0, 0, 0, 19, 0, 0, 0, -6, 0, 8, 0, 0], [0, -34, -36, 2, 0, 70, 0, -34, 0, 0, 0, 6, 0, 0, 0, 0], [0, 15, -14, -16, 0, 5, 0, 2, 18, 0, 0, 0, 0, 0, 0, 0], [0, 33, 21, 12, 0, -71, 0, 33, 0, 0, 0, -10, 0, 17, 0, 0], [0, 34, -57, -26, 0, -85, 0, -31, -8, 0, 0, 0, 0, 0, 0, 0], [0, 36, 19, 17, 0, -37, 0, 36, 0, 0, 0, -3, 0, -18, 0, 0], [-5, 0, 0, 0, 136, 0, -11, 0, 0, 1, 0, 0, 0, 0, 5, -33], [2, 0, 0, 0, -72, 0, 2, 0, 0, 2, 0, 0, 0, 0, -2, -50], [0, 45, -9, -14, 0, 46, 0, 5, -10, 0, 0, 0, 0, 0, 0, 0], [34, 0, 0, 0, 8, 0, -12, 0, 0, -4, -12, 0, -40, 0, -4, -6], [0, 71, 33, 26, 0, 118, 0, 7, -22, 0, 0, 0, 0, 0, 0, 0], [-10, 0, 0, 0, 38, 0, 0, 0, 0, -20, 0, 0, 0, 0, 10, -22], [0, 39, -31, 70, 0, -14, 0, 39, 0, 0, 0, 22, 0, 6, 0, 0], [15, 0, 0, 0, -110, 0, 59, 0, 0, -29, 0, 0, 0, 0, -15, 30], [0, 36, 35, 22, 0, 97, 0, 13, 8, 0, 0, 0, 0, 0, 0, 0], [476, 0, 0, 0, 24, 0, -36, 0, 0, -12, 0, 0, 10, 0, -12, 0], [0, 3, -3, 6, 0, 30, 0, 3, 0, 0, 0, -30, 0, -30, 0, 0], [-22, 0, 0, 0, 68, 0, -31, 0, 0, -13, 0, 0, 0, 0, 22, -10], [0, -10, 10, -20, 0, 40, 0, -10, 0, 0, 0, -46, 0, -40, 0, 0], [-145, 0, 0, 0, 18, 0, -27, 0, 0, -9, 52, 0, 16, 0, -9, 26], [0, 35, -20, -46, 0, 67, 0, 26, 16, 0, 0, 0, 0, 0, 0, 0], [-33, 0, 0, 0, -32, 0, 48, 0, 0, 16, -4, 0, -11, 0, 16, -2], [0, 0, 0, 0, 156, 0, -5, 0, 0, 5, 0, 0, 0, 0, 0, 51], [0, 78, -49, -26, 0, -17, 0, -23, 18, 0, 0, 0, 0, 0, 0, 0], [0, 32, 19, -32, 0, 153, 0, 51, 19, 0, 0, 0, 0, 0, 0, 0], [-3, 0, 0, 0, 78, 0, -7, 0, 0, 1, 0, 0, 0, 0, 3, -58], [0, 41, 29, 12, 0, 104, 0, 17, 28, 0, 0, 0, 0, 0, 0, 0], [0, 0, -39, 39, 0, 9, 0, 0, 0, 0, 0, 25, 0, 30, 0, 0], [0, 0, 0, 0, 298, 0, -2, 0, 0, 2, 0, 0, 0, 0, 0, 1], [0, 33, -49, 82, 0, -11, 0, 33, 0, 0, 0, 30, 0, 27, 0, 0], [-55, 0, 0, 0, -10, 0, 15, 0, 0, 5, 26, 0, 52, 0, 5, 13], [-334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 32, 0, 0, 25], [20, 0, 0, 0, -58, 0, 42, 0, 0, -2, 0, 0, 0, 0, -20, -25], [0, 55, 11, 44, 0, -40, 0, 55, 0, 0, 0, 24, 0, -26, 0, 0], [0, -20, -85, -82, 0, -111, 0, -3, 4, 0, 0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 114, 0, 8, 0, 0, 0, 0, 0, 0, 0, -4, 58], [-398, 0, 0, 0, -12, 0, 18, 0, 0, 6, -28, 0, 2, 0, 6, -14], [0, 46, 4, 42, 0, -16, 0, 46, 0, 0, 0, -12, 0, -34, 0, 0], [0, 67, -54, 4, 0, -103, 0, -58, -2, 0, 0, 0, 0, 0, 0, 0], [51, 0, 0, 0, 32, 0, -48, 0, 0, -16, 66, 0, 21, 0, -16, 33], [0, -78, 27, 38, 0, -73, 0, -11, 24, 0, 0, 0, 0, 0, 0, 0], [0, -40, -9, -31, 0, 19, 0, -40, 0, 0, 0, -43, 0, 30, 0, 0], [0, -64, -41, -16, 0, -155, 0, -25, 9, 0, 0, 0, 0, 0, 0, 0], [705, 0, 0, 0, 12, 0, -18, 0, 0, -6, 22, 0, 21, 0, -6, 11], [6, 0, 0, 0, 120, 0, 2, 0, 0, 10, 0, 0, 0, 0, -6, -18], [-366, 0, 0, 0, 0, 0, 0, 0, 0, 0, -28, 0, 20, 0, 0, -14], [-6, 0, 0, 0, -118, 0, -22, 0, 0, 10, 0, 0, 0, 0, 6, 27], [0, -5, 21, -56, 0, 170, 0, 77, -8, 0, 0, 0, 0, 0, 0, 0], [-22, 0, 0, 0, 294, 0, -58, 0, 0, 14, 0, 0, 0, 0, 22, -57], [-10, 0, 0, 0, -40, 0, -12, 0, 0, -8, 0, 0, 0, 0, 10, 22], [0, -56, -1, -66, 0, 73, 0, 65, -10, 0, 0, 0, 0, 0, 0, 0], [-22, 0, 0, 0, -82, 0, -72, 0, 0, 28, 0, 0, 0, 0, 22, 14], [0, 41, 16, 58, 0, -27, 0, -42, -26, 0, 0, 0, 0, 0, 0, 0], [0, -55, -53, -2, 0, 126, 0, -55, 0, 0, 0, -14, 0, -18, 0, 0], [-707, 0, 0, 0, -14, 0, 21, 0, 0, 7, 26, 0, 2, 0, 7, 13], [0, -40, -22, -18, 0, 24, 0, -40, 0, 0, 0, -58, 0, 38, 0, 0], [-257, 0, 0, 0, 40, 0, -60, 0, 0, -20, -28, 0, 17, 0, -20, -14], [-6, 0, 0, 0, -288, 0, -47, 0, 0, 35, 0, 0, 0, 0, 6, 2], [0, 54, -21, -10, 0, 11, 0, -11, 28, 0, 0, 0, 0, 0, 0, 0], [0, 66, 75, -9, 0, -83, 0, 66, 0, 0, 0, -29, 0, -58, 0, 0], [435, 0, 0, 0, -28, 0, 42, 0, 0, 14, 30, 0, -69, 0, 14, 15], [1, 0, 0, 0, 170, 0, 15, 0, 0, -13, 0, 0, 0, 0, -1, -18], [0, 95, -13, -26, 0, 108, 0, 13, 18, 0, 0, 0, 0, 0, 0, 0], [0, -68, -107, 39, 0, 121, 0, -68, 0, 0, 0, 65, 0, 54, 0, 0], [0, -71, -27, -30, 0, -92, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0], [0, -38, -58, 20, 0, 82, 0, -38, 0, 0, 0, -6, 0, 14, 0, 0], [0, -114, 35, 70, 0, -149, 0, -35, -11, 0, 0, 0, 0, 0, 0, 0], [-25, 0, 0, 0, 194, 0, -47, 0, 0, -3, 0, 0, 0, 0, 25, -16], [82, 0, 0, 0, -4, 0, 6, 0, 0, 2, -6, 0, 74, 0, 2, -3], [-19, 0, 0, 0, 340, 0, -25, 0, 0, -13, 0, 0, 0, 0, 19, -7], [0, 29, 27, 2, 0, -48, 0, 29, 0, 0, 0, -22, 0, -8, 0, 0], [28, 0, 0, 0, -260, 0, 37, 0, 0, 19, 0, 0, 0, 0, -28, -32], [0, -63, -36, -2, 0, -167, 0, -34, 38, 0, 0, 0, 0, 0, 0, 0], [0, 19, -83, 102, 0, -1, 0, 19, 0, 0, 0, 48, 0, 65, 0, 0], [-10, 0, 0, 0, 460, 0, -9, 0, 0, -11, 0, 0, 0, 0, 10, 9], [0, -32, 11, -43, 0, 19, 0, -32, 0, 0, 0, 5, 0, 2, 0, 0], [0, -48, -67, -26, 0, -197, 0, -41, -29, 0, 0, 0, 0, 0, 0, 0], [433, 0, 0, 0, 16, 0, -24, 0, 0, -8, -16, 0, 63, 0, -8, -8]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_960_l_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_960_3_l_j();".
// 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_960_3_l_j(:prec:=16)
    chi := MakeCharacter_960_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(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_960_3_l_j();".
// 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_960_3_l_j( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_960_l();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<7,R![576, 0, -1504, 0, 1076, 0, -164, 0, 1]>],Snew);
    return Vf;
end function;