Skip to content

Commit 6543ad4

Browse files
committed
External Dependency
1 parent b56b752 commit 6543ad4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module ITensorNetworksTensorOperationsExt
2+
3+
using ITensorNetworksNext: ITensorNetworksNext
4+
using TensorOperations: TensorOperations, optimaltree
5+
6+
function ITensorNetworksNext.contraction_sequence(::Algorithm"optimal", tn::Vector{<:AbstractArray})
7+
network = collect.(inds.(tn))
8+
#Converting dims to Float64 to minimize overflow issues
9+
inds_to_dims = Dict(i => Float64(dim(i)) for i in unique(reduce(vcat, network)))
10+
seq, _ = optimaltree(network, inds_to_dims)
11+
return seq
12+
end
13+
14+
end

0 commit comments

Comments
 (0)