diff --git a/src/abelianize.jl b/src/abelianize.jl index 4f47f0f..1ab92ee 100644 --- a/src/abelianize.jl +++ b/src/abelianize.jl @@ -53,7 +53,7 @@ function Groups._abelianize( ab = Groups.Homomorphism(Groups._abelianize, source, SlN, check=false) matrix_spn_map = let S = gens(target) - Dict(MatrixGroups.matrix_repr(g) => word(g) for g in union(S, inv.(S))) + Dict(MatrixGroups.matrix(g) => word(g) for g in union(S, inv.(S))) end # renumeration: @@ -63,7 +63,7 @@ function Groups._abelianize( p = [reverse(2:2:N); reverse(1:2:N)] g = source([i]) - Mg = MatrixGroups.matrix_repr(ab(g))[p, p] + Mg = MatrixGroups.matrix(ab(g))[p, p] return matrix_spn_map[Mg] end diff --git a/src/matrix_groups/abstract.jl b/src/matrix_groups/abstract.jl index 1da2228..5e022f7 100644 --- a/src/matrix_groups/abstract.jl +++ b/src/matrix_groups/abstract.jl @@ -2,12 +2,12 @@ abstract type MatrixGroup{N,T} <: Groups.AbstractFPGroup end const MatrixGroupElement{N,T} = Groups.AbstractFPGroupElement{<:MatrixGroup{N,T}} Base.isone(g::MatrixGroupElement{N,T}) where {N,T} = - isone(word(g)) || matrix_repr(g) == LinearAlgebra.I + isone(word(g)) || isone(matrix(g)) function Base.:(==)(m1::M1, m2::M2) where {M1<:MatrixGroupElement,M2<:MatrixGroupElement} parent(m1) === parent(m2) || return false word(m1) == word(m2) && return true - return matrix_repr(m1) == matrix_repr(m2) + return matrix(m1) == matrix(m2) end Base.size(m::MatrixGroupElement{N}) where {N} = (N, N) @@ -19,15 +19,15 @@ Base.parent(sl::MatrixGroupElement) = sl.parent Groups.alphabet(M::MatrixGroup) = M.alphabet Groups.rewriting(M::MatrixGroup) = alphabet(M) -Base.hash(sl::MatrixGroupElement, h::UInt) = - hash(matrix_repr(sl), hash(parent(sl), h)) +Base.hash(m::MatrixGroupElement, h::UInt) = + hash(matrix(m), hash(parent(m), h)) -function matrix_repr(m::MatrixGroupElement{N,T}) where {N,T} +function matrix(m::MatrixGroupElement{N,T}) where {N,T} if isone(word(m)) return StaticArrays.SMatrix{N,N,T}(LinearAlgebra.I) end A = alphabet(parent(m)) - return prod(matrix_repr(A[l]) for l in word(m)) + return prod(matrix(A[l]) for l in word(m)) end function Base.rand( diff --git a/src/matrix_groups/eltary_matrices.jl b/src/matrix_groups/eltary_matrices.jl index 6e3ed48..42b582d 100644 --- a/src/matrix_groups/eltary_matrices.jl +++ b/src/matrix_groups/eltary_matrices.jl @@ -20,7 +20,7 @@ Base.hash(e::ElementaryMatrix, h::UInt) = Base.inv(e::ElementaryMatrix{N}) where {N} = ElementaryMatrix{N}(e.i, e.j, -e.val) -function matrix_repr(e::ElementaryMatrix{N,T}) where {N,T} +function matrix(e::ElementaryMatrix{N,T}) where {N,T} m = StaticArrays.MMatrix{N,N,T}(LinearAlgebra.I) m[e.i, e.j] = e.val x = StaticArrays.SMatrix{N,N}(m) diff --git a/src/matrix_groups/eltary_symplectic.jl b/src/matrix_groups/eltary_symplectic.jl index 0640e6b..91ab941 100644 --- a/src/matrix_groups/eltary_symplectic.jl +++ b/src/matrix_groups/eltary_symplectic.jl @@ -57,7 +57,7 @@ LinearAlgebra.transpose(s::ElementarySymplectic{N}) where {N} = Base.inv(s::ElementarySymplectic{N}) where {N} = ElementarySymplectic{N}(s.symbol, s.i, s.j, -s.val) -function matrix_repr(s::ElementarySymplectic{N,T}) where {N,T} +function matrix(s::ElementarySymplectic{N,T}) where {N,T} @assert iseven(N) n = div(N, 2) m = StaticArrays.MMatrix{N,N,T}(LinearAlgebra.I)