Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust to changes in AA and Nemo #1236

Merged
merged 5 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ GAPExt = "GAP"
PolymakeExt = "Polymake"

[compat]
AbstractAlgebra = "^0.32.1"
AbstractAlgebra = "^0.33.0"
GAP = "0.9.6"
Nemo = "^0.36.1"
Nemo = "^0.37.0"
Polymake = "0.10, 0.11"
RandomExtensions = "0.4.3"
julia = "1.6"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/function_fields/degree_localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ localization(K::Generic.RationalFunctionField{T}, ::typeof(degree)) where T <: F

```@repl
using Hecke # hide
K, x = RationalFunctionField(FlintQQ, "x");
K, x = rational_function_field(FlintQQ, "x");
R = localization(K, degree)
```

Expand All @@ -51,7 +51,7 @@ the degree localization

```@repl
using Hecke # hide
K, x = RationalFunctionField(FlintQQ, "x");
K, x = rational_function_field(FlintQQ, "x");
R = localization(K, degree)

a = R()
Expand Down
10 changes: 5 additions & 5 deletions examples/Round2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ function Nemo.residue_field(a::HessQR, b::HessQRElem)
@assert parent(b) == a
@assert is_prime(b.c)
F = GF(b.c)
Ft, t = RationalFunctionField(F, String(var(a.R)), cached = false)
Ft, t = rational_function_field(F, String(var(a.R)), cached = false)
R = parent(numerator(t))
return Ft, MapFromFunc(a, Ft,
x->F(x.c)*Ft(map_coefficients(F, x.f, parent = R))//Ft(map_coefficients(F, x.g, parent = R)),
Expand Down Expand Up @@ -1330,9 +1330,9 @@ Hecke.example("Round2.jl")

?GenericRound2

Qt, t = RationalFunctionField(QQ, "t")
Qt, t = rational_function_field(QQ, "t")
Qtx, x = polynomial_ring(Qt, "x")
F, a = FunctionField(x^6+27*t^2+108*t+108, "a")
F, a = function_field(x^6+27*t^2+108*t+108, "a")
integral_closure(parent(denominator(t)), F)
integral_closure(localization(Qt, degree), F)
integral_closure(Hecke.Globals.Zx, F)
Expand All @@ -1345,7 +1345,7 @@ integral_closure(localization(ZZ, 2), k)

more interesting and MUCH harder:

G, b = FunctionField(x^6 + (140*t - 70)*x^3 + 8788*t^2 - 8788*t + 2197, "b")
G, b = function_field(x^6 + (140*t - 70)*x^3 + 8788*t^2 - 8788*t + 2197, "b")

=#

Expand Down Expand Up @@ -1442,7 +1442,7 @@ function Hecke.splitting_field(f::Generic.Poly{<:Generic.RationalFunctionFieldEl
end

while true
G, b = FunctionField(lf[1], "b", cached = false)
G, b = function_field(lf[1], "b", cached = false)
if length(lf) == 1 && degree(G) < 3
return G
end
Expand Down
4 changes: 2 additions & 2 deletions src/FunField/Factor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
g = gh[1]
h = gh[2]
k = base_ring(g)
kt, t = RationalFunctionField(k, base_ring(Pf).S, cached = false)
kt, t = rational_function_field(k, base_ring(Pf).S, cached = false)

Check warning on line 57 in src/FunField/Factor.jl

View check run for this annotation

Codecov / codecov/patch

src/FunField/Factor.jl#L57

Added line #L57 was not covered by tests
ktx, x = polynomial_ring(kt, symbols(Pf)[1], cached = false)
push!(la, [from_mpoly(g, ktx), from_mpoly(h, ktx)]=>v)
end
Expand Down Expand Up @@ -121,7 +121,7 @@
end

while true
G, b = FunctionField(lf[1], "b", cached = false)
G, b = function_field(lf[1], "b", cached = false)

Check warning on line 124 in src/FunField/Factor.jl

View check run for this annotation

Codecov / codecov/patch

src/FunField/Factor.jl#L124

Added line #L124 was not covered by tests
if length(lf) == 1 && degree(G) < 3
return G
end
Expand Down
2 changes: 1 addition & 1 deletion src/FunField/HessQR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function Nemo.residue_field(a::HessQR, b::HessQRElem)
@assert parent(b) == a
@assert is_prime(b.c)
F = GF(b.c)
Ft, t = RationalFunctionField(F, String(var(a.R)), cached = false)
Ft, t = rational_function_field(F, String(var(a.R)), cached = false)
R = parent(numerator(t))
return Ft, MapFromFunc(a, Ft,
x->F(x.c)*Ft(map_coefficients(F, x.f, parent = R))//Ft(map_coefficients(F, x.g, parent = R)),
Expand Down
6 changes: 3 additions & 3 deletions src/FunField/IntClsZx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ using .HessMain
#=
this should work:

Qt, t = RationalFunctionField(QQ, "t")
Qt, t = rational_function_field(QQ, "t")
Qtx, x = polynomial_ring(Qt, "x")
F, a = FunctionField(x^6+27*t^2+108*t+108, "a")
F, a = function_field(x^6+27*t^2+108*t+108, "a")
integral_closure(parent(denominator(t)), F)
integral_closure(localization(Qt, degree), F)
integral_closure(Hecke.Globals.Zx, F)
Expand All @@ -228,6 +228,6 @@ integral_closure(localization(ZZ, 2), k)

more interesting and MUCH harder:

G, b = FunctionField(x^6 + (140*t - 70)*x^3 + 8788*t^2 - 8788*t + 2197, "b")
G, b = function_field(x^6 + (140*t - 70)*x^3 + 8788*t^2 - 8788*t + 2197, "b")

=#
16 changes: 4 additions & 12 deletions src/GenOrd/Auxiliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,12 @@
return H[1:ncols(M), :]
end

function function_field(f::PolyElem{<:Generic.RationalFunctionFieldElem}, s::String = "_a"; check::Bool = true, cached::Bool = false)
return FunctionField(f, s, cached = cached)
function function_field(f::PolyElem{<:Generic.RationalFunctionFieldElem}, s::VarName = :_a; check::Bool = true, cached::Bool = false)
return function_field(f, s, cached = cached)
end

function function_field(f::PolyElem{<:Generic.RationalFunctionFieldElem}, s::Symbol; check::Bool = true, cached::Bool = false)
return FunctionField(f, s, cached = cached)
end

function extension_field(f::PolyElem{<:Generic.RationalFunctionFieldElem}, s::String = "_a"; check::Bool = true, cached::Bool = false)
return FunctionField(f, s, cached = cached)
end

function extension_field(f::PolyElem{<:Generic.RationalFunctionFieldElem}, s::Symbol; check::Bool = true, cached::Bool = false)
return FunctionField(f, s, cached = cached)
function extension_field(f::PolyElem{<:Generic.RationalFunctionFieldElem}, s::VarName = :_a; check::Bool = true, cached::Bool = false)
return function_field(f, s, cached = cached)

Check warning on line 80 in src/GenOrd/Auxiliary.jl

View check run for this annotation

Codecov / codecov/patch

src/GenOrd/Auxiliary.jl#L79-L80

Added lines #L79 - L80 were not covered by tests
end

function Hecke.basis(F::Generic.FunctionField)
Expand Down
4 changes: 0 additions & 4 deletions src/Misc/Integer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,6 @@ function _factors_trial_division(n::ZZRingElem, np::Int=10^5)
end


function (::Type{Base.Rational{BigInt}})(x::QQFieldElem)
return Rational{BigInt}(BigInt(numerator(x)), BigInt(denominator(x)))
end

export euler_phi_inv, Divisors, carmichael_lambda

@doc raw"""
Expand Down
12 changes: 8 additions & 4 deletions src/QuadForm/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,11 @@ Gram matrix quadratic form:
[ 0 0 0 4//3]

julia> abelian_group_homomorphism(f)
Map: GrpAb: (Z/3)^2 x Z/12 -> (General) abelian group with relation matrix
[4 0 0 0; 0 3 0 0; 0 0 3 0; 0 0 0 3]
with structure of GrpAb: (Z/3)^2 x Z/12
Map
from GrpAb: (Z/3)^2 x Z/12
to (General) abelian group with relation matrix
[4 0 0 0; 0 3 0 0; 0 0 3 0; 0 0 0 3]
with structure of GrpAb: (Z/3)^2 x Z/12
```

