1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2025-01-25 01:00:27 +01:00
Groups.jl/src/abelianize.jl

24 lines
751 B
Julia
Raw Normal View History

2022-04-02 14:24:01 +02:00
function _abelianize(
i::Integer,
source::AutomorphismGroup{<:FreeGroup},
target::MatrixGroups.SpecialLinearGroup{N, T}) where {N, T}
n = ngens(object(source))
@assert n == N
aut = alphabet(source)[i]
if aut isa Transvection
# we change (i,j) to (j, i) to be consistent with the action:
# Automorphisms act on the right which corresponds to action on
# the columns in the matrix case
eij = MatrixGroups.ElementaryMatrix{N}(
aut.j,
aut.i,
ifelse(aut.inv, -one(T), one(T))
)
k = alphabet(target)[eij]
return word_type(target)([k])
else
throw("unexpected automorphism symbol: $(typeof(aut))")
end
end