Skip to content

Commit 9d7abea

Browse files
committed
Upgrade to DataGraphs and NamedGraphs to 0.4 and 0.11
1 parent 9248686 commit 9d7abea

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ Adapt = "4.3"
3939
AlgorithmsInterface = "0.1"
4040
BackendSelection = "0.1.6"
4141
Combinatorics = "1"
42-
DataGraphs = "0.3.1"
42+
DataGraphs = "0.4.0"
4343
DiagonalArrays = "0.3.31"
4444
Dictionaries = "0.4.5"
4545
FunctionImplementations = "0.4.1"
4646
Graphs = "1.13.1"
4747
LinearAlgebra = "1.10"
4848
MacroTools = "0.5.16"
4949
NamedDimsArrays = "0.14.3"
50-
NamedGraphs = "0.10"
50+
NamedGraphs = "0.11"
5151
SimpleTraits = "0.9.5"
5252
SplitApplyCombine = "1.2.3"
5353
TensorOperations = "5.3.1"

src/abstracttensornetwork.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ using Graphs: Graphs, AbstractEdge, AbstractGraph, add_edge!, add_vertex!, dst,
88
using LinearAlgebra: LinearAlgebra
99
using MacroTools: @capture
1010
using NamedDimsArrays: dimnames, inds
11-
using NamedGraphs.GraphsExtensions:
12-
directed_graph, incident_edges, rem_edges!, similar_graph, vertextype
11+
using NamedGraphs.GraphsExtensions: directed_graph, incident_edges, rem_edges!, vertextype
1312
using NamedGraphs.OrdinalIndexing: OrdinalSuffixedInteger
14-
using NamedGraphs: NamedGraphs, NamedGraph, not_implemented
13+
using NamedGraphs: NamedGraphs, NamedGraph, not_implemented, similar_graph
1514

1615
abstract type AbstractTensorNetwork{V, VD} <: AbstractDataGraph{V, VD, Nothing} end
1716

src/tensornetwork.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,17 @@ function Graphs.rem_edge!(tn::TensorNetwork, e)
136136
return true
137137
end
138138

139-
function GraphsExtensions.similar_graph(type::Type{<:TensorNetwork})
139+
function NamedGraphs.similar_graph(
140+
type::Type{<:TensorNetwork},
141+
underlying_graph::AbstractGraph
142+
)
140143
DT = fieldtype(type, :tensors)
141144
empty_dict = DT()
142-
return TensorNetwork(similar_graph(underlying_graph_type(type)), empty_dict)
143-
end
144-
function GraphsExtensions.similar_graph(tn::TensorNetwork, underlying_graph::AbstractGraph)
145-
DT = fieldtype(typeof(tn), :tensors)
146-
empty_dict = DT()
147145
return _TensorNetwork(underlying_graph, empty_dict)
148146
end
147+
function NamedGraphs.similar_graph(tn::TensorNetwork, underlying_graph::AbstractGraph)
148+
return similar_graph(typeof(tn), underlying_graph)
149+
end
149150

150151
function NamedGraphs.induced_subgraph_from_vertices(graph::TensorNetwork, subvertices)
151152
return tensornetwork_induced_subgraph(graph, subvertices)

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ITensorBase = "0.5"
3434
ITensorNetworksNext = "0.4"
3535
ITensorPkgSkeleton = "0.3.42"
3636
NamedDimsArrays = "0.14"
37-
NamedGraphs = "0.10"
37+
NamedGraphs = "0.11"
3838
QuadGK = "2.11.2"
3939
SafeTestsets = "0.1"
4040
Suppressor = "0.2.8"

0 commit comments

Comments
 (0)