Skip to content

Commit d050cfa

Browse files
committed
Add missing siteinds and mpo method
1 parent 11aaba4 commit d050cfa

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/sitetype.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ function siteinds(x, g::AbstractGraph; kwargs...)
2020
return siteinds(to_siteinds_callable(x), g; kwargs...)
2121
end
2222

23+
# Convenient syntax for path graph.
24+
function siteinds(x, nv::Int; kwargs...)
25+
return siteinds(x, path_graph(nv); kwargs...)
26+
end
27+
2328
function to_siteind(x, vertex; kwargs...)
2429
return [siteind(x, vertex_tag(vertex); kwargs...)]
2530
end

src/treetensornetworks/opsum_to_ttn/opsum_to_ttn.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,10 @@ end
649649
function mpo(os::OpSum, external_inds::Vector; kwargs...)
650650
return ttn(os, path_indsnetwork(external_inds); kwargs...)
651651
end
652+
function mpo(os::OpSum, s::IndsNetwork; kwargs...)
653+
# TODO: Check it is a path graph.
654+
return ttn(os, s; kwargs...)
655+
end
652656

653657
# Conversion from other formats
654658
function ttn(o::Op, s::IndsNetwork; kwargs...)

0 commit comments

Comments
 (0)