mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-11-19 06:30:29 +01:00
Since SMC act from the left(!) distinguish Aut(Left|Right)Perm
This commit is contained in:
parent
99fd238cf2
commit
eef13c9afa
@ -217,3 +217,54 @@ function evaluate!(
|
|||||||
|
|
||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
|
||||||
|
struct PermLeftAut <: GSymbol
|
||||||
|
perm::Vector{UInt8}
|
||||||
|
|
||||||
|
function PermLeftAut(p::AbstractVector{<:Integer})
|
||||||
|
@assert sort(p) == 1:length(p)
|
||||||
|
return new(p)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Base.show(io::IO, p::PermLeftAut)
|
||||||
|
print(io, "σˡ")
|
||||||
|
join(io, (subscriptify(Int(i)) for i in p.perm))
|
||||||
|
end
|
||||||
|
|
||||||
|
Base.inv(p::PermLeftAut) = PermLeftAut(invperm(p.perm))
|
||||||
|
|
||||||
|
Base.:(==)(p::PermLeftAut, q::PermLeftAut) = p.perm == q.perm
|
||||||
|
Base.hash(p::PermLeftAut, h::UInt) = hash(p.perm, hash(PermLeftAut, h))
|
||||||
|
|
||||||
|
function evaluate!(v::NTuple{T, N}, p::PermLeftAut, ::Alphabet, tmp=one(first(v))) where {T, N}
|
||||||
|
|
||||||
|
G = parent(first(v))
|
||||||
|
A = alphabet(G)
|
||||||
|
img = gens(G)[p.perm]
|
||||||
|
gens_idcs = Dict(A[A[first(word(im))]] => img[i] for (i,im) in enumerate(gens(G)))
|
||||||
|
|
||||||
|
for elt in v
|
||||||
|
copyto!(tmp, elt)
|
||||||
|
resize!(word(elt), 0)
|
||||||
|
for idx in word(tmp)
|
||||||
|
# @show idx
|
||||||
|
if haskey(gens_idcs, idx)
|
||||||
|
k = gens_idcs[idx]
|
||||||
|
append!(word(elt), word(k))
|
||||||
|
elseif haskey(gens_idcs, inv(A, idx))
|
||||||
|
k = inv(gens_idcs[inv(A, idx)])
|
||||||
|
append!(word(elt), word(k))
|
||||||
|
else
|
||||||
|
push!(word(elt), idx)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
_setnormalform!(elt, false)
|
||||||
|
_setvalidhash!(elt, false)
|
||||||
|
|
||||||
|
normalform!(tmp, elt)
|
||||||
|
copyto!(elt, tmp)
|
||||||
|
end
|
||||||
|
|
||||||
|
return v
|
||||||
|
end
|
||||||
|
@ -82,25 +82,25 @@ Base.@propagate_inbounds function evaluate!(v::NTuple{T, N}, t::Transvection, A:
|
|||||||
return v
|
return v
|
||||||
end
|
end
|
||||||
|
|
||||||
struct PermAut <: GSymbol
|
struct PermRightAut <: GSymbol
|
||||||
perm::Vector{UInt8}
|
perm::Vector{UInt8}
|
||||||
|
|
||||||
function PermAut(p::AbstractVector{<:Integer})
|
function PermRightAut(p::AbstractVector{<:Integer})
|
||||||
@assert sort(p) == 1:length(p)
|
@assert sort(p) == 1:length(p)
|
||||||
return new(p)
|
return new(p)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Base.show(io::IO, p::PermAut)
|
function Base.show(io::IO, p::PermRightAut)
|
||||||
print(io, 'σ')
|
print(io, 'σ')
|
||||||
join(io, (subscriptify(Int(i)) for i in p.perm))
|
join(io, (subscriptify(Int(i)) for i in p.perm))
|
||||||
end
|
end
|
||||||
|
|
||||||
Base.inv(p::PermAut) = PermAut(invperm(p.perm))
|
Base.inv(p::PermRightAut) = PermRightAut(invperm(p.perm))
|
||||||
|
|
||||||
Base.:(==)(p::PermAut, q::PermAut) = p.perm == q.perm
|
Base.:(==)(p::PermRightAut, q::PermRightAut) = p.perm == q.perm
|
||||||
Base.hash(p::PermAut, h::UInt) = hash(p.perm, hash(PermAut, h))
|
Base.hash(p::PermRightAut, h::UInt) = hash(p.perm, hash(PermRightAut, h))
|
||||||
|
|
||||||
Base.@propagate_inbounds function evaluate!(v::NTuple{T, N}, p::PermAut, ::Alphabet, tmp=one(first(v))) where {T, N}
|
function evaluate!(v::NTuple{T, N}, p::PermRightAut, ::Alphabet, tmp=one(first(v))) where {T, N}
|
||||||
return v[p.perm]
|
return v[p.perm]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user