Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend evolve of an MPS with an MPO #169

Closed
wants to merge 2 commits into from

Conversation

jofrevalles
Copy link
Member

Summary

This PR was left open in the legacy code in Qrochet (#35). This PR extends 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 a kron product with the old λ (which come from the MPS) and the identity (comes from the MPO). Right now, this function only works for mps in the canonical form.

Example

Here we show how can we use this function:

julia> using Tenet

julia> ψ = rand(Chain, Open, State; n=8, χ=10); canonize!(ψ)
MPS (inputs=0, outputs=8)

julia> mpo = rand(Chain, Open, Operator; n=8, χ=10)
MPO (inputs=8, outputs=8)

julia> Tenet.@reindex! inputs(mpo) => outputs(ψ)
MPS (inputs=0, outputs=8)

julia> ψ = Tenet.evolve(ψ, mpo)
MPS (inputs=0, outputs=8)

julia> size.(tensors(ψ))
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)

@mofeing
Copy link
Member

mofeing commented Jul 9, 2024

Yep, like I said in the previous PR, those virtual bond dimensions are a big problem.

@jofrevalles
Copy link
Member Author

Yep, like I said in the previous PR, those virtual bond dimensions are a big problem.

I think that we just have to truncate.

@mofeing
Copy link
Member

mofeing commented Jul 9, 2024

Yep, like I said in the previous PR, those virtual bond dimensions are a big problem.

I think that we just have to truncate.

Great, that should solve it.

@jofrevalles
Copy link
Member Author

I am closing this, since PR #264 already introduced this feature. @starsfordummies Nevertheless, this code has that idea of extending the canonical form of an MPS with $\lambda \otimes I$ that you proposed. It seems interesting, we need to check it.

@jofrevalles jofrevalles closed this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants