-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add randomized SVD. #137
base: main
Are you sure you want to change the base?
Add randomized SVD. #137
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #137 +/- ##
==========================================
+ Coverage 73.24% 73.50% +0.25%
==========================================
Files 68 70 +2
Lines 4033 4261 +228
==========================================
+ Hits 2954 3132 +178
- Misses 1079 1129 +50 ☔ View full report in Codecov by Sentry. |
Good to see this – it will be great to have for many purposes! It does seem like a good goal would be if the I do also see quite a few ways the code could be compressed more by using generic code patterns. One key example is that the code body for Overall, a lot of the code length seems to be (understandably) dealing with the differences between the dense and QN cases. So while the code patterns are rather similar, the data structures and some extra logic are just different enough that the two cases don't quite merge together completely yet, thus leading to many extra lines of code and two versions of various helper functions. It would be good to think through whether there is a kind of common concept or data structure the two cases could share. (Easy for me to say, harder to do!) It would be good to remove the prefix |
Yes, I'll merge Yes, there is probably a better way to handle QN / non-QN ITensors and also generally more compact code-patterns for most of the routines. |
Can this be closed in favor of #160? |
Sounds good, I would prefer to keep it separate as well, it will be easier to review. |
This PR adds randomized SVD routines, in both a non-iterative version (
rsvd
) and an iterative version (rsvd_iterative
), which can be applied to single ITensors and collections thereof (currently limited toVectors{ITensor}
).Ultimately, the code design should have separate layers of specialization:
ITensor
, that just accepts a function or generic map which is the action of a matrix-like object (like the interface ofKrylovKit.jl
solvers).rsvd
for ITensors.jl inITensors.jl
to handle specialized things likeQN
s, but still mostly agnostic about the linear map needed.rsvd
inITensorNetworks.jl
which then makes use of contraction sequence optimization for bigger networks.Currently, the design is relying on
ITensors
functionality (2.) and is quite verbose in parts. The purpose of this draft is to discuss how to move towards the goals outlined below and streamline the implementation.