
// Make newform 105.3.o.a in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_105_o();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_105_o_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_105_3_o_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_105_3_o_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 := [1521, -10764, 41016, -96348, 148342, -152724, 103092, -41348, 6266, 1492, -88, -524, 162, 12, -4, -4, 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], [29387553354, -166399335570, 492147526380, -857050300178, 898049014875, -538089884310, 138561264022, 20977752170, -13893531470, -5440348978, 3374884060, 155658870, -201080763, -57698230, 19217450, 1282138], [-29454867221481, 117682690173798, -196224803262363, 51902331774725, 247141137866943, -345522051469818, 178644540686345, -15339757529897, -16797143566483, 609707566390, 3186101541443, -405935897763, -208584356535, -9615662912, 19734882097, -945353839], [36969480533544, -162853890704445, 432096143403529, -685350454209814, 632861897955195, -280505779827521, -15627298002614, 65976864749420, -11285354004386, -9264008158129, 2148166140275, 1133812525284, -206978139649, -110020669305, 5815573694, 6799338422], [10360850614686, -12117424237953, 32060282480337, -89523726958339, 80707484425902, 17387330869812, -79779869477764, 52540277384872, -6603544904488, -5532154780559, 730190682377, 982921499997, -161040415944, -79452033908, -489734378, 6939940550], [26162339620443, -200992392789411, 705130916855266, -1379621746034317, 1642118210452914, -1192570494771599, 473690676980758, -51676379354911, -25080362663489, -814254572587, 6905401670414, -1466326909149, -254360686162, 10808846529, 47901289016, -8517854635], [-31317616718193, 158881305502329, -386333932086932, 499088374704863, -287786946129621, -64996936610357, 199436126741848, -101554428867421, 2213398877473, 11668264098683, 129659506964, -1940234326557, 123632263943, 138130967169, 11841164258, -10954917349], [-1451250345714, 5486210722353, -8129675739049, 13481470583671, -29789710852077, 44710115365661, -36953946144364, 14179299874903, -14364679084, -1376673058709, -172395647507, 286447821441, -13603646729, -17809640997, -2653967414, 1683778105], [-169644585825, 1074418113927, -3732355604436, 7427499314864, -8909194143438, 6496113860289, -2630197201531, 345132534322, 115013085509, -1337656541, -34540664458, 9206342304, 925377984, -186701243, -247088261, 58793534], [-5795645027601, 35732535181197, -121253930827751, 239544740552129, -288215409944898, 212751901268509, -88386086837336, 12657496029497, 3717296483509, -205259572141, -1131332511223, 327126906459, 29044383254, -7910711853, -8267524636, 2053516175], [33091548064380, -247428058699014, 910012532192418, -1800341639918254, 2135855292432891, -1566177154674402, 663696947741006, -105149224552934, -26385199034992, 3165045634846, 8348914959986, -2680722251562, -224596420089, 74366831386, 64536858778, -15731411194], [209664117, -1466540094, 6793325772, -18935670938, 30360602271, -28706014158, 15191883352, -3201338854, -621978803, 220205102, 173697436, -71847798, -4855143, 2812046, 1397252, -394610], [-550491674226, 7264577187093, -38369553659586, 123536409068243, -228244343991577, 248666737552669, -155963493715472, 45084588651418, 3210138065694, -3836441442682, -1256911149637, 954757786289, -5680074782, -51058434102, -12683893446, 5555945704], [9989689919079, -93916582841499, 404857061994299, -1077064039952387, 1759996937587836, -1766588211189121, 1038716795984663, -278639362190279, -25378266515371, 22425615715333, 9176128816621, -5998145503491, -35455767722, 303155003931, 87110547559, -34807975271], [-41746013359011, 248779837958034, -827380101175731, 1862429268634547, -2696309558207121, 2454306807909024, -1303927051609243, 294321980014789, 45252236888369, -20653048094978, -13918910002351, 6550796205339, 286708401207, -278878852346, -117279863141, 37024534763], [128382868343808, -828557161276569, 2778386358592989, -5513797579347700, 6874644775014066, -5413835800346586, 2494464102157640, -456657473810939, -96167078872606, 22220875870225, 29737319342261, -10928412057036, -753064240620, 369876667756, 235645881604, -62968587943]];
    Rf_basisdens := [1, 3843901530, 2648448154170, 2648448154170, 2648448154170, 2648448154170, 2648448154170, 378349736310, 11081373030, 378349736310, 2648448154170, 32307210, 441408025695, 2648448154170, 2648448154170, 2648448154170];
    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_105_o();"
