-
Notifications
You must be signed in to change notification settings - Fork 2
Generalize blockedperm
ellipsis inputs, change constructor names
#27
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
==========================================
+ Coverage 93.95% 94.60% +0.65%
==========================================
Files 15 15
Lines 364 371 +7
==========================================
+ Hits 342 351 +9
+ Misses 22 20 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This PR changes the behavior of |
I can see why the new definition is helpful for FusionTensors, but I think the reason for the old definition was because there are cases where you want to fuse some subset of indices and leave the rest alone (say for example doing a "tensor network renormalization", say by contracting pairs of neighboring MPS tensors together and fusing the site indices into one "renormalized" site index). A proposal I can think of to allow users to choose between the two behaviors could be: blockedperm(.., (4, 3)) # ((1,), (2,), (4, 3))
blockedperm((..,), (4, 3)) # ((1, 2), (4, 3)) Then, fusedims(a, (3, 1), ..) # Only fuse dimensions 3 and 1 together, leave the rest unfused
fusedims(a, (3, 1), (..,)) # Fuse dimensions 3 and 1 together and fuse the rest with each other |
I now allow both |
@mtfishman this is ready to merge |
Besides the comments I've left, this looks good to me. The only other thing I can think of is that we probably will want to support |
I forgot about this issues with the testing which we should sort out before merging this.
I am not sure to understand what has to be done. This PR defines breaking changes for |
I think the heart of the issue is that some of the tests in this package make use of BlockSparseArrays.jl (https://github.com/ITensor/TensorAlgebra.jl/blob/f67770f305b8fe9605c8e3091976ad1a1dc632b5/test/test_gradedunitrangesext_contract.jl, https://github.com/ITensor/TensorAlgebra.jl/blob/f67770f305b8fe9605c8e3091976ad1a1dc632b5/test/test_blockarrays_contract.jl), which can't be installed because of the version bump in this PR. So I think we should move those tests to the BlockSparseArrays.jl repository. That is a better place for them anyway since that is where the package extension connecting TensorAlgebra.jl and BlockSparseArrays.jl ( |
Basically, we just want to make sure that the tests of a package |
I removed |
Thanks, glad that fixed it. What issue still lingers? |
It think the 3 linked PR |
Got it, thanks for the reminder and summary. |
blockedperm
blockedperm
ellipsis inputs, change constructor names
This PR changes the behavior of
blockedperm
when an Ellipsis appears in the arguments. The inferred elements are now merged into one single block. The objective is to haveblockedperm(.., (4, 3))
always returning aBlockedPermutation{2}
, and more generally to easily predictblocklength(blockdedperm(input))
.It also makes
blockedperm
fully type stable whenlength
is provided as aVal
.