Skip to content

Commit

Permalink
Merge pull request #40 from kalmarek/fix/simple_direct_summand
Browse files Browse the repository at this point in the history
Fix/simple direct summand
  • Loading branch information
Marek Kaluba authored Oct 18, 2021
2 parents dbbb167 + 6e16157 commit 9e23b8f
Show file tree
Hide file tree
Showing 13 changed files with 217 additions and 144 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
122 changes: 67 additions & 55 deletions examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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"
Expand All @@ -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"]
Expand Down Expand Up @@ -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"
Expand All @@ -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"]
Expand All @@ -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"
Expand All @@ -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"]
Expand All @@ -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"
Expand All @@ -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"
Expand Down
24 changes: 8 additions & 16 deletions examples/dihedral.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import GroupsCore
import GroupsCore #GroupsCore API

struct DihedralGroup <: GroupsCore.Group
n::Int
Expand Down Expand Up @@ -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

Expand All @@ -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")
Expand All @@ -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
2 changes: 1 addition & 1 deletion examples/ex_S4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion examples/ex_robinson_form.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
1 change: 1 addition & 0 deletions src/SymbolicWedderburn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading

2 comments on commit 9e23b8f

@kalmarek
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/48064

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.0 -m "<description of version>" 9e23b8f8ccbee6a55e7afe952961f80cc1fbc124
git push origin v0.2.0

Please sign in to comment.