Skip to content

Commit 6e603aa

Browse files
authored
Luxor (#47)
* git push luxor * luxor ok * new luxor viz * polish docstring * update backend: LuxorGraphPlot * update a docstring * update visualize
1 parent 482c362 commit 6e603aa

16 files changed

+346
-1312
lines changed

Project.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ version = "1.0.4"
66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
88
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
9-
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
10-
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
119
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
1210
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
1311
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
1412
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1513
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
14+
LuxorGraphPlot = "1f49bdf2-22a7-4bc4-978b-948dc219fbbc"
1615
Mods = "7475f97c-0381-53b1-977b-4c60186c8d62"
1716
OMEinsum = "ebe7aa44-baf0-506c-a96f-8464559b3922"
1817
OMEinsumContractionOrders = "6f22d1fd-8eed-4bb7-9776-e7d684900715"
@@ -25,13 +24,10 @@ SIMDTypes = "94e857df-77ce-4151-89e5-788b33177be4"
2524
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
2625
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
2726
TropicalNumbers = "b3a74e9c-7526-4576-a4eb-79c0d4c32334"
28-
Viznet = "52a3aca4-6234-47fd-b74a-806bdf78ede9"
2927

3028
[compat]
3129
AbstractTrees = "0.3, 0.4"
3230
CUDA = "3"
33-
Cairo = "1.0"
34-
Compose = "0.9"
3531
FFTW = "1.4"
3632
Graphs = "1.7"
3733
Mods = "1.3"
@@ -43,7 +39,6 @@ Requires = "1"
4339
SIMDTypes = "0.1"
4440
StatsBase = "0.33"
4541
TropicalNumbers = "0.4, 0.5"
46-
Viznet = "0.3"
4742
julia = "1"
4843

4944
[extras]

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Pkg
22
using GenericTensorNetworks
3-
using GenericTensorNetworks: TropicalNumbers, Polynomials, Mods, OMEinsum, OMEinsumContractionOrders
3+
using GenericTensorNetworks: TropicalNumbers, Polynomials, Mods, OMEinsum, OMEinsumContractionOrders, LuxorGraphPlot
44
using Documenter
55
using DocThemeIndigo
66
using PlutoStaticHTML
@@ -34,7 +34,7 @@ indigo = DocThemeIndigo.install(GenericTensorNetworks)
3434
DocMeta.setdocmeta!(GenericTensorNetworks, :DocTestSetup, :(using GenericTensorNetworks); recursive=true)
3535

3636
makedocs(;
37-
modules=[GenericTensorNetworks, TropicalNumbers, Mods, OMEinsum, OMEinsumContractionOrders],
37+
modules=[GenericTensorNetworks, TropicalNumbers, Mods, OMEinsum, OMEinsumContractionOrders, LuxorGraphPlot],
3838
authors="Jinguo Liu",
3939
repo="https://github.com/QuEraComputing/GenericTensorNetworks.jl/blob/{commit}{path}#{line}",
4040
sitename="GenericTensorNetworks.jl",

docs/src/ref.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ MergeGreedy
131131
```@docs
132132
show_graph
133133
show_gallery
134-
spring_layout
134+
show_einsum
135+
spring_layout!
135136
136137
diagonal_coupled_graph
137138
square_lattice_graph

examples/Coloring.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ graph = Graphs.smallgraph(:petersen)
1414
# We can visualize this graph using the following function
1515
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a
1616

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

1919
show_graph(graph; locs=locations)
2020

examples/DominatingSet.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ graph = Graphs.smallgraph(:petersen)
1717
# We can visualize this graph using the following function
1818
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a
1919

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

2222
show_graph(graph; locs=locations)
2323

examples/IndependentSet.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ graph = Graphs.smallgraph(:petersen)
1313
## set the vertex locations manually instead of using the default spring layout
1414
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a
1515

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

1818
show_graph(graph; locs=locations)
1919

examples/Matching.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ graph = Graphs.smallgraph(:petersen)
1515
# We can visualize this graph using the following function
1616
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a
1717

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

2020
show_graph(graph; locs=locations)
2121

examples/MaxCut.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ graph = Graphs.smallgraph(:petersen)
1818
# We can visualize this graph using the following function
1919
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a
2020

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

2323
show_graph(graph; locs=locations)
2424

examples/MaximalIS.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ graph = Graphs.smallgraph(:petersen)
1616
# We can visualize this graph using the following function
1717
rot15(a, b, i::Int) = cos(2i*π/5)*a + sin(2i*π/5)*b, cos(2i*π/5)*b - sin(2i*π/5)*a
1818

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

2121
show_graph(graph; locs=locations)
2222

examples/PaintShop.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sequence = collect("iadgbeadfcchghebif")
1919
# We can visualize this paint shop problem as a graph
2020
rot(a, b, θ) = cos(θ)*a + sin(θ)*b, cos(θ)*b - sin(θ)*a
2121

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

2424
graph = path_graph(length(sequence))
2525
for i=1:length(sequence)

0 commit comments

Comments
 (0)