Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to StarAlgebras.jl-0.3 #75

Merged
merged 16 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 226 additions & 0 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.10.2"
manifest_format = "2.0"
project_hash = "91757b21b288de2de800711fa083ac7a348f0716"

[[deps.AbstractPermutations]]
deps = ["GroupsCore"]
git-tree-sha1 = "fbede79e328d45b2f9258abbb83b1af4a4900a5e"
uuid = "36d08e8a-54dd-435f-8c9e-38a475050b11"
version = "0.3.0"

[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"

[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.1.0+0"

[[deps.Crayons]]
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1"

[[deps.Cyclotomics]]
deps = ["LRUCache", "Memoize", "Primes", "SparseArrays", "Test"]
git-tree-sha1 = "dc2e5fd64c188399434e83fa5c10c6fa4eff962a"
uuid = "da8f5974-afbb-4dc8-91d8-516d5257c83b"
version = "0.3.2"

[[deps.DataAPI]]
git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.16.0"

[[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"

[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[deps.GroupsCore]]
deps = ["Random"]
git-tree-sha1 = "36b28fedf46e05edbde98ad3ec73d6a5d8897ed1"
uuid = "d5909c97-4eac-4ecc-a3dc-fdd0858a4120"
version = "0.5.0"

[[deps.IntegerMathUtils]]
git-tree-sha1 = "b8ffb903da9f7b8cf695a8bead8e01814aa24b30"
uuid = "18e54dd8-cb9d-406c-a71d-865a43cbb235"
version = "0.1.2"

[[deps.InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[deps.IteratorInterfaceExtensions]]
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"

[[deps.LRUCache]]
git-tree-sha1 = "b3cc6698599b10e652832c2f23db3cab99d51b59"
uuid = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"
version = "1.6.1"
weakdeps = ["Serialization"]

[deps.LRUCache.extensions]
SerializationExt = ["Serialization"]

[[deps.LaTeXStrings]]
git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.3.1"

[[deps.Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[deps.LinearAlgebra]]
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[deps.Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[deps.MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.13"

[[deps.Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[deps.Memoize]]
deps = ["MacroTools"]
git-tree-sha1 = "2b1dfcba103de714d31c033b5dacc2e4a12c7caa"
uuid = "c03570c3-d221-55d1-a50c-7939bbd78826"
version = "0.4.4"

[[deps.MutableArithmetics]]
deps = ["LinearAlgebra", "SparseArrays", "Test"]
git-tree-sha1 = "c2e2d748aea87f006a87c1654878349baa04aaf0"
uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0"
version = "1.4.3"

[[deps.OpenBLAS_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
version = "0.3.23+4"

[[deps.OrderedCollections]]
git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.6.3"

[[deps.PermutationGroups]]
deps = ["AbstractPermutations", "GroupsCore", "PrecompileTools", "Random"]
git-tree-sha1 = "c6e5fdaa1340b59d58d675cd1641c9016809f4a6"
uuid = "8bc5a954-2dfc-11e9-10e6-cd969bffa420"
version = "0.6.2"

[[deps.PrecompileTools]]
deps = ["Preferences"]
git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f"
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
version = "1.2.1"

[[deps.Preferences]]
deps = ["TOML"]
git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.4.3"

[[deps.PrettyTables]]
deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "Reexport", "StringManipulation", "Tables"]
git-tree-sha1 = "88b895d13d53b5577fd53379d913b9ab9ac82660"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "2.3.1"

[[deps.Primes]]
deps = ["IntegerMathUtils"]
git-tree-sha1 = "cb420f77dc474d23ee47ca8d14c90810cafe69e7"
uuid = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
version = "0.5.6"

[[deps.Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[deps.Random]]
deps = ["SHA"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[deps.Reexport]]
git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "1.2.2"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[deps.Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[deps.SparseArrays]]
deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
version = "1.10.0"

[[deps.StarAlgebras]]
deps = ["LinearAlgebra", "MutableArithmetics", "SparseArrays"]
git-tree-sha1 = "01695523364a32851f48becc34c804d8360451f9"
repo-rev = "mk/changes_for_SW"
repo-url = "https://github.com/JuliaAlgebra/StarAlgebras.jl.git"
uuid = "0c0c59c1-dc5f-42e9-9a8b-b5dc384a6cd1"
version = "0.3.0"

[[deps.StringManipulation]]
deps = ["PrecompileTools"]
git-tree-sha1 = "a04cabe79c5f01f4d723cc6704070ada0b9d46d5"
uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e"
version = "0.3.4"

[[deps.SuiteSparse_jll]]
deps = ["Artifacts", "Libdl", "libblastrampoline_jll"]
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
version = "7.2.1+1"

[[deps.TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
version = "1.0.3"

[[deps.TableTraits]]
deps = ["IteratorInterfaceExtensions"]
git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39"
uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
version = "1.0.1"

[[deps.Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"]
git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.11.1"

[[deps.Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[deps.libblastrampoline_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
version = "5.8.0+1"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PermutationGroups = "0.6.2"
PrecompileTools = "1"
PrettyTables = "2"
Primes = "0.4, 0.5"
StarAlgebras = "0.2"
StarAlgebras = "0.3"
SparseArrays = "1"
julia = "1.6"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SymbolicWedderburn.jl
[![CI](https://github.com/kalmarek/SymbolicWedderburn.jl/workflows/CI/badge.svg?branch=master)](https://github.com/kalmarek/SymbolicWedderburn.jl/actions)
[![CI](https://github.com/kalmarek/SymbolicWedderburn.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/kalmarek/SymbolicWedderburn.jl/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/kalmarek/SymbolicWedderburn.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/kalmarek/SymbolicWedderburn.jl)

Amazing package providing symbolic but explicit
Expand Down
5 changes: 3 additions & 2 deletions examples/dihedral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ function GroupsCore.gens(G::DihedralGroup)
return [DihedralElement(G.n, false, 1), DihedralElement(G.n, true, 0)]
end

# Base.rand not needed for our purposes here

Base.parent(g::DihedralElement) = DihedralGroup(g.n)
function Base.:(==)(g::DihedralElement, h::DihedralElement)
return g.n == h.n && g.reflection == h.reflection && g.id == h.id
end
function Base.hash(g::DihedralElement, h::UInt)
return hash((g.n, g.reflection, g.id, hash(DihedralElement)), h)
end

function Base.inv(el::DihedralElement)
(el.reflection || iszero(el.id)) && return el
Expand Down
10 changes: 8 additions & 2 deletions examples/ex_C2_linear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ using Test
@testset "Decompose in basis" begin
g = gens(G, 1)

basis = monomials([x, y], 0:4)
basis = StarAlgebras.FixedBasis(
monomials([x, y], 0:4),
StarAlgebras.DiracMStructure(*),
)
k = SymbolicWedderburn.action(By90Rotation(), g, basis[2])
ehom = SymbolicWedderburn.ExtensionHomomorphism(By90Rotation(), basis)
idcs, vals = SymbolicWedderburn.decompose(k, ehom)
Expand All @@ -57,7 +60,10 @@ end

@testset "induced Matrix Representation" begin
g = gens(G, 1)
monomial_basis = monomials([x, y], 0:4)
monomial_basis = StarAlgebras.FixedBasis(
monomials([x, y], 0:4),
StarAlgebras.DiracMStructure(*),
)
ehom =
SymbolicWedderburn.ExtensionHomomorphism(By90Rotation(), monomial_basis)
m = droptol!(SymbolicWedderburn.induce(By90Rotation(), ehom, g), 1e-15)
Expand Down
12 changes: 10 additions & 2 deletions examples/sos_problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import SymbolicWedderburn.StarAlgebras

using JuMP

function DynamicPolynomials.coefficients(p, b::StarAlgebras.FixedBasis)
return DynamicPolynomials.coefficients(p, b.elts)
end

function invariant_constraint!(
M_orb::AbstractMatrix{<:AbstractFloat},
M::Matrix{<:Integer},
Expand All @@ -31,11 +35,12 @@ function sos_problem(poly::AbstractPolynomial)
0:DynamicPolynomials.maxdegree(poly)÷2,
)

basis_constraints = StarAlgebras.Basis{UInt16}(
basis_constraints = StarAlgebras.FixedBasis(
DynamicPolynomials.monomials(
vars,
0:DynamicPolynomials.maxdegree(poly),
),
StarAlgebras.DiracMStructure(*),
)

M = [basis_constraints[x*y] for x in basis_psd, y in basis_psd]
Expand Down Expand Up @@ -155,7 +160,10 @@ function sos_problem(
@timed sos_problem(poly, wedderburn, basis_psd)
else
(invariant_vs, basis_cnstr), symmetry_adaptation_time = @timed let G = G
basis = StarAlgebras.Basis{UInt32}(basis_constraints)
basis = StarAlgebras.FixedBasis(
basis_constraints,
StarAlgebras.DiracMStructure(*),
)

tblG = SymbolicWedderburn.Characters.CharacterTable(
Rational{Int},
Expand Down
Loading
Loading