1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-26 09:00:28 +01:00

reorganize actions

This commit is contained in:
kalmarek 2019-06-28 00:20:30 +02:00
parent f4f9dfe21d
commit 55b7ed09bc
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -178,6 +178,20 @@ end
#
###############################################################################
function (g::GroupRingElem)(y::GroupRingElem)
res = parent(y)()
for elt in GroupRings.supp(g)
res += g[elt]*elt(y)
end
return res
end
###############################################################################
#
# perm actions
#
###############################################################################
function (g::perm)(y::GroupRingElem)
RG = parent(y)
result = zero(RG, eltype(y.coeffs))
@ -199,12 +213,15 @@ function (g::perm)(y::GroupRingElem{T, <:SparseVector}) where T
return result
end
function (g::GroupRingElem)(y::GroupRingElem)
res = parent(y)()
for elt in GroupRings.supp(g)
res += g[elt]*elt(y)
function (p::perm)(A::MatElem)
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)
for j in 1:size(A, 2)
result[p[i],p[j]] = A[i,j] # action by permuting rows and colums/conjugation
end
return res
end
return result
end
function (p::perm)(A::MatElem)
@ -219,14 +236,20 @@ end
###############################################################################
#
# Action of WreathProductElems on Nemo.MatElem
# WreathProductElems action on Nemo.MatElem
#
###############################################################################
function matrix_emb(n::DirectPowerGroupElem, p::perm)
Id = parent(n.elts[1])()
elt = Diagonal([(el == Id ? 1 : -1) for el in n.elts])
return elt[:, p.d]
function (g::WreathProductElem)(y::GroupRingElem)
RG = parent(y)
result = zero(RG, eltype(y.coeffs))
for (idx, c) in enumerate(y.coeffs)
if c!= zero(eltype(y.coeffs))
result[g(RG.basis[idx])] = c
end
end
return result
end
function (g::WreathProductElem{N})(A::MatElem) where N
@ -241,17 +264,6 @@ function (g::WreathProductElem{N})(A::MatElem) where N
return result
end
function (p::perm)(A::MatElem)
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)
for j in 1:size(A, 2)
result[p[i],p[j]] = A[i,j] # action by permuting rows and colums/conjugation
end
end
return result
end
###############################################################################
#
# Action of WreathProductElems on AutGroupElem