-
Notifications
You must be signed in to change notification settings - Fork 14
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
Refactor alternating_update to use sweep_regions #77
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #77 +/- ##
==========================================
+ Coverage 77.79% 78.23% +0.44%
==========================================
Files 61 60 -1
Lines 3233 3262 +29
==========================================
+ Hits 2515 2552 +37
+ Misses 718 710 -8
|
The changes in this PR are so large it may be better to do the review in person, when you have time. I could give you a tour of the new code. It's very different from the previous code so the diffs don't really help, though maybe you're better at reading them than I am. |
@emstoudenmire I think this looks good and I'm happy to merge this and then build on top of it in future PRs. Let's start some issues with reminders of things we plan on improving, I've already forgotten from our last conversation. I've started with #90. |
Good idea to make a tracking issue. Glad you agree we can use this PR as a base. That's definitely how I envision it i.e. the tree_sweeping.jl code definitely could be improved and the design iterated, but this PR does accomplish the goal of totally isolating it into a closed, distinct subsystem. Also there is the observer-based printing idea but that is coming up in a follow-up PR based on this one. Could you then please merge and I'll work on finalizing the observer printing PR, and might stick a few other improvements into that. |
Major Changes
update_sweep
now accepts a keyword argumentsweep_regions
which is an array of"Frankentuples" i.e. a tuple of the form
(region, (; step_kwargs...))
thattells it how to move through the tree and what arguments to pass to the solver
and observer at each step
Made generic
half_sweep
function which handles tree iteration logic anduses a
region_function
callback to actually compute the regions that gointo
sweep_regions
. (I originally tried to compute the TDVP "in between"regions from an array that didn't have them but this caused numerous problems.)
Simplified what the TDVPOrder type does. It is now basically a custom Val.
As a result of the above changes, the
alternating_update
andupdate_step
codes now basically have any TDVP-specific logic factored out of them, with
the one exception of handling printing in a more custom way. The custom
printing idea, based on appending printing functions to the set of
Observer functions, will be in a future PR.