Skip to content

Commit

Permalink
Switch from FiniteField to finite_field (oscar-system#2872)
Browse files Browse the repository at this point in the history
Command used to create this PR:

    git grep -l -w FiniteField | xargs perl -pi -e 's;\bFiniteField\b;finite_field;g'
  • Loading branch information
fingolfin authored Oct 4, 2023
1 parent 34196e6 commit 5ec1474
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DocStringExtensions = "0.8, 0.9"
GAP = "0.9.4"
Hecke = "0.22.1"
JSON = "^0.20, ^0.21"
Nemo = "0.36"
Nemo = "0.36.1"
Polymake = "0.11.6"
Preferences = "1"
RandomExtensions = "0.4.3"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/CommutativeAlgebra/rings.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Finite field of characteristic 170141183460469231731687303715884105727
### Finite fields $\mathbb{F}_{p^n}$ with $p^n$ elements, $p$ a prime

```jldoctest
julia> FiniteField(2, 70, "a")
julia> finite_field(2, 70, "a")
(Finite field of degree 70 over GF(2), a)
```
Expand All @@ -156,7 +156,7 @@ Finite field of characteristic 3
julia> T, t = polynomial_ring(F, "t")
(Univariate polynomial ring in t over GF(3), t)
julia> K, a = FiniteField(t^2 + 1, "a")
julia> K, a = finite_field(t^2 + 1, "a")
(Finite field of degree 2 over GF(3), a)
```
Expand Down
4 changes: 2 additions & 2 deletions experimental/StandardFiniteFields/src/StandardFiniteFields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function _extension_with_tower_basis(
push!(lcoeffs, one(K))
pmat = identity_matrix(K, Int(deg))
vname = "x" * string(deg)
L, X = FiniteField(polynomial(K, lcoeffs), vname)
L, X = finite_field(polynomial(K, lcoeffs), vname)
set_standard_finite_field!(L)
set_primitive_powers_in_tower_basis!(L, pmat)

Expand Down Expand Up @@ -439,7 +439,7 @@ function _extension_with_tower_basis(
# pmat gives the primitive powers in the tower basis for the new extension

vname = "x" * string(d)
L, X = FiniteField(polynomial(F, poly), vname)
L, X = finite_field(polynomial(F, poly), vname)
set_standard_finite_field!(L)
set_primitive_powers_in_tower_basis!(L, pmat)

Expand Down
2 changes: 1 addition & 1 deletion src/GAP/iso_gap_oscar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Admissible values of `R` and the corresponding `S` are currently as follows.
| `Integers` | `ZZ` |
| `Rationals` | `QQ` |
| `mod(Integers, n)` | `residue_ring(ZZ, n)` |
| `GF(p, d)` | `FiniteField(p, d)[1]` |
| `GF(p, d)` | `finite_field(p, d)[1]` |
| `CF(n)` | `cyclotomic_field(n)[1]` |
| `AlgebraicExtension(Rationals, f)` | `number_field(g)[1]` |
| `Cyclotomics` | `abelian_closure(QQ)[1]` |
Expand Down
2 changes: 1 addition & 1 deletion src/GAP/iso_oscar_gap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ Admissible values of `R` and the corresponding `S` are currently as follows.
| `ZZ` | `Integers` |
| `QQ` | `Rationals` |
| `residue_ring(ZZ, n)` | `mod(Integers, n)` |
| `FiniteField(p, d)[1]` | `GF(p, d)` |
| `finite_field(p, d)[1]` | `GF(p, d)` |
| `cyclotomic_field(n)[1]` | `CF(n)` |
| `number_field(f::QQPolyRingElem)[1]` | `AlgebraicExtension(Rationals, g)` |
| `abelian_closure(QQ)[1]` | `Cyclotomics` |
Expand Down
2 changes: 1 addition & 1 deletion src/Rings/MPolyMap/MPolyRing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ to `S`, if such a homomorphism exists, and throw an error, otherwise.
# Examples
```jldoctest
julia> K, a = FiniteField(2, 2, "a");
julia> K, a = finite_field(2, 2, "a");
julia> R, (x, y) = polynomial_ring(K, ["x", "y"]);
Expand Down
2 changes: 1 addition & 1 deletion src/Serialization/Fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function load_object(s::DeserializerState,
::Type{<: fqPolyRepField},
dict::Dict)
def_pol = load_typed_object(s, dict[:def_pol])
K, _ = FiniteField(def_pol, cached=false)
K, _ = finite_field(def_pol, cached=false)
return K
end

Expand Down
4 changes: 2 additions & 2 deletions src/TropicalGeometry/valuation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ end
# Constructor:
function TropicalSemiringMap(Q::QQField, p::QQFieldElem, M::Union{typeof(min),typeof(max)}=min)
function residue_map(c)
return FiniteField(ZZ(p))[1](ZZ(c))
return finite_field(ZZ(p))[1](ZZ(c))
end
return TropicalSemiringMap{typeof(Q),typeof(p)}(Q,p,ZZ,ZZ(p),FiniteField(ZZ(p))[1],residue_map,:p,TropicalSemiring(M))
return TropicalSemiringMap{typeof(Q),typeof(p)}(Q,p,ZZ,ZZ(p),finite_field(ZZ(p))[1],residue_map,:p,TropicalSemiring(M))
end
# for other types of `p` such as `Integer`
TropicalSemiringMap(Q::QQField,p::ZZRingElem,M::Union{typeof(min),typeof(max)}=min) = TropicalSemiringMap(Q,QQ(p),M)
Expand Down
2 changes: 1 addition & 1 deletion test/Groups/conjugation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ end
end

F,t = polynomial_ring(GF(3),"t")
F,z = FiniteField(t^2+1,"z")
F,z = finite_field(t^2+1,"z")
_,t = polynomial_ring(F,"t")
G = GL(8,F)
x = cat(generalized_jordan_block(t^2+t+z,2), generalized_jordan_block(t^2+z+1,2); dims=(1,2))
Expand Down
16 changes: 8 additions & 8 deletions test/Groups/forms.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testset "Definition forms" begin
T,t = polynomial_ring(GF(3),"t")
F,z = FiniteField(t^2+1,"z")
F,z = finite_field(t^2+1,"z")

B = matrix(F,4,4,[0 1 0 0; 2 0 0 0; 0 0 0 z+2; 0 0 1-z 0])
@test is_alternating(B)
Expand Down Expand Up @@ -67,7 +67,7 @@
@test gram_matrix(f)==matrix(F,1,1,[-z])

T,t = polynomial_ring(GF(2),"t")
F,z = FiniteField(t^2+t+1,"z")
F,z = finite_field(t^2+t+1,"z")
R = polynomial_ring(F,4)[1]
p = R[1]*R[2]+z*R[3]*R[4]
Q = quadratic_form(p)
Expand All @@ -82,7 +82,7 @@
end

@testset "Evaluating forms" begin
F,z = FiniteField(3,2,"z")
F,z = finite_field(3,2,"z")
V=VectorSpace(F,6)

x = matrix(F,6,6,[1,0,0,0,z+1,0,0,0,0,2,1+2*z,1,0,0,1,0,0,z,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1])
Expand Down Expand Up @@ -177,7 +177,7 @@ end
@test z==nothing

T,t = polynomial_ring(GF(3),"t")
F,a = FiniteField(t^2+1,"a")
F,a = finite_field(t^2+1,"a")
x = zero_matrix(F,6,6)
x[1,2]=1+2*a; x[3,4]=a; x[5,6]=1; x=x+transpose(x)
y = diagonal_matrix(F.([a,1,1,a+1,2,2*a+2]))
Expand All @@ -201,7 +201,7 @@ end
@test is_true
@test f^z == g

F,a = FiniteField(2,3,"a")
F,a = finite_field(2,3,"a")
x = zero_matrix(F,6,6)
x[1,2]=a; x[2,3]=a^2+1; x[3,4]=1; x[1,5]=a^2+a+1; x[5,6]=1; x=x-transpose(x)
y = zero_matrix(F,6,6)
Expand Down Expand Up @@ -236,7 +236,7 @@ end
@test_throws ArgumentError is_congruent(f,g)

#hermitian
F,a = FiniteField(3,2,"a")
F,a = finite_field(3,2,"a")
x = zero_matrix(F,6,6)
x[4,5]=1; x[5,6]=a-1; x=x+conjugate_transpose(x)
y = zero_matrix(F,6,6)
Expand All @@ -253,7 +253,7 @@ end
@test is_true
@test f^z == g

F,a = FiniteField(2,2,"a")
F,a = finite_field(2,2,"a")
x = zero_matrix(F,6,6)
x[4,5]=1; x[5,6]=a+1; x=x+conjugate_transpose(x)
y = zero_matrix(F,6,6)
Expand Down Expand Up @@ -297,7 +297,7 @@ end
is_true,z = is_congruent(Q1,Q2)
@test !is_true

F,a = FiniteField(2,2,"a")
F,a = finite_field(2,2,"a")
R = polynomial_ring(F,6)[1]
p1 = R[1]*R[2]+R[3]*R[4]+R[5]^2+R[5]*R[6]+R[6]^2
p2 = R[1]*R[6]+a*R[2]*R[5]+R[3]*R[4]
Expand Down
14 changes: 7 additions & 7 deletions test/Groups/matrixgroups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@test GAP.Globals.Order(map_entries(G.ring_iso, diagonal_matrix([z,z,one(F)]))) == 28

T,t = polynomial_ring(GF(3) ,"t")
F,z = FiniteField(t^2+1,"z")
F,z = finite_field(t^2+1,"z")
G = GL(3,F)
@test G.X isa GAP.GapObj
@test isdefined(G,:X)
Expand Down Expand Up @@ -155,7 +155,7 @@ end
#FIXME : this may change in future. It can be easily skipped.
@testset "Fields assignment" begin
T,t=polynomial_ring(GF(3),"t")
F,z=FiniteField(t^2+1,"z")
F,z=finite_field(t^2+1,"z")

G = GL(2,F)
@test G isa MatrixGroup
Expand Down Expand Up @@ -377,7 +377,7 @@ end

@testset "Membership" begin
T,t=polynomial_ring(GF(3),"t")
F,z=FiniteField(t^2+1,"z")
F,z=finite_field(t^2+1,"z")

G = GL(2,F)
S = SL(2,F)
Expand Down Expand Up @@ -428,7 +428,7 @@ end

@testset "Methods on elements" begin
T,t=polynomial_ring(GF(3),"t")
F,z=FiniteField(t^2+1,"z")
F,z=finite_field(t^2+1,"z")

G = GL(2,F)
x = G([1,z,0,1])
Expand Down Expand Up @@ -471,7 +471,7 @@ end

@testset "Subgroups" begin
T,t=polynomial_ring(GF(3),"t")
F,z=FiniteField(t^2+1,"z")
F,z=finite_field(t^2+1,"z")

G = GL(2,F)
s1 = G([2,1,2,0])
Expand All @@ -496,7 +496,7 @@ end

@testset "Cosets and conjugacy classes" begin
T,t=polynomial_ring(GF(3),"t")
F,z=FiniteField(t^2+1,"z")
F,z=finite_field(t^2+1,"z")

G = GL(2,F)
H = GO(-1,2,F)
Expand Down Expand Up @@ -573,7 +573,7 @@ end
x = one(G)
@test is_semisimple(x) && is_unipotent(x)

F,z = FiniteField(5,3,"z")
F,z = finite_field(5,3,"z")
G = GL(6,F)
R,t = polynomial_ring(F,"t")
f = t^3+t*z+1
Expand Down
4 changes: 2 additions & 2 deletions test/Groups/operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ end
@test is_skew_symmetric(P-transpose(P))
@test is_alternating(P-transpose(P))

F,z = FiniteField(2,2)
F,z = finite_field(2,2)
x=matrix(F,4,4,[1,z,0,0,0,1,z^2,z,z,0,0,1,0,0,z+1,0])
y=x+transpose(x)
@test is_symmetric(y)
Expand Down Expand Up @@ -136,7 +136,7 @@ end
@test base_ring(f1)==F1
x = Oscar._centralizer(f1)(companion_matrix(f1))
@test order(GL(2,F1)(x))==8
K,z = FiniteField(f,"z")
K,z = finite_field(f,"z")
@test z^4==1
@test (change_base_ring(K,Oscar._centralizer(f1))(z))^4 !=1

Expand Down
2 changes: 1 addition & 1 deletion test/InvariantTheory/fundamental_invariants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
end

# Char p, modular
F9, b = FiniteField(3, 2, "b")
F9, b = finite_field(3, 2, "b")
N3 = matrix(F9, [ 1 0 0 0; b + 1 1 0 0; -1 0 1 0; b 0 -1 1 ])
N4 = matrix(F9, [ 1 0 0 0; 1 1 0 0; 1 0 1 0; b -b b 1 ])
RGm = invariant_ring(N3, N4)
Expand Down
2 changes: 1 addition & 1 deletion test/InvariantTheory/primary_invariants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
end

# Char p, modular
F9, b = FiniteField(3, 2, "b")
F9, b = finite_field(3, 2, "b")
N3 = matrix(F9, [ 1 0 0 0; b + 1 1 0 0; -1 0 1 0; b 0 -1 1 ])
N4 = matrix(F9, [ 1 0 0 0; 1 1 0 0; 1 0 1 0; b -b b 1 ])
RG = invariant_ring(N3, N4)
Expand Down
2 changes: 1 addition & 1 deletion test/InvariantTheory/secondary_invariants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
N2 = matrix(F3, 3, 3, [ 2, 0, 0, 0, 2, 0, 0, 0, 2 ])
RGp = invariant_ring(N1, N2) # char p, non-modular

F9, b = FiniteField(3, 2, "b")
F9, b = finite_field(3, 2, "b")
N3 = matrix(F9, [ 1 0 0 0; b + 1 1 0 0; -1 0 1 0; b 0 -1 1 ])
N4 = matrix(F9, [ 1 0 0 0; 1 1 0 0; 1 0 1 0; b -b b 1 ])
RGm = invariant_ring(N3, N4) # char p, modular
Expand Down
2 changes: 1 addition & 1 deletion test/Modules/ModulesGraded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ end
end

@testset "Coordinates" begin
Z3, a = FiniteField(3,1,"a")
Z3, a = finite_field(3,1,"a")
R, (x,y) = polynomial_ring(Z3, ["x", "y"])
Z = abelian_group(0)
Rg, (x, y) = grade(R, [Z[1],Z[1]])
Expand Down
2 changes: 1 addition & 1 deletion test/Modules/UngradedModules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ end
end

@testset "Coordinates (lift)" begin
Z3, a = FiniteField(3,1,"a")
Z3, a = finite_field(3,1,"a")
R, (x,y) = polynomial_ring(Z3, ["x", "y"])
coeffs = [Z3(i) for i=0:1]

Expand Down
2 changes: 1 addition & 1 deletion test/Rings/mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ end
@test iszero(divrem(l[1] + l[2], g)[2])
end

F, a = FiniteField(11, 2, "a")
F, a = finite_field(11, 2, "a")
R, (x, y, z) = polynomial_ring(F, ["x", "y", "z"], ordering = :degrevlex)
l = [3*x^5 + a*x*y^2 + a^2*z^2, z^3*x^2 + 7*y^3 + z]
gb = gens(groebner_basis(ideal(R, l); ordering = degrevlex(gens(R))))
Expand Down
2 changes: 1 addition & 1 deletion test/Serialization/Matrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ q = x^2 + 3//4
K, a = number_field(q)
Z7 = residue_ring(ZZ, 7)
Z7t, t = polynomial_ring(Z7, "t")
Fin, d = FiniteField(t^2 + t + 1)
Fin, d = finite_field(t^2 + t + 1)
Frac = fraction_field(R)

cases = [
Expand Down
2 changes: 1 addition & 1 deletion test/Serialization/PolynomialsSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Tow, b = number_field(y^2 + 1, "b")
NonSimRel, c = number_field([y^2 - 5 * a, y^2 - 7 * a])
Qu, u = RationalFunctionField(QQ, "u")
Zt, t = polynomial_ring(residue_ring(ZZ, 2), "t")
Fin, d = FiniteField(t^2 + t + 1)
Fin, d = finite_field(t^2 + t + 1)
Frac = fraction_field(R)
P7 = PadicField(7, 30)
T = TropicalSemiring()
Expand Down
2 changes: 1 addition & 1 deletion test/Serialization/upgrades/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@testset "< 0.12.0 Upgrade" begin
Zt, t = polynomial_ring(residue_ring(ZZ, 2), "t")
Fin, d = FiniteField(t^2 + t + 1)
Fin, d = finite_field(t^2 + t + 1)
Rx, x = Fin["x"]
p = x^2 + d * x + 1
loaded_p = load(joinpath(@__DIR__, "file_version<=0.12.0.json"); params=Rx);
Expand Down

0 comments on commit 5ec1474

Please sign in to comment.