-
Notifications
You must be signed in to change notification settings - Fork 53
perf: DMRG(2) with smarter adaptive tolerances #455
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
Open
lkdvos
wants to merge
18
commits into
main
Choose a base branch
from
ld-dynamictols
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
924c5e0
refactor fixedpoint to avoid warnings
lkdvos 174d864
refactor DMRG implementation
lkdvos abe50dd
refactor gauging
lkdvos 1caab6f
add AdaptiveKrylov solver
lkdvos 89cf07a
refactor DMRG2 to be in line with DMRG
lkdvos 16797ea
small type stability improvements
lkdvos 69c0d16
small fixes
lkdvos 8d33792
restore old DMRG convergence behavior
lkdvos 5c20e82
update default values
lkdvos 9663660
Use Galerkin error as DMRG/DMRG2 convergence measure
lkdvos d0f0397
fix: seed DMRG2 eigensolver with AC, not H*AC
lkdvos 4ee1bc0
rework and unify adaptive solver interface - use kwargs to easily sup…
lkdvos fd9ba08
update defaults once more
lkdvos 6d2b2f8
revert DynamicTol behavior
lkdvos f267171
guard two-site gauge complexification on state scalartype
lkdvos e7c9fdb
fix DMRG2 convergence measure; add truncation-aware stop
lkdvos 4b58685
restore updatetol docstring
lkdvos e3e7012
cleanup
lkdvos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,23 @@ | ||
| # wrapper around KrylovKit.jl's eigsolve function | ||
|
|
||
| function fixedpoint(A, x₀, which::Symbol; kwargs...) | ||
| alg = KrylovKit.eigselector(A, scalartype(x₀); kwargs...) | ||
| return fixedpoint(A, x₀, which, alg) | ||
| end | ||
|
|
||
| """ | ||
| fixedpoint(A, x₀, which::Symbol; kwargs...) -> val, vec | ||
| fixedpoint(A, x₀, which::Symbol, alg) -> val, vec | ||
| fixedpoint(A, x₀, which::Symbol; kwargs...) -> val, vec, info | ||
| fixedpoint(A, x₀, which::Symbol, alg) -> val, vec, info | ||
|
|
||
| Compute the fixed point of a linear operator `A` using the specified eigensolver `alg`. The | ||
| fixedpoint is assumed to be unique. | ||
| Compute the fixed point of a given linear operator `A` with initial guess `x₀`. | ||
| The dominant eigenvector is assumed to be unique. | ||
| """ | ||
| function fixedpoint(A, x₀, which::Symbol, alg::Lanczos) | ||
| vals, vecs, info = eigsolve(A, x₀, 1, which, alg) | ||
|
|
||
| info.converged == 0 && | ||
| @warnv 1 "fixed point not converged after $(info.numiter) iterations: normres = $(info.normres[1])" | ||
|
|
||
| return vals[1], vecs[1] | ||
| return vals[1], vecs[1], info | ||
| end | ||
|
|
||
| function fixedpoint(A, x₀, which::Symbol, alg::Arnoldi) | ||
| TT, vecs, vals, info = schursolve(A, x₀, 1, which, alg) | ||
|
|
||
| info.converged == 0 && | ||
| @warnv 1 "fixed point not converged after $(info.numiter) iterations: normres = $(info.normres[1])" | ||
| size(TT, 2) > 1 && TT[2, 1] != 0 && @warnv 1 "non-unique fixed point detected" | ||
|
|
||
| return vals[1], vecs[1] | ||
| end | ||
|
|
||
| function fixedpoint(A, x₀, which::Symbol; kwargs...) | ||
| alg = KrylovKit.eigselector(A, scalartype(x₀); kwargs...) | ||
| return fixedpoint(A, x₀, which, alg) | ||
| return vals[1], vecs[1], info | ||
| end | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.