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

Fix issue where SVDCut produces InfiniteMPS that is not full rank #174

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

lkdvos
Copy link
Member

@lkdvos lkdvos commented Aug 12, 2024

changebonds with SVDCut used the InfiniteMPS(AL, C0) constructor, and this constructor did not check that all tensors are full rank, or try to correct for it. InfiniteMPS(AL) does this, so this fixes the issue.

@lkdvos lkdvos enabled auto-merge (squash) August 12, 2024 16:01
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files Patch % Lines
src/algorithms/changebonds/svdcut.jl 80.00% 1 Missing ⚠️
Files Coverage Δ
src/states/infinitemps.jl 62.41% <100.00%> (+0.26%) ⬆️
src/algorithms/changebonds/svdcut.jl 87.03% <80.00%> (-0.97%) ⬇️

... and 1 file with indirect coverage changes

@lkdvos lkdvos disabled auto-merge August 12, 2024 16:50
@lkdvos lkdvos merged commit 0c44f67 into master Aug 12, 2024
10 of 11 checks passed
@lkdvos lkdvos deleted the ld/svdcutfix branch August 12, 2024 16:50
@Gertian
Copy link
Collaborator

Gertian commented Aug 12, 2024

Thanks for looking into this !

This is probably a stupid question but tensors not being full rank corresponds to them not having a block for certain sectors ?

@lkdvos
Copy link
Member Author

lkdvos commented Aug 12, 2024

Not necessarily, this also happens for non-symmetric tensors:

An mpstensor of dim 2x2x5 can never be full rank from left to right, which basically means that there is "one column too much". This can be transformed away without changing the state, and some of our algorithms fail because of this.

The exact condition is really just that both R <= P * L, and L <= P * R (with appropriate arrows), which can happen when you cut drastically or with strange truncation schemes.

Note that a sector not appearing really is not a problem, it is completely fine to have spin 1/2 on the left virtual space and the physical space, and only have spin 0 on the right.
Conversely, it would not be fine to only have spin 2 on the right, because then the condition is violated again.

As a final remark to go fully in depth: the error you had in VUMPS originates from the fact that TensorKit has a QR decomposition that makes Q square, it does not add zero rows because then it loses it's meaning as orthogonal basis.
A 4x5 matrix would thus have a 4x4 Q and a 4x5 R, where the last row of the R is zero. If you then multiply the R to the other side of the bond, this bond now suddenly becomes dimension 4 instead of 5, hence the spacemismatch. I wrongly assumed that our constructor automatically converts everything to full rank this way, because it is built into the constructor, but apparently not all constructors, thus the issue

On the other hand, it is perfectly fine to have a sector not appearing,

@Gertian
Copy link
Collaborator

Gertian commented Aug 12, 2024

Perfect, thank you for this great explanation :)

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