From 6993c284cd978c62afb0a6ce20b906d0e68787fe Mon Sep 17 00:00:00 2001 From: kalmar Date: Fri, 12 May 2017 19:55:50 +0200 Subject: [PATCH] AutGroup constructor --- src/automorphism_groups.jl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/automorphism_groups.jl b/src/automorphism_groups.jl index 94a7720..411feed 100644 --- a/src/automorphism_groups.jl +++ b/src/automorphism_groups.jl @@ -114,6 +114,25 @@ function getperm(s::AutSymbol) end end +function AutGroup(G::FPGroup; outer=false, special=false) + length(G.rels) == 0 || throw("Don't know how to construct AutGroup of $G.") + n = length(G.generators) + indexing = [[i,j] for i in 1:n for j in 1:n if i≠j] + rmuls = [rmul_autsymbol(i,j) for (i,j) in indexing] + lmuls = [lmul_autsymbol(i,j) for (i,j) in indexing] + S = [rmuls..., lmuls...] + if special + flips = [flip_autsymbol(i) for i in 1:n] + append!(S, flips...) + elseif outer + perms = collect(elements(PermutationGroup(n))) + perms = [perm_autsymbol(p) for p in perms[2:end]] # leave the identity + append!(S, perms) + end + return new(G, S) +end + + function (f::AutSymbol){T}(v::Vector{GWord{T}}) if f.pow == 0 return v