Skip to content

Commit

Permalink
CyclotomicField -> cyclotomic_field and so on
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 4, 2023
1 parent 88af0f0 commit 84c987f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion benchmarks/polynomials_number_field.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function benchmark_poly_nf_elem()
print("benchmark_poly_nf_elem ... ")
R, x = CyclotomicField(20, "x")
R, x = cyclotomic_field(20, "x")
S, y = polynomial_ring(R, "y")

f = (3x^7 + x^4 - 3x + 1)*y^3 + (2x^6-x^5+4x^4-x^3+x^2-1)*y +(-3x^7+2x^6-x^5+3x^3-2x^2+x)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/numberfield.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ resulting parent objects to coerce various elements into those fields.
```julia
R, x = polynomial_ring(QQ, "x")
K, a = number_field(x^3 + 3x + 1, "a")
L, b = CyclotomicField(5, "b")
L, b = cyclotomic_field(5, "b")
M, c = CyclotomicRealField(5, "c")

d = K(3)
Expand Down
8 changes: 4 additions & 4 deletions src/antic/nf_elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,8 @@ supplied, a default dollar sign will be used to represent the variable.
"""
function cyclotomic_field(n::Int, s::VarName = "z_$n", t = "_\$"; cached = true)
n > 0 || throw(ArgumentError("conductor must be positive, not $n"))
Zx, x = PolynomialRing(FlintZZ, gensym(); cached = false)
Qx, = PolynomialRing(FlintQQ, t; cached = cached)
Zx, x = polynomial_ring(FlintZZ, gensym(); cached = false)
Qx, = polynomial_ring(FlintQQ, t; cached = cached)
f = cyclotomic(n, x)
C, g = number_field(Qx(f), Symbol(s); cached = cached, check = false)
set_attribute!(C, :show => show_cyclo, :cyclo => n)
Expand All @@ -1224,8 +1224,8 @@ constructed, should be printed. If it is not supplied, a default dollar sign
will be used to represent the variable.
"""
function cyclotomic_real_subfield(n::Int, s::VarName = "(z_$n + 1/z_$n)", t = "\$"; cached = true)
Zx, x = PolynomialRing(FlintZZ, gensym(); cached = false)
Qx, = PolynomialRing(FlintQQ, t; cached = cached)
Zx, x = polynomial_ring(FlintZZ, gensym(); cached = false)
Qx, = polynomial_ring(FlintQQ, t; cached = cached)

Check warning on line 1228 in src/antic/nf_elem.jl

View check run for this annotation

Codecov / codecov/patch

src/antic/nf_elem.jl#L1227-L1228

Added lines #L1227 - L1228 were not covered by tests
f = cos_minpoly(n, x)
R, a = number_field(Qx(f), Symbol(s); cached = cached, check = false)
set_attribute!(R, :show => show_maxreal, :maxreal => n)
Expand Down
2 changes: 1 addition & 1 deletion test/Benchmark-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end
end

@testset "Benchmark.poly_nf_elem" begin
R, x = CyclotomicField(20, "x")
R, x = cyclotomic_field(20, "x")
S, y = polynomial_ring(R, "y")

f = (3x^7 + x^4 - 3x + 1)*y^3 + (2x^6-x^5+4x^4-x^3+x^2-1)*y +(-3x^7+2x^6-x^5+3x^3-2x^2+x)
Expand Down
2 changes: 1 addition & 1 deletion test/flint/fq_nmod_poly-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ end
@testset "issue #1353" begin
F, _ = finite_field(2, 1, "1")
E, a = finite_field(2, 15, "a")
S, x = PolynomialRing(F, "x")
S, x = polynomial_ring(F, "x")

@test_throws ErrorException x+a
end

0 comments on commit 84c987f

Please sign in to comment.