
// Make newform 380.2.r.a in Magma, downloaded from the LMFDB on 16 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_380_r();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_380_r_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_380_2_r_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_380_2_r_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 := [4096, 0, -24768, 0, 124617, 0, -134299, 0, 99376, 0, -39211, 0, 11074, 0, -1994, 0, 261, 0, -20, 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], [63024290250218436, 0, 2170497176992320, 0, -10869496174421115, 0, 16741977055075822, 0, -7266718287702885, 0, 2323089270554580, 0, -438571056316700, 0, 61286511972345, 0, -4826223210105, 0, 257269301703, 0], [-238859269757341696, 0, 6579414048167166051, 0, -6768804320649661609, 0, 5336438184716201168, 0, -2140435717198619993, 0, 618424582627382742, 0, -112486124646259822, 0, 14928136974663543, 0, -1151122140944668, 0, 58379368812683, 0], [-250780428775971323584, 0, 1259578493369127028273, 0, -1468016942861277361043, 0, 944354362189538749232, 0, -349276396009867994211, 0, 89902370458361971154, 0, -15323421807441242074, 0, 1868654652948801741, 0, -137623959156754484, 0, 6366481800502185, 0], [-4955504751551263591, 0, -941318257748307968, 0, 4713968444633542976, 0, -6782358791543175575, 0, 3151487442894034624, 0, -1007495594987342592, 0, 192433368253136232, 0, -26579215713710528, 0, 2093074375676352, 0, -108802723986440, 0], [-2918597117977935675, 0, -1075543988176763520, 0, 5386149030199971390, 0, -7533337923107099056, 0, 3600868617089492610, 0, -1151157774093599880, 0, 220945270298193633, 0, -30369235310188170, 0, 2391532877467530, 0, -123113231093090, 0], [224153346284272802752, 182780307164276557072, -1127871072781709528461, 734808564190512128, 1230925670964922837447, -3679801550568386096, -901408307418290504720, 10217679424117915920, 356441852003984207511, -2460103098942103504, -100804631860325583978, 786467685596365632, 18206740636302532114, -126231930067659184, -2387658497653929081, 20748174355631888, 183358087220694436, -1633888394360592, -9174325379691717, 112685518955184], [224153346284272802752, -182780307164276557072, -1127871072781709528461, -734808564190512128, 1230925670964922837447, 3679801550568386096, -901408307418290504720, -10217679424117915920, 356441852003984207511, 2460103098942103504, -100804631860325583978, -786467685596365632, 18206740636302532114, 126231930067659184, -2387658497653929081, -20748174355631888, 183358087220694436, 1633888394360592, -9174325379691717, -112685518955184], [0, 22508069497503397645, 0, 1236926030594408384, 0, -6194324001019140413, 0, 9657228077683790013, 0, -4141167794335228387, 0, 1323885430768152396, 0, -247970499250483465, 0, 34926044957117039, 0, -2750374974599151, 0, 149437719142871], [-1247247913760836672, 0, 6277643813918368339, 0, -6594892381858923769, 0, 5068566551834988016, 0, -2024168224595373833, 0, 581255154298509462, 0, -105468987745192622, 0, 13947552783106023, 0, -1073902569582988, 0, 54263059985435, 0], [0, -238859269757341696, 0, 6579414048167166051, 0, -6768804320649661609, 0, 5336438184716201168, 0, -2140435717198619993, 0, 618424582627382742, 0, -112486124646259822, 0, 14928136974663543, 0, -1151122140944668, 0, 58379368812683], [-91430995209659510784, 0, 2114820325419353216181, 0, -2590582498362261966815, 0, 2040723648133655490800, 0, -823296813298088269295, 0, 235405967494108868890, 0, -42637019206442019714, 0, 5597440381244918081, 0, -429531870127860356, 0, 21472706330772813, 0], [709395219183111220992, -166218017713291595776, 76224031701280088064, 4520388542025619161715, -381717529862951442048, -4710527327865639831641, 577191879275290897152, 3714706244185375280592, -255194326441686202752, -1487157977486890963977, 81582796826776290816, 431134182000265878518, -15365184231760305024, -78527538519393341710, 2152274179832962944, 10458402250723591943, -169488444796903296, -807651770702036060, 9113271949323008, 41145391020481691], [187218165953979990016, -897339246370397824064, -4587708322828118201908, 4517449307768857113203, 5305420213722642791836, -4695808121663366287257, -4182825108948452916032, 3673835526488903616912, 1680961734457623032796, -1477317565091122549961, -484801324268078626728, 427988311257880415990, 88192146776970433480, -78022610799122704974, -11702908170448679268, 10375409553301064391, 902920793679681040, -801116217124593692, -45810573468089876, 40694648944660955], [0, -15112667902972457477, 0, -3027711475567210304, 0, 15162285696465178103, 0, -21944735732755401673, 0, 10136629792755534697, 0, -3240568160043291876, 0, 617058244498298531, 0, -85490954590084109, 0, 6732287676656781, 0, -352957477246353], [0, 31115827382409820137, 0, 3388014006947935424, 0, -16966622061419083193, 0, 24723903923897988125, 0, -11342905028514213607, 0, 3626200978955352156, 0, -689861039846870731, 0, 95664515577493379, 0, -7533440729534211, 0, 395664181329051], [0, -353436183667271585792, 0, 9108096864853737363623, 0, -10015947541588282623477, 0, 7897531353133828196624, 0, -3168119711944513996773, 0, 915935506268344505246, 0, -166719685296363775190, 0, 22161310421172271211, 0, -1710572564381717100, 0, 86955964488571567], [0, -1250374162009682137408, 0, 6287552361196403142031, 0, -7052914632463443149421, 0, 4916800551459821697744, 0, -1902277734940496224477, 0, 522399676445550876270, 0, -92792312405128286118, 0, 11924107064037836787, 0, -905638902720961484, 0, 44403267011197975], [0, 2512480201371985676864, 0, -12640273317629698848059, 0, 13679166208473456186225, 0, -10054026219204032528144, 0, 3956950094181766287265, 0, -1113670060332052229382, 0, 200169113650494448030, 0, -26141423587608532335, 0, 2000882759717695292, 0, -99815889287337571]];
    Rf_basisdens := [1, 1, 16690142463557537, 1068169117667682368, 88658036766417636544, 1385281824475275571, 1385281824475275571, 88658036766417636544, 88658036766417636544, 5541127297901102284, 267042279416920592, 1068169117667682368, 88658036766417636544, 354632147065670546176, 354632147065670546176, 2770563648950551142, 2770563648950551142, 354632147065670546176, 177316073532835273088, 177316073532835273088];
    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_380_r();"
