PropertyT.jl/src/actions/alphabet_permutation.jl

39 lines
854 B
Julia
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## action induced from permuting letters of an alphabet
import Groups: Constructions
struct AlphabetPermutation{GEl,I} <: SW.ByPermutations
perms::Dict{GEl,PG.Perm{I}}
end
function AlphabetPermutation(
A::Alphabet,
Γ::PG.AbstractPermutationGroup,
op,
)
return AlphabetPermutation(
Dict(γ => inv(PG.Perm([A[op(l, γ)] for l in A])) for γ in Γ),
)
end
function AlphabetPermutation(A::Alphabet, W::Constructions.WreathProduct, op)
return AlphabetPermutation(
Dict(
w => inv(PG.Perm([A[op(op(l, w.p), w.n)] for l in A])) for
w in W
),
)
end
function SW.action(
act::AlphabetPermutation,
γ::Groups.GroupElement,
g::Groups.AbstractFPGroupElement,
)
G = parent(g)
# w = SW.action(act, γ, word(g))
w = word(g)^(act.perms[γ])
return G(w)
end