1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-11-19 06:30:29 +01:00

replace Nemo -> AbstractAlgebra

This commit is contained in:
kalmarek 2018-07-30 08:30:27 +02:00
parent 7663381084
commit 158ce5ee27
7 changed files with 27 additions and 28 deletions

View File

@ -19,7 +19,7 @@ struct FlipAut{I<:Integer}
end
struct PermAut{I<:Integer}
perm::Nemo.Generic.perm{I}
perm::Generic.perm{I}
end
struct Identity end

View File

@ -1,10 +1,10 @@
__precompile__()
module Groups
using Nemo
import Nemo: Group, GroupElem, Ring
import Nemo: parent, parent_type, elem_type
import Nemo: elements, order, gens, matrix_repr
using AbstractAlgebra
import AbstractAlgebra: Group, GroupElem, Ring
import AbstractAlgebra: parent, parent_type, elem_type
import AbstractAlgebra: elements, order, gens, matrix_repr
import Base: length, ==, hash, show, convert
import Base: inv, reduce, *, ^

View File

@ -1,5 +1,4 @@
@testset "Automorphisms" begin
using Nemo
G = PermutationGroup(Int8(4))
@testset "AutSymbol" begin
@ -14,7 +13,7 @@
@test isa(Groups.flip_autsymbol(3), Groups.AutSymbol)
end
a,b,c,d = Nemo.gens(FreeGroup(4))
a,b,c,d = gens(FreeGroup(4))
D = NTuple{4,FreeGroupElem}([a,b,c,d])
@testset "flip_autsymbol correctness" begin
@ -85,16 +84,16 @@
f = Groups.AutSymbol("a", 1, Groups.FlipAut(1))
@test isa(Automorphism{3}(f), Groups.GWord)
@test isa(Automorphism{3}(f), Automorphism)
@test isa(AutGroup(FreeGroup(3)), Nemo.Group)
@test isa(AutGroup(FreeGroup(3)), Group)
@test isa(AutGroup(FreeGroup(1)), Groups.AbstractFPGroup)
A = AutGroup(FreeGroup(1))
@test isa(Nemo.gens(A), Vector{Automorphism{1}})
@test length(Nemo.gens(A)) == 1
@test isa(gens(A), Vector{Automorphism{1}})
@test length(gens(A)) == 1
A = AutGroup(FreeGroup(1), special=true)
@test length(Nemo.gens(A)) == 0
@test length(gens(A)) == 0
A = AutGroup(FreeGroup(2))
@test length(Nemo.gens(A)) == 7
gens = Nemo.gens(A)
@test length(gens(A)) == 7
gens = gens(A)
@test isa(A(Groups.rmul_autsymbol(1,2)), Automorphism)
@test A(Groups.rmul_autsymbol(1,2)) in gens
@ -147,7 +146,7 @@
b = Groups.flip_autsymbol(2)*A(inv(Groups.rmul_autsymbol(1,2)))
@test a*b == b*a
@test a^3 * b^3 == A()
g,h = Nemo.gens(A)[[1,8]] # (g, h) = (ϱ₁₂, ϱ₃₂)
g,h = gens(A)[[1,8]] # (g, h) = (ϱ₁₂, ϱ₃₂)
@test Groups.domain(A) == NTuple{4, FreeGroupElem}(gens(A.objectGroup))
@ -193,13 +192,13 @@
@test isa(S, Vector{Groups.AutSymbol})
S = [G(s) for s in unique(S)]
@test isa(S, Vector{Automorphism{N}})
@test S == Nemo.gens(G)
@test S == gens(G)
@test length(S) == 51
S_inv = [S..., [inv(s) for s in S]...]
@test length(unique(S_inv)) == 75
G = AutGroup(FreeGroup(N), special=true)
S = Nemo.gens(G)
S = gens(G)
S_inv = [G(), S..., [inv(s) for s in S]...]
S_inv = unique(S_inv)
B_2 = [i*j for (i,j) in Base.product(S_inv, S_inv)]

View File

@ -1,13 +1,12 @@
@testset "DirectProducts" begin
using Nemo
G = PermutationGroup(3)
g = G([2,3,1])
F, a = FiniteField(2,3,"a")
@testset "Constructors" begin
@test isa(Groups.DirectProductGroup(G,2), Nemo.Group)
@test isa(G×G, Nemo.Group)
@test isa(Groups.DirectProductGroup(G,2), AbstractArray.Group)
@test isa(G×G, AbstractAlgebra.Group)
@test isa(Groups.DirectProductGroup(G,2), Groups.DirectProductGroup{Generic.PermGroup{Int64}})
GG = Groups.DirectProductGroup(G,2)

View File

@ -41,18 +41,18 @@ end
end
@testset "FreeGroup" begin
@test isa(FreeGroup(["s", "t"]), Nemo.Group)
@test isa(FreeGroup(["s", "t"]), Group)
G = FreeGroup(["s", "t"])
@testset "elements constructors" begin
@test isa(G(), FreeGroupElem)
@test eltype(G.gens) == Groups.FreeSymbol
@test length(G.gens) == 2
@test eltype(Nemo.gens(G)) == FreeGroupElem
@test length(Nemo.gens(G)) == 2
@test eltype(gens(G)) == FreeGroupElem
@test length(gens(G)) == 2
end
s, t = Nemo.gens(G)
s, t = gens(G)
@testset "internal arithmetic" begin
@ -130,7 +130,7 @@ end
@test Groups.replace_all(s*c*s*c*s, subst) == s*t^4*s*t^4*s
G = FreeGroup(["x", "y"])
x,y = Nemo.gens(G)
x,y = gens(G)
@test Groups.replace(x*y^9, 2, y^2, y) == x*y^8
@test Groups.replace(x^3, 1, x^2, y) == x*y

View File

@ -4,13 +4,13 @@
b = S_3([2,3,1])
@testset "Constructors" begin
@test isa(Groups.WreathProduct(F, S_3), Nemo.Group)
@test isa(Groups.WreathProduct(F, S_3), AbstractAlgebra.Group)
@test isa(Groups.WreathProduct(F, S_3), Groups.WreathProduct)
@test isa(Groups.WreathProduct(F, S_3), Groups.WreathProduct{Nemo.FqNmodFiniteField})
@test isa(Groups.WreathProduct(F, S_3), Groups.WreathProduct{AbstractAlgebra.FqNmodFiniteField})
aa = Groups.DirectProductGroupElem([a^0 ,a, a^2])
@test isa(Groups.WreathProductElem(aa, b), Nemo.GroupElem)
@test isa(Groups.WreathProductElem(aa, b), AbstractAlgebra.GroupElem)
@test isa(Groups.WreathProductElem(aa, b), Groups.WreathProductElem)
@test isa(Groups.WreathProductElem(aa, b), Groups.WreathProductElem{typeof(a)})

View File

@ -1,5 +1,6 @@
using Groups
using Base.Test
using AbstractAlgebra
using Groups
@testset "Groups" begin
include("FreeGroup-tests.jl")