-
Notifications
You must be signed in to change notification settings - Fork 23
Improve subspace kwarg handling #269
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
base: main
Are you sure you want to change the base?
Conversation
…g it take truncation parameters from factorize_kwargs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
=======================================
Coverage 68.98% 68.98%
=======================================
Files 81 81
Lines 4024 4024
=======================================
Hits 2776 2776
Misses 1248 1248
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:
|
I would like it if there was an "expert level" mode where users can fully specify |
|
So to be more concrete, the "expert level" I'm picturing might look like: nsweeps = 5
nsites = 1
factorize_kwargs = (; cutoff = 1e-5, maxdim = 32)
extract!_kwargs = (; subspace_expansion!_alg = Algorithm"densitymatrix"(; factorize_kwargs = (; cutoff = 1e-4)))
dmrg(H, psi0; extract!_kwargs, factorize_kwargs, nsites, nsweeps, outputlevel)where we could design it such that if Note that:
|
|
This is helpful feedback and what I was looking for. Fortunately there’s a workaround right now in the current interface, so this PR is definitely about making steps in the direction of a better one. I’ll think about the above points and see if this PR is heading in the right direction and adjust if not. |
This PR fixes an issue caused during the recent refactor of the solvers iterators, related to handling of keyword arguments for the subspace expansion step. If the
subspace_expand!_kwargsparameter was passed toeigsolve, and it didn't include another NamedTuple calledeigen_kwargswithin it, then the subspace expansion code would not obey the maxdim limit on the bond dimension.This PR has the subspace code use the
factorize_kwargsparameters to obtain the truncation parameters such as maxdim.An alternative we could consider besides this PR would be to require a user to pass maxdim twice: once in
factorize_kwargsand again insubspace_expand!_kwargs. But that would make the interface more complicated andfactorize_kwargsis a fairly generic name, not tied to the specificextract!,update!, andinsert!functions, it seems reasonable to use it in multiple places.