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

update left and right_virtualspace #205

Merged
merged 1 commit into from
Dec 12, 2024
Merged

update left and right_virtualspace #205

merged 1 commit into from
Dec 12, 2024

Conversation

lkdvos
Copy link
Member

@lkdvos lkdvos commented Dec 12, 2024

This is a fix of the long-standing issue #103, which rewrites the package to consistently use left_virtualspace to denote the space to the left of a lattice site, and right_virtualspace to denote the space to the right of a lattice site. Additionally, they are both returned "non-dualised", i.e. left_virtualspace(mps, i + 1) == right_virtualspace(mps, i).

This is obviously very breaking, but should be more consistent in the future.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/MPSKit.jl 100.00% <ø> (ø)
src/algorithms/expval.jl 72.30% <100.00%> (ø)
src/algorithms/fidelity_susceptibility.jl 100.00% <100.00%> (ø)
src/algorithms/timestep/timeevmpo.jl 84.79% <100.00%> (ø)
src/algorithms/toolbox.jl 93.27% <100.00%> (ø)
src/environments/abstract_envs.jl 87.75% <100.00%> (ø)
src/environments/finite_envs.jl 100.00% <100.00%> (+8.06%) ⬆️
src/operators/abstractmpo.jl 39.84% <100.00%> (ø)
src/operators/mpo.jl 94.58% <100.00%> (-0.03%) ⬇️
src/operators/mpohamiltonian.jl 90.22% <100.00%> (ø)
... and 6 more

... and 1 file with indirect coverage changes

@lkdvos lkdvos linked an issue Dec 12, 2024 that may be closed by this pull request
@lkdvos lkdvos merged commit 283a62c into master Dec 12, 2024
28 checks passed
@lkdvos lkdvos deleted the virtualspace branch December 12, 2024 11:49
@maartenvd
Copy link
Collaborator

how do you garantuee left_virtualspace(mps, i + 1) == right_virtualspace(mps, i) during twosite algorithms?

@lkdvos
Copy link
Member Author

lkdvos commented Dec 12, 2024

Sorry, my comment above was a bit misleading. What I meant is isdual(left_virtualspace(mps, i+1)) == isdual(right_virtualspace(mps, i)), and in most cases (infinite and onesite finite), the spaces are the same as well. In other cases, left_virtualspace(mps, i + 1) will give you the space to the right of the bond between i and i+1, while right_virtualspace(mps, i) gives you the space to the left of that bond. In other words, i now always refers to sites.
As a small remark, it turns out you actually were not really using these functions anyways, and simply calling space on the relevant tensors most of the time, so this has less big of an effect than I initially expected (although I honestly won't be surprised if some bugs still pop up).

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.

virtualspace conventions can be confusing
2 participants