Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Extend evolve! for Chain in canonical form #31

Merged
merged 35 commits into from
Mar 25, 2024
Merged

Conversation

jofrevalles
Copy link
Member

Summary

This PR extends the evolve! function for Chains in the canonical form.

@jofrevalles jofrevalles marked this pull request as draft March 15, 2024 10:51
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 40.74074% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 68.62%. Comparing base (4ed7f4e) to head (bccf668).
Report is 1 commits behind head on master.

Files Patch % Lines
src/Ansatz/Chain.jl 20.51% 31 Missing ⚠️
src/Quantum.jl 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #31      +/-   ##
==========================================
- Coverage   71.74%   68.62%   -3.13%     
==========================================
  Files           8        8              
  Lines         499      529      +30     
==========================================
+ Hits          358      363       +5     
- Misses        141      166      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jofrevalles jofrevalles marked this pull request as ready for review March 15, 2024 15:06
@jofrevalles
Copy link
Member Author

Everything seems to work nice:
image

Also, I have added some tests for both the canonical and non-canonical evolve functions.

test/integration/QrochetQuacExt_test.jl Outdated Show resolved Hide resolved
test/integration/QrochetQuacExt_test.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
"""
contract_θ!(ψ::Chain, site::Site)

For a [`Chain`](@ref) in the canonical form, forms the two-site wave function θ with ΛᵢΓᵢΛᵢ₊₁Γᵢ₊₁Λᵢ₊₂,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be less confusing if you use the notation $\Lambda_{(i-1, i)} \Gamma_i \Lambda_{(i,j)} \Gamma_j \Lambda_{(j,j+1)}$ instead.

Copy link
Member Author

@jofrevalles jofrevalles Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This for me is not ideal, I put the subindices there to explicitly show which $\Lambda$ and $\Gamma$ tensor we refer (we have a collection of $\Lambda^{[N-1]}$ and $\Gamma^{[N]}$ tensors). The indices you put are tensor indices, which is another thing. l like the notation that TenPy uses, which is a superindex.

src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
Comment on lines 620 to 624
delete!(TensorNetwork(ψ), Γᵢ)
delete!(TensorNetwork(ψ), Λᵢ₊₁)
delete!(TensorNetwork(ψ), Γᵢ₊₁)

push!(TensorNetwork(ψ), θ)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful about this. Wouldn't it be better to call contract! instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, it makes more sense to directly replace these three with θ.

src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
@jofrevalles
Copy link
Member Author

I'd merge this. I have tested locally and everything works fine. @mofeing

@mofeing mofeing merged commit 6a189a1 into master Mar 25, 2024
3 of 5 checks passed
@mofeing mofeing deleted the feature/evolve-canonized branch March 25, 2024 16:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants