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

Merge pull request #10 from kalmarek/fix/dealias_inverse_of_id

fix: dealias inv(id) from id
This commit is contained in:
kalmarek 2020-04-21 17:14:27 +02:00 committed by GitHub
commit 2674652221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 5 deletions

View File

@ -1,7 +1,7 @@
name = "Groups" name = "Groups"
uuid = "5d8bd718-bd84-11e8-3b40-ad14f4a32557" uuid = "5d8bd718-bd84-11e8-3b40-ad14f4a32557"
authors = ["Marek Kaluba <kalmar@amu.edu.pl>"] authors = ["Marek Kaluba <kalmar@amu.edu.pl>"]
version = "0.4.1" version = "0.4.2"
[deps] [deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"

View File

@ -91,7 +91,7 @@ function change_pow(s::AutSymbol, n::Integer)
elseif symbol isa LTransvect elseif symbol isa LTransvect
return transvection_L(symbol.i, symbol.j, n) return transvection_L(symbol.i, symbol.j, n)
elseif symbol isa Identity elseif symbol isa Identity
return s return id_autsymbol()
else else
throw(DomainError("Unknown type of AutSymbol: $s")) throw(DomainError("Unknown type of AutSymbol: $s"))
end end

View File

@ -1,5 +1,5 @@
function Base.inv(W::T) where T<:GWord function Base.inv(W::T) where T<:GWord
length(W) == 0 && return W length(W) == 0 && return one(W)
G = parent(W) G = parent(W)
w = T([inv(s) for s in Iterators.reverse(syllables(W))]) w = T([inv(s) for s in Iterators.reverse(syllables(W))])
return setparent!(w, G) return setparent!(w, G)

View File

@ -16,7 +16,8 @@
@test Groups.id_autsymbol() isa Groups.AutSymbol @test Groups.id_autsymbol() isa Groups.AutSymbol
@test inv(Groups.id_autsymbol()) isa Groups.AutSymbol @test inv(Groups.id_autsymbol()) isa Groups.AutSymbol
@test inv(Groups.id_autsymbol()) == Groups.id_autsymbol() x = Groups.id_autsymbol()
@test inv(x) == Groups.id_autsymbol()
end end
a,b,c,d = gens(FreeGroup(4)) a,b,c,d = gens(FreeGroup(4))
@ -266,7 +267,7 @@
@test Groups.abelianize(σ^3) == Matrix{Int}(I, N, N) @test Groups.abelianize(σ^3) == Matrix{Int}(I, N, N)
@test Groups.abelianize(σ)^3 == Matrix{Int}(I, N, N) @test Groups.abelianize(σ)^3 == Matrix{Int}(I, N, N)
@test Groups.abelianize(G(Groups.id_autsymbol())) == Matrix{Int}(I, N, N) @test Groups.abelianize(G(Groups.id_autsymbol())) == Matrix{Int}(I, N, N)
function test_homomorphism(S, r) function test_homomorphism(S, r)
for elts in Iterators.product([[g for g in S] for _ in 1:r]...) for elts in Iterators.product([[g for g in S] for _ in 1:r]...)

View File

@ -109,6 +109,13 @@ end
tt = deepcopy(t) tt = deepcopy(t)
append!(tt, s, inv(t)) append!(tt, s, inv(t))
@test string(tt) == "t*s*t^-1" @test string(tt) == "t*s*t^-1"
o = one(t)
o_inv = inv(o)
@test o == o_inv
@test o !== o_inv
Groups.rmul!(o, t)
@test o != o_inv
end end
@testset "reductions" begin @testset "reductions" begin