You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Add two itensornetworks together by growing the bond dimension. The network structures need to be have the same vertex names, same site index on each vertex """
818
801
function ITensorMPS.add(tn1::AbstractITensorNetwork, tn2::AbstractITensorNetwork)
819
802
@assertissetequal(vertices(tn1), vertices(tn2))
@@ -823,14 +806,13 @@ function ITensorMPS.add(tn1::AbstractITensorNetwork, tn2::AbstractITensorNetwork
823
806
824
807
edges_tn1, edges_tn2 =edges(tn1), edges(tn2)
825
808
826
-
if!edges_equal(tn1, tn2)
809
+
if!issetequal(tn1, tn2)
827
810
new_edges =union(edges_tn1, edges_tn2)
828
811
tn1 =insert_linkinds(tn1, new_edges)
829
812
tn2 =insert_linkinds(tn2, new_edges)
830
813
end
831
814
832
815
edges_tn1, edges_tn2 =edges(tn1), edges(tn2)
833
-
@assertedges_equal(tn1, tn2)
834
816
835
817
tn12 =copy(tn1)
836
818
new_edge_indices =Dict(
@@ -852,7 +834,6 @@ function ITensorMPS.add(tn1::AbstractITensorNetwork, tn2::AbstractITensorNetwork
852
834
e1_v =filter(x ->src(x) == v ||dst(x) == v, edges_tn1)
853
835
e2_v =filter(x ->src(x) == v ||dst(x) == v, edges_tn2)
854
836
855
-
@assertedges_equal(e1_v, e2_v)
856
837
tn1v_linkinds = Index[only(linkinds(tn1, e)) for e in e1_v]
857
838
tn2v_linkinds = Index[only(linkinds(tn2, e)) for e in e1_v]
858
839
tn12v_linkinds = Index[new_edge_indices[e] for e in e1_v]
0 commit comments