ITensors.jl
ITensors.jl copied to clipboard
[ITensors] Expose new `KrylovKit.realeigsolve` features to `dmrg`
Description
As of v0.8 KrylovKit supports finding the eigenvectors of real non-symmetric operators with real eigenvalues. This eliminates the need for complex arithmetic. For my problem it produces the same results as the standard hermitian=false algorithm.
I added an option to specify an early return from the eigensolve. I haven't tested this out but the documentation suggests it could significantly improve performance when the initial guess is very good, which I think could be a common case in later sweeps of DMRG so worth trying out.
I also forwarded the eigsolve_verbosity on to eigensolve. Previously this argument was ignored.
How Has This Been Tested?
It has not.
Checklist:
- [ ] My code follows the style guidelines of this project. Please run
using JuliaFormatter; format(".")in the base directory of the repository (~/.julia/dev/ITensors) to format your code according to our style guidelines. - [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have added tests that verify the behavior of the changes I made.
- [x] I have made corresponding changes to the documentation.
- [ ] My changes generate no new warnings.
- [x] Any dependent changes have been merged and published in downstream modules.
I didn't know about KrylovKit.realeigsolve, that's really cool! That's something I've wanted in multiple projects and wasn't even sure if it was possible/practical to do. @JoeyT1994 this is something we were discussing.
I'll take a look at this PR when I get a chance.
I measured the impact of eigsolve_eager and it is small but noticeable. The following is with eigensolve_krylovdim=10 and eigensolve_maxiter=10 with an already well converged MPS (what I imagine the optimal conditions to measure the impact is). For eight sweeps eigensolve_eager=false took 3726.6s ± 10s and with eigensolve_eager=true took 3592.8s ± 55s
I measured the impact of
eigsolve_eagerand it is small but noticeable. The following is witheigensolve_krylovdim=10andeigensolve_maxiter=10with an already well converged MPS (what I imagine the optimal conditions to measure the impact is). For eight sweepseigensolve_eager=falsetook 3726.6s ± 10s and witheigensolve_eager=truetook 3592.8s ± 55s
The difference should get larger as you make eigsolve_krylovdim larger.
The difference should get larger as you make
eigsolve_krylovdimlarger.
That's what I expect as well, but 10 with 10 iterations is already 33x larger than ITensors` default.
The difference should get larger as you make
eigsolve_krylovdimlarger.That's what I expect as well, but 10 with 10 iterations is already 33x larger than ITensors` default.
eager only relates to the number of Krylov states per iteration/restart, not the number of iterations/restarts. So it won't reach maxiter even if eager=false if it is converged to tol by the end of an earlier iteration/restart.
eageronly relates to the number of Krylov states per iteration/restart, not the number of iterations/restarts. So it won't reachmaxitereven ifeager=falseif it is converged totolby the end of an earlier iteration/restart.
Gotcha, that makes sense. This is the what slowed down tdvp too right? https://github.com/ITensor/ITensorMPS.jl/issues/40
@corbett5 could you move this PR over to https://github.com/ITensor/ITensorMPS.jl? All of the MPS/MPO code is over there now.
I'll close this PR since it needs to be moved to the ITensorMPS.jl repository.