1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-26 10:35:29 +01:00

streamline logic in rankOne_projection from a character

This commit is contained in:
kalmarek 2018-04-08 22:49:45 +02:00
parent 5bed58de2c
commit 50588bc792

View File

@ -102,8 +102,7 @@ function idempotents(RG::GroupRing{Generic.PermGroup{S}}, T::Type=Rational{S}) w
return unique(idems) return unique(idems)
end end
function rankOne_projection(chi::PropertyT.PermCharacter, function rankOne_projection(chi::PermCharacter, idems::Vector{T}) where {T<:GroupRingElem}
idems::Vector{T}) where {T<:GroupRingElem}
RG = parent(first(idems)) RG = parent(first(idems))
S = eltype(first(idems)) S = eltype(first(idems))
@ -114,14 +113,16 @@ function rankOne_projection(chi::PropertyT.PermCharacter,
for (i,j,k) in Base.product(ids, ids, ids) for (i,j,k) in Base.product(ids, ids, ids)
if chi(i) == zzz || chi(j) == zzz || chi(k) == zzz if chi(i) == zzz || chi(j) == zzz || chi(k) == zzz
continue continue
end else
elt = i*j*k elt = i*j*k
elt^2 == elt || continue if elt^2 != elt
if chi(elt) == one(S) continue
elseif chi(elt) == one(S)
return elt return elt
# return (i,j,k) # return (i,j,k)
end end
end end
end
throw("Couldn't find rank-one projection for $chi") throw("Couldn't find rank-one projection for $chi")
end end