1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-11-19 14:35:27 +01:00

use star() instead of inv() when creating pm_matrix

This commit is contained in:
kalmarek 2020-08-27 10:09:17 +02:00
parent 222063c2fc
commit f5f173fdb8
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -501,13 +501,16 @@ function star(X::GroupRingElem{T}) where T
result = RG(T)
for (i,c) in enumerate(X.coeffs)
if c != zero(T)
g = inv(RG.basis[i])
g = star(RG.basis[i])
result[g] = c
end
end
return result
end
star(g::GroupElem) = inv(g)
star(r::NCRingElem) = inv(r)
###############################################################################
#
# Misc
@ -535,7 +538,7 @@ function create_pm(basis::AbstractVector{T}, basis_dict::Dict{T, Int},
Threads.@threads for i in 1:limit
x = basis[i]
if twisted
x = inv(x)
x = star(x)
end
for j in 1:limit
product_matrix[i,j] = get(basis_dict, x*basis[j], 0)
@ -554,7 +557,7 @@ function check_pm(product_matrix, basis, twisted=false)
if idx != nothing
@warn("Product is not supported on basis")
i,j = Tuple(idx)
x = (twisted ? inv(basis[i]) : basis[i])
x = (twisted ? star(basis[i]) : basis[i])
throw(KeyError(x*basis[j]))
end
return true
@ -568,9 +571,9 @@ function complete!(RG::GroupRing, twisted::Bool=false)
end
warning = false
for idx in findall(RG.pm .== 0)
for idx in findall(iszero, RG.pm)
i,j = Tuple(idx)
g = (twisted ? inv(RG.basis[i]) : RG.basis[i])*RG.basis[j]
g = (twisted ? star(RG.basis[i]) : RG.basis[i])*RG.basis[j]
if haskey(RG.basis_dict, g)
RG.pm[i,j] = RG.basis_dict[g]
else