Hi Brian,
From the diagram in the paper (copied below for others to see), it looks like the main network is something like an MPS but which has a dangling virtual bond at the right-hand edge. Am I correct in thinking that the four horizontal MPS-like networks are all the same as each other?
As far as pseudo-code, you can just do a pattern like this (say if you want to contract two different MPS psi and phi):
L = ITensor(1.)
for j=1:N-1
L *= psi[j]
L *= dag(phi[j])
end
which would gradually contract and build up the large “block” tensor you show in the lower part of the diagram below. Lastly you can contract with the matrices shown in the last steps of your diagram. The code above might have to be adjusted if psi and phi are just copies of the same MPS to avoid accidentally contracting their shared virtual indices.
Does that help you get started? It’s hard to give a more specific answer without knowing more details about e.g. the assumptions on the individual tensors (are they all different in each row in your diagram, or can some be assumed to be the same, etc).
