diff --git a/experimental/GModule/AlgClosureFp.jl b/experimental/GModule/AlgClosureFp.jl index d8585b125301..1b81f3761a13 100644 --- a/experimental/GModule/AlgClosureFp.jl +++ b/experimental/GModule/AlgClosureFp.jl @@ -113,7 +113,7 @@ function Oscar.roots(a::AlgClosureElem, b::Int) d = mapreduce(degree, lcm, keys(lf.fac), init = 1) d = lcm(d, degree(parent(ad))) K = ext_of_degree(parent(a), d) - r = roots(f, K) + r = roots(K, f) return [AlgClosureElem(x, parent(a)) for x = r] end @@ -126,7 +126,7 @@ function Oscar.roots(a::Generic.Poly{AlgClosureElem{T}}) where T d = mapreduce(degree, lcm, keys(lf.fac), init = 1) d = lcm(d, degree(parent(b[1]))) K = ext_of_degree(A, d) - r = roots(f, K) + r = roots(K, f) return [AlgClosureElem(x, A) for x = r] end diff --git a/experimental/GModule/Misc.jl b/experimental/GModule/Misc.jl index bbb636ee115c..27c4b1a73c2d 100644 --- a/experimental/GModule/Misc.jl +++ b/experimental/GModule/Misc.jl @@ -19,7 +19,7 @@ function Hecke.number_field(::QQField, a::qqbar; cached::Bool = false) return b end f = minpoly(x) - r = roots(f, k) + r = roots(k, f) pr = 10 while true C = AcbField(pr) diff --git a/src/AlgebraicGeometry/Surfaces/K3Auto.jl b/src/AlgebraicGeometry/Surfaces/K3Auto.jl index 944672d319fe..830744f59a66 100644 --- a/src/AlgebraicGeometry/Surfaces/K3Auto.jl +++ b/src/AlgebraicGeometry/Surfaces/K3Auto.jl @@ -1928,7 +1928,7 @@ function ample_class(S::ZZLat) else rv = (r*gram_matrix(S)*transpose(v))[1,1] p = x^2*vsq + 2*x*rv + rsq - rp = roots(p, CalciumQQBar) + rp = roots(CalciumQQBar, p) a = rp[1] b = rp[2] if a > b diff --git a/src/NumberTheory/GaloisGrp/GaloisGrp.jl b/src/NumberTheory/GaloisGrp/GaloisGrp.jl index 36e73362dbd5..2f3b367996d7 100644 --- a/src/NumberTheory/GaloisGrp/GaloisGrp.jl +++ b/src/NumberTheory/GaloisGrp/GaloisGrp.jl @@ -476,7 +476,7 @@ mutable struct ComplexRootCtx rt::Vector{acb} function ComplexRootCtx(f::ZZPolyRingElem) @assert ismonic(f) - rt = roots(f, AcbField(20)) + rt = roots(AcbField(20), f) return new(f, 20, rt) end function ComplexRootCtx(f::QQPolyRingElem) @@ -492,7 +492,7 @@ function Hecke.roots(C::GaloisCtx{ComplexRootCtx}, pr::Int = 10; raw::Bool = fal if C.C.pr >= pr return C.C.rt end - rt = roots(C.C.f, AcbField(pr)) + rt = roots(AcbField(pr), C.C.f) C.C.pr = pr n = length(rt) for i=1:n @@ -580,7 +580,7 @@ function Nemo.roots_upper_bound(f::ZZMPolyRingElem, t::Int = 0) F = evaluate(f, [x, Qsx(s)]) dis = numerator(discriminant(F)) @assert !iszero(dis(t)) - rt = roots(dis, AcbField(20)) + rt = roots(AcbField(20), dis) r = Hecke.lower_bound(minimum([abs(x-t) for x = rt]), ZZRingElem) @assert r > 0 ff = map_coefficients(abs, f) @@ -1664,13 +1664,13 @@ If `prime` is given, no search is performed. function find_prime(f::QQPolyRingElem, extra::Int = 5; prime::Int = 0, pStart::Int = 2*degree(f), filter_prime = x->true, filter_pattern = x->true) if prime != 0 p = prime - lf = factor(f, GF(p)) + lf = factor(GF(p), f) return p, Set([CycleType(map(degree, collect(keys(lf.fac))))]) end if pStart < 0 error("should no longer happen") p = -pStart - lf = factor(f, GF(p)) + lf = factor(GF(p), f) return p, Set([CycleType(map(degree, collect(keys(lf.fac))))]) end @@ -1693,7 +1693,7 @@ function find_prime(f::QQPolyRingElem, extra::Int = 5; prime::Int = 0, pStart::I if k(leading_coefficient(f)) == 0 continue end - lf = factor(f, GF(p)) + lf = factor(GF(p), f) if any(x->x>1, values(lf.fac)) continue end @@ -2466,7 +2466,7 @@ ideal(x4^4 - 2, x3^3 + x3^2*x4 + x3*x4^2 + x4^3, x2^2 + x2*x3 + x2*x4 + x3^2 + x julia> k, _ = number_field(i); -julia> length(roots(x^4-2, k)) +julia> length(roots(k, x^4-2)) 4 ``` @@ -2532,7 +2532,7 @@ function galois_ideal(C::GaloisCtx, extra::Int = 5) push!(id, sum(evaluate(I^length(h), x) for I = PE) - v) end h = Hecke.power_sums_to_polynomial(h) - q = roots(h, number_field(C.f)[1]) + q = roots(number_field(C.f)[1], h) @assert length(q) > 0 q = parent(defining_polynomial(parent(q[1])))(q[1]) #TODO: think h(q(y)) is probably boring, while q(y) == pe might be diff --git a/src/NumberTheory/GaloisGrp/Qt.jl b/src/NumberTheory/GaloisGrp/Qt.jl index 53701b2840c0..dd75c87180e5 100644 --- a/src/NumberTheory/GaloisGrp/Qt.jl +++ b/src/NumberTheory/GaloisGrp/Qt.jl @@ -118,7 +118,7 @@ function _subfields(FF::Generic.FunctionField, f::ZZMPolyRingElem; tStart::Int = @vprint :Subfields 2 "for $f\n" d = numerator(discriminant(FF)) - rt = roots(d, AcbField(20)) + rt = roots(AcbField(20), d) t = tStart local g::ZZPolyRingElem while true @@ -140,7 +140,7 @@ function _subfields(FF::Generic.FunctionField, f::ZZMPolyRingElem; tStart::Int = @vprint :Subfields 2 "now looking for a nice prime...\n" p, _ = find_prime(defining_polynomial(K), pStart = 200) - d = lcm(map(degree, collect(keys(factor(g, GF(p)).fac)))) + d = lcm(map(degree, collect(keys(factor(GF(p), g).fac)))) @assert evaluate(evaluate(f, [X, T+t]), [gen(Zx), zero(Zx)]) == g diff --git a/test/NumberTheory/galthy.jl b/test/NumberTheory/galthy.jl index a5926a89974e..8c451453cc3f 100644 --- a/test/NumberTheory/galthy.jl +++ b/test/NumberTheory/galthy.jl @@ -8,7 +8,7 @@ U = trivial_subgroup(G)[1] L = fixed_field(C, U) @test degree(L) == order(G) - @test length(roots(k.pol, L)) == 5 + @test length(roots(L, k.pol)) == 5 R, x = polynomial_ring(QQ, "x") pol = x^6 - 366*x^4 - 878*x^3 + 4329*x^2 + 14874*x + 10471