Skip to content

Commit f0d6a6f

Browse files
authored
Update to NamedGraphs 0.6 (#163)
1 parent c0621b7 commit f0d6a6f

File tree

8 files changed

+50
-47
lines changed

8 files changed

+50
-47
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ITensorNetworks"
22
uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7"
33
authors = ["Matthew Fishman <[email protected]> and contributors"]
4-
version = "0.10.0"
4+
version = "0.10.1"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
@@ -49,7 +49,7 @@ ITensorNetworksOMEinsumContractionOrdersExt = "OMEinsumContractionOrders"
4949
AbstractTrees = "0.4.4"
5050
Combinatorics = "1"
5151
Compat = "3, 4"
52-
DataGraphs = "0.2.2"
52+
DataGraphs = "0.2.3"
5353
DataStructures = "0.18"
5454
Dictionaries = "0.4"
5555
Distributions = "0.25.86"
@@ -61,7 +61,7 @@ ITensors = "0.4"
6161
IsApprox = "0.1"
6262
IterTools = "1.4.0"
6363
KrylovKit = "0.6, 0.7"
64-
NamedGraphs = "0.5.1"
64+
NamedGraphs = "0.6.0"
6565
NDTensors = "0.3"
6666
Observers = "0.2"
6767
OMEinsumContractionOrders = "0.8.3"

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ julia> using ITensorNetworks: ITensorNetwork
3838

3939
julia> tn = ITensorNetwork(path_graph(4); link_space=2)
4040
ITensorNetworks.ITensorNetwork{Int64} with 4 vertices:
41-
4-element Dictionaries.Indices{Int64}
41+
4-element NamedGraphs.OrderedDictionaries.OrderedIndices{Int64}
4242
1
4343
2
4444
3
@@ -93,7 +93,7 @@ julia> using NamedGraphs.NamedGraphGenerators: named_grid
9393

9494
julia> tn = ITensorNetwork(named_grid((2, 2)); link_space=2)
9595
ITensorNetworks.ITensorNetwork{Tuple{Int64, Int64}} with 4 vertices:
96-
4-element Dictionaries.Indices{Tuple{Int64, Int64}}
96+
4-element NamedGraphs.OrderedDictionaries.OrderedIndices{Tuple{Int64, Int64}}
9797
(1, 1)
9898
(2, 1)
9999
(1, 2)
@@ -128,7 +128,7 @@ julia> neighbors(tn, (1, 2))
128128

129129
julia> tn_1 = subgraph(v -> v[1] == 1, tn)
130130
ITensorNetworks.ITensorNetwork{Tuple{Int64, Int64}} with 2 vertices:
131-
2-element Dictionaries.Indices{Tuple{Int64, Int64}}
131+
2-element NamedGraphs.OrderedDictionaries.OrderedIndices{Tuple{Int64, Int64}}
132132
(1, 1)
133133
(1, 2)
134134

@@ -142,7 +142,7 @@ with vertex data:
142142

143143
julia> tn_2 = subgraph(v -> v[1] == 2, tn)
144144
ITensorNetworks.ITensorNetwork{Tuple{Int64, Int64}} with 2 vertices:
145-
2-element Dictionaries.Indices{Tuple{Int64, Int64}}
145+
2-element NamedGraphs.OrderedDictionaries.OrderedIndices{Tuple{Int64, Int64}}
146146
(2, 1)
147147
(2, 2)
148148

@@ -167,7 +167,7 @@ julia> using ITensorUnicodePlots: @visualize
167167

168168
julia> s = siteinds("S=1/2", named_grid(3))
169169
ITensorNetworks.IndsNetwork{Int64, ITensors.Index} with 3 vertices:
170-
3-element Dictionaries.Indices{Int64}
170+
3-element NamedGraphs.OrderedDictionaries.OrderedIndices{Int64}
171171
1
172172
2
173173
3
@@ -187,7 +187,7 @@ and edge data:
187187

188188
julia> tn1 = ITensorNetwork(s; link_space=2)
189189
ITensorNetworks.ITensorNetwork{Int64} with 3 vertices:
190-
3-element Dictionaries.Indices{Int64}
190+
3-element NamedGraphs.OrderedDictionaries.OrderedIndices{Int64}
191191
1
192192
2
193193
3
@@ -204,7 +204,7 @@ with vertex data:
204204
205205
julia> tn2 = ITensorNetwork(s; link_space=2)
206206
ITensorNetworks.ITensorNetwork{Int64} with 3 vertices:
207-
3-element Dictionaries.Indices{Int64}
207+
3-element NamedGraphs.OrderedDictionaries.OrderedIndices{Int64}
208208
1
209209
2
210210
3
@@ -305,20 +305,20 @@ julia> @visualize Z̃;
305305
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
306306
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
307307
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
308-
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(3, 1)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
309-
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠉⠉⠑⠒⠒⠢⠤⠤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
310-
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈2⠉⠑⠒⠒⠤⠤⠤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
311-
⠀⠀⠀⠀⠀⠀⠀⠀⠀(2)'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(3, 2)⠀⠀
312-
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠊⠀⠀⠀⠀⠀⠀⠀
313-
⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠒⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
314-
⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀2⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
315-
(2, 1)⠤⠤⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
316-
⠀⠀⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠑⠒2⠢⠤⠤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⣀⠔⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
317-
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉(2, 2)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
318-
⠀⠀⠀⠀⠀2⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠤⠤⠒⠊⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
319-
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡠⠤2⠒⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
320-
⠀⠀⠀⠀⠀⠀⢱⠀⢀⣀⠤⠔⠒⠊⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
321-
⠀⠀Z̃(1, 2)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
308+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2, 1)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
309+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2)'⠤⠤⠔⠒⠒⠉⠉⠀⠀⢱⠀⠈⠉⠑⠒⠢⠤⢄⣀2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
310+
⠀⠀⠀⠀⠀⠀⠀⣀⣀⠤⠤⠔⠒⠊⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠒⠒⠤⠤⢄⣀⡀⠀⠀⠀⠀⠀
311+
(3, 1)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀Z̃(1, 2)⠀⠀
312+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀
313+
⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
314+
⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠2⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
315+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
316+
⠀⠀⠀⠀⠀⠀⠀2⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⢀⠤⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
317+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀(2, 2)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
318+
⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⡠⠤⠒⠊⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
319+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠤2⠒⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
320+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⣀⡠⠤⠒⠊⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
321+
⠀⠀⠀⠀⠀⠀(3, 2)⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
322322
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
323323
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
324324
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

