Skip to content

Commit ca47544

Browse files
committed
update Graphs
1 parent e71d8ca commit ca47544

12 files changed

+21
-21
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name = "GraphTensorNetworks"
22
uuid = "0978c8c2-34f6-49c7-9826-ea2cc20dabd2"
33
authors = ["GiggleLiu <cacate0129@gmail.com> and contributors"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
88
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
99
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
1010
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
11-
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
11+
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1212
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1313
Mods = "7475f97c-0381-53b1-977b-4c60186c8d62"
1414
OMEinsum = "ebe7aa44-baf0-506c-a96f-8464559b3922"
@@ -25,7 +25,7 @@ Viznet = "52a3aca4-6234-47fd-b74a-806bdf78ede9"
2525
CUDA = "3.5"
2626
Compose = "0.9"
2727
FFTW = "1.4"
28-
LightGraphs = "1.3"
28+
Graphs = "1.4"
2929
Mods = "1.3"
3030
OMEinsum = "0.6.1"
3131
OMEinsumContractionOrders = "0.5"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ end
3636

3737
Let us use the Petersen graph as an example, we first generate its tensor network contraction tree.
3838
```julia
39-
julia> using GraphTensorNetworks, Random, LightGraphs
39+
julia> using GraphTensorNetworks, Random, Graphs
4040

41-
julia> graph = (Random.seed!(2); LightGraphs.smallgraph(:petersen))
41+
julia> graph = (Random.seed!(2); Graphs.smallgraph(:petersen))
4242
{10, 15} undirected simple Int64 graph
4343

4444
julia> problem = Independence(graph; optimizer=TreeSA(sc_target=0, sc_weight=1.0, ntrials=10, βs=0.01:0.1:15.0, niters=20, rw_weight=0.2));

notebooks/tropicalwidget_simple.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ begin
1818
using Revise
1919
using Pkg
2020
Pkg.activate(dirname(pwd()))
21-
using LightGraphs # graph support
21+
using Graphs # graph support
2222
using PlutoUI
2323
using Viznet, Compose
2424
using TropicalNumbers, OMEinsum, GraphTensorNetworks#, TropicalGEMM

src/GraphTensorNetworks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using Core: Argument
55
using TropicalGEMM, TropicalNumbers
66
using OMEinsum
77
using OMEinsum: timespace_complexity, collect_ixs
8-
using LightGraphs
8+
using Graphs
99

1010
export timespace_complexity, @ein_str
1111
export GreedyMethod, TreeSA, SABipartite, KaHyParBipartite, MergeVectors, MergeGreedy

src/graph_polynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Polynomials
22
using OMEinsum: NestedEinsum, getixs, getiy
33
using FFTW
4-
using LightGraphs
4+
using Graphs
55

66
export contractx, contractf, graph_polynomial, max_size, max_size_count
77

src/graphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using LightGraphs, OMEinsumContractionOrders
1+
using Graphs, OMEinsumContractionOrders
22
export random_regular_graph, diagonal_coupled_graph, isindependentset
33
export square_lattice_graph, unitdisk_graph
44

src/networks.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ struct Independence{CT<:EinTypes} <: GraphProblem
1515
end
1616

1717
function Independence(g::SimpleGraph; openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
18-
rawcode = EinCode(([(i,) for i in LightGraphs.vertices(g)]..., # labels for vertex tensors
19-
[minmax(e.src,e.dst) for e in LightGraphs.edges(g)]...), openvertices) # labels for edge tensors
18+
rawcode = EinCode(([(i,) for i in Graphs.vertices(g)]..., # labels for vertex tensors
19+
[minmax(e.src,e.dst) for e in Graphs.edges(g)]...), openvertices) # labels for edge tensors
2020
code = _optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier)
2121
Independence(code)
2222
end
@@ -32,7 +32,7 @@ struct MaxCut{CT<:EinTypes} <: GraphProblem
3232
code::CT
3333
end
3434
function MaxCut(g::SimpleGraph; openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
35-
rawcode = EinCode(([minmax(e.src,e.dst) for e in LightGraphs.edges(g)]...,), openvertices) # labels for edge tensors
35+
rawcode = EinCode(([minmax(e.src,e.dst) for e in Graphs.edges(g)]...,), openvertices) # labels for edge tensors
3636
MaxCut(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier))
3737
end
3838

@@ -48,7 +48,7 @@ struct MaximalIndependence{CT<:EinTypes} <: GraphProblem
4848
end
4949

5050
function MaximalIndependence(g::SimpleGraph; openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
51-
rawcode = EinCode(([(LightGraphs.neighbors(g, v)..., v) for v in LightGraphs.vertices(g)]...,), openvertices)
51+
rawcode = EinCode(([(Graphs.neighbors(g, v)..., v) for v in Graphs.vertices(g)]...,), openvertices)
5252
MaximalIndependence(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier))
5353
end
5454

@@ -69,8 +69,8 @@ struct Matching{CT<:EinTypes} <: GraphProblem
6969
end
7070

7171
function Matching(g::SimpleGraph; openvertices=(), optimizer=GreedyMethod(), simplifier=nothing)
72-
rawcode = EinCode(([(minmax(e.src,e.dst),) for e in LightGraphs.edges(g)]..., # labels for edge tensors
73-
[([minmax(i,j) for j in neighbors(g, i)]...,) for i in LightGraphs.vertices(g)]...,), openvertices) # labels for vertex tensors
72+
rawcode = EinCode(([(minmax(e.src,e.dst),) for e in Graphs.edges(g)]..., # labels for edge tensors
73+
[([minmax(i,j) for j in neighbors(g, i)]...,) for i in Graphs.vertices(g)]...,), openvertices) # labels for vertex tensors
7474
Matching(_optimize_code(rawcode, uniformsize(rawcode, 2), optimizer, simplifier))
7575
end
7676

src/viz.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export vizeinsum, vizconfig
33
using Compose
44

55
function vizconfig(g::SimpleGraph; locs, config=zeros(Int, length(locs)), unit=1.0, graphsize=12cm, radius=0.03)
6-
vizconfig([string(v)=>locs[v] for v in LightGraphs.vertices(g)], [(e.src, e.dst) for e in edges(g)]; config=config, unit=unit, graphsize=graphsize, radius=radius)
6+
vizconfig([string(v)=>locs[v] for v in Graphs.vertices(g)], [(e.src, e.dst) for e in edges(g)]; config=config, unit=unit, graphsize=graphsize, radius=radius)
77
end
88

99
function vizconfig(nodes, edges; config=zeros(Int, length(nodes)), unit=1.0, graphsize=12cm, radius=0.03)

test/arithematics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using GraphTensorNetworks, Test, OMEinsum, OMEinsumContractionOrders
22
using Mods, Polynomials, TropicalNumbers
3-
using LightGraphs, Random
3+
using Graphs, Random
44
using GraphTensorNetworks: StaticBitVector
55

66
@testset "truncated poly" begin

test/configurations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using GraphTensorNetworks, Test, LightGraphs
1+
using GraphTensorNetworks, Test, Graphs
22
using OMEinsum
33
using TropicalNumbers: CountingTropicalF64
44

0 commit comments

Comments
 (0)