function MakeCharacter_380_r()
    N := 380;
    order := 6;
    char_gens := [191, 77, 21];
    v := [6, 3, 4];
    // 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_380_r_Hecke();"
function MakeCharacter_380_r_Hecke(Kf)
    N := 380;
    order := 6;
    char_gens := [191, 77, 21];
    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, 1, 0, 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 := 2;
    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, -1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1, 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, 1, 0, 0, -1, 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, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 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5, 0, -8, -8, 0, 3, 0, -5, 0, 0, 0, 0, 0, 0, 0], [-3, 0, -1, 0, 0, 9, -5, 0, -4, 0, 0, 0, 0, -4, 4, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, -5, 0, -3, -3, 0, 4, -3, 0, -4], [0, -2, 0, 0, 0, 0, 0, 4, 0, -8, 0, 2, 0, -4, -4, 0, 0, 8, -3, -7], [0, -5, 0, 0, 0, 0, 0, 4, -4, 3, 0, 0, 0, 0, 0, 2, 6, 0, 0, 0], [-11, 0, -5, 0, 0, -5, 2, 0, -2, 0, 0, 0, 0, -2, 2, 0, 0, 0, 0, 0], [-1, 0, 0, 1, -3, -1, 0, -3, -3, 0, 3, 0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 2, 15, -3, 0, 3, -2, 0, 0, 2, 0, -1, 2, -2, 0, 0, 0, 0, 0], [0, -5, 0, 0, 0, 0, 0, 1, 0, 1, 0, 5, 0, -1, -1, 0, 0, -1, -6, -1], [0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 2, 0, 2, 2, 0, 2, -1, 0, -2], [0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 1, -3, 3, -3, 3, -3], [-16, 0, 0, 16, -5, 3, 0, -1, -1, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0], [-4, 0, 0, 4, 2, -5, 0, 6, 6, 0, 7, 0, -5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, -9, 0, 7, 7, -6, 0, 0, 6, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 1, 1, 0, -1, -1], [0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 4, 0, -5, -5, 7, 3, 5, -7, -3], [4, 0, -3, 0, 0, -5, 6, 0, -3, 0, 0, 0, 0, -3, 3, 0, 0, 0, 0, 0], [0, 0, 7, -3, -2,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0, 0, -3, 3, 5, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0], [0, -6, 0, 0, 0, 0, 0, 4, -4, -5, 0, 0, 0, 0, 0, -5, 7, 0, 0, 0], [1, 0, -11, 0, 0, -2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -7, -6, -4, 0, 4, 2, 0, 0, -7, 0, 2, -2, 2, 0, 0, 0, 0, 0], [0, -6, 0, 0, 0, 0, 0, 2, 0, -8, 0, 6, 0, -2, -2, 0, 0, 8, 1, 7], [0, 3, 0, 0, 0, 0, 0, 3, 0, -1, 0, -3, 0, -3, -3, 0, 0, 1, 8, -7], [-12, 0, 0, 12, 0, -1, 0, -5, -5, 0, -2, 0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, -7, 0, -2, -2, 5, -3, -2, -5, 3], [0, -7, 0, 0, 0, 0, 0, 1, 0, -5, 0, 7, 0, -1, -1, 0, 0, 5, 0, -3], [-1, 0, -3, 0, 0, -5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, -9, 9, -2, 0, 0, 0, 0, 0, 3, -1, 0, 0, 0], [0, -14, 0, 0, 0, 0, 0, -2, 2, 2, 0, 0, 0, 0, 0, -2, 3, 0, 0, 0], [0, 4, 0, 0, 0, 0, 0, 1, 0, -4, 0, -4, 0, -1, -1, 0, 0, 4, 4, -6], [29, 0, -6, 0, 0, -2, -2, 0, 5, 0, 0, 0, 0, 5, -5, 0, 0, 0, 0, 0], [11, 0, -8, 0, 0, -3, 0, 0, 11, 0, 0, 0, 0, 11, -11, 0, 0, 0, 0, 0], [0, 0, 8, 8, -8, 0, 8, 5, 0, 0, 8, 0, 1, -5, 5, 0, 0, 0, 0, 0], [0, 4, 0, 0, 0, 0, 0, 8, -8, -2, 0, 0, 0, 0, 0, -6, 5, 0, 0, 0], [-3, 0, 0, 3, 1, -7, 0, 7, 7, 0, 5, 0, -7, 0, 0, 0, 0, 0, 0, 0], [0, 7, 0, 0, 0, 0, 0, 4, 0, 3, 0, -7, 0, -4, -4, 0, 0, -3, -1, 4], [0, 7, 0, 0, 0, 0, 0, 0, 0, -8, 0, -7, 0, 0, 0, 0, 0, 8, 0, 2], [0, 9, 0, 0, 0, 0, 0, 3, 0, -5, 0, -9, 0, -3, -3, 0, 0, 5, 5, 1], [0, 0, -8, 3, 2, 0, -2, -4, 0, 0, -8, 0, -5, 4, -4, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 1, 1, 3, -8, -1, -3], [0, -1, 0, 0, 0, 0, 0, 1, 0, -4, 0, 1, 0, -1, -1, 0, 0, 4, 9, -3], [0, 0, 14, 0, -4, 0, 4, 1, 0, 0, 14, 0, 2, -1, 1, 0, 0, 0, 0, 0], [0, -2, 0, 0, 0, 0, 0, -4, 4, -3, 0, 0, 0, 0, 0, -4, -5, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_380_r_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_380_2_r_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_380_2_r_a(:prec:=20)
    chi := MakeCharacter_380_r();
    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_380_2_r_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_380_2_r_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_380_r();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;