diff --git a/benchmarks/resultant.jl b/benchmarks/resultant.jl index 8933ad99e..bdc322b4f 100644 --- a/benchmarks/resultant.jl +++ b/benchmarks/resultant.jl @@ -1,6 +1,6 @@ function benchmark_resultant() print("benchmark_resultant ... ") - R, x = FiniteField(7, 11, "x") + R, x = finite_field(7, 11, "x") S, y = polynomial_ring(R, "y") T = residue_ring(S, y^3 + 3x*y + 1) U, z = polynomial_ring(T, "z") diff --git a/docs/src/constructors.md b/docs/src/constructors.md index e2270440b..aafb867e4 100644 --- a/docs/src/constructors.md +++ b/docs/src/constructors.md @@ -60,7 +60,7 @@ they represent. |---------------------------------------|-----------------------------------------------| | $R = \mathbb{Z}$ | `R = ZZ` | | $R = \mathbb{Q}$ | `R = QQ` | -| $R = \mathbb{F}_{p^n}$ | `R, a = FiniteField(p, n, "a")` | +| $R = \mathbb{F}_{p^n}$ | `R, a = finite_field(p, n, "a")` | | $R = \mathbb{Z}/n\mathbb{Z}$ | `R = residue_ring(ZZ, n)` | | $S = R[x]$ | `S, x = polynomial_ring(R, "x")` | | $S = R[x, y]$ | `S, (x, y) = polynomial_ring(R, ["x", "y"])` | diff --git a/docs/src/ff_embedding.md b/docs/src/ff_embedding.md index 827d62929..2941cfe41 100644 --- a/docs/src/ff_embedding.md +++ b/docs/src/ff_embedding.md @@ -34,10 +34,10 @@ embed(::fqPolyRepField, ::fqPolyRepField) **Examples** ```jldoctest; filter = r"[gG]F" -julia> k2, x2 = FiniteField(19, 2, "x2") +julia> k2, x2 = finite_field(19, 2, "x2") (Finite field of degree 2 over GF(19), x2) -julia> k4, x4 = FiniteField(19, 4, "x4") +julia> k4, x4 = finite_field(19, 4, "x4") (Finite field of degree 4 over GF(19), x4) julia> f = embed(k2, k4) @@ -62,10 +62,10 @@ preimage_map(::FinFieldMorphism) **Examples** ```jldoctest -julia> k7, x7 = FiniteField(13, 7, "x7") +julia> k7, x7 = finite_field(13, 7, "x7") (Finite field of degree 7 over GF(13), x7) -julia> k21, x21 = FiniteField(13, 21, "x21") +julia> k21, x21 = finite_field(13, 21, "x21") (Finite field of degree 21 over GF(13), x21) julia> s = preimage_map(k7, k21) diff --git a/docs/src/finitefield.md b/docs/src/finitefield.md index 0abfe535f..7b4be16ff 100644 --- a/docs/src/finitefield.md +++ b/docs/src/finitefield.md @@ -16,10 +16,10 @@ Finite fields are constructed using the `FlintFiniteField` function. However, for convenience we define ``` -FiniteField = FlintFiniteField +finite_field = FlintFiniteField ``` -so that finite fields can be constructed using `FiniteField` rather than +so that finite fields can be constructed using `finite_field` rather than `FlintFiniteField`. Note that this is the name of the constructor, but not of finite field type. @@ -69,16 +69,16 @@ resulting parent objects to coerce various elements into those fields. **Examples** ```jldoctest -julia> R, x = FiniteField(7, 3, "x") +julia> R, x = finite_field(7, 3, "x") (Finite field of degree 3 over GF(7), x) -julia> S, y = FiniteField(ZZ(12431351431561), 2, "y") +julia> S, y = finite_field(ZZ(12431351431561), 2, "y") (Finite field of degree 2 over GF(12431351431561), y) julia> T, t = polynomial_ring(residue_ring(ZZ, 12431351431561), "t") (Univariate polynomial ring in t over ZZ/(12431351431561), t) -julia> U, z = FiniteField(t^2 + 7, "z") +julia> U, z = finite_field(t^2 + 7, "z") (Finite field of degree 2 over GF(12431351431561), z) julia> a = R(5) @@ -119,7 +119,7 @@ modulus(::FqPolyRepField) **Examples** ```jldoctest -julia> R, x = FiniteField(ZZ(7), 5, "x") +julia> R, x = finite_field(ZZ(7), 5, "x") (Finite field of degree 5 over GF(7), x) julia> c = gen(R) @@ -161,7 +161,7 @@ pth_root(::FqPolyRepFieldElem) **Examples** ```jldoctest -julia> R, x = FiniteField(ZZ(7), 5, "x") +julia> R, x = finite_field(ZZ(7), 5, "x") (Finite field of degree 5 over GF(7), x) julia> a = x^4 + 3x^2 + 6x + 1 @@ -192,7 +192,7 @@ lift(::FpPolyRing, ::FqPolyRepFieldElem) **Examples** ```jldoctest -julia> R, x = FiniteField(23, 2, "x") +julia> R, x = finite_field(23, 2, "x") (Finite field of degree 2 over GF(23), x) julia> S, y = polynomial_ring(GF(23), "y") diff --git a/docs/src/index.md b/docs/src/index.md index 48c3d8bd2..d9b2a20e9 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -82,7 +82,7 @@ Here is an example using generic recursive ring constructions. ```jldoctest julia> using Nemo -julia> R, x = FiniteField(7, 11, "x") +julia> R, x = finite_field(7, 11, "x") (Finite field of degree 11 over GF(7), x) julia> S, y = polynomial_ring(R, "y") diff --git a/src/Aliases.jl b/src/Aliases.jl index 50223d37a..8de744675 100644 --- a/src/Aliases.jl +++ b/src/Aliases.jl @@ -182,3 +182,5 @@ @alias NmodRelSeriesRing zzModRelPowerSeriesRing @alias MPolyElem MPolyRingElem + +@alias FiniteField finite_field diff --git a/src/Native.jl b/src/Native.jl index d8d3783c2..f451abaab 100644 --- a/src/Native.jl +++ b/src/Native.jl @@ -21,51 +21,54 @@ function GF(n::ZZRingElem; cached::Bool=true) return FpField(n, cached) end -function FiniteField(char::ZZRingElem, deg::Int, s::VarName = :o; cached = true) +function finite_field(char::ZZRingElem, deg::Int, s::VarName = :o; cached = true) parent_obj = FqPolyRepField(char, deg, Symbol(s), cached) return parent_obj, gen(parent_obj) end -function FiniteField(pol::Union{ZZModPolyRingElem, FpPolyRingElem}, +function finite_field(pol::Union{ZZModPolyRingElem, FpPolyRingElem}, s::VarName = :o; cached = true, check::Bool=true) parent_obj = FqPolyRepField(pol, Symbol(s), cached, check=check) return parent_obj, gen(parent_obj) end -function FiniteField(F::FqPolyRepField, deg::Int, s::VarName = :o; cached = true) +function finite_field(F::FqPolyRepField, deg::Int, s::VarName = :o; cached = true) return FqPolyRepField(characteristic(F), deg, Symbol(s), cached) end -function FiniteField(char::Int, deg::Int, s::VarName = :o; cached = true) +function finite_field(char::Int, deg::Int, s::VarName = :o; cached = true) parent_obj = fqPolyRepField(ZZRingElem(char), deg, Symbol(s), cached) return parent_obj, gen(parent_obj) end -function FiniteField(pol::Zmodn_poly, s::VarName = :o; cached = true, check::Bool=true) +function finite_field(pol::Zmodn_poly, s::VarName = :o; cached = true, check::Bool=true) parent_obj = fqPolyRepField(pol, Symbol(s), cached, check=check) return parent_obj, gen(parent_obj) end -function FiniteField(F::fqPolyRepField, deg::Int, s::VarName = :o; cached = true) +function finite_field(F::fqPolyRepField, deg::Int, s::VarName = :o; cached = true) return fqPolyRepField(characteristic(F), deg, Symbol(s), cached) end # Additional from Hecke -function FiniteField(p::Integer; cached::Bool = true) +function finite_field(p::Integer; cached::Bool = true) @assert is_prime(p) k = GF(p, cached=cached) return k, k(1) end -function FiniteField(p::ZZRingElem; cached::Bool = true) +function finite_field(p::ZZRingElem; cached::Bool = true) @assert is_prime(p) k = GF(p, cached=cached) return k, k(1) end -GF(p::Integer, k::Int, s::VarName = :o; cached::Bool = true) = FiniteField(p, k, s, cached = cached)[1] +GF(p::Integer, k::Int, s::VarName = :o; cached::Bool = true) = finite_field(p, k, s, cached = cached)[1] -GF(p::ZZRingElem, k::Int, s::VarName = :o; cached::Bool = true) = FiniteField(p, k, s, cached = cached)[1] +GF(p::ZZRingElem, k::Int, s::VarName = :o; cached::Bool = true) = finite_field(p, k, s, cached = cached)[1] + +import ..Nemo: @alias +@alias FiniteField finite_field # for compatibility with Hecke end # module diff --git a/src/Nemo.jl b/src/Nemo.jl index 3f235b315..cd91dba1a 100644 --- a/src/Nemo.jl +++ b/src/Nemo.jl @@ -48,7 +48,7 @@ import AbstractAlgebra: nullspace, @show_name, @show_special, find_name, get_cached!, @show_special_elem, force_coerce, force_op, expressify -# We don't want the QQ, ZZ, FiniteField, number_field from AbstractAlgebra +# We don't want the QQ, ZZ, finite_field, number_field from AbstractAlgebra # as they are for parents of Julia types or naive implementations # We only import AbstractAlgebra, not export # We do not want the AbstractAlgebra version of certain functions as the Base version @@ -76,7 +76,7 @@ export PadicField, QadicField, NGFiniteField export QQBar # Things/constants which are also defined in AbstractAlgebra: -export ZZ, QQ, FiniteField, number_field +export ZZ, QQ, finite_field, number_field # FIXME/TODO: for compatibility with AbstractAlgebra before 0.28.x; remove in the future @@ -477,7 +477,7 @@ const _ecm_nCs = Vector{Int}[_ecm_nC] ############################################################################### # -# Set domain for ZZ, QQ, PadicField, FiniteField to Flint +# Set domain for ZZ, QQ, PadicField, finite_field to Flint # ############################################################################### @@ -485,7 +485,7 @@ const ZZ = FlintZZ const QQ = FlintQQ const PadicField = FlintPadicField const QadicField = FlintQadicField -const FiniteField = FlintFiniteField +const finite_field = FlintFiniteField ############################################################################### # diff --git a/src/embedding/embedding.jl b/src/embedding/embedding.jl index 8e5082092..5ed60257b 100644 --- a/src/embedding/embedding.jl +++ b/src/embedding/embedding.jl @@ -346,7 +346,7 @@ function intersections(k::T, K::T) where T <: FinField # and we embed it in k and S else # kc of same type as k but degree c - kc = FiniteField(k, c, string("x", c)) + kc = finite_field(k, c, string("x", c)) embed(kc, k) for g in subK[l] embed(kc, domain(g)) diff --git a/test/Native-test.jl b/test/Native-test.jl index 342755917..1b3c5fc00 100644 --- a/test/Native-test.jl +++ b/test/Native-test.jl @@ -5,24 +5,24 @@ @test Native.GF(UInt(2), cached = false) isa Nemo.fpField @test Native.GF(ZZ(2)) isa Nemo.FpField @test Native.GF(ZZ(2), cached = false) isa Nemo.FpField - @test Native.FiniteField(ZZ(2), 2, :oo) isa Tuple{FqPolyRepField, FqPolyRepFieldElem} - @test Native.FiniteField(ZZ(2), 2, :oo, cached = false) isa Tuple{FqPolyRepField, FqPolyRepFieldElem} - @test Native.FiniteField(2, 2, :oo) isa Tuple{fqPolyRepField, fqPolyRepFieldElem} - @test Native.FiniteField(2, 2, :oo, cached = false) isa Tuple{fqPolyRepField, fqPolyRepFieldElem} + @test Native.finite_field(ZZ(2), 2, :oo) isa Tuple{FqPolyRepField, FqPolyRepFieldElem} + @test Native.finite_field(ZZ(2), 2, :oo, cached = false) isa Tuple{FqPolyRepField, FqPolyRepFieldElem} + @test Native.finite_field(2, 2, :oo) isa Tuple{fqPolyRepField, fqPolyRepFieldElem} + @test Native.finite_field(2, 2, :oo, cached = false) isa Tuple{fqPolyRepField, fqPolyRepFieldElem} F, x = Native.GF(2)["x"] - @test Native.FiniteField(x - 1, :oo, cached = false) isa Tuple{fqPolyRepField, fqPolyRepFieldElem} + @test Native.finite_field(x - 1, :oo, cached = false) isa Tuple{fqPolyRepField, fqPolyRepFieldElem} F, x = Native.GF(ZZ(2))["x"] - @test Native.FiniteField(x - 1, :oo, cached = false) isa Tuple{FqPolyRepField, FqPolyRepFieldElem} - F, = Native.FiniteField(2, 2) - @test Native.FiniteField(F, 2) isa fqPolyRepField - F, = Native.FiniteField(ZZ(2), 2) - @test Native.FiniteField(F, 2) isa FqPolyRepField + @test Native.finite_field(x - 1, :oo, cached = false) isa Tuple{FqPolyRepField, FqPolyRepFieldElem} + F, = Native.finite_field(2, 2) + @test Native.finite_field(F, 2) isa fqPolyRepField + F, = Native.finite_field(ZZ(2), 2) + @test Native.finite_field(F, 2) isa FqPolyRepField - @test Native.FiniteField(2) isa Tuple{Nemo.fpField, Nemo.fpFieldElem} - @test Native.FiniteField(2, cached = false) isa Tuple{Nemo.fpField, Nemo.fpFieldElem} - @test Native.FiniteField(ZZ(2)) isa Tuple{Nemo.FpField, Nemo.FpFieldElem} - @test Native.FiniteField(ZZ(2), cached = false) isa Tuple{Nemo.FpField, Nemo.FpFieldElem} + @test Native.finite_field(2) isa Tuple{Nemo.fpField, Nemo.fpFieldElem} + @test Native.finite_field(2, cached = false) isa Tuple{Nemo.fpField, Nemo.fpFieldElem} + @test Native.finite_field(ZZ(2)) isa Tuple{Nemo.FpField, Nemo.FpFieldElem} + @test Native.finite_field(ZZ(2), cached = false) isa Tuple{Nemo.FpField, Nemo.FpFieldElem} @test Native.GF(2, 2) isa fqPolyRepField @test Native.GF(ZZ(2), 2) isa FqPolyRepField diff --git a/test/Rings-test.jl b/test/Rings-test.jl index f70ed72f2..15a499621 100644 --- a/test/Rings-test.jl +++ b/test/Rings-test.jl @@ -2,8 +2,8 @@ const ring_to_mat = Dict(FlintZZ => ZZMatrix, FlintQQ => QQMatrix, residue_ring(ZZ, 9) => zzModMatrix, GF(5) => fpMatrix, - FiniteField(3, 2, "b")[1] => fqPolyRepMatrix, - FiniteField(ZZRingElem(3), 2, "b")[1] => FqPolyRepMatrix, + finite_field(3, 2, "b")[1] => fqPolyRepMatrix, + finite_field(ZZRingElem(3), 2, "b")[1] => FqPolyRepMatrix, ArbField() => arb_mat, AcbField() => acb_mat, RealField() => RealMat, diff --git a/test/flint/fq-test.jl b/test/flint/fq-test.jl index 2aeb550b6..19768aedc 100644 --- a/test/flint/fq-test.jl +++ b/test/flint/fq-test.jl @@ -3,19 +3,19 @@ function test_elem(R::FqPolyRepField) end @testset "FqPolyRepFieldElem.conformance_tests" begin - test_Field_interface_recursive(FiniteField(ZZRingElem(7), 5, "z")[1]) + test_Field_interface_recursive(finite_field(ZZRingElem(7), 5, "z")[1]) Sy, y = polynomial_ring(residue_ring(FlintZZ, 36893488147419103363), "y") - T, z = FiniteField(y^2 + 1, "z") + T, z = finite_field(y^2 + 1, "z") test_Field_interface_recursive(T) Syy, yy = polynomial_ring(GF(ZZRingElem(36893488147419103363)), "y") - T2, z2 = FiniteField(yy^2 + 1, "z") + T2, z2 = finite_field(yy^2 + 1, "z") test_Field_interface_recursive(T2) end @testset "FqPolyRepFieldElem.constructors" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") @test elem_type(R) == FqPolyRepFieldElem @test elem_type(FqPolyRepField) == FqPolyRepFieldElem @@ -24,14 +24,14 @@ end Sy, y = polynomial_ring(residue_ring(FlintZZ, 36893488147419103363), "y") Syy, yy = polynomial_ring(GF(ZZRingElem(36893488147419103363)), "y") - T, z = FiniteField(y^2 + 1, "z") - T2, z2 = FiniteField(yy^2 + 1, "z") + T, z = finite_field(y^2 + 1, "z") + T2, z2 = finite_field(yy^2 + 1, "z") # check that one can leave out the name for the generator, or specify it as a symbol - @test FiniteField(ZZRingElem(7), 5)[1] isa FqPolyRepField - @test FiniteField(ZZRingElem(7), 5, :x)[1] isa FqPolyRepField - @test FiniteField(y^2 + 1)[1] isa FqPolyRepField - @test FiniteField(y^2 + 1, :x)[1] isa FqPolyRepField + @test finite_field(ZZRingElem(7), 5)[1] isa FqPolyRepField + @test finite_field(ZZRingElem(7), 5, :x)[1] isa FqPolyRepField + @test finite_field(y^2 + 1)[1] isa FqPolyRepField + @test finite_field(y^2 + 1, :x)[1] isa FqPolyRepField @test isa(R, FqPolyRepField) @test isa(T, FqPolyRepField) @@ -62,15 +62,15 @@ end @test isa(d, FqPolyRepFieldElem) # check for primality - T3, z3 = FiniteField(yy^2 + 1, "z", check=false) + T3, z3 = finite_field(yy^2 + 1, "z", check=false) @test isa(T2, FqPolyRepField) Syyy, yyy = polynomial_ring(residue_ring(FlintZZ, ZZ(4)), "y") @test yyy isa ZZModPolyRingElem - @test_throws DomainError FiniteField(yyy^2+1, "z") + @test_throws DomainError finite_field(yyy^2+1, "z") end @testset "FqPolyRepFieldElem.printing" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = 3x^4 + 2x^3 + 4x^2 + x + 1 @@ -78,7 +78,7 @@ end end @testset "FqPolyRepFieldElem.manipulation" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") @test iszero(zero(R)) @@ -108,7 +108,7 @@ end end @testset "FqPolyRepFieldElem.unary_ops" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -116,7 +116,7 @@ end end @testset "FqPolyRepFieldElem.binary_ops" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 b = 3x^4 + 2x^2 + x + 1 @@ -129,7 +129,7 @@ end end @testset "FqPolyRepFieldElem.adhoc_binary" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -147,7 +147,7 @@ end end @testset "FqPolyRepFieldElem.powering" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -157,7 +157,7 @@ end end @testset "FqPolyRepFieldElem.comparison" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 b = 3x^4 + 2x^2 + 2 @@ -168,7 +168,7 @@ end end @testset "FqPolyRepFieldElem.inversion" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -180,7 +180,7 @@ end end @testset "FqPolyRepFieldElem.exact_division" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 b = 3x^4 + 2x^2 + 2 @@ -191,7 +191,7 @@ end end @testset "FqPolyRepFieldElem.gcd" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 b = 3x^4 + 2x^2 + x + 1 @@ -202,7 +202,7 @@ end end @testset "FqPolyRepFieldElem.special_functions" begin - R, x = FiniteField(ZZRingElem(7), 5, "x") + R, x = finite_field(ZZRingElem(7), 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -232,29 +232,29 @@ end end @testset "FqPolyRepFieldElem.rand" begin - R, x = FiniteField(ZZRingElem(17), 3, "x") + R, x = finite_field(ZZRingElem(17), 3, "x") test_rand(R) end @testset "FqPolyRepFieldElem.iteration" begin for n = [2, 3, 5, 13, 31] - R, _ = FiniteField(ZZRingElem(n), 1, "x") + R, _ = finite_field(ZZRingElem(n), 1, "x") elts = Nemo.AbstractAlgebra.test_iterate(R) @test elts == R.(0:n-1) - R, _ = FiniteField(ZZRingElem(n), rand(2:9), "x") + R, _ = finite_field(ZZRingElem(n), rand(2:9), "x") Nemo.AbstractAlgebra.test_iterate(R) end end @testset "FqPolyRepFieldElem.lift" begin - R, x = FiniteField(ZZ(23), 2, "x") + R, x = finite_field(ZZ(23), 2, "x") f = 8x + 9 S, y = polynomial_ring(GF(ZZ(23)), "y") @test lift(S, f) == 8y + 9 end @testset "FqPolyRepField.overload" begin - R, x = FiniteField(ZZ(19), 3, "x") + R, x = finite_field(ZZ(19), 3, "x") @test R([1, 0, 1]) == x^2 + 1 end diff --git a/test/flint/fq_abs_series-test.jl b/test/flint/fq_abs_series-test.jl index ce369204d..373c5e4b5 100644 --- a/test/flint/fq_abs_series-test.jl +++ b/test/flint/fq_abs_series-test.jl @@ -3,7 +3,7 @@ end @testset "FqPolyRepAbsPowerSeriesRingElem.constructors" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R1 = AbsPowerSeriesRing(S, 30) R2 = AbsPowerSeriesRing(S, 30) @@ -36,7 +36,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.printing" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) b = x^2 + 3x + O(x^4) @@ -45,7 +45,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.manipulation" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -67,7 +67,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.similar" begin - R0, a = FiniteField(ZZ(23), 2, "a") + R0, a = finite_field(ZZ(23), 2, "a") R, x = power_series_ring(R0, 10, "x"; model=:capped_absolute) S, y = power_series_ring(ZZ, 10, "y"; model=:capped_absolute) @@ -115,7 +115,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.abs_series" begin - R, a = FiniteField(ZZ(23), 2, "a") + R, a = finite_field(ZZ(23), 2, "a") f = abs_series(R, [1, 2, 3], 3, 5, "y") @test isa(f, FqPolyRepAbsPowerSeriesRingElem) @@ -158,7 +158,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.unary_ops" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -170,7 +170,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.binary_ops" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -190,7 +190,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.adhoc_binary_ops" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -208,7 +208,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.comparison" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -224,7 +224,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.adhoc_comparison" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -244,7 +244,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.powering" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -264,7 +264,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.shift" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -286,7 +286,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.truncation" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -306,7 +306,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.exact_division" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = x + x^3 @@ -324,7 +324,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.adhoc_exact_division" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(ZZ, 30, "x", model=:capped_absolute) a = x + x^3 @@ -344,7 +344,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.adhoc_exact_division" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(ZZ, 30, "x", model=:capped_absolute) a = x + x^3 @@ -364,7 +364,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.inversion" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 1 + x + 2x^2 + O(x^5) @@ -376,7 +376,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.square_root" begin - S, t = FiniteField(ZZRingElem(31), 5, "t") + S, t = finite_field(ZZRingElem(31), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) for iter = 1:300 @@ -386,7 +386,7 @@ end end for p in [2, 7, 19, 65537] - R, t = FiniteField(ZZRingElem(p), 2, "t") + R, t = finite_field(ZZRingElem(p), 2, "t") S, x = power_series_ring(R, 10, "x", model=:capped_absolute) for iter = 1:10 @@ -416,7 +416,7 @@ end end @testset "FqPolyRepAbsPowerSeriesRingElem.unsafe_operators" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) for iter = 1:300 diff --git a/test/flint/fq_embed-test.jl b/test/flint/fq_embed-test.jl index 6205e9279..410e6a92e 100644 --- a/test/flint/fq_embed-test.jl +++ b/test/flint/fq_embed-test.jl @@ -3,17 +3,17 @@ for i in 1:10 p = ZZRingElem(next_prime(rand(1:999))) - k1, x1 = FiniteField(p, 1, "x1") - k2, x2 = FiniteField(p, 2, "x2") - k3, x3 = FiniteField(p, 3, "x3") - k4, x4 = FiniteField(p, 4, "x4") - k6, x6 = FiniteField(p, 6, "x6") - k8, x8 = FiniteField(p, 8, "x8") - k9, x9 = FiniteField(p, 9, "x9") - k12, x12 = FiniteField(p, 12, "x12") - k16, x16 = FiniteField(p, 16, "x16") - k18, x18 = FiniteField(p, 18, "x18") - k24, x24 = FiniteField(p, 24, "x24") + k1, x1 = finite_field(p, 1, "x1") + k2, x2 = finite_field(p, 2, "x2") + k3, x3 = finite_field(p, 3, "x3") + k4, x4 = finite_field(p, 4, "x4") + k6, x6 = finite_field(p, 6, "x6") + k8, x8 = finite_field(p, 8, "x8") + k9, x9 = finite_field(p, 9, "x9") + k12, x12 = finite_field(p, 12, "x12") + k16, x16 = finite_field(p, 16, "x16") + k18, x18 = finite_field(p, 18, "x18") + k24, x24 = finite_field(p, 24, "x24") S = Set([(k4, k12), (k6, k24), @@ -81,8 +81,8 @@ end p = ZZRingElem(next_prime(rand(1:999))) a, b = rand(1:5), rand(1:5) - ka, xa = FiniteField(p, a, "xa") - kab, xab = FiniteField(p, a*b, "xab") + ka, xa = finite_field(p, a, "xa") + kab, xab = finite_field(p, a*b, "xab") f = preimage_map(ka, kab) g = embed(ka, kab) @@ -107,7 +107,7 @@ end pop!(S, p) p = ZZRingElem(p) - F = FiniteField(p, 4, "s")[1] + F = finite_field(p, 4, "s")[1] Z = GF(p) R, x = polynomial_ring(Z, "x") @@ -140,10 +140,10 @@ end F4 = factor(P4) end - K1 = FiniteField(P1, "r1")[1] - K2 = FiniteField(P2, "r2")[1] - K3 = FiniteField(P3, "r3")[1] - K4 = FiniteField(P4, "r4")[1] + K1 = finite_field(P1, "r1")[1] + K2 = finite_field(P2, "r2")[1] + K3 = finite_field(P3, "r3")[1] + K4 = finite_field(P4, "r4")[1] K = Set([K1, K2, K3, K4]) while !isempty(K) diff --git a/test/flint/fq_mat-test.jl b/test/flint/fq_mat-test.jl index 8cf963fed..db1acfd27 100644 --- a/test/flint/fq_mat-test.jl +++ b/test/flint/fq_mat-test.jl @@ -1,6 +1,6 @@ @testset "FqPolyRepMatrix.constructors" begin - F4, a = FiniteField(ZZRingElem(2), 2, "a") - F9, b = FiniteField(ZZRingElem(3), 2, "b") + F4, a = finite_field(ZZRingElem(2), 2, "a") + F9, b = finite_field(ZZRingElem(3), 2, "b") R = FqPolyRepMatrixSpace(F4, 2, 2) @@ -167,7 +167,7 @@ end @testset "FqPolyRepMatrix.similar" begin - F9, b = FiniteField(ZZRingElem(3), 2, "b") + F9, b = finite_field(ZZRingElem(3), 2, "b") S = matrix_space(F9, 3, 3) s = S(ZZRingElem(3)) @@ -195,7 +195,7 @@ end end @testset "FqPolyRepMatrix.printing" begin - F4, _ = FiniteField(ZZRingElem(2), 2, "a") + F4, _ = finite_field(ZZRingElem(2), 2, "a") R = FqPolyRepMatrixSpace(F4, 2, 2) a = R(1) @@ -205,9 +205,9 @@ end end @testset "FqPolyRepMatrix.manipulation" begin - F4, _ = FiniteField(ZZRingElem(2), 2, "a") + F4, _ = finite_field(ZZRingElem(2), 2, "a") R = FqPolyRepMatrixSpace(F4, 2, 2) - F9, _ = FiniteField(ZZRingElem(3), 2, "b") + F9, _ = finite_field(ZZRingElem(3), 2, "b") S = FqPolyRepMatrixSpace(F9, 2, 2) ar = [ 1 2; 3 4] @@ -273,7 +273,7 @@ end end @testset "FqPolyRepMatrix.unary_ops" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) RR = matrix_space(F17, 4, 3) @@ -290,7 +290,7 @@ end end @testset "FqPolyRepMatrix.binary_ops" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) a = R([ 1 2 3 1; 3 2 1 2; 1 3 2 0]) @@ -356,10 +356,10 @@ end end @testset "FqPolyRepMatrix.adhoc_binary" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) - F2, _ = FiniteField(ZZRingElem(2), 1, "a") + F2, _ = finite_field(ZZRingElem(2), 1, "a") a = R([ 1 2 3 1; 3 2 1 2; 1 3 2 0]) @@ -395,7 +395,7 @@ end end @testset "FqPolyRepMatrix.comparison" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) @@ -409,7 +409,7 @@ end end @testset "FqPolyRepMatrix.adhoc_comparison" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) @@ -423,7 +423,7 @@ end end @testset "FqPolyRepMatrix.powering" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) @@ -466,7 +466,7 @@ end end @testset "FqPolyRepMatrix.trace_det" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) RR = matrix_space(F17, 4, 3) @@ -498,7 +498,7 @@ end end @testset "FqPolyRepMatrix.rank" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) RR = matrix_space(F17, 4, 3) @@ -522,7 +522,7 @@ end end @testset "FqPolyRepMatrix.inv" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 4) RR = matrix_space(F17, 4, 3) @@ -542,7 +542,7 @@ end end @testset "FqPolyRepMatrix.solve" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 3) S = matrix_space(F17, 3, 4) @@ -632,7 +632,7 @@ end @testset "FqPolyRepMatrix.lu" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 3) S = matrix_space(F17, 3, 4) @@ -659,7 +659,7 @@ end end @testset "FqPolyRepMatrix.view" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 3) S = matrix_space(F17, 3, 4) @@ -695,7 +695,7 @@ end end @testset "FqPolyRepMatrix.sub" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") S = matrix_space(F17, 3, 3) A = S([1 2 3; 4 5 6; 7 8 9]) @@ -719,7 +719,7 @@ end end @testset "FqPolyRepMatrix.concatenation" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 3) S = matrix_space(F17, 3, 4) @@ -755,7 +755,7 @@ end end @testset "FqPolyRepMatrix.conversion" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") R = matrix_space(F17, 3, 3) a = R([ 1 2 3 ; 3 2 1 ; 0 0 2 ]) @@ -766,7 +766,7 @@ end end @testset "FqPolyRepMatrix.charpoly" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") for dim = 0:5 S = matrix_space(F17, dim, dim) @@ -786,7 +786,7 @@ end end @testset "FqPolyRepMatrix.rand" begin - F17, _ = FiniteField(ZZRingElem(17), 1, "a") + F17, _ = finite_field(ZZRingElem(17), 1, "a") S = matrix_space(F17, 3, 3) M = rand(S) @test parent(M) == S diff --git a/test/flint/fq_nmod-test.jl b/test/flint/fq_nmod-test.jl index 261d7e827..dd6a689bf 100644 --- a/test/flint/fq_nmod-test.jl +++ b/test/flint/fq_nmod-test.jl @@ -1,5 +1,5 @@ @testset "fqPolyRepFieldElem.constructors" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") @test elem_type(R) == fqPolyRepFieldElem @test elem_type(fqPolyRepField) == fqPolyRepFieldElem @@ -8,14 +8,14 @@ Sy, y = polynomial_ring(residue_ring(FlintZZ, 3), "y") Syy, yy = GF(3)["y"] - T, z = FiniteField(y^2 + 1, "z") - T2, z2 = FiniteField(yy^2 + 1, "z") + T, z = finite_field(y^2 + 1, "z") + T2, z2 = finite_field(yy^2 + 1, "z") # check that one can leave out the name for the generator, or specify it as a symbol - @test FiniteField(7, 5)[1] isa fqPolyRepField - @test FiniteField(7, 5, :x)[1] isa fqPolyRepField - @test FiniteField(y^2 + 1)[1] isa fqPolyRepField - @test FiniteField(y^2 + 1, :x)[1] isa fqPolyRepField + @test finite_field(7, 5)[1] isa fqPolyRepField + @test finite_field(7, 5, :x)[1] isa fqPolyRepField + @test finite_field(y^2 + 1)[1] isa fqPolyRepField + @test finite_field(y^2 + 1, :x)[1] isa fqPolyRepField @test isa(R, fqPolyRepField) @test isa(T, fqPolyRepField) @@ -41,15 +41,15 @@ @test isa(d, fqPolyRepFieldElem) # check for primality - T3, z3 = FiniteField(yy^2 + 1, "z", check=false) + T3, z3 = finite_field(yy^2 + 1, "z", check=false) @test isa(T2, fqPolyRepField) Syyy, yyy = polynomial_ring(residue_ring(FlintZZ, 4), "y") @test yyy isa zzModPolyRingElem - @test_throws DomainError FiniteField(yyy^2+1, "z") + @test_throws DomainError finite_field(yyy^2+1, "z") end @testset "fqPolyRepFieldElem.rand" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") test_rand(R) test_rand(R, 1:9) @@ -63,7 +63,7 @@ end end @testset "fqPolyRepFieldElem.unsafe_coeffs" begin - R, a = FiniteField(23, 2, "a") + R, a = finite_field(23, 2, "a") b = R() @@ -88,7 +88,7 @@ end end @testset "fqPolyRepFieldElem.printing" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = 3x^4 + 2x^3 + 4x^2 + x + 1 @@ -96,7 +96,7 @@ end end @testset "fqPolyRepFieldElem.manipulation" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") @test iszero(zero(R)) @@ -126,7 +126,7 @@ end end @testset "fqPolyRepFieldElem.unary_ops" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -134,7 +134,7 @@ end end @testset "fqPolyRepFieldElem.binary_ops" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 b = 3x^4 + 2x^2 + x + 1 @@ -147,7 +147,7 @@ end end @testset "fqPolyRepFieldElem.adhoc_binary" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -165,7 +165,7 @@ end end @testset "fqPolyRepFieldElem.powering" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -175,7 +175,7 @@ end end @testset "fqPolyRepFieldElem.comparison" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 b = 3x^4 + 2x^2 + 2 @@ -186,7 +186,7 @@ end end @testset "fqPolyRepFieldElem.inversion" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -198,7 +198,7 @@ end end @testset "fqPolyRepFieldElem.exact_division" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 b = 3x^4 + 2x^2 + 2 @@ -209,7 +209,7 @@ end end @testset "fqPolyRepFieldElem.gcd" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 b = 3x^4 + 2x^2 + x + 1 @@ -220,7 +220,7 @@ end end @testset "fqPolyRepFieldElem.special_functions" begin - R, x = FiniteField(7, 5, "x") + R, x = finite_field(7, 5, "x") a = x^4 + 3x^2 + 6x + 1 @@ -251,22 +251,22 @@ end @testset "fqPolyRepFieldElem.iteration" begin for n = [2, 3, 5, 13, 31] - R, _ = FiniteField(n, 1, "x") + R, _ = finite_field(n, 1, "x") elts = Nemo.AbstractAlgebra.test_iterate(R) @test elts == R.(0:n-1) - R, _ = FiniteField(n, rand(2:9), "x") + R, _ = finite_field(n, rand(2:9), "x") Nemo.AbstractAlgebra.test_iterate(R) end end @testset "fqPolyRepFieldElem.lift" begin - R, x = FiniteField(23, 2, "x") + R, x = finite_field(23, 2, "x") f = 8x + 9 S, y = polynomial_ring(GF(23), "y") @test lift(S, f) == 8y + 9 end @testset "fqPolyRepField.overload" begin - R, x = FiniteField(19, 3, "x") + R, x = finite_field(19, 3, "x") @test R([1, 0, 1]) == x^2 + 1 end diff --git a/test/flint/fq_nmod_abs_series-test.jl b/test/flint/fq_nmod_abs_series-test.jl index 23acd0f86..d365f0762 100644 --- a/test/flint/fq_nmod_abs_series-test.jl +++ b/test/flint/fq_nmod_abs_series-test.jl @@ -3,7 +3,7 @@ end @testset "fqPolyRepAbsPowerSeriesRingElem.constructors" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R1 = AbsPowerSeriesRing(S, 30) R2 = AbsPowerSeriesRing(S, 30) @@ -36,7 +36,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.printing" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) b = x^2 + 3x + O(x^4) @@ -45,7 +45,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.manipulation" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -67,7 +67,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.similar" begin - R0, a = FiniteField(23, 2, "a") + R0, a = finite_field(23, 2, "a") R, x = power_series_ring(R0, 10, "x"; model=:capped_absolute) S, y = power_series_ring(ZZ, 10, "y"; model=:capped_absolute) @@ -115,7 +115,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.abs_series" begin - R, a = FiniteField(23, 2, "a") + R, a = finite_field(23, 2, "a") f = abs_series(R, [1, 2, 3], 3, 5, "y") @test isa(f, fqPolyRepAbsPowerSeriesRingElem) @@ -158,7 +158,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.unary_ops" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -170,7 +170,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.binary_ops" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -190,7 +190,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.adhoc_binary_ops" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -206,14 +206,14 @@ end @test d*ZZ(3) == 3x^2 + 9x^3 - 3x^4 - F, x = FiniteField(23, 1, "x") + F, x = finite_field(23, 1, "x") R, t = power_series_ring(F, 6, "t", model=:capped_absolute) @test F(1) * t == t end @testset "fqPolyRepAbsPowerSeriesRingElem.comparison" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -229,7 +229,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.adhoc_comparison" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -249,7 +249,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.powering" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -269,7 +269,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.shift" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -291,7 +291,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.truncation" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 2x + x^3 @@ -311,7 +311,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.exact_division" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = x + x^3 @@ -329,7 +329,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.adhoc_exact_division" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(ZZ, 30, "x", model=:capped_absolute) a = x + x^3 @@ -349,7 +349,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.inversion" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) a = 1 + x + 2x^2 + O(x^5) @@ -361,7 +361,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.square_root" begin - S, t = FiniteField(31, 5, "t") + S, t = finite_field(31, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) for iter = 1:300 @@ -371,7 +371,7 @@ end end for p in [2, 7, 19, 65537] - R, t = FiniteField(p, 2, "t") + R, t = finite_field(p, 2, "t") S, x = power_series_ring(R, 10, "x", model=:capped_absolute) for iter = 1:10 @@ -401,7 +401,7 @@ end end @testset "fqPolyRepAbsPowerSeriesRingElem.unsafe_operators" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x", model=:capped_absolute) for iter = 1:300 diff --git a/test/flint/fq_nmod_embed-test.jl b/test/flint/fq_nmod_embed-test.jl index dd2b1c24a..4d958c681 100644 --- a/test/flint/fq_nmod_embed-test.jl +++ b/test/flint/fq_nmod_embed-test.jl @@ -7,17 +7,17 @@ p = rand(2:997) end - k1, x1 = FiniteField(p, 1, "x1") - k2, x2 = FiniteField(p, 2, "x2") - k3, x3 = FiniteField(p, 3, "x3") - k4, x4 = FiniteField(p, 4, "x4") - k6, x6 = FiniteField(p, 6, "x6") - k8, x8 = FiniteField(p, 8, "x8") - k9, x9 = FiniteField(p, 9, "x9") - k12, x12 = FiniteField(p, 12, "x12") - k16, x16 = FiniteField(p, 16, "x16") - k18, x18 = FiniteField(p, 18, "x18") - k24, x24 = FiniteField(p, 24, "x24") + k1, x1 = finite_field(p, 1, "x1") + k2, x2 = finite_field(p, 2, "x2") + k3, x3 = finite_field(p, 3, "x3") + k4, x4 = finite_field(p, 4, "x4") + k6, x6 = finite_field(p, 6, "x6") + k8, x8 = finite_field(p, 8, "x8") + k9, x9 = finite_field(p, 9, "x9") + k12, x12 = finite_field(p, 12, "x12") + k16, x16 = finite_field(p, 16, "x16") + k18, x18 = finite_field(p, 18, "x18") + k24, x24 = finite_field(p, 24, "x24") S = Set([(k4, k12), (k6, k24), @@ -89,8 +89,8 @@ end end a, b = rand(1:5), rand(1:5) - ka, xa = FiniteField(p, a, "xa") - kab, xab = FiniteField(p, a*b, "xab") + ka, xa = finite_field(p, a, "xa") + kab, xab = finite_field(p, a*b, "xab") f = preimage_map(ka, kab) g = embed(ka, kab) @@ -113,7 +113,7 @@ end end pop!(S, p) - F = FiniteField(p, 4, "s")[1] + F = finite_field(p, 4, "s")[1] Z = residue_ring(ZZ, p) R, x = polynomial_ring(Z, "x") @@ -146,10 +146,10 @@ end F4 = factor(P4) end - K1 = FiniteField(P1, "r1")[1] - K2 = FiniteField(P2, "r2")[1] - K3 = FiniteField(P3, "r3")[1] - K4 = FiniteField(P4, "r4")[1] + K1 = finite_field(P1, "r1")[1] + K2 = finite_field(P2, "r2")[1] + K3 = finite_field(P3, "r3")[1] + K4 = finite_field(P4, "r4")[1] K = Set([K1, K2, K3, K4]) while !isempty(K) diff --git a/test/flint/fq_nmod_mat-test.jl b/test/flint/fq_nmod_mat-test.jl index 10e18e1a0..17a9f9426 100644 --- a/test/flint/fq_nmod_mat-test.jl +++ b/test/flint/fq_nmod_mat-test.jl @@ -167,7 +167,7 @@ end @testset "fqPolyRepMatrix.similar" begin - F9, b = FiniteField(3, 2, "b") + F9, b = finite_field(3, 2, "b") S = fqPolyRepMatrixSpace(F9, 2, 2) s = S(ZZRingElem(3)) diff --git a/test/flint/fq_nmod_mpoly-test.jl b/test/flint/fq_nmod_mpoly-test.jl index 3f3b8257a..836c326da 100644 --- a/test/flint/fq_nmod_mpoly-test.jl +++ b/test/flint/fq_nmod_mpoly-test.jl @@ -1,5 +1,5 @@ @testset "fqPolyRepMPolyRingElem.constructors" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -78,19 +78,19 @@ end end - RR, = FiniteField(23, 2, "a") + RR, = finite_field(23, 2, "a") S, (x, y) = polynomial_ring(R, ["x", "y"]) M = MPolyBuildCtx(S) @test_throws ErrorException push_term!(M, one(RR), zeros(Int, 2)) - F, = FiniteField(2, 2, :z) + F, = finite_field(2, 2, :z) R, (x, ) = polynomial_ring(F, ["x",]) @test R([F(1)], [[BigInt(1)]]) == x @test R([1], [[BigInt(1)]]) == x end @testset "fqPolyRepMPolyRingElem.printing" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") S, (x, y) = polynomial_ring(R, ["x", "y"]) @test !occursin(r"{", string(S)) @@ -107,7 +107,7 @@ end end @testset "fqPolyRepMPolyRingElem.hash" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") S, (x, y) = polynomial_ring(R, ["x", "y"]) p = y^ZZRingElem(2)^100 @@ -117,7 +117,7 @@ end end @testset "fqPolyRepMPolyRingElem.manipulation" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -250,7 +250,7 @@ end end @testset "fqPolyRepMPolyRingElem.multivariate_coeff" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for ord in Nemo.flint_orderings S, (x, y, z) = polynomial_ring(R, ["x", "y", "z"]; ordering=ord) @@ -268,7 +268,7 @@ end end @testset "fqPolyRepMPolyRingElem.unary_ops" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -285,7 +285,7 @@ end end @testset "fqPolyRepMPolyRingElem.binary_ops" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -308,7 +308,7 @@ end end @testset "fqPolyRepMPolyRingElem.adhoc_binary" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -344,7 +344,7 @@ end end @testset "fqPolyRepMPolyRingElem.adhoc_comparison" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -366,7 +366,7 @@ end end @testset "fqPolyRepMPolyRingElem.powering" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -393,7 +393,7 @@ end end @testset "fqPolyRepMPolyRingElem.divides" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -422,7 +422,7 @@ end end @testset "fqPolyRepMPolyRingElem.euclidean_division" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -458,7 +458,7 @@ end end @testset "fqPolyRepMPolyRingElem.ideal_reduction" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -507,7 +507,7 @@ end end @testset "fqPolyRepMPolyRingElem.gcd" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:4 var_names = ["x$j" for j in 1:num_vars] @@ -533,7 +533,7 @@ end end @testset "fqPolyRepMPolyRingElem.factor" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") R, (x, y, z) = polynomial_ring(R, ["x", "y", "z"]) function check_factor(a, esum) @@ -550,7 +550,7 @@ end end @testset "fqPolyRepMPolyRingElem.sqrt" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:4 var_names = ["x$j" for j in 1:num_vars] @@ -576,7 +576,7 @@ end end @testset "fqPolyRepMPolyRingElem.evaluation" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -659,7 +659,7 @@ end end @testset "fqPolyRepMPolyRingElem.valuation" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -697,7 +697,7 @@ end end @testset "fqPolyRepMPolyRingElem.derivative" begin - R, a = FiniteField(23, 5, "a") + R, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -717,7 +717,7 @@ end end @testset "fqPolyRepMPolyRingElem.combine_like_terms" begin - R23, a = FiniteField(23, 5, "a") + R23, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -753,7 +753,7 @@ end end @testset "fqPolyRepMPolyRingElem.exponents" begin - R23, a = FiniteField(23, 5, "a") + R23, a = finite_field(23, 5, "a") for num_vars = 1:10 var_names = ["x$j" for j in 1:num_vars] @@ -808,7 +808,7 @@ end end @testset "fqPolyRepMPolyRingElem.gcd_with_cofactors" begin - R23, t = FiniteField(23, 5, "t") + R23, t = finite_field(23, 5, "t") R, (x, y, z) = polynomial_ring(R23, [:x, :y, :z]) @test gcd_with_cofactors(x, y) == (1, x, y) diff --git a/test/flint/fq_nmod_poly-test.jl b/test/flint/fq_nmod_poly-test.jl index eb91fb78e..d8a2d3961 100644 --- a/test/flint/fq_nmod_poly-test.jl +++ b/test/flint/fq_nmod_poly-test.jl @@ -1,5 +1,5 @@ @testset "fqPolyRepPolyRingElem.constructors" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S1 = PolyRing(R) S2 = PolyRing(R) @@ -68,7 +68,7 @@ end @testset "fqPolyRepPolyRingElem.printing" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x^2 + y^3 + 1 @@ -77,7 +77,7 @@ end end @testset "fqPolyRepPolyRingElem.manipulation" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") @test iszero(zero(S)) @@ -110,7 +110,7 @@ end end @testset "fqPolyRepPolyRingElem.polynomial" begin - R, _ = FiniteField(23, 3, "a") + R, _ = finite_field(23, 3, "a") f = polynomial(R, []) g = polynomial(R, [1, 2, 3]) @@ -130,7 +130,7 @@ end end @testset "fqPolyRepPolyRingElem.similar" begin - R, a = FiniteField(23, 3, "a") + R, a = finite_field(23, 3, "a") f = polynomial(R, [1, 2, 3]) g = similar(f) @@ -145,7 +145,7 @@ end end @testset "fqPolyRepPolyRingElem.binary_ops" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -159,7 +159,7 @@ end end @testset "fqPolyRepPolyRingElem.adhoc_binary" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -195,7 +195,7 @@ end end @testset "fqPolyRepPolyRingElem.comparison" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -207,7 +207,7 @@ end end @testset "fqPolyRepPolyRingElem.adhoc_comparison" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") @test S(1) == 1 @@ -224,7 +224,7 @@ end end @testset "fqPolyRepPolyRingElem.unary_ops" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -233,7 +233,7 @@ end end @testset "fqPolyRepPolyRingElem.truncation" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -249,7 +249,7 @@ end end @testset "fqPolyRepPolyRingElem.reverse" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -258,7 +258,7 @@ end end @testset "fqPolyRepPolyRingElem.shift" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -273,7 +273,7 @@ end end @testset "fqPolyRepPolyRingElem.powering" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -284,7 +284,7 @@ end end @testset "fqPolyRepPolyRingElem.modular_arithmetic" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = (3*x^2 + x + 2)*y + x^2 + 1 @@ -305,7 +305,7 @@ end end @testset "fqPolyRepPolyRingElem.exact_division" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -315,7 +315,7 @@ end end @testset "fqPolyRepPolyRingElem.adhoc_exact_division" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -326,7 +326,7 @@ end end @testset "fqPolyRepPolyRingElem.euclidean_division" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") k = y^3 + x*y^2 + (x + 1)*y + 3 @@ -338,7 +338,7 @@ end end @testset "fqPolyRepPolyRingElem.content_primpart_gcd" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") k = x*y^2 + (x + 1)*y + 3 @@ -361,7 +361,7 @@ end @testset "fqPolyRepPolyRingElem.square_root" begin for p in [2, 23] - R, x = FiniteField(p, 3, "x") + R, x = finite_field(p, 3, "x") S, y = polynomial_ring(R, "y") for iter in 1:1000 @@ -395,7 +395,7 @@ end end @testset "fqPolyRepPolyRingElem.evaluation" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x^2 + 2x + 1 @@ -416,7 +416,7 @@ end end @testset "fqPolyRepPolyRingElem.composition" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -426,7 +426,7 @@ end end @testset "fqPolyRepPolyRingElem.derivative" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") h = x*y^2 + (x + 1)*y + 3 @@ -435,7 +435,7 @@ end end @testset "fqPolyRepPolyRingElem.integral" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = (x^2 + 2x + 1)*y^2 + (x + 1)*y - 2x + 4 @@ -444,7 +444,7 @@ end end @testset "fqPolyRepPolyRingElem.resultant" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = 3x*y^2 + (x + 1)*y + 3 @@ -454,7 +454,7 @@ end end @testset "fqPolyRepPolyRingElem.discriminant" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -463,7 +463,7 @@ end end @testset "fqPolyRepPolyRingElem.gcdx" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = 3x*y^2 + (x + 1)*y + 3 @@ -473,7 +473,7 @@ end end @testset "fqPolyRepPolyRingElem.special" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") @test chebyshev_t(20, y) == 524288*y^20-2621440*y^18+5570560*y^16-6553600*y^14+4659200*y^12-2050048*y^10+549120*y^8-84480*y^6+6600*y^4-200*y^2+1 @@ -482,7 +482,7 @@ end end @testset "fqPolyRepPolyRingElem.inflation_deflation" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = (x + 1)*y^2 + 2x*y + x + 3 @@ -491,7 +491,7 @@ end end @testset "fqPolyRepPolyRingElem.is_irreducible" begin - R, a = FiniteField(23, 1, "a") + R, a = finite_field(23, 1, "a") Rx, x = polynomial_ring(R, "x") f = x^6 + x^4 + 2 *x^2 @@ -504,7 +504,7 @@ end end @testset "fqPolyRepPolyRingElem.is_squarefree" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = y^6 + y^4 + 2 *y^2 @@ -515,7 +515,7 @@ end end @testset "fqPolyRepPolyRingElem.factor" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = 7y^2 + 3y + 2 @@ -547,7 +547,7 @@ end end @testset "fqPolyRepPolyRingElem.remove_valuation" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = 7y^2 + 3y + 2 @@ -574,8 +574,8 @@ end end @testset "issue #1353" begin - F, _ = FiniteField(2, 1, "1") - E, a = FiniteField(2, 15, "a") + F, _ = finite_field(2, 1, "1") + E, a = finite_field(2, 15, "a") S, x = PolynomialRing(F, "x") @test_throws ErrorException x+a diff --git a/test/flint/fq_nmod_rel_series-test.jl b/test/flint/fq_nmod_rel_series-test.jl index 37761d8f9..8244bc389 100644 --- a/test/flint/fq_nmod_rel_series-test.jl +++ b/test/flint/fq_nmod_rel_series-test.jl @@ -3,7 +3,7 @@ end @testset "fqPolyRepRelPowerSeriesRingElem.constructors" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S1 = RelPowerSeriesRing(R, 30) S2 = RelPowerSeriesRing(R, 30) @@ -45,7 +45,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.printing" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") b = (t^2 + 1)*x^2 + (t + 3)x + O(x^4) @@ -54,7 +54,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.manipulation" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") @test max_precision(S) == 30 @@ -90,7 +90,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.similar" begin - R0, a = FiniteField(23, 2, "a") + R0, a = finite_field(23, 2, "a") R, x = power_series_ring(R0, 10, "x") S, y = power_series_ring(ZZ, 10, "y") @@ -138,7 +138,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.rel_series" begin - R, a = FiniteField(23, 2, "a") + R, a = finite_field(23, 2, "a") f = rel_series(R, [1, 2, 3], 3, 5, 2, "y") @test isa(f, fqPolyRepRelPowerSeriesRingElem) @@ -181,7 +181,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.unary_ops" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -193,7 +193,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.binary_ops" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -331,7 +331,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.adhoc_binary_ops" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -349,7 +349,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.comparison" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -369,7 +369,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.adhoc_comparison" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -389,7 +389,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.powering" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -409,7 +409,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.shift" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -431,7 +431,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.truncation" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -451,7 +451,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.inversion" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = 1 + x + 2x^2 + O(x^5) @@ -463,7 +463,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.exact_division" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = x + x^3 @@ -481,7 +481,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.adhoc_exact_division" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") a = x + x^3 @@ -503,7 +503,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.square_root" begin - S, t = FiniteField(31, 5, "t") + S, t = finite_field(31, 5, "t") R, x = power_series_ring(S, 30, "x") for iter = 1:300 @@ -513,7 +513,7 @@ end end for p in [2, 7, 19, 65537] - R, t = FiniteField(p, 2, "t") + R, t = finite_field(p, 2, "t") S, x = power_series_ring(R, 10, "x") @@ -544,7 +544,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.special_functions" begin - R, t = FiniteField(23, 5, "t") + R, t = finite_field(23, 5, "t") S, x = power_series_ring(R, 30, "x") @test isequal(exp(x + O(x^10)), 18*x^9+x^8+8*x^7+10*x^6+14*x^5+x^4+4*x^3+12*x^2+x+1+O(x^10)) @@ -553,7 +553,7 @@ end end @testset "fqPolyRepRelPowerSeriesRingElem.unsafe_operators" begin - S, t = FiniteField(23, 5, "t") + S, t = finite_field(23, 5, "t") R, x = power_series_ring(S, 30, "x") for iter = 1:300 diff --git a/test/flint/fq_poly-test.jl b/test/flint/fq_poly-test.jl index 1f47b7693..d00096da9 100644 --- a/test/flint/fq_poly-test.jl +++ b/test/flint/fq_poly-test.jl @@ -1,5 +1,5 @@ @testset "FqPolyRepPolyRingElem.constructors" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S1 = PolyRing(R) S2 = PolyRing(R) @@ -68,7 +68,7 @@ end @testset "FqPolyRepPolyRingElem.printing" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") T, z = polynomial_ring(S, "z") @@ -78,7 +78,7 @@ end end @testset "FqPolyRepPolyRingElem.manipulation" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") @test iszero(zero(S)) @@ -109,7 +109,7 @@ end end @testset "FqPolyRepPolyRingElem.polynomial" begin - R, _ = FiniteField(ZZ(23), 3, "a") + R, _ = finite_field(ZZ(23), 3, "a") f = polynomial(R, []) g = polynomial(R, [1, 2, 3]) @@ -129,7 +129,7 @@ end end @testset "FqPolyRepPolyRingElem.similar" begin - R, a = FiniteField(ZZ(23), 3, "a") + R, a = finite_field(ZZ(23), 3, "a") f = polynomial(R, [1, 2, 3]) g = similar(f) @@ -144,7 +144,7 @@ end end @testset "FqPolyRepPolyRingElem.binary_ops" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -158,7 +158,7 @@ end end @testset "FqPolyRepPolyRingElem.adhoc_binary" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -194,7 +194,7 @@ end end @testset "FqPolyRepPolyRingElem.comparison" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -206,7 +206,7 @@ end end @testset "FqPolyRepPolyRingElem.adhoc_comparison" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") @test S(1) == 1 @@ -223,7 +223,7 @@ end end @testset "FqPolyRepPolyRingElem.unary_ops" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -232,7 +232,7 @@ end end @testset "FqPolyRepPolyRingElem.truncation" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -248,7 +248,7 @@ end end @testset "FqPolyRepPolyRingElem.reverse" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -259,7 +259,7 @@ end end @testset "FqPolyRepPolyRingElem.shift" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -274,7 +274,7 @@ end end @testset "FqPolyRepPolyRingElem.powering" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -285,7 +285,7 @@ end end @testset "FqPolyRepPolyRingElem.modular_arithmetic" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = (3*x^2 + x + 2)*y + x^2 + 1 @@ -306,7 +306,7 @@ end end @testset "FqPolyRepPolyRingElem.exact_division" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -316,7 +316,7 @@ end end @testset "FqPolyRepPolyRingElem.adhoc_exact_division" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -327,7 +327,7 @@ end end @testset "FqPolyRepPolyRingElem.euclidean_division" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") k = y^3 + x*y^2 + (x + 1)*y + 3 @@ -339,7 +339,7 @@ end end @testset "FqPolyRepPolyRingElem.content_primpart_gcd" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") k = x*y^2 + (x + 1)*y + 3 @@ -362,7 +362,7 @@ end @testset "FqPolyRepPolyRingElem.square_root" begin for p in [2, 23] - R, x = FiniteField(ZZRingElem(p), 3, "x") + R, x = finite_field(ZZRingElem(p), 3, "x") S, y = polynomial_ring(R, "y") for iter in 1:1000 @@ -396,7 +396,7 @@ end end @testset "FqPolyRepPolyRingElem.evaluation" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x^2 + 2x + 1 @@ -417,7 +417,7 @@ end end @testset "FqPolyRepPolyRingElem.composition" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -427,7 +427,7 @@ end end @testset "FqPolyRepPolyRingElem.derivative" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") h = x*y^2 + (x + 1)*y + 3 @@ -436,7 +436,7 @@ end end @testset "FqPolyRepPolyRingElem.integral" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = (x^2 + 2x + 1)*y^2 + (x + 1)*y - 2x + 4 @@ -445,7 +445,7 @@ end end @testset "FqPolyRepPolyRingElem.resultant" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = 3x*y^2 + (x + 1)*y + 3 @@ -455,7 +455,7 @@ end end @testset "FqPolyRepPolyRingElem.discriminant" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = x*y^2 + (x + 1)*y + 3 @@ -464,7 +464,7 @@ end end @testset "FqPolyRepPolyRingElem.gcdx" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = 3x*y^2 + (x + 1)*y + 3 @@ -474,7 +474,7 @@ end end @testset "FqPolyRepPolyRingElem.special" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") @test chebyshev_t(20, y) == 524288*y^20-2621440*y^18+5570560*y^16-6553600*y^14+4659200*y^12-2050048*y^10+549120*y^8-84480*y^6+6600*y^4-200*y^2+1 @@ -483,7 +483,7 @@ end end @testset "FqPolyRepPolyRingElem.inflation_deflation" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = (x + 1)*y^2 + 2x*y + x + 3 @@ -492,7 +492,7 @@ end end @testset "FqPolyRepPolyRingElem.is_irreducible" begin - R, a = FiniteField(ZZRingElem(23), 1, "a") + R, a = finite_field(ZZRingElem(23), 1, "a") Rx, x = polynomial_ring(R, "x") f = x^6 + x^4 + 2 *x^2 @@ -505,7 +505,7 @@ end end @testset "FqPolyRepPolyRingElem.is_squarefree" begin - R, a = FiniteField(ZZRingElem(23), 1, "a") + R, a = finite_field(ZZRingElem(23), 1, "a") Rx, x = polynomial_ring(R, "x") f = x^6 + x^4 + 2 *x^2 @@ -516,7 +516,7 @@ end end @testset "FqPolyRepPolyRingElem.factor" begin - R, x = FiniteField(ZZRingElem(23), 5, "x") + R, x = finite_field(ZZRingElem(23), 5, "x") S, y = polynomial_ring(R, "y") f = 7y^2 + 3y + 2 @@ -550,7 +550,7 @@ end end @testset "FqPolyRepPolyRingElem.remove_valuation" begin - R, x = FiniteField(23, 5, "x") + R, x = finite_field(23, 5, "x") S, y = polynomial_ring(R, "y") f = 7y^2 + 3y + 2 diff --git a/test/flint/fq_rel_series-test.jl b/test/flint/fq_rel_series-test.jl index 0baae1d07..a16671f2b 100644 --- a/test/flint/fq_rel_series-test.jl +++ b/test/flint/fq_rel_series-test.jl @@ -3,7 +3,7 @@ end @testset "FqPolyRepRelPowerSeriesRingElem.constructors" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S1 = RelPowerSeriesRing(R, 30) S2 = RelPowerSeriesRing(R, 30) @@ -45,7 +45,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.printing" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") b = (t^2 + 1)*x^2 + (t + 3)x + O(x^4) @@ -54,7 +54,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.manipulation" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") @test max_precision(S) == 30 @@ -90,7 +90,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.similar" begin - R0, a = FiniteField(ZZ(23), 2, "a") + R0, a = finite_field(ZZ(23), 2, "a") R, x = power_series_ring(R0, 10, "x") S, y = power_series_ring(ZZ, 10, "y") @@ -138,7 +138,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.rel_series" begin - R, a = FiniteField(ZZ(23), 2, "a") + R, a = finite_field(ZZ(23), 2, "a") f = rel_series(R, [1, 2, 3], 3, 5, 2, "y") @test isa(f, FqPolyRepRelPowerSeriesRingElem) @@ -181,7 +181,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.unary_ops" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -193,7 +193,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.binary_ops" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -331,7 +331,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.adhoc_binary_ops" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -349,7 +349,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.comparison" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -369,7 +369,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.adhoc_comparison" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -389,7 +389,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.powering" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -409,7 +409,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.shift" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -431,7 +431,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.truncation" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 2x + x^3 @@ -451,7 +451,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.inversion" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = 1 + x + 2x^2 + O(x^5) @@ -463,7 +463,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.exact_division" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = x + x^3 @@ -481,7 +481,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.adhoc_exact_division" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") a = x + x^3 @@ -503,7 +503,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.square_root" begin - S, t = FiniteField(ZZRingElem(31), 5, "t") + S, t = finite_field(ZZRingElem(31), 5, "t") R, x = power_series_ring(S, 30, "x") for iter = 1:300 @@ -513,7 +513,7 @@ end end for p in [2, 7, 19, 65537] - R, t = FiniteField(ZZRingElem(p), 2, "t") + R, t = finite_field(ZZRingElem(p), 2, "t") S, x = power_series_ring(R, 10, "x") @@ -544,7 +544,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.special_functions" begin - R, t = FiniteField(ZZRingElem(23), 5, "t") + R, t = finite_field(ZZRingElem(23), 5, "t") S, x = power_series_ring(R, 30, "x") @test isequal(exp(x + O(x^10)), 18*x^9+x^8+8*x^7+10*x^6+14*x^5+x^4+4*x^3+12*x^2+x+1+O(x^10)) @@ -553,7 +553,7 @@ end end @testset "FqPolyRepRelPowerSeriesRingElem.unsafe_operators" begin - S, t = FiniteField(ZZRingElem(23), 5, "t") + S, t = finite_field(ZZRingElem(23), 5, "t") R, x = power_series_ring(S, 30, "x") for iter = 1:300