Skip to content

Commit 35582f9

Browse files
committed
Use preserve graph
1 parent 72bea86 commit 35582f9

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
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]>, Joseph Tindall <[email protected]> and contributors"]
4-
version = "0.13.8"
4+
version = "0.13.9"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

src/abstractitensornetwork.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,8 @@ function gauge_edge(
607607
left_inds = uniqueinds(tn, edge)
608608
ltags = tags(tn, edge)
609609
X, Y = factorize(tn[src(edge)], left_inds; tags=ltags, ortho="left", kwargs...)
610-
tn[src(edge)] = X
611-
tn[dst(edge)] *= Y
610+
@preserve_graph tn[src(edge)] = X
611+
@preserve_graph tn[dst(edge)] = tn[dst(edge)]*Y
612612
return tn
613613
end
614614

@@ -681,8 +681,8 @@ function _truncate_edge(tn::AbstractITensorNetwork, edge::AbstractEdge; kwargs..
681681
left_inds = uniqueinds(tn, edge)
682682
ltags = tags(tn, edge)
683683
U, S, V = svd(tn[src(edge)], left_inds; lefttags=ltags, kwargs...)
684-
tn[src(edge)] = U
685-
tn[dst(edge)] *= (S * V)
684+
@preserve_graph tn[src(edge)] = U
685+
@preserve_graph tn[dst(edge)] = tn[dst(edge)] * (S*V)
686686
return tn
687687
end
688688

test/test_belief_propagation.jl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,27 @@ using ITensorNetworks:
2424
update,
2525
update_factor,
2626
updated_message,
27-
message_diff
28-
using ITensors: ITensors, ITensor, combiner, dag, inds, inner, op, prime, random_itensor
27+
message_diff,
28+
ITensorNetwork
29+
using ITensors:
30+
norm,
31+
ITensors,
32+
ITensor,
33+
@Algorithm_str,
34+
Algorithm,
35+
combiner,
36+
dag,
37+
inds,
38+
inner,
39+
op,
40+
prime,
41+
random_itensor
2942
using ITensorNetworks.ModelNetworks: ModelNetworks
3043
using ITensors.NDTensors: array
3144
using LinearAlgebra: eigvals, tr
3245
using NamedGraphs: NamedEdge, NamedGraph
3346
using NamedGraphs.NamedGraphGenerators: named_comb_tree, named_grid
34-
using NamedGraphs.PartitionedGraphs: PartitionVertex, partitionedges
47+
using NamedGraphs.PartitionedGraphs: PartitionVertex, partitionedges, unpartitioned_graph
3548
using SplitApplyCombine: group
3649
using StableRNGs: StableRNG
3750
using TensorOperations: TensorOperations

0 commit comments

Comments
 (0)