From 9e14f14866467bd66b077c8e34aee0fb3755b31d Mon Sep 17 00:00:00 2001 From: Joey Date: Wed, 12 Jun 2024 16:21:47 -0400 Subject: [PATCH] Revert --- src/abstractitensornetwork.jl | 4 +++- src/solvers/alternating_update/alternating_update.jl | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/abstractitensornetwork.jl b/src/abstractitensornetwork.jl index 34c2db07..06bd5e27 100644 --- a/src/abstractitensornetwork.jl +++ b/src/abstractitensornetwork.jl @@ -806,13 +806,14 @@ function ITensorMPS.add(tn1::AbstractITensorNetwork, tn2::AbstractITensorNetwork edges_tn1, edges_tn2 = edges(tn1), edges(tn2) - if !issetequal(tn1, tn2) + if !issetequal(edges_tn1, edges_tn2) new_edges = union(edges_tn1, edges_tn2) tn1 = insert_linkinds(tn1, new_edges) tn2 = insert_linkinds(tn2, new_edges) end edges_tn1, edges_tn2 = edges(tn1), edges(tn2) + @assert issetequal(edges_tn1, edges_tn2) tn12 = copy(tn1) new_edge_indices = Dict( @@ -833,6 +834,7 @@ function ITensorMPS.add(tn1::AbstractITensorNetwork, tn2::AbstractITensorNetwork e1_v = filter(x -> src(x) == v || dst(x) == v, edges_tn1) e2_v = filter(x -> src(x) == v || dst(x) == v, edges_tn2) + @assert issetequal(e1_v, e2_v) tn1v_linkinds = Index[only(linkinds(tn1, e)) for e in e1_v] tn2v_linkinds = Index[only(linkinds(tn2, e)) for e in e1_v] diff --git a/src/solvers/alternating_update/alternating_update.jl b/src/solvers/alternating_update/alternating_update.jl index 86ef9da6..2cd5de71 100644 --- a/src/solvers/alternating_update/alternating_update.jl +++ b/src/solvers/alternating_update/alternating_update.jl @@ -28,7 +28,6 @@ function alternating_update( nsweeps, init_state; root_vertex, - sweep_plan_func, extracter, extracter_kwargs, updater, @@ -53,7 +52,7 @@ end function alternating_update( projected_operator, - init_state, + init_state::AbstractTTN, sweep_plans; outputlevel=default_outputlevel(), checkdone=default_checkdone(), #