From edeab3524921b4a0c0e4f36b24f763a370e2d334 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 21 Sep 2021 10:29:30 +0200 Subject: [PATCH 01/15] add default actions on vectors --- src/actions.jl | 16 ++++++++++++++++ src/wedderburn_decomposition.jl | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/actions.jl b/src/actions.jl index 750e55a..f9a1d21 100644 --- a/src/actions.jl +++ b/src/actions.jl @@ -10,6 +10,22 @@ implements: * action(hom::InducedActionHomomorphism, g::GroupElement, feature) → the action of `g` on `feature` =# +function action( + hom::InducedActionHomomorphism{<:ByPermutations}, + g::GroupElement, + v::AbstractVector, +) + return v^induce(hom, g) +end + +function action( + hom::InducedActionHomomorphism{<:ByLinearTransformation}, + g::GroupElement, + v::AbstractVector, +) + return induce(hom, g) * v +end + function induce(ac::Action, hom::InducedActionHomomorphism, g::GroupElement) throw( "No fallback is provided for $(typeof(ac)). You need to implement `induce(::$(typeof(ac)), ::$(typeof(hom)), ::$(typeof(g)))`.", diff --git a/src/wedderburn_decomposition.jl b/src/wedderburn_decomposition.jl index 63d997c..e51ebc1 100644 --- a/src/wedderburn_decomposition.jl +++ b/src/wedderburn_decomposition.jl @@ -145,8 +145,8 @@ function invariant_vectors( # * `tmp_subspace`, the subspace spanned by the orbit for g in G - k = induce(hom, g) * b_orth - @assert isapprox(norm(k, 2), 1.0, atol=atol) + k = SymbolicWedderburn.action(hom, g, b_orth) + @assert isapprox(norm(k, 2), 1.0, atol = atol) inv_v .+= k residual = k - _orth_proj(orbit_subspace, k) From 36e5ea6986e55ce7c282d3fac8c1ae2ab3b18f65 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 21 Sep 2021 10:30:56 +0200 Subject: [PATCH 02/15] formatting --- src/actions.jl | 43 +++++++++++++------- src/wedderburn_decomposition.jl | 71 +++++++++++++++++++-------------- 2 files changed, 69 insertions(+), 45 deletions(-) diff --git a/src/actions.jl b/src/actions.jl index f9a1d21..f7fc4d8 100644 --- a/src/actions.jl +++ b/src/actions.jl @@ -27,17 +27,17 @@ function action( end function induce(ac::Action, hom::InducedActionHomomorphism, g::GroupElement) - throw( + return throw( "No fallback is provided for $(typeof(ac)). You need to implement `induce(::$(typeof(ac)), ::$(typeof(hom)), ::$(typeof(g)))`.", ) end -induce(hom::InducedActionHomomorphism, g::GroupElement) = induce(action(hom), hom, g) +induce(hom::InducedActionHomomorphism, g::GroupElement) = + induce(action(hom), hom, g) decompose(x::Any, hom::InducedActionHomomorphism) = throw( "No fallback is provided for $(typeof(x)). You need to implement `decompose(::$(typeof(x)), ::$(typeof(hom)))`.", ) - coeff_type(ac::ByLinearTransformation) = throw( "No fallback is provided for $(typeof(ac)). You need to implement `_coeff_type(::$(typeof(ac)))`.", ) @@ -46,8 +46,11 @@ coeff_type(ac::ByLinearTransformation) = throw( # an SDP constraint of size 65535×65535, which is highly unlikely ;) _int_type(::InducedActionHomomorphism) = UInt16 -function induce(ac::ByLinearTransformation, hom::InducedActionHomomorphism, g::GroupElement) - +function induce( + ac::ByLinearTransformation, + hom::InducedActionHomomorphism, + g::GroupElement, +) n = length(features(hom)) I = Int[] @@ -69,7 +72,6 @@ function decompose(m::T, hom::InducedActionHomomorphism{A,T}) where {A,T} return [hom[m]], [one(coeff_type(action(hom)))] end - struct ExtensionHomomorphism{A,T,I,V} <: InducedActionHomomorphism{A,T} ac::A features::V # supports linear indexing @@ -77,18 +79,21 @@ struct ExtensionHomomorphism{A,T,I,V} <: InducedActionHomomorphism{A,T} end # see the comment about UInt16 above -ExtensionHomomorphism(ac::Action, features) = ExtensionHomomorphism{UInt16}(ac, features) +ExtensionHomomorphism(ac::Action, features) = + ExtensionHomomorphism{UInt16}(ac, features) -function ExtensionHomomorphism{I}(ac::Action, features) where {I <: Integer} +function ExtensionHomomorphism{I}(ac::Action, features) where {I<:Integer} @assert typemax(I) >= length(features) "Use wider Integer type!" - reversef = Dict{eltype(features),I}(f => idx for (idx, f) in pairs(features)) + reversef = + Dict{eltype(features),I}(f => idx for (idx, f) in pairs(features)) return ExtensionHomomorphism(ac, features, reversef) end _int_type(::ExtensionHomomorphism{A,T,I}) where {A,T,I} = I Base.getindex(ehom::ExtensionHomomorphism, i::Integer) = ehom.features[i] -Base.getindex(ehom::ExtensionHomomorphism{A,T}, f::T) where {A,T} = ehom.reversef[f] +Base.getindex(ehom::ExtensionHomomorphism{A,T}, f::T) where {A,T} = + ehom.reversef[f] # interface: features(hom::ExtensionHomomorphism) = hom.features @@ -99,7 +104,8 @@ function induce(::ByPermutations, hom::ExtensionHomomorphism, g::GroupElement) return Perm(vec(I[hom[action(action(hom), g, f)] for f in features(hom)])) end -struct CachedExtensionHomomorphism{A,T,G,H,E <: InducedActionHomomorphism{A,T}} <: InducedActionHomomorphism{A,T} +struct CachedExtensionHomomorphism{A,T,G,H,E<:InducedActionHomomorphism{A,T}} <: + InducedActionHomomorphism{A,T} ehom::E cache::Dict{G,H} end @@ -110,10 +116,15 @@ end Base.getindex(h::CachedExtensionHomomorphism, x::Any) = h.ehom[x] -function CachedExtensionHomomorphism(G::Group, action::Action, basis; precompute=false) +function CachedExtensionHomomorphism( + G::Group, + action::Action, + basis; + precompute = false, +) hom = ExtensionHomomorphism(action, basis) S = typeof(induce(hom, one(G))) - chom = CachedExtensionHomomorphism{eltype(G), S}(hom) + chom = CachedExtensionHomomorphism{eltype(G),S}(hom) if precompute # to make sure that the future access to chom is read-only, i.e. thread-safe # one may choose to precompute the images @@ -134,7 +145,11 @@ function induce(ac::Action, hom::CachedExtensionHomomorphism, g::GroupElement) return hom.cache[g] end #disambiguation: -function induce(ac::ByLinearTransformation, hom::CachedExtensionHomomorphism, g::GroupElement) +function induce( + ac::ByLinearTransformation, + hom::CachedExtensionHomomorphism, + g::GroupElement, +) if !haskey(hom.cache, g) hom.cache[g] = induce(ac, hom.ehom, g) end diff --git a/src/wedderburn_decomposition.jl b/src/wedderburn_decomposition.jl index e51ebc1..c2069b1 100644 --- a/src/wedderburn_decomposition.jl +++ b/src/wedderburn_decomposition.jl @@ -1,4 +1,4 @@ -struct WedderburnDecomposition{B, iV, DS<:DirectSummand, Hom} +struct WedderburnDecomposition{B,iV,DS<:DirectSummand,Hom} basis::B invariants::iV Uπs::Vector{DS} @@ -11,21 +11,27 @@ function WedderburnDecomposition( action::Action, basis_full, basis_half, - S = Rational{Int}; + S = Rational{Int}, ) basis = StarAlgebras.Basis{UInt32}(basis_full) invariants = invariant_vectors(G, action, basis) tbl = CharacterTable(S, G) - ehom = CachedExtensionHomomorphism(G, action, basis_half, precompute=true) + ehom = CachedExtensionHomomorphism(G, action, basis_half, precompute = true) Uπs = let - sa_basis = symmetry_adapted_basis(T, tbl, ehom; semisimple=false) - @debug "fill factor of sa_basis:" round.(_fillfactor.(sa_basis), digits=3) + sa_basis = symmetry_adapted_basis(T, tbl, ehom; semisimple = false) + @debug "fill factor of sa_basis:" round.( + _fillfactor.(sa_basis), + digits = 3, + ) sp_basis = sparse.(sa_basis) if T <: AbstractFloat - droptol!.(sp_basis, eps(T)*length(basis_half)) - @debug "fill factor after sparsification" round.(_fillfactor.(sa_basis), digits=3) + droptol!.(sp_basis, eps(T) * length(basis_half)) + @debug "fill factor after sparsification" round.( + _fillfactor.(sa_basis), + digits = 3, + ) end sp_basis end @@ -40,18 +46,18 @@ direct_summands(wbdec::WedderburnDecomposition) = wbdec.Uπs _tmps(wbdec::WedderburnDecomposition) = [zeros(eltype(U), reverse(size(U))) for U in wbdec.Uπs] -_fillfactor(M::AbstractMatrix) = count(!iszero, M)/length(M) -_fillfactor(M::AbstractSparseMatrix) = nnz(M)/length(M) +_fillfactor(M::AbstractMatrix) = count(!iszero, M) / length(M) +_fillfactor(M::AbstractSparseMatrix) = nnz(M) / length(M) function diagonalize( M::AbstractMatrix, wbdec::WedderburnDecomposition, - tmps=_tmps(wbdec) + tmps = _tmps(wbdec), ) # return [degree(Uπ).*(Uπ*(M*Uπ')) for Uπ in summands(wbdec)] T = eltype(eltype(direct_summands(wbdec))) - Mπs = [(d = size(Uπ, 1); zeros(T, d,d)) for Uπ in direct_summands(wbdec)] + Mπs = [(d = size(Uπ, 1); zeros(T, d, d)) for Uπ in direct_summands(wbdec)] return diagonalize!(Mπs, M, direct_summands(wbdec), tmps) end @@ -59,7 +65,8 @@ function diagonalize!( Mπs, M::AbstractMatrix, wbdec::WedderburnDecomposition, - tmps=_tmps(wbdec)) + tmps = _tmps(wbdec), +) return diagonalize!(Mπs, M, direct_summands(wbdec), tmps) end @@ -67,7 +74,7 @@ function diagonalize!( Mπs::AbstractVector{<:AbstractMatrix}, M::AbstractMatrix, Uπs::AbstractVector{<:DirectSummand}, - tmps + tmps, ) for (π, Uπ) in enumerate(Uπs) imUπ = image_basis(Uπ) # Base.Matrix to allow BLAS paths below @@ -79,14 +86,12 @@ function diagonalize!( return Mπs end - function invariant_vectors( G::Group, act::ByPermutations, - basis::StarAlgebras.Basis{T, I}, -) where {T, I} - - tovisit = trues(length(basis)); + basis::StarAlgebras.Basis{T,I}, +) where {T,I} + tovisit = trues(length(basis)) invariant_vs = Vector{SparseVector{Rational{Int}}}() ordG = order(Int, G) @@ -100,36 +105,40 @@ function invariant_vectors( orbit[j] = basis[action(act, elts[j], bi)] end tovisit[orbit] .= false - push!(invariant_vs, sparsevec(orbit, fill(1//ordG, ordG), length(basis))) + push!( + invariant_vs, + sparsevec(orbit, fill(1 // ordG, ordG), length(basis)), + ) end end return invariant_vs end -_orth_proj(A::AbstractMatrix, v, QR=qr(A)) = A * (QR\v) +_orth_proj(A::AbstractMatrix, v, QR = qr(A)) = A * (QR \ v) function invariant_vectors( G::Group, act::ByLinearTransformation, basis, - atol=1e-12 - ) - + atol = 1e-12, +) hom = CachedExtensionHomomorphism(G, act, basis, precompute = true) dim = 0 T = coeff_type(action(hom)) - @assert T==Float64 - subspaces = SparseMatrixCSC{T, Int64}[] - qrs = LinearAlgebra.QRCompactWY{Float64, Matrix{Float64}}[] + @assert T == Float64 + subspaces = SparseMatrixCSC{T,Int64}[] + qrs = LinearAlgebra.QRCompactWY{Float64,Matrix{Float64}}[] - inv_vectors = SparseVector{T, Int64}[] + inv_vectors = SparseVector{T,Int64}[] inv_v = Vector{T}(undef, length(basis)) for b in basis b_orth = sparsevec(decompose(b, hom)..., length(basis)) if dim > 0 - b_orth -= sum(_orth_proj(V, b_orth, QR) for (V, QR) in zip(subspaces, qrs)) + b_orth -= sum( + _orth_proj(V, b_orth, QR) for (V, QR) in zip(subspaces, qrs) + ) @debug "orthogonalizing $b:" norm(b_orth) norm(b_orth, 2) < atol && continue end @@ -145,16 +154,16 @@ function invariant_vectors( # * `tmp_subspace`, the subspace spanned by the orbit for g in G - k = SymbolicWedderburn.action(hom, g, b_orth) + k = induce(hom, g) * b_orth @assert isapprox(norm(k, 2), 1.0, atol = atol) inv_v .+= k residual = k - _orth_proj(orbit_subspace, k) (rnorm = norm(residual, 2)) < atol && continue - orbit_subspace = hcat(orbit_subspace, Vector(residual./rnorm)) + orbit_subspace = hcat(orbit_subspace, Vector(residual ./ rnorm)) end - push!(inv_vectors, inv_v/order(Int, G)) # a copy if inv_v + push!(inv_vectors, inv_v / order(Int, G)) # a copy if inv_v push!(subspaces, orbit_subspace) # orbit_subspace is freshly allocated every nonzero b_orth dim += size(orbit_subspace, 2) dim == length(basis) && break From 731a9511f93e33effd057540110bd589bac45416 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 21 Sep 2021 10:42:15 +0200 Subject: [PATCH 03/15] minimal_rank_projection doesn't to what it promises --- src/minimal_projections.jl | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/minimal_projections.jl b/src/minimal_projections.jl index c2c6c84..bab3070 100644 --- a/src/minimal_projections.jl +++ b/src/minimal_projections.jl @@ -99,24 +99,16 @@ function minimal_rank_projection(χ::Character, RG::StarAlgebra{<:Group}; idems = small_idempotents(RG), # idems are AlgebraElements over Rational{Int} iters=3 ) - - k = if isirreducible(χ) - 1 - else - sum(constituents(χ).>0) - # the minimal rank projection for the composite character - end - - degree(χ) == k && return one(RG, Rational{Int}), true + degree(χ) == 1 && return one(RG, Rational{Int}), true for µ in idems - χ(µ) == k && µ^2 == µ && return µ, true + isone(χ(µ)) && µ^2 == µ && return µ, true end for n in 2:iters - for elts in Iterators.product(ntuple(i -> idems, n)...) + for (i, elts) in enumerate(Iterators.product(fill(idems, n)...)) µ = *(elts...) - χ(µ) == k && µ^2 == µ && return µ, true + isone(χ(µ)) && µ^2 == µ && return µ, true end end @debug "Could not find minimal projection for $χ" From 92d8e921ef76f658ad8d1e8bd16d9f429bc2e67e Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 11:54:50 +0200 Subject: [PATCH 04/15] fix: type instability --- src/minimal_projections.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/minimal_projections.jl b/src/minimal_projections.jl index bab3070..da4f1bf 100644 --- a/src/minimal_projections.jl +++ b/src/minimal_projections.jl @@ -86,11 +86,13 @@ end @static if VERSION < v"1.3.0" function (χ::Character)(α::AlgebraElement{<:StarAlgebra{<:Group}}) @assert parent(χ) === parent(parent(α)) + iszero(α) && return zero(eltype(StarAlgebras.coeffs(α)))*zero(eltype(χ)) return sum(α(g) * χ(g) for g in supp(α)) end else function (χ::AbstractClassFunction)(α::AlgebraElement{<:StarAlgebra{<:Group}}) @assert parent(χ) === parent(parent(α)) + iszero(α) && return zero(eltype(StarAlgebras.coeffs(α)))*zero(eltype(χ)) return sum(α(g) * χ(g) for g in supp(α)) end end From ef75d74ab025b00b1b3c074a57293813166a075a Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 11:55:33 +0200 Subject: [PATCH 05/15] fix: iteration over CyclicSubgroups --- src/minimal_projections.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/minimal_projections.jl b/src/minimal_projections.jl index da4f1bf..692dc46 100644 --- a/src/minimal_projections.jl +++ b/src/minimal_projections.jl @@ -49,7 +49,7 @@ function Base.iterate(citr::CyclicSubgroups) g, state = iterate(citr.group) # g is identity here @assert isone(g) if citr.min_order ≤ 1 ≤ citr.max_order - citr.seen[ord] = Set([g]) + citr.seen[1] = Set([g]) return Set([g]), state end return iterate(citr, state) From ec0e1447731b89df38ddf63f57f4ffcc11e5ba30 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 11:56:21 +0200 Subject: [PATCH 06/15] =?UTF-8?q?add=20matrix=5Fprojection(hom,=20=CF=87)?= =?UTF-8?q?=20for=20completeness?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/matrix_projections.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/matrix_projections.jl b/src/matrix_projections.jl index df18892..7891b27 100644 --- a/src/matrix_projections.jl +++ b/src/matrix_projections.jl @@ -91,6 +91,15 @@ function matrix_projection(χ::Character{T}) where T return eltype(res) == T ? res : T.(res) end +function matrix_projection(hom::InducedActionHomomorphism, χ::Character{T}) where T + tbl = table(χ) + res = sum( + c .* matrix_projection_irr(hom, ψ) + for (c, ψ) in zip(constituents(χ), irreducible_characters(tbl)) if !iszero(c) + ) + return eltype(res) == T ? res : T.(res) +end + function matrix_projection( hom::InducedActionHomomorphism{<:ByPermutations}, α::AlgebraElement, From 1d99f0657443da6acf451115c152bb7c78f0dec8 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 11:58:30 +0200 Subject: [PATCH 07/15] add semisimple kwarg to WedderburnDecomposition --- src/wedderburn_decomposition.jl | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/wedderburn_decomposition.jl b/src/wedderburn_decomposition.jl index c2069b1..e0068c3 100644 --- a/src/wedderburn_decomposition.jl +++ b/src/wedderburn_decomposition.jl @@ -11,7 +11,8 @@ function WedderburnDecomposition( action::Action, basis_full, basis_half, - S = Rational{Int}, + S = Rational{Int}; + semisimple=false, ) basis = StarAlgebras.Basis{UInt32}(basis_full) invariants = invariant_vectors(G, action, basis) @@ -20,20 +21,12 @@ function WedderburnDecomposition( ehom = CachedExtensionHomomorphism(G, action, basis_half, precompute = true) Uπs = let - sa_basis = symmetry_adapted_basis(T, tbl, ehom; semisimple = false) - @debug "fill factor of sa_basis:" round.( - _fillfactor.(sa_basis), - digits = 3, + sa_basis = symmetry_adapted_basis( + T, + tbl, + ehom; + semisimple = semisimple ) - sp_basis = sparse.(sa_basis) - if T <: AbstractFloat - droptol!.(sp_basis, eps(T) * length(basis_half)) - @debug "fill factor after sparsification" round.( - _fillfactor.(sa_basis), - digits = 3, - ) - end - sp_basis end return WedderburnDecomposition(basis, invariants, Uπs, ehom) From d83f41e8226c5432808454911356b6d7510ab9c3 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 12:02:20 +0200 Subject: [PATCH 08/15] more accurate (but more expensive) _orth_proj --- src/wedderburn_decomposition.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wedderburn_decomposition.jl b/src/wedderburn_decomposition.jl index e0068c3..c4c5b8a 100644 --- a/src/wedderburn_decomposition.jl +++ b/src/wedderburn_decomposition.jl @@ -107,7 +107,12 @@ function invariant_vectors( return invariant_vs end -_orth_proj(A::AbstractMatrix, v, QR = qr(A)) = A * (QR \ v) +function _orth_proj(A::AbstractMatrix, v, QR = qr(A)) + # return A * (QR \ v) + y = QR.Q' * v + y[size(A,2)+1:end] .= 0 # project to y = Q̂'x + return QR.Q * y +end function invariant_vectors( G::Group, From ec7a2a714900943deeccf635da745efeffc1466a Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 18:27:24 +0200 Subject: [PATCH 09/15] fix: add semisimple kwarg to WD --- src/wedderburn_decomposition.jl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/wedderburn_decomposition.jl b/src/wedderburn_decomposition.jl index c4c5b8a..059c023 100644 --- a/src/wedderburn_decomposition.jl +++ b/src/wedderburn_decomposition.jl @@ -21,12 +21,7 @@ function WedderburnDecomposition( ehom = CachedExtensionHomomorphism(G, action, basis_half, precompute = true) Uπs = let - sa_basis = symmetry_adapted_basis( - T, - tbl, - ehom; - semisimple = semisimple - ) + sa_basis = symmetry_adapted_basis(T, tbl, ehom; semisimple = semisimple) end return WedderburnDecomposition(basis, invariants, Uπs, ehom) From 9076fe0c934cd5ec33f6a350e5eeabd5afd6d926 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 19:06:45 +0200 Subject: [PATCH 10/15] add zerotol! --- src/SymbolicWedderburn.jl | 1 + src/util.jl | 8 ++++++++ src/wedderburn_decomposition.jl | 10 ++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 src/util.jl diff --git a/src/SymbolicWedderburn.jl b/src/SymbolicWedderburn.jl index e3ca167..18a9e49 100644 --- a/src/SymbolicWedderburn.jl +++ b/src/SymbolicWedderburn.jl @@ -30,6 +30,7 @@ using .Characters import .Characters: row_echelon_form! import .Characters.FiniteFields +include("util.jl") include("actions.jl") include("action_characters.jl") include("matrix_projections.jl") diff --git a/src/util.jl b/src/util.jl new file mode 100644 index 0000000..5355f28 --- /dev/null +++ b/src/util.jl @@ -0,0 +1,8 @@ +function zerotol!(M::AbstractArray; atol=eps(eltype(M))) + @inbounds for i in eachindex(M) + if abs(M[i]) < atol + M[i] = zero(M[i]) + end + end + return M +end diff --git a/src/wedderburn_decomposition.jl b/src/wedderburn_decomposition.jl index 059c023..caef12b 100644 --- a/src/wedderburn_decomposition.jl +++ b/src/wedderburn_decomposition.jl @@ -64,12 +64,14 @@ function diagonalize!( Uπs::AbstractVector{<:DirectSummand}, tmps, ) + @assert length(Mπs) == length(Uπs) + for (π, Uπ) in enumerate(Uπs) imUπ = image_basis(Uπ) # Base.Matrix to allow BLAS paths below - LinearAlgebra.mul!(tmps[π], M, imUπ') - LinearAlgebra.mul!(Mπs[π], imUπ, tmps[π]) - deg = degree(Uπ) - Mπs[π] .*= deg + LinearAlgebra.mul!(tmps[π], imUπ, M) + LinearAlgebra.mul!(Mπs[π], tmps[π], imUπ') + zerotol!(Mπs[π], atol = eps(eltype(imUπ)) * max(size(imUπ)...)) + Mπs[π] .*= degree(Uπ) end return Mπs end From 3ce181e761a3b32c52d528e99e9b9f2dc980e1c7 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 19:07:55 +0200 Subject: [PATCH 11/15] cosmetics + formatting --- src/sa_basis.jl | 6 ++++++ src/wedderburn_decomposition.jl | 18 +++++++++++++++--- test/action_dihedral.jl | 8 +++++--- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/sa_basis.jl b/src/sa_basis.jl index 0ddb75a..8dc42f4 100644 --- a/src/sa_basis.jl +++ b/src/sa_basis.jl @@ -144,6 +144,10 @@ function symmetry_adapted_basis( irr, multips = _constituents_decomposition(ψ, tbl) if T <: Real irr, multips = affordable_real(irr, multips) + @debug "Decomposition into real character spaces: + degrees: $(join([lpad(d, 6) for d in degrees], "")) + multiplicities: $(join([lpad(m, 6) for m in multiplicities], ""))" + end if semisimple || all(isone ∘ degree, irr) @@ -195,6 +199,7 @@ function _symmetry_adapted_basis( image = hom === nothing ? image_basis(µT) : image_basis(hom, µT) simple = size(image, 1) == m deg = degree(µ) + @assert size(image, 1) == (simple ? m : m*deg) "incompatible projection dimension: $(size(image, 1)) ≠ $(simple ? m : m*deg)" if deg == 1 @assert simple "Central projection associated to character is not simple unless its degree == 1" end @@ -217,6 +222,7 @@ function _symmetry_adapted_basis( @spawn_compat begin µT = eltype(µ) == T ? µ : AlgebraElement{T}(µ) image = hom === nothing ? image_basis(µT) : image_basis(hom, µT) + @assert size(image, 1) == (simple ? m : m*deg) "incompatible projection dimension: $(size(image, 1)) ≠ $(simple ? m : m*deg)" DirectSummand(image, m, deg, simple) end end diff --git a/src/wedderburn_decomposition.jl b/src/wedderburn_decomposition.jl index caef12b..c8ba92a 100644 --- a/src/wedderburn_decomposition.jl +++ b/src/wedderburn_decomposition.jl @@ -12,7 +12,7 @@ function WedderburnDecomposition( basis_full, basis_half, S = Rational{Int}; - semisimple=false, + semisimple = false, ) basis = StarAlgebras.Basis{UInt32}(basis_full) invariants = invariant_vectors(G, action, basis) @@ -27,12 +27,24 @@ function WedderburnDecomposition( return WedderburnDecomposition(basis, invariants, Uπs, ehom) end +function Base.show(io::IO, wbdec::SymbolicWedderburn.WedderburnDecomposition) + ds = direct_summands(wbdec) + simple = all(issimple.(ds)) + dims = size.(ds, 1) + norbs = length(invariant_vectors(wbdec)) + + print(io, "Wedderburn Decomposition into $norbs orbits and $(length(ds))") + all(simple) && print(io, " simple") + println(io, " summands of sizes") + return print(io, dims) +end + invariant_vectors(wbdec::WedderburnDecomposition) = wbdec.invariants StarAlgebras.basis(wbdec::WedderburnDecomposition) = wbdec.basis direct_summands(wbdec::WedderburnDecomposition) = wbdec.Uπs _tmps(wbdec::WedderburnDecomposition) = - [zeros(eltype(U), reverse(size(U))) for U in wbdec.Uπs] + zeros.(eltype(wbdec), size.(direct_summands(wbdec))) _fillfactor(M::AbstractMatrix) = count(!iszero, M) / length(M) _fillfactor(M::AbstractSparseMatrix) = nnz(M) / length(M) @@ -107,7 +119,7 @@ end function _orth_proj(A::AbstractMatrix, v, QR = qr(A)) # return A * (QR \ v) y = QR.Q' * v - y[size(A,2)+1:end] .= 0 # project to y = Q̂'x + y[size(A, 2)+1:end] .= 0 # project to y = Q̂'x return QR.Q * y end diff --git a/test/action_dihedral.jl b/test/action_dihedral.jl index 8bf7244..aaf62a1 100644 --- a/test/action_dihedral.jl +++ b/test/action_dihedral.jl @@ -67,16 +67,18 @@ end ] # preallocating - Mπs = zeros.(T, size.(psds)) M_orb = similar(M, T) - tmps = zeros.(T, reverse.(size.(direct_summands(wedderburn)))) + # these could be preallocated as well: + # Mπs = zeros.(T, size.(psds)) + # tmps = SymbolicWedderburn._temps(wedderburn) C = DynamicPolynomials.coefficients(robinson_form - t, basis(wedderburn)) for iv in invariant_vectors(wedderburn) c = dot(C, iv) M_orb = invariant_constraint!(M_orb, M, iv) - Mπs = SymbolicWedderburn.diagonalize!(Mπs, M_orb, wedderburn, tmps) + # Mπs = SymbolicWedderburn.diagonalize!(Mπs, M_orb, wedderburn, tmps) + Mπs = SymbolicWedderburn.diagonalize(M_orb, wedderburn) JuMP.@constraint m sum( dot(Mπ, Pπ) for (Mπ, Pπ) in zip(Mπs, psds) if !iszero(Mπ) From c32eda69b72c97196af4412fb694fcb19214009c Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 19:09:07 +0200 Subject: [PATCH 12/15] add convenience eltype(::WedderburnDecomposition) --- src/wedderburn_decomposition.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wedderburn_decomposition.jl b/src/wedderburn_decomposition.jl index c8ba92a..11098f8 100644 --- a/src/wedderburn_decomposition.jl +++ b/src/wedderburn_decomposition.jl @@ -42,6 +42,8 @@ end invariant_vectors(wbdec::WedderburnDecomposition) = wbdec.invariants StarAlgebras.basis(wbdec::WedderburnDecomposition) = wbdec.basis direct_summands(wbdec::WedderburnDecomposition) = wbdec.Uπs +Base.eltype(wbdec::WedderburnDecomposition) = + eltype(eltype(direct_summands(wbdec))) _tmps(wbdec::WedderburnDecomposition) = zeros.(eltype(wbdec), size.(direct_summands(wbdec))) From f5695cdaa5babc60937964d68436ee3ea1979f84 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 19:10:33 +0200 Subject: [PATCH 13/15] bump GroupsCore to 0.4 --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 1dbcf6d..2ea2d90 100644 --- a/Project.toml +++ b/Project.toml @@ -14,8 +14,8 @@ StarAlgebras = "0c0c59c1-dc5f-42e9-9a8b-b5dc384a6cd1" [compat] Cyclotomics = "0.2.3" -GroupsCore = "0.3.1" -PermutationGroups = "0.3" +GroupsCore = "0.4" +PermutationGroups = "0.3.1" Primes = "0.4, 0.5" StarAlgebras = "0.1.5" julia = "1" From 1fd7b25315ade78e6be0ae5fb737cbd5da7bf124 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 28 Sep 2021 19:11:28 +0200 Subject: [PATCH 14/15] minify Dihedral implementation --- examples/dihedral.jl | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/examples/dihedral.jl b/examples/dihedral.jl index 1813024..07822c9 100644 --- a/examples/dihedral.jl +++ b/examples/dihedral.jl @@ -1,4 +1,4 @@ -import GroupsCore +import GroupsCore #GroupsCore API struct DihedralGroup <: GroupsCore.Group n::Int @@ -28,7 +28,8 @@ end Base.IteratorSize(::Type{DihedralGroup}) = Base.HasLength() GroupsCore.order(::Type{T}, G::DihedralGroup) where {T} = convert(T, 2G.n) -GroupsCore.gens(G::DihedralGroup) = [DihedralElement(G.n, false, 1), DihedralElement(G.n, true, 0)] +GroupsCore.gens(G::DihedralGroup) = + [DihedralElement(G.n, false, 1), DihedralElement(G.n, true, 0)] # Base.rand not needed for our purposes here @@ -38,11 +39,8 @@ function Base.:(==)(g::DihedralElement, h::DihedralElement) end function Base.inv(el::DihedralElement) - if el.reflection || iszero(el.id) - return el - else - return DihedralElement(el.n, false, el.n - el.id) - end + (el.reflection || iszero(el.id)) && return el + return DihedralElement(el.n, false, el.n - el.id) end function Base.:*(a::DihedralElement, b::DihedralElement) a.n == b.n || error("Cannot multiply elements from different Dihedral groups") @@ -54,13 +52,7 @@ Base.copy(a::DihedralElement) = DihedralElement(a.n, a.reflection, a.id) # optional functions: function GroupsCore.order(T::Type, el::DihedralElement) - if el.reflection - return T(2) - else - if iszero(el.id) - return T(1) - else - return T(div(el.n, gcd(el.n, el.id))) - end - end + el.reflection && return T(2) + iszero(el.id )&& return T(1) + return T(div(el.n, gcd(el.n, el.id))) end From 6e16157b05cf6e0265de58497a96b3d10d8a7877 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Wed, 29 Sep 2021 00:25:59 +0200 Subject: [PATCH 15/15] fix examples (run only locally) --- examples/Manifest.toml | 122 +++++++++++++++++++---------------- examples/ex_S4.jl | 2 +- examples/ex_robinson_form.jl | 2 +- 3 files changed, 69 insertions(+), 57 deletions(-) diff --git a/examples/Manifest.toml b/examples/Manifest.toml index 8baee98..ab09aae 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -16,10 +16,10 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" [[BenchmarkTools]] -deps = ["JSON", "Logging", "Printf", "Statistics", "UUIDs"] -git-tree-sha1 = "c31ebabde28d102b602bada60ce8922c266d205b" +deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] +git-tree-sha1 = "61adeb0823084487000600ef8b1c00cc2474cd47" uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -version = "1.1.1" +version = "1.2.0" [[BinaryProvider]] deps = ["Libdl", "Logging", "SHA"] @@ -41,9 +41,9 @@ version = "0.5.1" [[ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "0b0aa9d61456940511416b59a0e902c57b154956" +git-tree-sha1 = "e8a30e8019a512e4b6c56ccebc065026624660e8" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "0.10.12" +version = "1.7.0" [[CodecBzip2]] deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] @@ -57,6 +57,11 @@ git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" version = "0.7.0" +[[Combinatorics]] +git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" +uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" +version = "1.0.2" + [[CommonSubexpressions]] deps = ["MacroTools", "Test"] git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" @@ -65,9 +70,9 @@ version = "0.3.0" [[Compat]] deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] -git-tree-sha1 = "dc7dedc2c2aa9faf59a55c622760a25cbefbe941" +git-tree-sha1 = "31d0151f5716b655421d9d75b7fa74cc4e744df2" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.31.0" +version = "3.39.0" [[CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] @@ -81,15 +86,15 @@ version = "0.0.2" [[Cyclotomics]] deps = ["LRUCache", "Memoize", "Primes", "SparseArrays", "Test"] -git-tree-sha1 = "cbd552a1037f87fa589f1c760c1c60b5843ab8f5" +git-tree-sha1 = "aff368c5b38052cc10140d6c3cdcd2b5862903f8" uuid = "da8f5974-afbb-4dc8-91d8-516d5257c83b" -version = "0.2.2" +version = "0.2.3" [[DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677" +git-tree-sha1 = "7d9d316f04214f7efdbb6398d545446e246eff02" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.9" +version = "0.18.10" [[Dates]] deps = ["Printf"] @@ -107,9 +112,9 @@ version = "1.0.3" [[DiffRules]] deps = ["NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "214c3fcac57755cfda163d91c58893a8723f93e9" +git-tree-sha1 = "7220bc21c33e990c14f4a9a319b1d242ebc5b269" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.0.2" +version = "1.3.1" [[Distributed]] deps = ["Random", "Serialization", "Sockets"] @@ -127,15 +132,15 @@ uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" [[DynamicPolynomials]] deps = ["DataStructures", "Future", "LinearAlgebra", "MultivariatePolynomials", "MutableArithmetics", "Pkg", "Reexport", "Test"] -git-tree-sha1 = "5e47c4d652ea67652b7c5945c79c46472397d47f" +git-tree-sha1 = "05b68e727a192783be0b34bd8fee8f678505c0bf" uuid = "7c1d4256-1411-5781-91ec-d7bc3513ac07" -version = "0.3.18" +version = "0.3.20" [[ForwardDiff]] deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "NaNMath", "Printf", "Random", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "e2af66012e08966366a43251e1fd421522908be6" +git-tree-sha1 = "b5e930ac60b613ef3406da6d4f42c35d8dc51419" uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.18" +version = "0.10.19" [[Future]] deps = ["Random"] @@ -149,9 +154,9 @@ version = "0.3.2" [[HTTP]] deps = ["Base64", "Dates", "IniFile", "Logging", "MbedTLS", "NetworkOptions", "Sockets", "URIs"] -git-tree-sha1 = "c6a1fff2fd4b1da29d3dccaffb1e1001244d844e" +git-tree-sha1 = "24675428ca27678f003414a98c9e473e45fe6a21" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.9.12" +version = "0.9.15" [[IniFile]] deps = ["Test"] @@ -163,6 +168,11 @@ version = "0.5.0" deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +[[IrrationalConstants]] +git-tree-sha1 = "f76424439413893a832026ca355fe273e93bce94" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.1.0" + [[JLLWrappers]] deps = ["Preferences"] git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e" @@ -171,21 +181,21 @@ version = "1.3.0" [[JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4" +git-tree-sha1 = "8076680b162ada2a031f707ac7b4953e30667a37" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.1" +version = "0.21.2" [[JSONSchema]] -deps = ["HTTP", "JSON", "ZipFile"] -git-tree-sha1 = "b84ab8139afde82c7c65ba2b792fe12e01dd7307" +deps = ["HTTP", "JSON", "URIs"] +git-tree-sha1 = "2f49f7f86762a0fbbeef84912265a1ae61c4ef80" uuid = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" -version = "0.3.3" +version = "0.3.4" [[JuMP]] deps = ["Calculus", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MathOptInterface", "MutableArithmetics", "NaNMath", "Printf", "Random", "SparseArrays", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "8dfc5df8aad9f2cfebc8371b69700efd02060827" +git-tree-sha1 = "4358b7cbf2db36596bdbbe3becc6b9d87e4eb8f5" uuid = "4076af6c-e467-56ae-b986-b466b2749572" -version = "0.21.8" +version = "0.21.10" [[LRUCache]] git-tree-sha1 = "d64a0aff6691612ab9fb0117b0995270871c5dfc" @@ -216,19 +226,19 @@ deps = ["Libdl"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[LogExpFunctions]] -deps = ["DocStringExtensions", "LinearAlgebra"] -git-tree-sha1 = "7bd5f6565d80b6bf753738d2bc40a5dfea072070" +deps = ["ChainRulesCore", "DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "34dc30f868e368f8a17b728a1238f3fcda43931a" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.2.5" +version = "0.3.3" [[Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[MacroTools]] deps = ["Markdown", "Random"] -git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0" +git-tree-sha1 = "5a5bc6bf062f0f95e62d0fe0a2d99699fed82dd9" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.6" +version = "0.5.8" [[Markdown]] deps = ["Base64"] @@ -304,6 +314,10 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +[[OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" + [[OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" @@ -317,9 +331,9 @@ version = "1.4.1" [[Parsers]] deps = ["Dates"] -git-tree-sha1 = "c8abc88faa3f7a3950832ac5d6e690881590d6dc" +git-tree-sha1 = "9d8c00ef7a8d110787ff6f170579846f776133a9" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "1.1.0" +version = "2.0.4" [[PermutationGroups]] deps = ["AbstractAlgebra", "GroupsCore", "Markdown", "Random"] @@ -352,6 +366,10 @@ version = "0.5.0" deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" +[[Profile]] +deps = ["Printf"] +uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" + [[REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" @@ -367,9 +385,9 @@ uuid = "fb686558-2515-59ef-acaa-46db3789a887" version = "0.4.3" [[Reexport]] -git-tree-sha1 = "5f6c21241f0f655da3952fd60aa18477cf96c220" +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" uuid = "189a3867-3050-52da-a836-e630ba90ab69" -version = "1.1.0" +version = "1.2.2" [[Requires]] deps = ["UUIDs"] @@ -391,15 +409,15 @@ version = "0.7.1" [[SCS_GPU_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenBLAS_jll", "Pkg"] -git-tree-sha1 = "9c0b47a387c4c7d8a66abb11977391a6602d2384" +git-tree-sha1 = "a96402e3b494a8bbec61b1adb86d4be04112c646" uuid = "af6e375f-46ec-5fa0-b791-491b0dfa44a4" -version = "2.1.3+0" +version = "2.1.4+0" [[SCS_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenBLAS_jll", "Pkg"] -git-tree-sha1 = "4816f8272a3e9d08a32a4e94b367c7e84057c145" +git-tree-sha1 = "66c07568ecec96260aaac194ee1e5ee8df62f386" uuid = "f4f2fc5b-1d94-523c-97ea-2ab488bedf4b" -version = "2.1.3+0" +version = "2.1.4+0" [[SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -425,26 +443,26 @@ deps = ["LinearAlgebra", "Random"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[SpecialFunctions]] -deps = ["ChainRulesCore", "LogExpFunctions", "OpenSpecFun_jll"] -git-tree-sha1 = "a50550fa3164a8c46747e62063b4d774ac1bcf49" +deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "793793f1df98e3d7d554b65a107e9c9a6399a6ed" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "1.5.1" +version = "1.7.0" [[StaticArrays]] deps = ["LinearAlgebra", "Random", "Statistics"] -git-tree-sha1 = "1b9a0f17ee0adde9e538227de093467348992397" +git-tree-sha1 = "3240808c6d463ac46f1c1cd7638375cd22abbccb" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.2.7" +version = "1.2.12" [[Statistics]] deps = ["LinearAlgebra", "SparseArrays"] uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [[SumOfSquares]] -deps = ["ComplexOptInterface", "DataStructures", "JuMP", "LinearAlgebra", "MathOptInterface", "MultivariateBases", "MultivariateMoments", "MultivariatePolynomials", "MutableArithmetics", "PolyJuMP", "Reexport", "SemialgebraicSets", "SparseArrays"] -git-tree-sha1 = "d8323f2f157052c226a31ba44d4018c39d92ca25" +deps = ["Combinatorics", "ComplexOptInterface", "DataStructures", "JuMP", "LinearAlgebra", "MathOptInterface", "MultivariateBases", "MultivariateMoments", "MultivariatePolynomials", "MutableArithmetics", "PolyJuMP", "Reexport", "SemialgebraicSets", "SparseArrays", "SymbolicWedderburn"] +git-tree-sha1 = "514777215559fbf8dd3d9489187d119ace65c7d1" uuid = "4b9e565b-77fc-50a5-a571-1244f986bda1" -version = "0.4.6" +version = "0.4.7" [[SymbolicWedderburn]] deps = ["Cyclotomics", "GroupsCore", "LinearAlgebra", "PermutationGroups", "Primes", "SparseArrays"] @@ -466,9 +484,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[TranscodingStreams]] deps = ["Random", "Test"] -git-tree-sha1 = "7c53c35547de1c5b9d46a4797cf6d8253807108c" +git-tree-sha1 = "216b95ea110b5972db65aa90f88d8d89dcb8851c" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.5" +version = "0.9.6" [[URIs]] git-tree-sha1 = "97bbe755a53fe859669cd907f2d96aee8d2c1355" @@ -482,12 +500,6 @@ uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [[Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" -[[ZipFile]] -deps = ["Libdl", "Printf", "Zlib_jll"] -git-tree-sha1 = "c3a5637e27e914a7a445b8d0ad063d701931e9f7" -uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" -version = "0.9.3" - [[Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" diff --git a/examples/ex_S4.jl b/examples/ex_S4.jl index f52fa7f..ce6a40c 100644 --- a/examples/ex_S4.jl +++ b/examples/ex_S4.jl @@ -118,7 +118,7 @@ wedderburn_dec = let f=f, G = PermGroup([perm"(1,2)", Perm([2:N; 1])]), T = Floa # preallocating Mπs = zeros.(T, size.(psds)) M_orb = similar(M, T) - tmps = zeros.(T, reverse.(size.(direct_summands(wedderburn)))) + tmps = SymbolicWedderburn._tmps(wedderburn) C = DynamicPolynomials.coefficients(f-t, SymbolicWedderburn.basis(wedderburn)) diff --git a/examples/ex_robinson_form.jl b/examples/ex_robinson_form.jl index 8724a7b..2ee40f3 100644 --- a/examples/ex_robinson_form.jl +++ b/examples/ex_robinson_form.jl @@ -221,7 +221,7 @@ wedderburn_dec = let f = robinson_form, G = DihedralGroup(4), T = Float64 # preallocating Mπs = zeros.(T, size.(psds)) M_orb = similar(M, T) - tmps = zeros.(T, reverse.(size.(direct_summands(wedderburn)))) + tmps = SymbolicWedderburn._tmps(wedderburn) C = DynamicPolynomials.coefficients(f - t, SymbolicWedderburn.basis(wedderburn))