diff --git a/src/orbitdata.jl b/src/orbitdata.jl index 116e23d..6818c06 100644 --- a/src/orbitdata.jl +++ b/src/orbitdata.jl @@ -213,7 +213,7 @@ function (g::perm)(y::GroupRingElem{T, <:SparseVector}) where T return result end -function (p::perm)(A::MatElem) +function (p::perm)(A::MatAlgElem) length(p.d) == size(A, 1) == size(A,2) || throw("Can't act via $p on matrix of size $(size(A))") result = similar(A) @inbounds for i in 1:size(A, 1) @@ -226,7 +226,7 @@ end ############################################################################### # -# WreathProductElems action on Nemo.MatElem +# WreathProductElems action on MatAlgElem # ############################################################################### @@ -242,7 +242,7 @@ function (g::WreathProductElem)(y::GroupRingElem) return result end -function (g::WreathProductElem{N})(A::MatElem) where N +function (g::WreathProductElem{N})(A::MatAlgElem) where N # @assert N == size(A,1) == size(A,2) flips = ntuple(i->(g.n[i].d[1]==1 && g.n[i].d[2]==2 ? 1 : -1), N) result = similar(A) diff --git a/src/sqadjop.jl b/src/sqadjop.jl index d060b57..2fa94e1 100644 --- a/src/sqadjop.jl +++ b/src/sqadjop.jl @@ -9,7 +9,7 @@ function generating_set(G::AutGroup{N}, n=N) where N return [gen_set; inv.(gen_set)] end -function E(M::MatSpace, i::Integer, j::Integer, val=1) +function E(M::MatAlgebra, i::Integer, j::Integer, val=1) @assert i ≠ j @assert 1 ≤ i ≤ nrows(M) @assert 1 ≤ j ≤ ncols(M) @@ -18,8 +18,7 @@ function E(M::MatSpace, i::Integer, j::Integer, val=1) return m end -function generating_set(M::MatSpace, n=nrows(M)) - @assert nrows(M) == ncols(M) +function generating_set(M::MatAlgebra, n=M.n) elts = [E(M, i,j) for (i,j) in indexing(n)] return elem_type(M)[elts; inv.(elts)] @@ -92,10 +91,13 @@ function Op(RG::GroupRing, N::Integer) return op÷factorial(N-2)^2 end +AbstractAlgebra.nrows(M::MatAlgebra) = M.n +AbstractAlgebra.ncols(M::MatAlgebra) = M.n + for Elt in [:Sq, :Adj, :Op] @eval begin $Elt(RG::GroupRing{AutGroup{N}}) where N = $Elt(RG, N) - $Elt(RG::GroupRing{<:MatSpace}) = $Elt(RG, nrows(RG.group)) + $Elt(RG::GroupRing{<:MatAlgebra}) = $Elt(RG, nrows(RG.group)) end end