From b2584388fc8eec375ccc5c1905be6edb50e2b89e Mon Sep 17 00:00:00 2001 From: mtfishman Date: Thu, 28 Mar 2024 14:49:21 -0400 Subject: [PATCH] Fix tests --- src/solvers/contract.jl | 7 ++++++- src/tensornetworkoperators.jl | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/solvers/contract.jl b/src/solvers/contract.jl index 7163f931..7a9fb2d9 100644 --- a/src/solvers/contract.jl +++ b/src/solvers/contract.jl @@ -1,3 +1,8 @@ +using Graphs: nv, vertices +using ITensors: ITensors, linkinds, sim +using ITensors.NDTensors: Algorithm, @Algorithm_str, contract +using NamedGraphs: vertextype + function sum_contract( ::Algorithm"fit", tns::Vector{<:Tuple{<:AbstractTTN,<:AbstractTTN}}; @@ -66,7 +71,7 @@ end """ Overload of `ITensors.apply`. """ -function apply(tn1::AbstractTTN, tn2::AbstractTTN; init, kwargs...) +function ITensors.apply(tn1::AbstractTTN, tn2::AbstractTTN; init, kwargs...) if !isone(plev_diff(flatten_external_indsnetwork(tn1, tn2), external_indsnetwork(init))) error( "Initial guess `init` needs to primelevel one less than the contraction tn1 and tn2." diff --git a/src/tensornetworkoperators.jl b/src/tensornetworkoperators.jl index e515685b..c1ae29da 100644 --- a/src/tensornetworkoperators.jl +++ b/src/tensornetworkoperators.jl @@ -1,3 +1,6 @@ +using ITensors: ITensors, commoninds, product +using LinearAlgebra: factorize + """ Take a vector of gates which act on different edges/ vertices of an Inds network and construct the tno which represents prod(gates). """