Open mtfishman opened 3 years ago
Hi, is this feature available? If not, is this a good first issue to be working on? Thanks!
I think this would be a good first-time issue, yes. We may ultimately want to have a single, generic code that would do reverse on any linear tensor network (either MPS, MPO, or something like them with any number of site indices) but having just the MPS and MPO versions initially would be helpful.
@mtfishman I would imagine this function would also re-index all of the sites, correct?
I was picturing this would result in an MPS/MPO such that:
psi_rev = reverse(psi)
n = length(psi)
psi[1] == psi_rev[n]
psi[2] == psi_rev[n-1]
# etc.
just like how it acts on a Vector:
julia> reverse([1, 2, 3])
3-element Vector{Int64}:
3
2
1
However, @sr33dhar please note that the next generation of MPS code is being developed in https://github.com/mtfishman/ITensorNetworks.jl so we would prefer to add new features to that code.
Ah, thanks! For now, the idea of psi[k] == psi_rev[n-k+1] would work for me @mtfishman.
I was trying to implement the TEBD using MPS on an all to all connected Ising Hamiltonian using a SWAP network when I needed this. After half the network, the tensors all go into reverse order, and it would be wasteful to keep swapping until they regain the original order.
Meanwhile, I'll checkout https://github.com/mtfishman/ITensorNetworks.jl Please do let me know if there is anything I can do to help.
Define
reverse(::MPS/MPO)
by reversing the tensor order as well as the orthogonality limits.