-
Notifications
You must be signed in to change notification settings - Fork 33
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
LazySum: Functionality to perform TDVP and find_groundstate with a lazy sum #91
Conversation
Holy traits to follow.
With the addition of time dependent operators in mind for the future, some support to differentiate between time dependent and time-independent operators with Holy traits, is already added. I'm not sure my implementation is satisfactory and if this system should be extended to derivative operators or left as is. |
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.
Great PR, looks clean! Can we resolve the minor comments and then merge?
Co-authored-by: DaanMaertens <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #91 +/- ##
==========================================
- Coverage 84.72% 83.79% -0.93%
==========================================
Files 61 63 +2
Lines 3784 3827 +43
==========================================
+ Hits 3206 3207 +1
- Misses 578 620 +42 ☔ View full report in Codecov by Sentry. |
src/algorithms/toolbox.jl
Outdated
envs isa MultipleEnvironments && | ||
throw(ArgumentError("The environment cannot be Lazy i.e. use environments of sum(H)")) |
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.
[JuliaFormatter] reported by reviewdog 🐶
envs isa MultipleEnvironments && | |
throw(ArgumentError("The environment cannot be Lazy i.e. use environments of sum(H)")) | |
envs isa MultipleEnvironments && throw( | |
ArgumentError("The environment cannot be Lazy i.e. use environments of sum(H)") | |
) |
Adds a new struct
LazySum
for a lazy sum of operators, together with aMultipleEnvironments
cache for the corresponding environments. This lazy sum only gets evaluated when it is needed e.g. in expectation_valueor when the action of derivative operator is calculated. Thanks to support for the latter
LazySum
works out of the box for VUMPS, GradientGrassmann or TDVP algorithms. For iDMRG some minor changes were needed in order to make it work with the iDMRG environments.