function MakeCharacter_105_o()
    N := 105;
    order := 6;
    char_gens := [71, 22, 31];
    v := [3, 3, 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_105_o_Hecke();"
function MakeCharacter_105_o_Hecke(Kf)
    N := 105;
    order := 6;
    char_gens := [71, 22, 31];
    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], [0, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0], [0, 0, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, -1], [0, 0, 0, 0, 0, 2, 0, 1, 0, 3, 0, 0, 0, -1, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 3, 0, 1, -1], [0, 0, 0, 0, 0, 0, 0, -8, 0, -3, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2], [0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0], [0, 0, 4, 0, 4, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4], [0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0], [43, 43, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, -6, 0, 0], [0, 0, -1, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, -1, 0], [0, 0, 0, 0, 0, 0, 0, -17, 0, -16, 0, 0, 0, 0, 0, 0], [0, 0, -1, 0, -1, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, -1], [0, 0, 0, 12, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6, -6], [0, 0, 0, 0, -8, 0, 0, 0, -31, 0, 0, 0, -31, 0, -8, 8], [0, 49, 0, 0, 0, 0, 0, 0, 0, 0, -5, -5, 0, 0, 0, 0], [0, 0, 0, 0, 0, 26, 0, -26, 0, -13, 0, 0, 0, 13, 0, 0], [0, 0, -2, 0, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, -2, 0], [0, 0, 0, 0, 0, -37, 0, 37, 0, 4, 0, 0, 0, -4, 0, 0], [0, -76, 0, 0, 0, 0, 0, 0, 0, 0, -3, -3, 0, 0, 0, 0], [0, 0, -14, -29, 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 14, 0], [0, 0, 11, 0, -11, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 11], [0, 0, 0, 0, 0, 0, 0, -5, 0, -1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 6, 0, 0, 0, -45, 0, 0, 0, -45, 0, 6, -6], [0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0, -62, 0, 0], [0, 0, 21, 0, 21, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 21], [26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0], [0, 0, 0, -6, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -16, 0, 85, 0, 0, 0, 0, 0, 0], [0, 0, 29, 0, -29, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 29], [0, 0, 0, 9, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21], [64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0], [0, 0, -19, 0, 19, 0, 0, 0, 0, 0, 0, 0, -56, 0, 0, -19], [-209, -209, 0, 0, 0, 0, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -36, 0, 36, 0, -90, 0, 0, 0, 90, 0, 0], [0, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0, 0, 0, -58, 0, 0], [0, 0, -25, -3, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 25, 0], [0, 0, -3, 0, -3, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, -3], [0, 0, 0, 0, 36, 0, 0, 0, -4, 0, 0, 0, -4, 0, 36, -36], [-78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0], [0, 0, 26, 0, -26, 0, 0, 0, 0, 0, 0, 0, -90, 0, 0, 26], [0, 0, 0, 0, 0, 99, 0, -99, 0, -8, 0, 0, 0, 8, 0, 0], [0, 0, -11, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 11, 0], [-79, -79, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 24, 0, 30, 0, 0, 0, 0, 0, 0], [0, 0, 0, 13, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19], [0, -71, 0, 0, 0, 0, 0, 0, 0, 0, -60, -60, 0, 0, 0, 0], [0, 0, 9, 0, 9, 0, -68, 0, 0, 0, 0, 0, 0, 0, 0, 9], [0, 0, 61, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 61, 0], [-19, -19, 0, 0, 0, 0, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0], [0, 0, -15, 0, 0, 0, 0, 0, -51, 0, 0, 0, 0, 0, -15, 0], [0, 0, 15, 0, 15, 0, -67, 0, 0, 0, 0, 0, 0, 0, 0, 15], [0, 0, 0, -102, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, -9], [0, 0, 0, 0, 23, 0, 0, 0, 38, 0, 0, 0, 38, 0, 23, -23], [0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0], [0, 0, 0, 0, 0, -81, 0, 81, 0, 70, 0, 0, 0, -70, 0, 0], [0, 0, 43, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 43, 0], [0, 0, 0, 0, 0, -41, 0, 41, 0, 100, 0, 0, 0, -100, 0, 0], [0, 0, 7, 48, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, -7, 0], [0, 0, 0, 0, 0, 0, 0, -76, 0, 3, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -48, 0, 0, 0, 57, 0, 0, 0, 57, 0, -48, 48], [0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0], [0, 0, -8, 0, -8, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, -8], [0, 489, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 110, 0, 197, 0, 0, 0, 0, 0, 0], [0, 0, 0, -54, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 28], [-298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0], [0, 0, 0, 119, -67, 0, 0, 0, 0, 0, 0, 0, 0, 0, -67, -67], [0, 0, -6, 0, 6, 0, 0, 0, 0, 0, 0, 0, 121, 0, 0, -6], [0, 0, 0, 0, 0, -88, 0, 88, 0, -95, 0, 0, 0, 95, 0, 0], [0, 0, 0, 0, 0, -92, 0, 0, 0, 0, 0, 0, 0, 73, 0, 0], [169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0], [0, 0, -34, 0, -34, 0, 262, 0, 0, 0, 0, 0, 0, 0, 0, -34], [0, 0, 0, 0, -84, 0, 0, 0, 43, 0, 0, 0, 43, 0, -84, 84], [0, 0, 0, 0, 0, -149, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0], [0, 0, -66, 0, 66, 0, 0, 0, 0, 0, 0, 0, -18, 0, 0, -66], [71, 71, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0], [0, 0, 2, 0, 0, 0, 0, 0, 102, 0, 0, 0, 0, 0, 2, 0], [84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 0, 0], [0, 0, 0, 0, -55, 0, 0, 0, 52, 0, 0, 0, 52, 0, -55, 55], [0, 0, 0, 0, 0, 0, 0, -130, 0, -33, 0, 0, 0, 0, 0, 0], [0, 249, 0, 0, 0, 0, 0, 0, 0, 0, -107, -107, 0, 0, 0, 0], [0, 0, 85, 0, 85, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 85], [0, 0, -108, 0, 0, 0, 0, 0, -146, 0, 0, 0, 0, 0, -108, 0], [0, 0, 0, 0, 0, -208, 0, 0, 0, 0, 0, 0, 0, -191, 0, 0], [0, 0, 99, 0, 0, 0, 0, 0, 135, 0, 0, 0, 0, 0, 99, 0], [0, 0, 0, 0, 0, 0, 0, 24, 0, 135, 0, 0, 0, 0, 0, 0], [0, 0, -22, 0, -22, 0, -138, 0, 0, 0, 0, 0, 0, 0, 0, -22], [0, 0, 0, 0, -51, 0, 0, 0, -12, 0, 0, 0, -12, 0, -51, 51], [0, 0, 0, 0, 0, 100, 0, -100, 0, 143, 0, 0, 0, -143, 0, 0], [0, 0, 17, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 17, 0], [0, -331, 0, 0, 0, 0, 0, 0, 0, 0, 154, 154, 0, 0, 0, 0], [0, 0, -24, -132, 0, 0, -132, 0, 0, 0, 0, 0, 0, 0, 24, 0], [0, 0, 20, 0, -20, 0, 0, 0, 0, 0, 0, 0, 138, 0, 0, 20], [0, 0, 0, 0, -12, 0, 0, 0, -88, 0, 0, 0, -88, 0, -12, 12], [0, 0, 0, 0, 0, -162, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0], [0, -231, 0, 0, 0, 0, 0, 0, 0, 0, -44, -44, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 42, 0, 140, 0, 0, 0, 0, 0, 0], [0, 0, 0, -20, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23], [0, 0, 0, -270, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 46], [0, 0, 15, 0, -15, 0, 0, 0, 0, 0, 0, 0, 219, 0, 0, 15], [6, 6, 0, 0, 0, 0, 0, 0, 0, 0, -163, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -212, 0, 212, 0, 291, 0, 0, 0, -291, 0, 0], [0, 0, 109, 15, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, -109, 0], [0, 0, -31, 0, -31, 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, -31], [0, 0, 0, 0, 49, 0, 0, 0, 176, 0, 0, 0, 176, 0, 49, -49], [424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 155, 0, 0], [0, 0, 0, 0, 0, -345, 0, 345, 0, -167, 0, 0, 0, 167, 0, 0], [0, 0, 94, 244, 0, 0, 244, 0, 0, 0, 0, 0, 0, 0, -94, 0], [373, 373, 0, 0, 0, 0, 0, 0, 0, 0, -48, 0, 0, 0, 0, 0], [-926, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0], [0, 0, 0, 0, 115, 0, 0, 0, -413, 0, 0, 0, -413, 0, 115, -115], [0, 0, 0, 0, 0, 0, 0, 250, 0, -111, 0, 0, 0, 0, 0, 0], [0, 0, 0, -145, -71, 0, 0, 0, 0, 0, 0, 0, 0, 0, -71, -71], [0, 0, -12, 0, -12, 0, 191, 0, 0, 0, 0, 0, 0, 0, 0, -12], [0, 0, -44, 0, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, -44, 0], [-384, -384, 0, 0, 0, 0, 0, 0, 0, 0, -103, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 272, 0, 137, 0, 0, 0, 0, 0, 0], [0, 0, 118, 0, 118, 0, -173, 0, 0, 0, 0, 0, 0, 0, 0, 118], [0, 0, 0, 307, -99, 0, 0, 0, 0, 0, 0, 0, 0, 0, -99, -99], [0, 49, 0, 0, 0, 0, 0, 0, 0, 0, -166, -166, 0, 0, 0, 0], [0, 0, 9, 0, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 9, 0], [0, 19, 0, 0, 0, 0, 0, 0, 0, 0, -21, -21, 0, 0, 0, 0], [0, 0, 15, 0, -15, 0, 0, 0, 0, 0, 0, 0, -258, 0, 0, 15], [0, 0, 0, 0, 0, 0, 0, 393, 0, 206, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -192, 0, 0, 0, 0, 0, 0, 0, -197, 0, 0], [346, 346, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0], [0, 0, -11, -337, 0, 0, -337, 0, 0, 0, 0, 0, 0, 0, 11, 0], [0, 729, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -220, 0, -86, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, 0, 0, 0], [-558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -87, 0, 0, 0, 0], [0, 0, 0, -99, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26], [0, 0, 0, 0, 0, 288, 0, -288, 0, -236, 0, 0, 0, 236, 0, 0], [0, 0, -69, -277, 0, 0, -277, 0, 0, 0, 0, 0, 0, 0, 69, 0], [0, 0, 0, 0, -21, 0, 0, 0, -426, 0, 0, 0, -426, 0, -21, 21], [649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 0, 0, 0, 0], [0, 0, -17, 0, 17, 0, 0, 0, 0, 0, 0, 0, -277, 0, 0, -17], [0, 0, 0, 0, 0, -65, 0, 65, 0, 1, 0, 0, 0, -1, 0, 0], [0, 0, -103, 30, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 103, 0], [-564, -564, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0], [0, 0, -162, 0, 0, 0, 0, 0, -135, 0, 0, 0, 0, 0, -162, 0], [0, 0, 0, 0, 0, 0, 0, -107, 0, -356, 0, 0, 0, 0, 0, 0], [0, 0, 0, 123, -187, 0, 0, 0, 0, 0, 0, 0, 0, 0, -187, -187], [0, 677, 0, 0, 0, 0, 0, 0, 0, 0, 137, 137, 0, 0, 0, 0], [0, 0, -203, 0, -203, 0, -300, 0, 0, 0, 0, 0, 0, 0, 0, -203], [0, 0, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 488, 0, 0], [0, 0, -199, 0, 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, -199, 0], [0, 0, 0, 0, 0, 0, 0, -541, 0, 260, 0, 0, 0, 0, 0, 0], [0, 0, -127, 0, -127, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, -127], [0, 0, 0, 0, 0, -167, 0, 167, 0, 454, 0, 0, 0, -454, 0, 0], [0, 0, 55, 0, 0, 0, 0, 0, -303, 0, 0, 0, 0, 0, 55, 0], [0, -1363, 0, 0, 0, 0, 0, 0, 0, 0, 38, 38, 0, 0, 0, 0], [0, 0, 97, 0, -97, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 97], [0, 0, 0, 0, 0, 0, 0, -411, 0, 398, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 136, 0, 0, 0, 369, 0, 0, 0, 369, 0, 136, -136], [0, 0, 107, 0, 107, 0, -117, 0, 0, 0, 0, 0, 0, 0, 0, 107], [0, 0, 96, -336, 0, 0, -336, 0, 0, 0, 0, 0, 0, 0, -96, 0], [0, 0, 0, 0, 0, 0, 0, 357, 0, -518, 0, 0, 0, 0, 0, 0], [0, 0, 117, 0, -117, 0, 0, 0, 0, 0, 0, 0, -490, 0, 0, 117], [0, 0, 0, -261, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 120], [0, 0, 0, 69, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 117], [-202, -202, 0, 0, 0, 0, 0, 0, 0, 0, 157, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -67, 0, 67, 0, 374, 0, 0, 0, -374, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_105_o_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_105_3_o_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_105_3_o_a(:prec:=16)
    chi := MakeCharacter_105_o();
    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_105_3_o_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_105_3_o_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_105_o();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<2,R![100, 0, 100, 0, 90, 0, 10, 0, 1]>],Snew);
    return Vf;
end function;