Note that an object of type `TorQuadModuleMor` needs not to be a morphism
Expand Down Expand Up @@ -397,7 +399,9 @@ Gram matrix quadratic form:
[2 4 3//2]

julia> f = hom(T, T6, gens(T6))
Map: finite quadratic module -> finite quadratic module
Map
from finite quadratic module: (Z/3)^2 x Z/12 -> Q/2Z
to finite quadratic module: (Z/3)^2 x Z/12 -> Q/12Z

julia> T[1]*T[1] == f(T[1])*f(T[1])
false
Expand Down
8 changes: 4 additions & 4 deletions src/QuadForm/indefiniteLLL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If `v` is a square matrix, return the identity matrix of size nxn.
If `redflag` is set to `true`, it LLL-reduces the `m-n` first rows.
"""
function _complete_to_basis(v::MatElem{ZZRingElem}, redflag::Bool = false)

n = nrows(v)
m = ncols(v)

Expand Down Expand Up @@ -131,7 +131,7 @@ function _quadratic_form_solve_triv(G::MatElem{ZZRingElem}; base::Bool = false,
#Case 2: G has a block +- [1 0 ; 0 -1] on the diagonal
for i = 2:n
if G[i-1,i] == 0 && abs(G[i-1,i-1])==1 &&abs(G[i,i])==1 && sign(G[i-1,i-1])*sign(G[i,i]) == -1

H[i,i-1] = -1
sol = H[i,:]
if !base
Expand Down Expand Up @@ -298,7 +298,7 @@ function lll_gram_indef_with_transform(G::MatElem{ZZRingElem}; check::Bool = fal
#The first line of the matrix G3 only contains 0, except some 'g' on the right, where g² | det G.
n = ncols(G)
U3 = identity_matrix(ZZ,n)
U3[n,1] = round(- G3[n,n]//2*1//G3[1,n])
U3[n,1] = round(ZZRingElem, - G3[n,n]//2*1//G3[1,n])
G4 = U3*G3*transpose(U3)

#The coeff G4[n,n] is reduced modulo 2g
Expand All @@ -310,7 +310,7 @@ function lll_gram_indef_with_transform(G::MatElem{ZZRingElem}; check::Bool = fal
V = G4[[1,n], 2:(n-1)]
end

B = map_entries(round, -inv(change_base_ring(QQ,U))*V)
B = map_entries(x->round(ZZRingElem, x), -inv(change_base_ring(QQ,U))*V)
U4 = identity_matrix(ZZ,n)

for j = 2:n-1
Expand Down
6 changes: 3 additions & 3 deletions test/EllCrv/LocalData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
@test @inferred kodaira_symbol(E, P) == "I0"

# rational function field
QQt, t = RationalFunctionField(QQ, "t")
QQt, t = rational_function_field(QQ, "t")
E = elliptic_curve_from_j_invariant(t)
_, K, f, c, s = tates_algorithm_local(E, 1//t)
@test K == "I1"
Expand Down Expand Up @@ -356,7 +356,7 @@
@test s == true

k, a = quadratic_field(2)
kt, t = RationalFunctionField(k, "t")
kt, t = rational_function_field(k, "t")
E = elliptic_curve_from_j_invariant(1//(t^2 + t + a))

_, K, f, c, s = tates_algorithm_local(E, 1//t)
Expand All @@ -377,7 +377,7 @@
@test c == 1
@test s == true

kt, t = RationalFunctionField(GF(2), "t")
kt, t = rational_function_field(GF(2), "t")
E = elliptic_curve_from_j_invariant(t^3/(t^2 + t + 1))
_, K, f, c, s = tates_algorithm_local(E, t^2 + t + 1)
@test K == "I1"
Expand Down
4 changes: 2 additions & 2 deletions test/EllCrv/MinimalModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
end

# _minimize and integral model
Kt, t = RationalFunctionField(QQ, "t")
Kt, t = rational_function_field(QQ, "t")
E = EllipticCurve(Kt.([0, t^21, 1//216, -7//1296, 1//t]))
EE, = integral_model(E)
@test all(p -> is_one(denominator(p)) && is_one(denominator(numerator(p))), a_invars(EE))
Expand All @@ -63,7 +63,7 @@

Qx, x = QQ["x"]
K, z = number_field(x^2 + 1, "z", cached = false)
Kt, t = RationalFunctionField(K, "t")
Kt, t = rational_function_field(K, "t")
E = EllipticCurve(Kt.([0, t^21, (z + 1)//216, -7//1296, (z + 3)//t]))
EE, = integral_model(E)
EE = Hecke.reduce_model(E)
Expand Down
2 changes: 1 addition & 1 deletion test/FunField/DegreeLocalization.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

R, x = RationalFunctionField(QQ, "x")
R, x = rational_function_field(QQ, "x")
L = localization(R, degree)

@testset "DegreeLocalization" begin
Expand Down
2 changes: 1 addition & 1 deletion test/FunField/Differential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Hecke: divisor
flds = [QQ, rationals_as_number_field()[1]]

@testset "Differentials" for k in flds
kx, x = RationalFunctionField(k, "x")
kx, x = rational_function_field(k, "x")
kt = parent(numerator(x))
ky, y = polynomial_ring(kx, "y")

Expand Down
2 changes: 1 addition & 1 deletion test/FunField/Divisor.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
k = QQ
kx, x = RationalFunctionField(k, "x")
kx, x = rational_function_field(k, "x")
kt = parent(numerator(x))
ky, y = polynomial_ring(kx, "y")

Expand Down
2 changes: 1 addition & 1 deletion test/GenOrd/GenOrd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end
test_Ring_interface(O)

k = GF(5)
kx, x = RationalFunctionField(k, "x")
kx, x = rational_function_field(k, "x")
kt = parent(numerator(x))
ky, y = polynomial_ring(kx, "y")
F, a = function_field(y^3+(4*x^3 + 4*x^2 + 2*x +2)*y^2 + (3*x+3)*y +2)
Expand Down
4 changes: 2 additions & 2 deletions test/GenOrd/Ideal.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@testset "Ideals for orders over function fields" begin

k = GF(7)
kx, x = RationalFunctionField(k, "x")
kx, x = rational_function_field(k, "x")
kt = parent(numerator(x))
ky, y = polynomial_ring(kx, "y")
F, a = function_field(y^2+x)
Expand All @@ -26,7 +26,7 @@


k = QQ
kx, x = RationalFunctionField(k, "x")
kx, x = rational_function_field(k, "x")
kt = parent(numerator(x))
ky, y = polynomial_ring(kx, "y")
F, a = function_field(y^2+x*y+x^3+y^3)
Expand Down
10 changes: 5 additions & 5 deletions test/GenOrd/MaximalOrder.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@testset "Qt" begin
qt, t = RationalFunctionField(QQ, "t")
qt, t = rational_function_field(QQ, "t")
qtx, x = polynomial_ring(qt, "x")
f = x^4 + t*x^3 - 6*x^2 - t*x + 1
F, a = FunctionField(f, "a")
F, a = function_field(f, "a")
O = integral_closure(Hecke.localization(qt, degree), F)
b = basis(O, F)
mp = map(minpoly, b)
Expand All @@ -24,16 +24,16 @@ end

@testset "FldFin" begin
for q = [GF(17), GF(next_prime(ZZRingElem(10)^30)), finite_field(5, 2)[1], finite_field(next_prime(ZZRingElem(10)^25), 2, "a", cached = false)[1]]
qt, t = RationalFunctionField(q, "t", cached = false)
qt, t = rational_function_field(q, "t", cached = false)
qtx, x = polynomial_ring(qt, cached = false)
f = x^3+(t+1)^5*(x+1)+(t^2+t+1)^7
F, a = FunctionField(f, "a", cached = false)
F, a = function_field(f, "a", cached = false)
integral_closure(parent(numerator(t)), F)
integral_closure(localization(qt, degree), F)
end

k = GF(5)
kx, x = RationalFunctionField(k, "x")
kx, x = rational_function_field(k, "x")
kt = parent(numerator(x))
ky, y = polynomial_ring(kx, "y")
F, a = function_field(y^3+(4*x^3 + 4*x^2 + 2*x +2)*y^2 + (3*x+3)*y +2)
Expand Down
2 changes: 1 addition & 1 deletion test/Misc/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ end
@test @inferred is_squarefree(x * (x + 1))
@test @inferred !is_squarefree(x * (x + 1)^2)

F, a = RationalFunctionField(GF(3), "a")
F, a = rational_function_field(GF(3), "a")
Fx, x = F["x"]
@test @inferred is_squarefree(x)
@test @inferred is_squarefree(2*x^0)
Expand Down
Loading