-
Notifications
You must be signed in to change notification settings - Fork 0
Implement evolve
of an MPS
with an MPO
#35
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the optimal way to evolve a MPS through a MPO, but it's good enough. Thanks for your PR!
What is more optimal? Here we just contract and update the bond dimensions. |
Well, you can do MPS compression algorithm with the partial traces but inserting the MPO in between the original MPS and the target MPS. But just like we did with |
@mofeing Now I managed to make this function in place, but if we followed my suggestion in bsc-quantic/Tenet.jl#147, these could be much more clean. |
Great! Then let's fix bsc-quantic/Tenet.jl#147 first |
- Refactor `select` to `tensor`,`inds` methods - Remove `ValSplit` dependency
…g compat) (#38) Co-authored-by: CompatHelper Julia <[email protected]>
…ps] at version 1, (keep existing compat)
@mofeing Now this works in place and the code is much better with julia> mps = rand(Chain, Open, State; n=8, χ=10)
MPS (inputs=0, outputs=8)
julia> mpo = rand(Chain, Open, Operator; n=8, χ=10)
MPO (inputs=8, outputs=8)
julia> canonize!(mps)
MPS (inputs=0, outputs=8)
julia> Qrochet.@reindex! inputs(mpo) => outputs(mps)
MPS (inputs=0, outputs=8)
julia> evolve!(mps, mpo)
MPS (inputs=0, outputs=8)
julia> size.(tensors(mps))
15-element Vector{Tuple{Int64, Vararg{Int64}}}:
(8,)
(40,)
(80,)
(100,)
(80,)
(40,)
(8,)
(2, 8)
(2, 8, 40)
(2, 40, 80)
(2, 80, 100)
(2, 100, 80)
(2, 80, 40)
(2, 40, 8)
(2, 8) |
Wait, why are there vectors of size 80? Also the sizes are too big for a 8-site MPS. The maximum theoretical bond dimension for a physical dim of 2 should be |
The bond dimensions go up to |
Summary
This PR introduces the
evolve
function, which evolves a Matrix Product State (MPS
) using a Matrix Product Operator (MPO
). The idea from @starsfordummies is that we contract the tensors of each corresponding site, and we then create the newλ
with akron
product with the oldλ
(which come from theMPS
) and the identity (comes from theMPO
). Right now, this function only works formps
in the canonical form.Example
Here we show how can we use this function: