Skip to content

Luxor #47

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

Merged
merged 7 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 1 addition & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ version = "1.0.4"
[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LuxorGraphPlot = "1f49bdf2-22a7-4bc4-978b-948dc219fbbc"
Mods = "7475f97c-0381-53b1-977b-4c60186c8d62"
OMEinsum = "ebe7aa44-baf0-506c-a96f-8464559b3922"
OMEinsumContractionOrders = "6f22d1fd-8eed-4bb7-9776-e7d684900715"
Expand All @@ -25,13 +24,10 @@ SIMDTypes = "94e857df-77ce-4151-89e5-788b33177be4"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
TropicalNumbers = "b3a74e9c-7526-4576-a4eb-79c0d4c32334"
Viznet = "52a3aca4-6234-47fd-b74a-806bdf78ede9"

[compat]
AbstractTrees = "0.3, 0.4"
CUDA = "3"
Cairo = "1.0"
Compose = "0.9"
FFTW = "1.4"
Graphs = "1.7"
Mods = "1.3"
Expand All @@ -43,7 +39,6 @@ Requires = "1"
SIMDTypes = "0.1"
StatsBase = "0.33"
TropicalNumbers = "0.4, 0.5"
Viznet = "0.3"
julia = "1"

[extras]
Expand Down
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Pkg
using GenericTensorNetworks
using GenericTensorNetworks: TropicalNumbers, Polynomials, Mods, OMEinsum, OMEinsumContractionOrders
using GenericTensorNetworks: TropicalNumbers, Polynomials, Mods, OMEinsum, OMEinsumContractionOrders, LuxorGraphPlot
using Documenter
using DocThemeIndigo
using PlutoStaticHTML
Expand Down Expand Up @@ -34,7 +34,7 @@ indigo = DocThemeIndigo.install(GenericTensorNetworks)
DocMeta.setdocmeta!(GenericTensorNetworks, :DocTestSetup, :(using GenericTensorNetworks); recursive=true)

makedocs(;
modules=[GenericTensorNetworks, TropicalNumbers, Mods, OMEinsum, OMEinsumContractionOrders],
modules=[GenericTensorNetworks, TropicalNumbers, Mods, OMEinsum, OMEinsumContractionOrders, LuxorGraphPlot],
authors="Jinguo Liu",
repo="https://github.com/QuEraComputing/GenericTensorNetworks.jl/blob/{commit}{path}#{line}",
sitename="GenericTensorNetworks.jl",
Expand Down
3 changes: 2 additions & 1 deletion docs/src/ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ MergeGreedy
```@docs
show_graph
show_gallery
spring_layout
show_einsum
spring_layout!

diagonal_coupled_graph
square_lattice_graph
Expand Down
2 changes: 1 addition & 1 deletion examples/Coloring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ graph = Graphs.smallgraph(:petersen)
# We can visualize this graph using the following function
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a

locations = [[rot15(0.0, 1.0, i) for i=0:4]..., [rot15(0.0, 0.6, i) for i=0:4]...]
locations = [[rot15(0.0, 2.0, i) for i=0:4]..., [rot15(0.0, 1.0, i) for i=0:4]...]

show_graph(graph; locs=locations)

Expand Down
2 changes: 1 addition & 1 deletion examples/DominatingSet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ graph = Graphs.smallgraph(:petersen)
# We can visualize this graph using the following function
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a

locations = [[rot15(0.0, 1.0, i) for i=0:4]..., [rot15(0.0, 0.6, i) for i=0:4]...]
locations = [[rot15(0.0, 2.0, i) for i=0:4]..., [rot15(0.0, 1.0, i) for i=0:4]...]

show_graph(graph; locs=locations)

Expand Down
2 changes: 1 addition & 1 deletion examples/IndependentSet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ graph = Graphs.smallgraph(:petersen)
## set the vertex locations manually instead of using the default spring layout
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a

locations = [[rot15(0.0, 1.0, i) for i=0:4]..., [rot15(0.0, 0.6, i) for i=0:4]...]
locations = [[rot15(0.0, 2.0, i) for i=0:4]..., [rot15(0.0, 1.0, i) for i=0:4]...]

show_graph(graph; locs=locations)

Expand Down
2 changes: 1 addition & 1 deletion examples/Matching.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ graph = Graphs.smallgraph(:petersen)
# We can visualize this graph using the following function
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a

locations = [[rot15(0.0, 1.0, i) for i=0:4]..., [rot15(0.0, 0.6, i) for i=0:4]...]
locations = [[rot15(0.0, 2.0, i) for i=0:4]..., [rot15(0.0, 1.0, i) for i=0:4]...]

show_graph(graph; locs=locations)

Expand Down
2 changes: 1 addition & 1 deletion examples/MaxCut.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ graph = Graphs.smallgraph(:petersen)
# We can visualize this graph using the following function
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a

locations = [[rot15(0.0, 1.0, i) for i=0:4]..., [rot15(0.0, 0.6, i) for i=0:4]...]
locations = [[rot15(0.0, 2.0, i) for i=0:4]..., [rot15(0.0, 1.0, i) for i=0:4]...]

show_graph(graph; locs=locations)

Expand Down
2 changes: 1 addition & 1 deletion examples/MaximalIS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ graph = Graphs.smallgraph(:petersen)
# We can visualize this graph using the following function
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a

locations = [[rot15(0.0, 1.0, i) for i=0:4]..., [rot15(0.0, 0.6, i) for i=0:4]...]
locations = [[rot15(0.0, 2.0, i) for i=0:4]..., [rot15(0.0, 1.0, i) for i=0:4]...]

show_graph(graph; locs=locations)

Expand Down
2 changes: 1 addition & 1 deletion examples/PaintShop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sequence = collect("iadgbeadfcchghebif")
# We can visualize this paint shop problem as a graph
rot(a, b, θ) = cos(θ)*a + sin(θ)*b, cos(θ)*b - sin(θ)*a

locations = [rot(0.0, 1.0, -0.25π - 1.5*π*(i-0.5)/length(sequence)) for i=1:length(sequence)]
locations = [rot(0.0, 2.0, -0.25π - 1.5*π*(i-0.5)/length(sequence)) for i=1:length(sequence)]

graph = path_graph(length(sequence))
for i=1:length(sequence)
Expand Down
2 changes: 1 addition & 1 deletion examples/weighted.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ max_config_weighted = solve(problem, SingleConfigMax())[]
# Let us visualize the solution.
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a

locations = [[rot15(0.0, 1.0, i) for i=0:4]..., [rot15(0.0, 0.6, i) for i=0:4]...]
locations = [[rot15(0.0, 2.0, i) for i=0:4]..., [rot15(0.0, 1.0, i) for i=0:4]...]

show_graph(graph; locs=locations, vertex_colors=
[iszero(max_config_weighted.c.data[i]) ? "white" : "red" for i=1:nv(graph)])
Expand Down
Loading