src/abstractitensornetwork.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ using ITensors:
3939
using ITensors.ITensorMPS: ITensorMPS, add, linkdim, linkinds, siteinds
4040
using .ITensorsExtensions: ITensorsExtensions, indtype, promote_indtype
4141
using LinearAlgebra: LinearAlgebra, factorize
42-
using NamedGraphs:
43-
NamedGraphs, NamedGraph, not_implemented, parent_vertex_to_vertex, vertex_to_parent_vertex
42+
using NamedGraphs: NamedGraphs, NamedGraph, not_implemented
4443
using NamedGraphs.GraphsExtensions:
4544
, directed_graph, incident_edges, rename_vertices, vertextype
4645
using NDTensors: NDTensors, dim
@@ -94,11 +93,11 @@ function DataGraphs.edge_data(graph::AbstractITensorNetwork, args...)
9493
end
9594

9695
DataGraphs.underlying_graph(tn::AbstractITensorNetwork) = underlying_graph(data_graph(tn))
97-
function NamedGraphs.vertex_to_parent_vertex(tn::AbstractITensorNetwork, vertex)
98-
return vertex_to_parent_vertex(underlying_graph(tn), vertex)
96+
function NamedGraphs.vertex_positions(tn::AbstractITensorNetwork)
97+
return NamedGraphs.vertex_positions(underlying_graph(tn))
9998
end
100-
function NamedGraphs.parent_vertex_to_vertex(tn::AbstractITensorNetwork, parent_vertex)
101-
return parent_vertex_to_vertex(underlying_graph(tn), parent_vertex)
99+
function NamedGraphs.ordered_vertices(tn::AbstractITensorNetwork)
100+
return NamedGraphs.ordered_vertices(underlying_graph(tn))
102101
end
103102

104103
#

src/contract.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
using NamedGraphs: vertex_to_parent_vertex
21
using ITensors: ITensor, scalar
32
using ITensors.ContractionSequenceOptimization: deepmap
43
using ITensors.NDTensors: NDTensors, Algorithm, @Algorithm_str, contract
54
using LinearAlgebra: normalize!
5+
using NamedGraphs: NamedGraphs
6+
using NamedGraphs.OrdinalIndexing: th
67

78
function NDTensors.contract(tn::AbstractITensorNetwork; alg="exact", kwargs...)
89
return contract(Algorithm(alg), tn; kwargs...)
@@ -15,10 +16,8 @@ function NDTensors.contract(
1516
sequence=contraction_sequence(tn; contraction_sequence_kwargs...),
1617
kwargs...,
1718
)
18-
# TODO: Use `vertex`.
19-
sequence_linear_index = deepmap(v -> vertex_to_parent_vertex(tn, v), sequence)
20-
# TODO: Use `tokenized_vertex`.
21-
ts = map(pv -> tn[parent_vertex_to_vertex(tn, pv)], 1:nv(tn))
19+
sequence_linear_index = deepmap(v -> NamedGraphs.vertex_positions(tn)[v], sequence)
20+
ts = map(v -> tn[v], (1:nv(tn))th)
2221
return contract(ts; sequence=sequence_linear_index, kwargs...)
2322
end
2423

