mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-11-19 06:30:29 +01:00
update to AA-v0.7 → bump to v0.2.3
This commit is contained in:
parent
998a9cdf43
commit
8a42e33b6d
@ -1,7 +1,7 @@
|
||||
name = "Groups"
|
||||
uuid = "5d8bd718-bd84-11e8-3b40-ad14f4a32557"
|
||||
authors = ["Marek Kaluba <kalmar@amu.edu.pl>"]
|
||||
version = "0.2.2"
|
||||
version = "0.2.3"
|
||||
|
||||
[deps]
|
||||
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
|
||||
@ -13,3 +13,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
|
||||
[targets]
|
||||
test = ["Test"]
|
||||
|
||||
[compat]
|
||||
AbstractAlgebra = "^0.7.0"
|
||||
|
@ -19,7 +19,7 @@ struct FlipAut
|
||||
end
|
||||
|
||||
struct PermAut
|
||||
perm::Generic.perm{Int8}
|
||||
perm::Generic.Perm{Int8}
|
||||
end
|
||||
|
||||
struct Identity end
|
||||
@ -130,7 +130,7 @@ function flip_autsymbol(i::Integer; pow::Integer=1)
|
||||
end
|
||||
end
|
||||
|
||||
function perm_autsymbol(p::Generic.perm{I}; pow::Integer=one(I)) where I<:Integer
|
||||
function perm_autsymbol(p::Generic.Perm{I}; pow::Integer=one(I)) where I<:Integer
|
||||
if pow != 1
|
||||
p = p^pow
|
||||
end
|
||||
@ -143,8 +143,8 @@ function perm_autsymbol(p::Generic.perm{I}; pow::Integer=one(I)) where I<:Intege
|
||||
return id_autsymbol()
|
||||
end
|
||||
|
||||
function perm_autsymbol(a::Vector{T}) where T<:Integer
|
||||
return perm_autsymbol(perm(Vector{Int8}(a), false))
|
||||
function perm_autsymbol(a::Vector{<:Integer})
|
||||
return perm_autsymbol(Generic.Perm(Vector{Int8}(a), false))
|
||||
end
|
||||
|
||||
function domain(G::AutGroup{N}) where N
|
||||
|
@ -29,12 +29,12 @@ struct WreathProduct{N, T<:Group, PG<:Generic.PermGroup} <: Group
|
||||
end
|
||||
end
|
||||
|
||||
struct WreathProductElem{N, T<:GroupElem, P<:Generic.perm} <: GroupElem
|
||||
struct WreathProductElem{N, T<:GroupElem, P<:Generic.Perm} <: GroupElem
|
||||
n::DirectPowerGroupElem{N, T}
|
||||
p::P
|
||||
|
||||
function WreathProductElem(n::DirectPowerGroupElem{N,T}, p::P,
|
||||
check::Bool=true) where {N, T, P<:Generic.perm}
|
||||
check::Bool=true) where {N, T, P<:Generic.Perm}
|
||||
if check
|
||||
N == length(p.d) || throw(DomainError(
|
||||
"Can't form WreathProductElem: lengths differ"))
|
||||
@ -69,19 +69,19 @@ function (G::WreathProduct{N})(g::WreathProductElem{N}) where {N}
|
||||
end
|
||||
|
||||
@doc doc"""
|
||||
(G::WreathProduct)(n::DirectPowerGroupElem, p::Generic.perm)
|
||||
(G::WreathProduct)(n::DirectPowerGroupElem, p::Generic.Perm)
|
||||
> Creates an element of wreath product `G` by coercing `n` and `p` to `G.N` and
|
||||
> `G.P`, respectively.
|
||||
"""
|
||||
(G::WreathProduct)(n::DirectPowerGroupElem, p::Generic.perm) = WreathProductElem(n,p)
|
||||
(G::WreathProduct)(n::DirectPowerGroupElem, p::Generic.Perm) = WreathProductElem(n,p)
|
||||
|
||||
(G::WreathProduct)() = WreathProductElem(G.N(), G.P(), false)
|
||||
|
||||
@doc doc"""
|
||||
(G::WreathProduct)(p::Generic.perm)
|
||||
(G::WreathProduct)(p::Generic.Perm)
|
||||
> Returns the image of permutation `p` in `G` via embedding `p -> (id,p)`.
|
||||
"""
|
||||
(G::WreathProduct)(p::Generic.perm) = G(G.N(), p)
|
||||
(G::WreathProduct)(p::Generic.Perm) = G(G.N(), p)
|
||||
|
||||
@doc doc"""
|
||||
(G::WreathProduct)(n::DirectPowerGroupElem)
|
||||
@ -144,7 +144,7 @@ end
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
(p::perm)(n::DirectPowerGroupElem) = DirectPowerGroupElem(n.elts[p.d])
|
||||
(p::Generic.Perm)(n::DirectPowerGroupElem) = DirectPowerGroupElem(n.elts[p.d])
|
||||
|
||||
@doc doc"""
|
||||
*(g::WreathProductElem, h::WreathProductElem)
|
||||
@ -152,7 +152,7 @@ end
|
||||
>
|
||||
> `g*h = (g.n*g.p(h.n), g.p*h.p)`,
|
||||
>
|
||||
> where `g.p(h.n)` denotes the action of `g.p::Generic.perm` on
|
||||
> where `g.p(h.n)` denotes the action of `g.p::Generic.Perm` on
|
||||
> `h.n::DirectPowerGroupElem` via standard permutation of coordinates.
|
||||
"""
|
||||
function *(g::WreathProductElem, h::WreathProductElem)
|
||||
@ -188,7 +188,7 @@ end
|
||||
function iterate(G::WreathProduct, state)
|
||||
state_N, p, state_P = state
|
||||
res = iterate(G.N, state_N)
|
||||
|
||||
|
||||
if res == nothing
|
||||
resP = iterate(G.P, state_P)
|
||||
if resP == nothing
|
||||
@ -200,7 +200,7 @@ function iterate(G::WreathProduct, state)
|
||||
else
|
||||
n, state_N = res
|
||||
end
|
||||
|
||||
|
||||
return G(n,p), (state_N, p, state_P)
|
||||
end
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
g = perm"(1,2,3)"
|
||||
|
||||
@test GG(g, g^2) isa GroupElem
|
||||
@test GG(g, g^2) isa Groups.DirectPowerGroupElem{2, Generic.perm{Int64}}
|
||||
@test GG(g, g^2) isa Groups.DirectPowerGroupElem{2, Generic.Perm{Int64}}
|
||||
|
||||
h = GG(g,g^2)
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
GG = G×G
|
||||
i = perm"(1,3)"
|
||||
g = perm"(1,2,3)"
|
||||
|
||||
|
||||
h = GG(g,g^2)
|
||||
k = GG(g^3, g^2)
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
@test h*k == GG(g,g)
|
||||
|
||||
@test h*inv(h) == (G×G)()
|
||||
|
||||
|
||||
w = GG(g,i)*GG(i,g)
|
||||
@test w == GG(perm"(1,2)(3)", perm"(2,3)")
|
||||
@test w == inv(w)
|
||||
|
@ -15,8 +15,8 @@
|
||||
@test Groups.WreathProductElem(aa, b) isa AbstractAlgebra.GroupElem
|
||||
x = Groups.WreathProductElem(aa, b)
|
||||
@test x isa Groups.WreathProductElem
|
||||
@test x isa
|
||||
Groups.WreathProductElem{3, perm{Int}, perm{Int}}
|
||||
@test x isa
|
||||
Groups.WreathProductElem{3, Generic.Perm{Int}, Generic.Perm{Int}}
|
||||
|
||||
@test B3.N == Groups.DirectPowerGroup(S_2, 3)
|
||||
@test B3.P == S_3
|
||||
@ -35,7 +35,7 @@
|
||||
@testset "Types" begin
|
||||
B3 = Groups.WreathProduct(S_2, S_3)
|
||||
|
||||
@test elem_type(B3) == Groups.WreathProductElem{3, perm{Int}, perm{Int}}
|
||||
@test elem_type(B3) == Groups.WreathProductElem{3, Generic.Perm{Int}, Generic.Perm{Int}}
|
||||
|
||||
@test parent_type(typeof(B3())) == Groups.WreathProduct{3, parent_type(typeof(B3.N.group())), Generic.PermGroup{Int}}
|
||||
|
||||
@ -87,8 +87,8 @@
|
||||
Wr = WreathProduct(PermutationGroup(2),PermutationGroup(4))
|
||||
|
||||
elts = collect(Wr)
|
||||
@test elts isa Vector{Groups.WreathProductElem{4, perm{Int}, perm{Int}}}
|
||||
@test order(Wr) == 2^4*factorial(4)
|
||||
@test elts isa Vector{Groups.WreathProductElem{4, Generic.Perm{Int}, Generic.Perm{Int}}}
|
||||
@test order(Wr) == 2^4*factorial(4)
|
||||
|
||||
@test length(elts) == order(Wr)
|
||||
@test all([g*inv(g) == Wr() for g in elts])
|
||||
|
Loading…
Reference in New Issue
Block a user