Fix Base.similar for physical and contractible network types#149
Merged
Fix Base.similar for physical and contractible network types#149
Base.similar for physical and contractible network types#149Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
Collaborator
|
Thanks for taking of this. IIRC, I ran into this a long while ago and even included a comment somewhere but that might have been removed. I agree with your way of implementing |
Member
|
I guess this is a bit strange if you ever want to use it to change the spaces, so maybe we should just explicitly not allow this? |
lkdvos
approved these changes
Mar 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The (untested) current implementations of
Base.similarfor our different network types was broken, leading to anUndefRefErrorin the checks on the virtual spaces in the inner constructor because all of theunitcellentries areundef. I patched it to really mapsimilarover the unit cell entries, which I think is more in line with what we want here (e.g. to change the storage type of the entries insimilar(::TensorMap, ...)style).For context, I encountered this when calling
similaron anInfinitePEPS, where I really expected the result to have the same virtual space structure. Alternatively, it's not clear that this is the proper way of implementingBase.similarand since this was never used or tested, I could also useBase.copyand just remove the brokenBase.similarimplementations.Either way, I didn't want to leave in the broken implementations.