-
Notifications
You must be signed in to change notification settings - Fork 1
Fix isstored
with trailing singletons, vector show
#45
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 #45 +/- ##
==========================================
+ Coverage 74.88% 75.59% +0.70%
==========================================
Files 7 7
Lines 450 463 +13
==========================================
+ Hits 337 350 +13
Misses 113 113
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@lkdvos the root of ITensor/BlockSparseArrays.jl#77 is that a = SparseArrayDOK{Float64}(undef, 2)
isstored(a, 1, 1) should have output You PR #39 refactors |
It should handle that correctly, since there are the calls to |
This issue led me to wonder how Base handles that logic, apparently it isn't in julia> Base.to_indices(randn(2), (1, 1))
(1, 1) But anyway, however it is done, let's handle that logic as part of #39 and this PR will be limited to changing the definition of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double-checked it, in case you were interested, it's the combination of Base.to_indices
and Base._to_linear_index
or Base._to_subscript_indices
that should resolve all combinations of indices. (which indeed is fixed in that PR)
Definitely agree on the rest though, if this works this is definitely a good intermediate patch.
isstored
with trailing singletons, vector showisstored
with trailing singletons, vector show
Alight, as you say I guess this is a reasonable intermediate solution, so I'll go ahead and merge this with the assumption that the |
This is a step towards addressing ITensor/BlockSparseArrays.jl#77.
To-do:
isstored
.