src/contraction_sequences.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ using Graphs: vertices
22
using ITensors: ITensor, contract
33
using ITensors.ContractionSequenceOptimization: deepmap, optimal_contraction_sequence
44
using ITensors.NDTensors: Algorithm, @Algorithm_str
5-
using NamedGraphs: parent_vertex_to_vertex
65
using NamedGraphs.Keys: Key
6+
using NamedGraphs.OrdinalIndexing: th
77

88
function contraction_sequence(tn::Vector{ITensor}; alg="optimal", kwargs...)
99
return contraction_sequence(Algorithm(alg), tn; kwargs...)
1010
end
1111

1212
function contraction_sequence(tn::AbstractITensorNetwork; kwargs...)
1313
# TODO: Use `token_vertex` and/or `token_vertices` here.
14-
ts = map(pv -> tn[parent_vertex_to_vertex(tn, pv)], 1:nv(tn))
14+
ts = map(v -> tn[v], (1:nv(tn))th)
1515
seq_linear_index = contraction_sequence(ts; kwargs...)
1616
# TODO: Use `Functors.fmap` or `StructWalk`?
17-
return deepmap(n -> Key(parent_vertex_to_vertex(tn, n)), seq_linear_index)
17+
return deepmap(n -> Key(vertices(tn)[n * th]), seq_linear_index)
1818
end
1919

2020
function contraction_sequence(::Algorithm"optimal", tn::Vector{ITensor})

src/treetensornetworks/projttns/projttn.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct ProjTTN{V,Pos<:Union{Indices{V},NamedEdge{V}}} <: AbstractProjTTN{V}
1414
environments::Dictionary{NamedEdge{V},ITensor}
1515
end
1616

17-
function ProjTTN(pos::Vector, operator::TTN, environments::Dictionary)
17+
function ProjTTN(pos, operator::TTN, environments::Dictionary)
1818
return ProjTTN(Indices(pos), operator, environments)
1919
end
2020

src/treetensornetworks/treetensornetwork.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct TreeTensorNetwork{V} <: AbstractTreeTensorNetwork{V}
1616
end
1717
end
1818

19-
function _TreeTensorNetwork(tensornetwork::ITensorNetwork, ortho_region::Vector)
19+
function _TreeTensorNetwork(tensornetwork::ITensorNetwork, ortho_region)
2020
return _TreeTensorNetwork(tensornetwork, Indices(ortho_region))
2121
end
2222

src/visualize.jl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# TODO: Move to `ITensorNetworksITensors.ITensorVisualizationCoreExt`.
2-
using DataGraphs: AbstractDataGraph, underlying_graph
1+
# TODO: Move to `NamedGraphsITensorVisualizationCoreExt`.
32
using Graphs: vertices
4-
using ITensors.ITensorVisualizationCore: ITensorVisualizationCore, visualize
5-
using NamedGraphs: AbstractNamedGraph, parent_graph
6-
3+
using NamedGraphs: NamedGraphs, AbstractNamedGraph
4+
using ITensors.ITensorVisualizationCore: ITensorVisualizationCore
75
function ITensorVisualizationCore.visualize(
86
graph::AbstractNamedGraph,
97
args...;
@@ -15,9 +13,16 @@ function ITensorVisualizationCore.visualize(
1513
vertex_labels = [vertex_labels_prefix * string(v) for v in vertices(graph)]
1614
end
1715
#edge_labels = [string(e) for e in edges(graph)]
18-
return visualize(parent_graph(graph), args...; vertex_labels, kwargs...)
16+
return ITensorVisualizationCore.visualize(
17+
NamedGraphs.position_graph(graph), args...; vertex_labels, kwargs...
18+
)
1919
end
2020

21+
# TODO: Move to `DataGraphsITensorVisualizationCoreExt`.
22+
using DataGraphs: DataGraphs, AbstractDataGraph
23+
using ITensors.ITensorVisualizationCore: ITensorVisualizationCore
2124
function ITensorVisualizationCore.visualize(graph::AbstractDataGraph, args...; kwargs...)
22-
return visualize(underlying_graph(graph), args...; kwargs...)
25+
return ITensorVisualizationCore.visualize(
26+
DataGraphs.underlying_graph(graph), args...; kwargs...
27+
)
2328
end

0 commit comments

Comments
 (0)