Skip to content

Commit

Permalink
CyclotomicField -> cyclotomic_field and so on (#1232)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Oct 8, 2023
1 parent 4b32e06 commit 0071049
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/FunField/Factor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function to_mpoly(f::Generic.Poly{<:Generic.RationalFunctionFieldElem})
end
return finish(Fc)
end

function Hecke.factor(f::Generic.Poly{<:Generic.RationalFunctionFieldElem})
Pf = parent(f)
lf = factor(to_mpoly(f))
Expand All @@ -44,7 +44,7 @@ function Hecke.factor(f::Generic.Poly{<:Generic.RationalFunctionFieldElem})
@assert iszero(f) || sum(degree(x)*y for (x,y) = fa; init = 0) == degree(f)
return fa
end

function Hecke.factor_absolute(f::Generic.Poly{<:Generic.RationalFunctionFieldElem})
Pf = parent(f)
lf = factor_absolute(to_mpoly(f))
Expand All @@ -55,7 +55,7 @@ function Hecke.factor_absolute(f::Generic.Poly{<:Generic.RationalFunctionFieldEl
h = gh[2]
k = base_ring(g)
kt, t = RationalFunctionField(k, base_ring(Pf).S, cached = false)
ktx, x = PolynomialRing(kt, symbols(Pf)[1], cached = false)
ktx, x = polynomial_ring(kt, symbols(Pf)[1], cached = false)
push!(la, [from_mpoly(g, ktx), from_mpoly(h, ktx)]=>v)
end
return la
Expand Down
4 changes: 2 additions & 2 deletions src/NumField/ComplexEmbeddings/Generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ This is the same as `g * f`.
# Examples
```jldoctest
julia> K, a = CyclotomicField(5, "a");
julia> K, a = cyclotomic_field(5, "a");
julia> k, ktoK = Hecke.subfield(K, [a + inv(a)]);
Expand Down Expand Up @@ -175,7 +175,7 @@ all embedings of $K$ which restrict to $e$ along $f$.
# Example
```jldoctest
julia> K, a = CyclotomicField(5, "a");
julia> K, a = cyclotomic_field(5, "a");
julia> k, ktoK = Hecke.subfield(K, [a + inv(a)]);
Expand Down
6 changes: 3 additions & 3 deletions test/Misc/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
end

@testset "roots" begin
o = CyclotomicField(2)[1](1)
o = cyclotomic_field(2)[1](1)
@test issetequal(roots(o, 2), [o, -o])
o = CyclotomicField(1)[1](1)
o = cyclotomic_field(1)[1](1)
@test issetequal(roots(o, 2), [o, -o])

o, a = CyclotomicField(4)
o, a = cyclotomic_field(4)
_, x = o["x"]
@test length(roots(x^2-a^2//4)) == 2

Expand Down
2 changes: 1 addition & 1 deletion test/Misc/jordan_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ end
@test haskey(l, one(FlintQQ))
@test l[one(FlintQQ)] == 2

K, a = CyclotomicField(3, "a")
K, a = cyclotomic_field(3, "a")
lK = eigvals(M, K)
@test length(keys(lK)) == 3
@test haskey(lK, one(K)) && haskey(lK, a) && haskey(lK, -a - 1)
Expand Down
22 changes: 11 additions & 11 deletions test/NfAbs/NfAbs.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
@testset "coercion between cyclotomic fields" begin
F2, z2 = CyclotomicField(2)
F2, z2 = cyclotomic_field(2)
@test Hecke.force_coerce_cyclo(F2, z2) == z2

F1, z1 = CyclotomicField(1)
F1, z1 = cyclotomic_field(1)
up = Hecke.force_coerce_cyclo(F2, z1)
@test Hecke.force_coerce_cyclo(F1, up) == z1

choices = ZZRingElem[collect(-5:5)...]

# coerce first up and then down
for n in 1:15
Fn, zn = CyclotomicField(n)
Fn, zn = cyclotomic_field(n)
for m in 1:15
nm = n*m
Fnm, znm = CyclotomicField(nm)
Fnm, znm = cyclotomic_field(nm)
x = rand(Fn, choices)
x_up = Hecke.force_coerce_cyclo(Fnm, x)
x_down = Hecke.force_coerce_cyclo(Fn, x_up)
Expand All @@ -23,12 +23,12 @@

# coerce first down and then up
for n in 1:15
Fn, zn = CyclotomicField(n)
Fn, zn = cyclotomic_field(n)
for g in divisors(n)
Fg, zg = CyclotomicField(g)
Fg, zg = cyclotomic_field(g)
for m in 1:15
gm = g*m
Fgm, zgm = CyclotomicField(gm)
Fgm, zgm = cyclotomic_field(gm)
x = rand(Fg, choices)
x_up = Hecke.force_coerce_cyclo(Fgm, x)
x_n = Hecke.force_coerce_cyclo(Fn, x_up)
Expand All @@ -39,19 +39,19 @@

# impossible coercions
for n in 1:45
Fn, zn = CyclotomicField(n)
Fn, zn = cyclotomic_field(n)
for m in 1:45
if n % m != 0 && ! (isodd(n) && (2*n) % m == 0)
Fm, zm = CyclotomicField(m)
Fm, zm = cyclotomic_field(m)
@test_throws ErrorException Hecke.force_coerce_cyclo(Fn, zm)
@test Hecke.force_coerce_cyclo(Fn, zm, Val{false}) === nothing
end
end
end

# equality check requiring the construction of a common superfield
F5, z5 = CyclotomicField(5)
F3, z3 = CyclotomicField(3)
F5, z5 = cyclotomic_field(5)
F3, z3 = cyclotomic_field(3)
@test z5^5 == z3^3

# splitting field
Expand Down
4 changes: 2 additions & 2 deletions test/NumField/NfAbs/NfAbs.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@testset "NumField/NfAbs/NfAbs" begin
cyclo_expl = function(n, m)
Fn, zn = CyclotomicField(n)
Fnm, znm = CyclotomicField(n*m)
Fn, zn = cyclotomic_field(n)
Fnm, znm = cyclotomic_field(n*m)
x = zn
x_up = Hecke.force_coerce_cyclo(Fnm, x)
x_down = Hecke.force_coerce_cyclo(Fn, x_up)
Expand Down

0 comments on commit 0071049

Please sign in to comment.