mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-11-19 06:30:29 +01:00
use the new Nemo.Generic module
This commit is contained in:
parent
2e208032d2
commit
261f7761eb
@ -46,7 +46,7 @@ function λ(i,j, pow=1)
|
||||
return v -> [(k==i ? v[j]^pow*v[i] : v[k]) for k in eachindex(v)]
|
||||
end
|
||||
|
||||
function σ(p::perm, pow=1)
|
||||
function σ(p::Generic.perm, pow=1)
|
||||
return v -> [v[(p^pow)[k]] for k in eachindex(v)]
|
||||
end
|
||||
|
||||
@ -79,7 +79,7 @@ function flip_autsymbol(i; pow::Int=1)
|
||||
return AutSymbol(str, pow, :(ɛ($i, $pow)), ɛ(i, pow))
|
||||
end
|
||||
|
||||
function perm_autsymbol(p::perm; pow::Int=1)
|
||||
function perm_autsymbol(p::Generic.perm; pow::Int=1)
|
||||
if p == parent(p)()
|
||||
return id_autsymbol()
|
||||
else
|
||||
|
@ -17,13 +17,13 @@ doc"""
|
||||
|
||||
# Arguments:
|
||||
* `::Group` : the single factor of group $N$
|
||||
* `::PermGroup` : full `PermutationGroup`
|
||||
* `::Generic.PermGroup` : full `PermutationGroup`
|
||||
"""
|
||||
struct WreathProduct{T<:Group} <: Group
|
||||
N::DirectProductGroup{T}
|
||||
P::PermGroup
|
||||
P::Generic.PermGroup
|
||||
|
||||
function WreathProduct{T}(G::T, P::PermGroup) where {T}
|
||||
function WreathProduct{T}(G::T, P::Generic.PermGroup) where {T}
|
||||
N = DirectProductGroup(G, P.n)
|
||||
return new(N, P)
|
||||
end
|
||||
@ -31,10 +31,10 @@ end
|
||||
|
||||
struct WreathProductElem{T<:GroupElem} <: GroupElem
|
||||
n::DirectProductGroupElem{T}
|
||||
p::perm
|
||||
p::Generic.perm
|
||||
# parent::WreathProduct
|
||||
|
||||
function WreathProductElem{T}(n::DirectProductGroupElem{T}, p::perm,
|
||||
function WreathProductElem{T}(n::DirectProductGroupElem{T}, p::Generic.perm,
|
||||
check::Bool=true) where {T}
|
||||
if check
|
||||
length(n.elts) == parent(p).n || throw("Can't form WreathProductElem: lengths differ")
|
||||
@ -62,7 +62,7 @@ parent(g::WreathProductElem) = WreathProduct(parent(g.n[1]), parent(g.p))
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
WreathProduct(G::Gr, P::PermGroup) where {Gr} = WreathProduct{Gr}(G, P)
|
||||
WreathProduct(G::Gr, P::Generic.PermGroup) where {Gr} = WreathProduct{Gr}(G, P)
|
||||
|
||||
WreathProductElem(n::DirectProductGroupElem{T}, p, check=true) where {T} = WreathProductElem{T}(n, p, check)
|
||||
|
||||
@ -87,19 +87,19 @@ function (G::WreathProduct)(g::WreathProductElem)
|
||||
end
|
||||
|
||||
doc"""
|
||||
(G::WreathProduct)(n::DirectProductGroupElem, p::perm)
|
||||
(G::WreathProduct)(n::DirectProductGroupElem, 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::DirectProductGroupElem, p::perm) = WreathProductElem(n,p)
|
||||
(G::WreathProduct)(n::DirectProductGroupElem, p::Generic.perm) = WreathProductElem(n,p)
|
||||
|
||||
(G::WreathProduct)() = WreathProductElem(G.N(), G.P(), false)
|
||||
|
||||
doc"""
|
||||
(G::WreathProduct)(p::perm)
|
||||
(G::WreathProduct)(p::Generic.perm)
|
||||
> Returns the image of permutation `p` in `G` via embedding `p -> (id,p)`.
|
||||
"""
|
||||
(G::WreathProduct)(p::perm) = G(G.N(), p)
|
||||
(G::WreathProduct)(p::Generic.perm) = G(G.N(), p)
|
||||
|
||||
doc"""
|
||||
(G::WreathProduct)(n::DirectProductGroupElem)
|
||||
@ -170,7 +170,7 @@ doc"""
|
||||
>
|
||||
> `g*h = (g.n*g.p(h.n), g.p*h.p)`,
|
||||
>
|
||||
> where `g.p(h.n)` denotes the action of `g.p::perm` on
|
||||
> where `g.p(h.n)` denotes the action of `g.p::Generic.perm` on
|
||||
> `h.n::DirectProductGroupElem` via standard permutation of coordinates.
|
||||
"""
|
||||
function *(g::WreathProductElem, h::WreathProductElem)
|
||||
|
@ -8,7 +8,7 @@
|
||||
@testset "Constructors" begin
|
||||
@test isa(Groups.DirectProductGroup(G,2), Nemo.Group)
|
||||
@test isa(G×G, Nemo.Group)
|
||||
@test isa(Groups.DirectProductGroup(G,2), Groups.DirectProductGroup{Nemo.PermGroup})
|
||||
@test isa(Groups.DirectProductGroup(G,2), Groups.DirectProductGroup{Generic.PermGroup})
|
||||
|
||||
GG = Groups.DirectProductGroup(G,2)
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
@test GG(G(), G()) == GG()
|
||||
|
||||
@test isa(GG([g, g^2]), GroupElem)
|
||||
@test isa(GG([g, g^2]), Groups.DirectProductGroupElem{Nemo.perm})
|
||||
@test isa(GG([g, g^2]), Groups.DirectProductGroupElem{Generic.perm})
|
||||
|
||||
h = GG([g,g^2])
|
||||
|
||||
|
@ -73,7 +73,7 @@
|
||||
|
||||
Wr = WreathProduct(PermutationGroup(2),S_3)
|
||||
|
||||
@test isa([elements(Wr)...], Vector{Groups.WreathProductElem{Nemo.perm}})
|
||||
@test isa([elements(Wr)...], Vector{Groups.WreathProductElem{Generic.perm}})
|
||||
|
||||
elts = [elements(Wr)...]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user