mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 11:45:28 +01:00
use star() instead of inv() when creating pm_matrix
This commit is contained in:
parent
222063c2fc
commit
f5f173fdb8
@ -501,13 +501,16 @@ function star(X::GroupRingElem{T}) where T
|
|||||||
result = RG(T)
|
result = RG(T)
|
||||||
for (i,c) in enumerate(X.coeffs)
|
for (i,c) in enumerate(X.coeffs)
|
||||||
if c != zero(T)
|
if c != zero(T)
|
||||||
g = inv(RG.basis[i])
|
g = star(RG.basis[i])
|
||||||
result[g] = c
|
result[g] = c
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
star(g::GroupElem) = inv(g)
|
||||||
|
star(r::NCRingElem) = inv(r)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Misc
|
# Misc
|
||||||
@ -535,7 +538,7 @@ function create_pm(basis::AbstractVector{T}, basis_dict::Dict{T, Int},
|
|||||||
Threads.@threads for i in 1:limit
|
Threads.@threads for i in 1:limit
|
||||||
x = basis[i]
|
x = basis[i]
|
||||||
if twisted
|
if twisted
|
||||||
x = inv(x)
|
x = star(x)
|
||||||
end
|
end
|
||||||
for j in 1:limit
|
for j in 1:limit
|
||||||
product_matrix[i,j] = get(basis_dict, x*basis[j], 0)
|
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
|
if idx != nothing
|
||||||
@warn("Product is not supported on basis")
|
@warn("Product is not supported on basis")
|
||||||
i,j = Tuple(idx)
|
i,j = Tuple(idx)
|
||||||
x = (twisted ? inv(basis[i]) : basis[i])
|
x = (twisted ? star(basis[i]) : basis[i])
|
||||||
throw(KeyError(x*basis[j]))
|
throw(KeyError(x*basis[j]))
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
@ -568,9 +571,9 @@ function complete!(RG::GroupRing, twisted::Bool=false)
|
|||||||
end
|
end
|
||||||
|
|
||||||
warning = false
|
warning = false
|
||||||
for idx in findall(RG.pm .== 0)
|
for idx in findall(iszero, RG.pm)
|
||||||
i,j = Tuple(idx)
|
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)
|
if haskey(RG.basis_dict, g)
|
||||||
RG.pm[i,j] = RG.basis_dict[g]
|
RG.pm[i,j] = RG.basis_dict[g]
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user